com.inxar.syntacs.analyzer
Class StringSymbol
java.lang.Object
|
+--com.inxar.syntacs.analyzer.StringSymbol
- All Implemented Interfaces:
- Symbol
- public class StringSymbol
- extends Object
- implements Symbol
Concrete implementation of Symbol
which internally
contains a String.
Field Summary |
String |
value
The value of the symbol Symbol represented as an
String . |
Constructor Summary |
StringSymbol(int type,
String value)
Constructs the StringSymbol with the given
type and String value. |
StringSymbol(String value)
Constructs the StringSymbol with the given
String value. |
value
public String value
- The value of the symbol
Symbol
represented as an
String
.
StringSymbol
public StringSymbol(String value)
- Constructs the
StringSymbol
with the given
String
value.
StringSymbol
public StringSymbol(int type,
String value)
- Constructs the
StringSymbol
with the given
type and String
value.
getSymbolType
public int getSymbolType()
- Description copied from interface:
Symbol
- Returns the symbol type.
- Specified by:
getSymbolType
in interface Symbol
setSymbolType
public void setSymbolType(int type)
- Description copied from interface:
Symbol
- Sets the symbol type. This method is necessary because the
design of the shift-reduce parser interacts with the symbol
such that it automatically sets the type of the symbol returned
to the parser after a reduction to the correct nonterminal
(such that the user doesn't have to worry about it).
- Specified by:
setSymbolType
in interface Symbol
toString
public String toString()
- Overrides:
toString
in class Object
equals
public boolean equals(Object other)
- Overrides:
equals
in class Object