Class Symbol

java.lang.Object
net.aifusion.asn.Symbol

public class Symbol extends Object
Class to manage a symbol
Author:
Sharad Singhal
  • Constructor Details

    • Symbol

      public Symbol(String name, AsnProduction type, Symbol parent, String definingType)
      Create a symbol
      Parameters:
      name - - name of the symbol (must not be null)
      type - - type of this symbol
      parent - - enclosing symbol, if any
      definingType - - name of the defining type, if not a built-in type
  • Method Details

    • getName

      public String getName()
      Get the name of this symbol
      Returns:
      - name of this symbol
    • getFullName

      public String getFullName()
      Get the fully qualified name of this symbol
      Returns:
      - fully qualified name in the form "@" moduleName ( "." symbol)*
    • getProduction

      public AsnProduction getProduction()
      Get the production associated with this symbol
      Returns:
      - AST Production associated with the symbol
    • getParent

      public Symbol getParent()
      Get the parent of this symbol, if any
      Returns:
      - parent of this symbol. Null if none defined
    • getDefiningType

      public String getDefiningType()
      Get the name of the defining type, if any
      Returns:
      - name of the defining type. Null if none exists
    • setDefinition

      public void setDefinition(AsnNode definition)
      Set the definition for this symbol
      Parameters:
      definition - - AST node defining this symbol
    • getDefinition

      public AsnNode getDefinition()
      Get the definition for this symbol
      Returns:
      - definition. Null if the symbol is not yet defined
    • toString

      public String toString()
      Overrides:
      toString in class Object