📄 fielddeclaration.java
字号:
} // Declared in java.ast at line 2 // Declared in java.ast line 77 private String tokenString_ID; // Declared in java.ast at line 3 public void setID(String value) { tokenString_ID = value; } // Declared in java.ast at line 6 public int IDstart; // Declared in java.ast at line 7 public int IDend; // Declared in java.ast at line 8 public void setID(beaver.Symbol symbol) { if(symbol.value != null && !(symbol.value instanceof String)) throw new UnsupportedOperationException("setID is only valid for String lexemes"); tokenString_ID = (String)symbol.value; IDstart = symbol.getStart(); IDend = symbol.getEnd(); } // Declared in java.ast at line 15 public String getID() { return tokenString_ID != null ? tokenString_ID : ""; } // Declared in java.ast at line 2 // Declared in java.ast line 77 public void setInitOpt(Opt<Expr> opt) { setChild(opt, 2); } // Declared in java.ast at line 6 public boolean hasInit() { return getInitOpt().getNumChild() != 0; } // Declared in java.ast at line 10 @SuppressWarnings({"unchecked", "cast"}) public Expr getInit() { return (Expr)getInitOpt().getChild(0); } // Declared in java.ast at line 14 public void setInit(Expr node) { getInitOpt().setChild(node, 0); } // Declared in java.ast at line 17 @SuppressWarnings({"unchecked", "cast"}) public Opt<Expr> getInitOpt() { return (Opt<Expr>)getChild(2); } // Declared in java.ast at line 21 @SuppressWarnings({"unchecked", "cast"}) public Opt<Expr> getInitOptNoTransform() { return (Opt<Expr>)getChildNoTransform(2); } // Declared in GOP.jrag at line 351
public void checkModifiers() {
super.checkModifiers();
if(hostType().isInterfaceDecl()) {
if(isProtected())
error("an interface field may not be protected");
if(isPrivate())
error("an interface field may not be private");
if(isTransient())
error("an interface field may not be transient");
if(isVolatile())
error("an interface field may not be volatile");
}
if(!hostType().isGranuleDecl() && isExternal())
error("external field can only exsit in Granule");
} protected java.util.Map accessibleFrom_TypeDecl_visited; protected java.util.Map accessibleFrom_TypeDecl_values; // Declared in AccessControl.jrag at line 109 @SuppressWarnings({"unchecked", "cast"}) public boolean accessibleFrom(TypeDecl type) { Object _parameters = type;if(accessibleFrom_TypeDecl_visited == null) accessibleFrom_TypeDecl_visited = new java.util.HashMap(4);if(accessibleFrom_TypeDecl_values == null) accessibleFrom_TypeDecl_values = new java.util.HashMap(4); if(accessibleFrom_TypeDecl_values.containsKey(_parameters)) return ((Boolean)accessibleFrom_TypeDecl_values.get(_parameters)).booleanValue(); if(new Integer(boundariesCrossed).equals(accessibleFrom_TypeDecl_visited.get(_parameters))) throw new RuntimeException("Circular definition of attr: accessibleFrom in class: "); accessibleFrom_TypeDecl_visited.put(_parameters, new Integer(boundariesCrossed)); int num = boundariesCrossed; boolean isFinal = this.is$Final(); boolean accessibleFrom_TypeDecl_value = accessibleFrom_compute(type); if(isFinal && num == boundariesCrossed) accessibleFrom_TypeDecl_values.put(_parameters, Boolean.valueOf(accessibleFrom_TypeDecl_value)); accessibleFrom_TypeDecl_visited.remove(_parameters); return accessibleFrom_TypeDecl_value; } private boolean accessibleFrom_compute(TypeDecl type) { if(isPublic()) return true; else if(isProtected()) { if(hostPackage().equals(type.hostPackage())) return true; if(type.withinBodyThatSubclasses(hostType()) != null) return true; return false; } else if(isPrivate()) return hostType().topLevelType() == type.topLevelType(); else return hostPackage().equals(type.hostPackage()); } protected int exceptions_visited = -1; protected boolean exceptions_computed = false; protected Collection exceptions_value; // Declared in AnonymousClasses.jrag at line 112 @SuppressWarnings({"unchecked", "cast"}) public Collection exceptions() { if(exceptions_computed) return exceptions_value; if(exceptions_visited == boundariesCrossed) throw new RuntimeException("Circular definition of attr: exceptions in class: "); exceptions_visited = boundariesCrossed; int num = boundariesCrossed; boolean isFinal = this.is$Final(); exceptions_value = exceptions_compute(); if(isFinal && num == boundariesCrossed) exceptions_computed = true; exceptions_visited = -1; return exceptions_value; } private Collection exceptions_compute() { HashSet set = new HashSet(); if(isInstanceVariable() && hasInit()) { collectExceptions(set, this); for(Iterator iter = set.iterator(); iter.hasNext(); ) { TypeDecl typeDecl = (TypeDecl)iter.next(); if(!getInit().reachedException(typeDecl)) iter.remove(); } } return set; } protected int isConstant_visited = -1; // Declared in ConstantExpression.jrag at line 463 @SuppressWarnings({"unchecked", "cast"}) public boolean isConstant() { if(isConstant_visited == boundariesCrossed) throw new RuntimeException("Circular definition of attr: isConstant in class: "); isConstant_visited = boundariesCrossed; boolean isConstant_value = isConstant_compute(); isConstant_visited = -1; return isConstant_value; } private boolean isConstant_compute() { return isFinal() && hasInit() && getInit().isConstant() && (type().isPrimitive() || type().isString()); } protected int size_visited = -1; // Declared in DataStructures.jrag at line 67 @SuppressWarnings({"unchecked", "cast"}) public int size() { if(size_visited == boundariesCrossed) throw new RuntimeException("Circular definition of attr: size in class: "); size_visited = boundariesCrossed; int size_value = size_compute(); size_visited = -1; return size_value; } private int size_compute() { return 1; } protected int isEmpty_visited = -1; // Declared in DataStructures.jrag at line 68 @SuppressWarnings({"unchecked", "cast"}) public boolean isEmpty() { if(isEmpty_visited == boundariesCrossed) throw new RuntimeException("Circular definition of attr: isEmpty in class: "); isEmpty_visited = boundariesCrossed; boolean isEmpty_value = isEmpty_compute(); isEmpty_visited = -1; return isEmpty_value; } private boolean isEmpty_compute() { return false; } protected java.util.Map contains_Object_visited; // Declared in DataStructures.jrag at line 72 @SuppressWarnings({"unchecked", "cast"}) public boolean contains(Object o) { Object _parameters = o;if(contains_Object_visited == null) contains_Object_visited = new java.util.HashMap(4); if(new Integer(boundariesCrossed).equals(contains_Object_visited.get(_parameters))) throw new RuntimeException("Circular definition of attr: contains in class: "); contains_Object_visited.put(_parameters, new Integer(boundariesCrossed)); boolean contains_Object_value = contains_compute(o); contains_Object_visited.remove(_parameters); return contains_Object_value; } private boolean contains_compute(Object o) { return this == o; } protected java.util.Map isDAafter_Variable_visited; // Declared in DefiniteAssignment.jrag at line 316 @SuppressWarnings({"unchecked", "cast"}) public boolean isDAafter(Variable v) { Object _parameters = v;if(isDAafter_Variable_visited == null) isDAafter_Variable_visited = new java.util.HashMap(4);if(isDAafter_Variable_values == null) isDAafter_Variable_values = new java.util.HashMap(4); if(isDAafter_Variable_values.containsKey(_parameters)) return ((Boolean)isDAafter_Variable_values.get(_parameters)).booleanValue(); if(new Integer(boundariesCrossed).equals(isDAafter_Variable_visited.get(_parameters))) throw new RuntimeException("Circular definition of attr: isDAafter in class: "); isDAafter_Variable_visited.put(_parameters, new Integer(boundariesCrossed)); int num = boundariesCrossed; boolean isFinal = this.is$Final(); boolean isDAafter_Variable_value = isDAafter_compute(v); if(isFinal && num == boundariesCrossed) isDAafter_Variable_values.put(_parameters, Boolean.valueOf(isDAafter_Variable_value)); isDAafter_Variable_visited.remove(_parameters); return isDAafter_Variable_value; } private boolean isDAafter_compute(Variable v) { if(v == this) return hasInit(); return hasInit() ? getInit().isDAafter(v) : isDAbefore(v); } protected java.util.Map isDUafter_Variable_visited; // Declared in DefiniteAssignment.jrag at line 772 @SuppressWarnings({"unchecked", "cast"}) public boolean isDUafter(Variable v) { Object _parameters = v;if(isDUafter_Variable_visited == null) isDUafter_Variable_visited = new java.util.HashMap(4);if(isDUafter_Variable_values == null) isDUafter_Variable_values = new java.util.HashMap(4); if(isDUafter_Variable_values.containsKey(_parameters)) return ((Boolean)isDUafter_Variable_values.get(_parameters)).booleanValue(); if(new Integer(boundariesCrossed).equals(isDUafter_Variable_visited.get(_parameters))) throw new RuntimeException("Circular definition of attr: isDUafter in class: "); isDUafter_Variable_visited.put(_parameters, new Integer(boundariesCrossed)); int num = boundariesCrossed; boolean isFinal = this.is$Final(); boolean isDUafter_Variable_value = isDUafter_compute(v); if(isFinal && num == boundariesCrossed) isDUafter_Variable_values.put(_parameters, Boolean.valueOf(isDUafter_Variable_value)); isDUafter_Variable_visited.remove(_parameters); return isDUafter_Variable_value; } private boolean isDUafter_compute(Variable v) { if(v == this) return !hasInit(); return hasInit() ? getInit().isDUafter(v) : isDUbefore(v); } protected int isExternal_visited = -1; // Declared in GOP.jrag at line 350 @SuppressWarnings({"unchecked", "cast"}) public boolean isExternal() { if(isExternal_visited == boundariesCrossed) throw new RuntimeException("Circular definition of attr: isExternal in class: "); isExternal_visited = boundariesCrossed; boolean isExternal_value = isExternal_compute(); isExternal_visited = -1; return isExternal_value; } private boolean isExternal_compute() { return getModifiers().isExternal(); } protected int isSynthetic_visited = -1; // Declared in Modifiers.jrag at line 214 @SuppressWarnings({"unchecked", "cast"}) public boolean isSynthetic() { if(isSynthetic_visited == boundariesCrossed) throw new RuntimeException("Circular definition of attr: isSynthetic in class: "); isSynthetic_visited = boundariesCrossed; boolean isSynthetic_value = isSynthetic_compute(); isSynthetic_visited = -1; return isSynthetic_value; } private boolean isSynthetic_compute() { return getModifiers().isSynthetic(); } protected int isPublic_visited = -1; // Declared in Modifiers.jrag at line 237 @SuppressWarnings({"unchecked", "cast"}) public boolean isPublic() { if(isPublic_visited == boundariesCrossed) throw new RuntimeException("Circular definition of attr: isPublic in class: "); isPublic_visited = boundariesCrossed; boolean isPublic_value = isPublic_compute(); isPublic_visited = -1; return isPublic_value; } private boolean isPublic_compute() { return getModifiers().isPublic() || hostType().isInterfaceDecl(); } protected int isPrivate_visited = -1; // Declared in Modifiers.jrag at line 238 @SuppressWarnings({"unchecked", "cast"}) public boolean isPrivate() { if(isPrivate_visited == boundariesCrossed) throw new RuntimeException("Circular definition of attr: isPrivate in class: "); isPrivate_visited = boundariesCrossed; boolean isPrivate_value = isPrivate_compute(); isPrivate_visited = -1; return isPrivate_value; } private boolean isPrivate_compute() { return getModifiers().isPrivate(); } protected int isProtected_visited = -1; // Declared in Modifiers.jrag at line 239 @SuppressWarnings({"unchecked", "cast"}) public boolean isProtected() { if(isProtected_visited == boundariesCrossed) throw new RuntimeException("Circular definition of attr: isProtected in class: "); isProtected_visited = boundariesCrossed; boolean isProtected_value = isProtected_compute(); isProtected_visited = -1; return isProtected_value; } private boolean isProtected_compute() { return getModifiers().isProtected(); } protected int isStatic_visited = -1; // Declared in Modifiers.jrag at line 240 @SuppressWarnings({"unchecked", "cast"}) public boolean isStatic() { if(isStatic_visited == boundariesCrossed) throw new RuntimeException("Circular definition of attr: isStatic in class: "); isStatic_visited = boundariesCrossed; boolean isStatic_value = isStatic_compute();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -