Class IdentifierExpression

java.lang.Object
team.unnamed.mocha.parser.ast.IdentifierExpression
All Implemented Interfaces:
Expression

public final class IdentifierExpression extends Object implements Expression
Identifier expression implementation for Molang.

Note that, identifiers in Molang are always case-insensitive

Example identifier expressions: math, name, this, print

Since:
3.0.0
  • Constructor Details

    • IdentifierExpression

      public IdentifierExpression(@NotNull @NotNull String name)
  • Method Details

    • name

      @NotNull public @NotNull String name()
      Gets the identifier name.
      Returns:
      The identifier name.
      Since:
      3.0.0
    • visit

      public <R> R visit(@NotNull @NotNull ExpressionVisitor<R> visitor)
      Description copied from interface: Expression
      Visits this expression with the given visitor.
      Specified by:
      visit in interface Expression
      Type Parameters:
      R - The visit result return type
      Parameters:
      visitor - The expression visitor
      Returns:
      The visit result
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object