org.extendj.ast
node type Literal

General Info

Production
Literal : PrimaryExpr ::= <LITERAL:String>;
Type Hierarchy:
java.lang.Object
  extended by beaver.Symbol
      extended by org.extendj.ast.ASTNode<ASTNode>
          extended by org.extendj.ast.Expr
              extended by org.extendj.ast.PrimaryExpr
                  extended by org.extendj.ast.Literal
All Implemented Interfaces:
java.lang.Cloneable, java.lang.Iterable<ASTNode>, org.jastadd.util.PrettyPrintable
Direct Known Subclasses:
BooleanLiteral, CharacterLiteral, IllegalLiteral, NullLiteral, NumericLiteral, StringLiteral

Description

The abstract base class for all literals.
Source
Declared in /home/jesper/git/extendj/java7/grammar/Literals.ast at line 4

Member Filters

API level:

Aspect:

Constructors

public Literal()
 
Source
Declared in /home/jesper/git/extendj/ASTNode at line 1
public Literal(java.lang.String p0)
 
Source
Declared in /home/jesper/git/extendj/ASTNode at line 12
public Literal(beaver.Symbol p0)
 
Source
Declared in /home/jesper/git/extendj/ASTNode at line 15

Attributes

@ASTNodeAnnotation.Attribute
syn org.extendj.ast.Constant constant()
Overrides:constant in class Expr
Source
Declared in /home/jesper/git/extendj/java4/frontend/ConstantExpression.jrag at line 37
Aspect
ConstantExpression
Overrides:isConstant in class Expr
Source
Declared in /home/jesper/git/extendj/java4/frontend/ConstantExpression.jrag at line 254
Aspect
ConstantExpression
Overrides:isTrue in class Expr
Source
Declared in /home/jesper/git/extendj/java4/frontend/ConstantExpression.jrag at line 283
Aspect
ConstantExpression
Overrides:isFalse in class Expr
Source
Declared in /home/jesper/git/extendj/java4/frontend/ConstantExpression.jrag at line 284
Aspect
ConstantExpression

Methods

public static Literal buildBooleanLiteral(boolean value)
Source
Declared in /home/jesper/git/extendj/java4/frontend/BytecodeCONSTANT.jrag at line 98
Aspect
BytecodeCONSTANT
public static Literal buildStringLiteral(java.lang.String value)
Source
Declared in /home/jesper/git/extendj/java4/frontend/BytecodeCONSTANT.jrag at line 102
Aspect
BytecodeCONSTANT
public void prettyPrint(org.jastadd.util.PrettyPrinter out)
Specified by:prettyPrint in interface org.jastadd.util.PrettyPrintableOverrides:prettyPrint in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java4/frontend/PrettyPrint.jadd at line 184
Aspect
Java4PrettyPrint
protected static java.lang.String escape(java.lang.String s)
Escapes a string literal.
Parameters:
s - string to escape
Returns:
escaped string literal
Source
Declared in /home/jesper/git/extendj/java4/frontend/PrettyPrintUtil.jrag at line 323
Aspect
PrettyPrintUtil
protected static java.lang.String asEscape(int value)
Source
Declared in /home/jesper/git/extendj/java4/frontend/PrettyPrintUtil.jrag at line 363
Aspect
PrettyPrintUtil
public void emitPushConstant(org.extendj.ast.CodeGeneration gen)
Source
Declared in /home/jesper/git/extendj/java4/backend/CodeGeneration.jrag at line 177
Aspect
CodeGeneration
public void createBCode(org.extendj.ast.CodeGeneration gen)
Overrides:createBCode in class ASTNode<ASTNode>
Source
Declared in /home/jesper/git/extendj/java4/backend/CreateBCode.jrag at line 238
Aspect
CreateBCode
public void init$Children()
Initializes the child array to the correct size. Initializes List and Opt nta children.
Overrides:init$Children in class PrimaryExpr
Source
Declared in /home/jesper/git/extendj/ASTNode at line 10
protected int numChildren()
Overrides:numChildren in class PrimaryExpr
Source
Declared in /home/jesper/git/extendj/ASTNode at line 21
public boolean mayHaveRewrite()
Overrides:mayHaveRewrite in class PrimaryExpr
Source
Declared in /home/jesper/git/extendj/ASTNode at line 27
public void flushAttrCache()
Overrides:flushAttrCache in class PrimaryExpr
Source
Declared in /home/jesper/git/extendj/ASTNode at line 33
public void flushCollectionCache()
Overrides:flushCollectionCache in class PrimaryExpr
Source
Declared in /home/jesper/git/extendj/ASTNode at line 40
public void flushRewriteCache()
Overrides:flushRewriteCache in class PrimaryExpr
Source
Declared in /home/jesper/git/extendj/ASTNode at line 46
public Literal clone()
              throws java.lang.CloneNotSupportedException
Overrides:clone in class PrimaryExpr
Throws:
java.lang.CloneNotSupportedException
Source
Declared in /home/jesper/git/extendj/ASTNode at line 52
@Deprecated
public abstract Literal fullCopy()
Deprecated. Please use treeCopy or treeCopyNoTransform instead

Create a deep copy of the AST subtree at this node. The copy is dangling, i.e. has no parent.

Specified by:fullCopy in class PrimaryExpr
Returns:
dangling copy of the subtree at this node
Source
Declared in /home/jesper/git/extendj/ASTNode at line 63
public abstract Literal treeCopyNoTransform()
Create a deep copy of the AST subtree at this node. The copy is dangling, i.e. has no parent.
Specified by:treeCopyNoTransform in class PrimaryExpr
Returns:
dangling copy of the subtree at this node
Source
Declared in /home/jesper/git/extendj/ASTNode at line 71
public abstract Literal treeCopy()
Create a deep copy of the AST subtree at this node. The subtree of this node is traversed to trigger rewrites before copy. The copy is dangling, i.e. has no parent.
Specified by:treeCopy in class PrimaryExpr
Returns:
dangling copy of the subtree at this node
Source
Declared in /home/jesper/git/extendj/ASTNode at line 79
public void setLITERAL(java.lang.String value)
Replaces the lexeme LITERAL.
Parameters:
value - The new value for the lexeme LITERAL.
public void setLITERAL(beaver.Symbol symbol)
JastAdd-internal setter for lexeme LITERAL using the Beaver parser.
Parameters:
symbol - Symbol containing the new value for the lexeme LITERAL
@ASTNodeAnnotation.Token(name="LITERAL")
public java.lang.String getLITERAL()
Retrieves the value for the lexeme LITERAL.
Returns:
The value for the lexeme LITERAL.
public static Literal buildDoubleLiteral(double value)
Returns:
a fresh double literal representing the given value
Source
Declared in /home/jesper/git/extendj/java7/frontend/Literals.jrag at line 76
Aspect
Java7Literals
public static Literal buildFloatLiteral(float value)
Returns:
a fresh float literal representing the given value
Source
Declared in /home/jesper/git/extendj/java7/frontend/Literals.jrag at line 88
Aspect
Java7Literals
public static Literal buildIntegerLiteral(int value)
Returns:
a fresh integer literal representing the given value
Source
Declared in /home/jesper/git/extendj/java7/frontend/Literals.jrag at line 100
Aspect
Java7Literals
public static Literal buildLongLiteral(long value)
Returns:
a fresh long literal representing the given value
Source
Declared in /home/jesper/git/extendj/java7/frontend/Literals.jrag at line 112
Aspect
Java7Literals
Overrides:rewriteTo in class PrimaryExpr

Fields

protected java.lang.String tokenString_LITERAL
public int LITERALstart
public int LITERALend
protected boolean constant_computed
protected org.extendj.ast.Constant constant_value

Inherited Members

Attributes inherited from org.extendj.ast.Expr

Attributes inherited from org.extendj.ast.ASTNode

Methods inherited from class org.extendj.ast.Expr

Methods inherited from class org.extendj.ast.ASTNode

Methods inherited from class beaver.Symbol

getColumn
getEnd
getId
getLine
getStart
makePosition

Methods inherited from class java.lang.Object

equals
finalize
getClass
hashCode
notify
notifyAll
wait
wait
wait

Fields inherited from org.extendj.ast.Expr

Fields inherited from org.extendj.ast.ASTNode

Fields inherited from beaver.Symbol

end
id
start
value