Class ConstantSymbol

java.lang.Object
org.ek9lang.compiler.symbols.Symbol
org.ek9lang.compiler.symbols.ConstantSymbol
All Implemented Interfaces:
Serializable, ISymbol, ITokenReference

public class ConstantSymbol extends Symbol
A very simple type that holds a single distinct value. For example PI = 3.242 would be a constant.
See Also:
  • Constructor Details

    • ConstantSymbol

      public ConstantSymbol(String name, boolean fromLiteral)
    • ConstantSymbol

      public ConstantSymbol(String name)
    • ConstantSymbol

      public ConstantSymbol(String name, ISymbol type, boolean fromLiteral)
    • ConstantSymbol

      public ConstantSymbol(String name, ISymbol type)
    • ConstantSymbol

      public ConstantSymbol(String name, Optional<ISymbol> type)
    • ConstantSymbol

      public ConstantSymbol(String name, Optional<ISymbol> type, boolean fromLiteral)
      Construction of a Constant.
  • Method Details

    • isFromLiteral

      public boolean isFromLiteral()
    • isConstant

      public boolean isConstant()
    • clone

      public ConstantSymbol clone(IScope withParentAsAppropriate)
      Description copied from interface: ISymbol
      Clone the symbol and re-parent if this symbol like a method should have a parent. Other symbols like VariableSymbols are un-parented
      Specified by:
      clone in interface ISymbol
      Overrides:
      clone in class Symbol
    • cloneIntoConstant

      protected ConstantSymbol cloneIntoConstant(ConstantSymbol newCopy)
    • equals

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

      public int hashCode()
      Overrides:
      hashCode in class Symbol
    • toString

      public String toString()
      Overrides:
      toString in class Symbol