|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object avrora.core.isdl.ast.Expr avrora.core.isdl.ast.Literal
The Literal
class represents a literal (constant value) as part of an expression. Literals
have known, constant values, either boolean or integer.
Nested Class Summary | |
static class |
Literal.BoolExpr
The BoolExpr inner class represents a boolean literal that has a known, constant value
(true or false). |
static class |
Literal.IntExpr
The IntExpr inner class represents an integer literal that has a known, constant value. |
Field Summary | |
Token |
token
The token fields stores a reference to the original token representing this literal. |
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(Token t)
|
Method Summary | |
void |
accept(ExprVisitor 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. |
boolean |
isConstantExpr()
The isConstantExpr() method tests whether this expression is a constant expression (i.e.
|
boolean |
isLiteral()
The isLiteral() method tests whether this expression is a known constant directly (i.e. a
literal). |
Methods inherited from class avrora.core.isdl.ast.Expr |
accept, accept, getBitWidth, getPrecedence, innerString, isBitRangeExpr, isMap, isVariable, tokenToBool, tokenToInt |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public final Token token
token
fields stores a reference to the original token representing this literal.
Constructor Detail |
public Literal(Token t)
Method Detail |
public boolean isLiteral()
Expr
isLiteral()
method tests whether this expression is a known constant directly (i.e. a
literal).
isLiteral
in class Expr
public boolean isConstantExpr()
isConstantExpr()
method tests whether this expression is a constant expression (i.e.
it is reducable to a constant and has no references to variables, maps, etc). For literals, this method
will always return true because a literal is a constant value.
isConstantExpr
in class Expr
public void accept(ExprVisitor 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 Expr
v
- the visitor to accept
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |