Class LiteralExpression

java.lang.Object
dev.frostlake.executor.expressions.LiteralExpression
All Implemented Interfaces:
Expression

public class LiteralExpression extends Object implements Expression
Represents a literal value (string, number, boolean, null)
  • Constructor Details

  • Method Details

    • getValue

      public Object getValue()
    • getPosition

      public SourcePosition getPosition()
      Where this literal was written, or null when it was synthesised. Metadata only — it takes no part in equality, so the by-text AST cache is unaffected.
      Returns:
      the position, or null
    • setPosition

      public void setPosition(SourcePosition where)
      Note where the literal was written.
      Parameters:
      where - the literal's own place in the fragment it was parsed from
    • getType

      public LiteralType getType()
    • accept

      public <T> T accept(ExpressionVisitor<T> visitor)
      Description copied from interface: Expression
      Accept a visitor for the visitor pattern
      Specified by:
      accept in interface Expression
    • toString

      public String toString()
      Overrides:
      toString in class Object