|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectavrora.core.isdl.ast.Expr
avrora.core.isdl.ast.Literal
avrora.core.isdl.ast.Literal.IntExpr
The IntExpr inner class represents an integer literal that has a known, constant value.
| Nested Class Summary |
| Nested classes inherited from class avrora.core.isdl.ast.Literal |
Literal.BoolExpr, Literal.IntExpr |
| Field Summary | |
int |
value
The value class stores the constant integer value of this literal. |
| Fields inherited from class avrora.core.isdl.ast.Literal |
token |
| Fields inherited from class avrora.core.isdl.ast.Expr |
PREC_A_ADD, PREC_A_AND, PREC_A_MUL, PREC_A_OR, PREC_A_SHIFT, PREC_A_XOR, PREC_L_AND, PREC_L_EQU, PREC_L_OR, PREC_L_REL, PREC_L_XOR, PREC_TERM, PREC_UN |
| Constructor Summary | |
Literal.IntExpr(int v)
The constructor of the IntExpr class evaluates the token's string value to an integer
and stores it in the publicly accessable value field, as well as storing a reference
to the original token. |
|
Literal.IntExpr(Token v)
The constructor of the IntExpr class evaluates the token's string value to an integer
and stores it in the publicly accessable value field, as well as storing a reference
to the original token. |
|
| Method Summary | |
Expr |
accept(CodeRebuilder r,
java.lang.Object env)
The accept() method implements one half of the visitor pattern for rebuilding of
expressions. |
void |
accept(CodeVisitor v)
The accept() method implements one half of the visitor pattern so that client visitors
can traverse the syntax tree easily and in an extensible way. |
int |
getBitWidth()
The getBitWidth() method returns the known bit size of this expression which is needed
in computing the size of an encoding. |
int |
getPrecedence()
The getPrecedence() method gets the binding precedence for this expression. |
java.lang.String |
toString()
|
| Methods inherited from class avrora.core.isdl.ast.Literal |
accept, isConstantExpr, isLiteral |
| Methods inherited from class avrora.core.isdl.ast.Expr |
innerString, isBitRangeExpr, isMap, isVariable, tokenToBool, tokenToInt |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public final int value
value class stores the constant integer value of this literal.
| Constructor Detail |
public Literal.IntExpr(Token v)
IntExpr class evaluates the token's string value to an integer
and stores it in the publicly accessable value field, as well as storing a reference
to the original token.
v - the token representing the value of this integerpublic Literal.IntExpr(int v)
IntExpr class evaluates the token's string value to an integer
and stores it in the publicly accessable value field, as well as storing a reference
to the original token.
v - the token representing the value of this integer| Method Detail |
public int getBitWidth()
getBitWidth() method returns the known bit size of this expression which is needed
in computing the size of an encoding. For integer literals, the known bit width is only defined for
binary constants (e.g. "0b0101011"), in which case it is the number of bits after the "0b" prefix.
getBitWidth in class Exprpublic void accept(CodeVisitor v)
accept() method implements one half of the visitor pattern so that client visitors
can traverse the syntax tree easily and in an extensible way.
accept in class Exprv - the visitor to accept
public Expr accept(CodeRebuilder r,
java.lang.Object env)
Expraccept() method implements one half of the visitor pattern for rebuilding of
expressions. This visitor allows code to be slightly modified while only writing visit methods for the
parts of the syntax tree affected.
accept in class Exprr - the rebuilder to accept
visit() method of the rebuilderpublic java.lang.String toString()
public int getPrecedence()
ExprgetPrecedence() method gets the binding precedence for this expression. This is used
to compute when inner expressions must be nested within parentheses in order to preserve the implied
order of evaluation.
getPrecedence in class Expr
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||