Class LiteralExpressionSyntax


public final class LiteralExpressionSyntax extends ExpressionSyntax
Represents a literal expression in the syntax tree. This class encapsulates a single literal token.
Version:
1.0
Author:
Siyabend Urun
See Also:
  • Constructor Details

    • LiteralExpressionSyntax

      public LiteralExpressionSyntax(SyntaxToken literalToken)
      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

      public LiteralExpressionSyntax(SyntaxToken literalToken, Object value)
      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

      public SyntaxType getType()
      Gets the syntax type of the literal expression.
      Specified by:
      getType in class SyntaxNode
      Returns:
      The syntax type of the literal expression.
    • getChildren

      public Iterator<SyntaxNode> 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:
      getChildren in class SyntaxNode
      Returns:
      An iterator over the child nodes of the literal expression.
    • getLiteralToken

      public SyntaxToken getLiteralToken()
      Gets the literal token representing the value of the literal expression.
      Returns:
      The literal token representing the value of the literal expression.
    • setLiteralToken

      public void setLiteralToken(SyntaxToken literalToken)
      Sets the literal token for the literal expression.
      Parameters:
      literalToken - The literal token representing the value of the literal expression.
    • getValue

      public Object getValue()
      Gets the value for the literal expression.
      Returns:
      The valueof the literal expression.