Package codeanalysis.syntax
Class LiteralExpressionSyntax
java.lang.Object
codeanalysis.syntax.SyntaxNode
codeanalysis.syntax.ExpressionSyntax
codeanalysis.syntax.LiteralExpressionSyntax
Represents a literal expression in the syntax tree.
This class encapsulates a single literal token.
- Version:
- 1.0
- Author:
- Siyabend Urun
- See Also:
-
Field Summary
Fields inherited from class codeanalysis.syntax.SyntaxNode
_span -
Constructor Summary
ConstructorsConstructorDescriptionLiteralExpressionSyntax(SyntaxToken literalToken) Initializes a new instance of the LiteralExpressionSyntax class with the specified literal token.LiteralExpressionSyntax(SyntaxToken literalToken, Object value) Initializes a new instance of the LiteralExpressionSyntax class with the specified literal token. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves an iterator over the child nodes of the literal expression.Gets the literal token representing the value of the literal expression.getType()Gets the syntax type of the literal expression.getValue()Gets the value for the literal expression.voidsetLiteralToken(SyntaxToken literalToken) Sets the literal token for the literal expression.Methods inherited from class codeanalysis.syntax.SyntaxNode
getSpan, toString, writeTo
-
Constructor Details
-
LiteralExpressionSyntax
Initializes a new instance of the LiteralExpressionSyntax class with the specified literal token.- Parameters:
literalToken- The literal token representing the value of the literal expression.
-
LiteralExpressionSyntax
Initializes a new instance of the LiteralExpressionSyntax class with the specified literal token.- Parameters:
literalToken- The literal token representing the value of the literal expression.value- The value of literal expression.
-
-
Method Details
-
getType
Gets the syntax type of the literal expression.- Specified by:
getTypein classSyntaxNode- Returns:
- The syntax type of the literal expression.
-
getChildren
Retrieves an iterator over the child nodes of the literal expression. In this case, the only child node is the literal token.- Specified by:
getChildrenin classSyntaxNode- Returns:
- An iterator over the child nodes of the literal expression.
-
getLiteralToken
Gets the literal token representing the value of the literal expression.- Returns:
- The literal token representing the value of the literal expression.
-
setLiteralToken
Sets the literal token for the literal expression.- Parameters:
literalToken- The literal token representing the value of the literal expression.
-
getValue
Gets the value for the literal expression.- Returns:
- The valueof the literal expression.
-