Package jeco.core.util.bnf
Class Symbol
java.lang.Object
jeco.core.util.bnf.Symbol
Class to represent a symbol in a grammar
- Version:
- 1.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Enum to represent the type of the symbol -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
Symbol stringprotected Symbol.SYMBOL_TYPE
Symbol type -
Constructor Summary
ConstructorsConstructorDescriptionSymbol()
ConstructorSymbol
(String symbolString, Symbol.SYMBOL_TYPE type) ConstructorSymbol
(Symbol.SYMBOL_TYPE type) Constructor -
Method Summary
-
Field Details
-
type
Symbol type -
symbolString
Symbol string
-
-
Constructor Details
-
Symbol
Constructor- Parameters:
symbolString
- Symbol stringtype
- Symbol type
-
Symbol
Constructor- Parameters:
type
- Symbol type
-
Symbol
public Symbol()Constructor
-
-
Method Details
-
clone
-
equals
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
-