Class Symbol

java.lang.Object
jeco.core.util.bnf.Symbol

public class Symbol extends Object
Class to represent a symbol in a grammar
Version:
1.0
  • Field Details

  • Constructor Details

    • Symbol

      public Symbol(String symbolString, Symbol.SYMBOL_TYPE type)
      Constructor
      Parameters:
      symbolString - Symbol string
      type - Symbol type
    • Symbol

      public Symbol(Symbol.SYMBOL_TYPE type)
      Constructor
      Parameters:
      type - Symbol type
    • Symbol

      public Symbol()
      Constructor
  • Method Details

    • clone

      public Symbol clone()
      Overrides:
      clone in class Object
    • equals

      public boolean equals(Symbol right)
      Check if a symbol is equal to another
      Parameters:
      right - Symbol to compare
      Returns:
      True if the symbols are equal, false otherwise
    • isTerminal

      public boolean isTerminal()
      Checks if a symbol is terminal
      Returns:
      True if the symbol is terminal, false otherwise
    • toString

      public String toString()
      Overrides:
      toString in class Object