📄 shorttype.java
字号:
package AST;
import java.util.HashSet;import java.util.LinkedHashSet;import java.io.FileNotFoundException;import java.io.File;import java.util.*;import beaver.*;import java.util.ArrayList;import java.util.zip.*;import java.io.*;public class ShortType extends IntegralType implements Cloneable {
public void flushCache() { super.flushCache(); cast_Constant_visited = new java.util.HashMap(4); narrowingConversionTo_TypeDecl_visited = new java.util.HashMap(4); narrowingConversionTo_TypeDecl_values = null; unaryNumericPromotion_visited = -1; unaryNumericPromotion_computed = false; unaryNumericPromotion_value = null; isShort_visited = -1; } @SuppressWarnings({"unchecked", "cast"}) public ShortType clone() throws CloneNotSupportedException { ShortType node = (ShortType)super.clone(); node.cast_Constant_visited = new java.util.HashMap(4); node.narrowingConversionTo_TypeDecl_visited = new java.util.HashMap(4); node.narrowingConversionTo_TypeDecl_values = null; node.unaryNumericPromotion_visited = -1; node.unaryNumericPromotion_computed = false; node.unaryNumericPromotion_value = null; node.isShort_visited = -1; node.in$Circle(false); node.is$Final(false); return node; } @SuppressWarnings({"unchecked", "cast"}) public ShortType copy() { try { ShortType node = (ShortType)clone(); if(children != null) node.children = (ASTNode[])children.clone(); return node; } catch (CloneNotSupportedException e) { } System.err.println("Error: Could not clone node of type " + getClass().getName() + "!"); return null; } @SuppressWarnings({"unchecked", "cast"}) public ShortType fullCopy() { ShortType res = (ShortType)copy(); for(int i = 0; i < getNumChildNoTransform(); i++) { ASTNode node = getChildNoTransform(i); if(node != null) node = node.fullCopy(); res.setChild(node, i); } return res; } // Declared in java.ast at line 3 // Declared in java.ast line 54
public ShortType() { super();
setChild(new Opt(), 1);
setChild(new List(), 2);
} // Declared in java.ast at line 12
// Declared in java.ast line 54 public ShortType(Modifiers p0, String p1, Opt<Access> p2, List<BodyDecl> p3) { setChild(p0, 0); setID(p1); setChild(p2, 1); setChild(p3, 2); } // Declared in java.ast at line 20 // Declared in java.ast line 54 public ShortType(Modifiers p0, beaver.Symbol p1, Opt<Access> p2, List<BodyDecl> p3) { setChild(p0, 0); setID(p1); setChild(p2, 1); setChild(p3, 2); } // Declared in java.ast at line 27 protected int numChildren() {
return 3;
} // Declared in java.ast at line 30
public boolean mayHaveRewrite() { return false; } // Declared in java.ast at line 2 // Declared in java.ast line 42 public void setModifiers(Modifiers node) { setChild(node, 0); } // Declared in java.ast at line 5 public Modifiers getModifiers() { return (Modifiers)getChild(0); } // Declared in java.ast at line 9 public Modifiers getModifiersNoTransform() { return (Modifiers)getChildNoTransform(0); } // Declared in java.ast at line 2 // Declared in java.ast line 42 public void setSuperClassAccessOpt(Opt<Access> opt) { setChild(opt, 1); } // Declared in java.ast at line 6 public boolean hasSuperClassAccess() { return getSuperClassAccessOpt().getNumChild() != 0; } // Declared in java.ast at line 10 @SuppressWarnings({"unchecked", "cast"}) public Access getSuperClassAccess() { return (Access)getSuperClassAccessOpt().getChild(0); } // Declared in java.ast at line 14 public void setSuperClassAccess(Access node) { getSuperClassAccessOpt().setChild(node, 0); } // Declared in java.ast at line 17 @SuppressWarnings({"unchecked", "cast"}) public Opt<Access> getSuperClassAccessOpt() { return (Opt<Access>)getChild(1); } // Declared in java.ast at line 21 @SuppressWarnings({"unchecked", "cast"}) public Opt<Access> getSuperClassAccessOptNoTransform() { return (Opt<Access>)getChildNoTransform(1); } // Declared in java.ast at line 2 // Declared in java.ast line 42 public void setBodyDeclList(List<BodyDecl> list) { setChild(list, 2); } // Declared in java.ast at line 6 private int getNumBodyDecl = 0; // Declared in java.ast at line 7 public int getNumBodyDecl() { return getBodyDeclList().getNumChild(); } // Declared in java.ast at line 11 @SuppressWarnings({"unchecked", "cast"}) public BodyDecl getBodyDecl(int i) { return (BodyDecl)getBodyDeclList().getChild(i); } // Declared in java.ast at line 15 public void addBodyDecl(BodyDecl node) { List<BodyDecl> list = getBodyDeclList(); list.addChild(node); } // Declared in java.ast at line 20 public void setBodyDecl(BodyDecl node, int i) { List<BodyDecl> list = getBodyDeclList(); list.setChild(node, i); } // Declared in java.ast at line 24 public List<BodyDecl> getBodyDecls() { return getBodyDeclList(); } // Declared in java.ast at line 27 public List<BodyDecl> getBodyDeclsNoTransform() { return getBodyDeclListNoTransform(); } // Declared in java.ast at line 31 @SuppressWarnings({"unchecked", "cast"}) public List<BodyDecl> getBodyDeclList() { return (List<BodyDecl>)getChild(2); } // Declared in java.ast at line 35 @SuppressWarnings({"unchecked", "cast"}) public List<BodyDecl> getBodyDeclListNoTransform() { return (List<BodyDecl>)getChildNoTransform(2); } protected java.util.Map cast_Constant_visited; // Declared in ConstantExpression.jrag at line 295 @SuppressWarnings({"unchecked", "cast"}) public Constant cast(Constant c) { Object _parameters = c;if(cast_Constant_visited == null) cast_Constant_visited = new java.util.HashMap(4); if(new Integer(boundariesCrossed).equals(cast_Constant_visited.get(_parameters))) throw new RuntimeException("Circular definition of attr: cast in class: "); cast_Constant_visited.put(_parameters, new Integer(boundariesCrossed)); Constant cast_Constant_value = cast_compute(c); cast_Constant_visited.remove(_parameters); return cast_Constant_value; } private Constant cast_compute(Constant c) { return Constant.create((short)c.intValue()); } protected java.util.Map narrowingConversionTo_TypeDecl_visited; // Declared in TypeAnalysis.jrag at line 29 @SuppressWarnings({"unchecked", "cast"}) public boolean narrowingConversionTo(TypeDecl type) { Object _parameters = type;if(narrowingConversionTo_TypeDecl_visited == null) narrowingConversionTo_TypeDecl_visited = new java.util.HashMap(4);if(narrowingConversionTo_TypeDecl_values == null) narrowingConversionTo_TypeDecl_values = new java.util.HashMap(4); if(narrowingConversionTo_TypeDecl_values.containsKey(_parameters)) return ((Boolean)narrowingConversionTo_TypeDecl_values.get(_parameters)).booleanValue(); if(new Integer(boundariesCrossed).equals(narrowingConversionTo_TypeDecl_visited.get(_parameters))) throw new RuntimeException("Circular definition of attr: narrowingConversionTo in class: "); narrowingConversionTo_TypeDecl_visited.put(_parameters, new Integer(boundariesCrossed)); int num = boundariesCrossed; boolean isFinal = this.is$Final(); boolean narrowingConversionTo_TypeDecl_value = narrowingConversionTo_compute(type); if(isFinal && num == boundariesCrossed) narrowingConversionTo_TypeDecl_values.put(_parameters, Boolean.valueOf(narrowingConversionTo_TypeDecl_value)); narrowingConversionTo_TypeDecl_visited.remove(_parameters); return narrowingConversionTo_TypeDecl_value; } private boolean narrowingConversionTo_compute(TypeDecl type) { return type.isByte() || type.isChar(); } protected int unaryNumericPromotion_visited = -1; // Declared in TypeAnalysis.jrag at line 151 @SuppressWarnings({"unchecked", "cast"}) public TypeDecl unaryNumericPromotion() { if(unaryNumericPromotion_computed) return unaryNumericPromotion_value; if(unaryNumericPromotion_visited == boundariesCrossed) throw new RuntimeException("Circular definition of attr: unaryNumericPromotion in class: "); unaryNumericPromotion_visited = boundariesCrossed; int num = boundariesCrossed; boolean isFinal = this.is$Final(); unaryNumericPromotion_value = unaryNumericPromotion_compute(); if(isFinal && num == boundariesCrossed) unaryNumericPromotion_computed = true; unaryNumericPromotion_visited = -1; return unaryNumericPromotion_value; } private TypeDecl unaryNumericPromotion_compute() { return typeInt(); } protected int isShort_visited = -1; // Declared in TypeAnalysis.jrag at line 191 @SuppressWarnings({"unchecked", "cast"}) public boolean isShort() { if(isShort_visited == boundariesCrossed) throw new RuntimeException("Circular definition of attr: isShort in class: "); isShort_visited = boundariesCrossed; boolean isShort_value = isShort_compute(); isShort_visited = -1; return isShort_value; } private boolean isShort_compute() { return true; }public ASTNode rewriteTo() { return super.rewriteTo();}}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -