1 package polyglot.types; 2 3 import polyglot.util.Position; 4 5 9 public class NoMemberException extends SemanticException { 10 private int kind; 11 public static final int METHOD = 1; 12 public static final int CONSTRUCTOR = 2; 13 public static final int FIELD = 3; 14 15 public NoMemberException(int kind, String s) { 16 super(s); 17 this.kind = kind; 18 } 19 20 public NoMemberException(int kind, String s, Position position) { 21 super(s, position); 22 this.kind = kind; 23 } 24 25 public int getKind() { 26 return kind; 27 } 28 public String getKindStr() { 29 switch (kind) { 30 case METHOD: 31 return "method"; 32 case CONSTRUCTOR: 33 return "constructor"; 34 case FIELD: 35 return "field"; 36 default: 37 return "unknown!!!"; 38 } 39 } 40 } 41 | Popular Tags |