Alachisoft.NCache.Parser.Token Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of nc-parser Show documentation
Show all versions of nc-parser Show documentation
Internal package of Alachisoft.
package Alachisoft.NCache.Parser;
// C# Translation of GoldParser, by Marcus Klimstra .
// Based on GOLDParser by Devin Cook .
/**
* While the Symbol represents a class of terminals and nonterminals,
* the Token represents an individual piece of information.
*/
public class Token extends Symbol {
private int m_state;
private Object m_data;
/* constructors */
/**
*
*/
public Token() {
m_state = -1;
m_data = "";
}
/**
*
*/
public Token(Symbol p_symbol) {
this();
SetParent(p_symbol);
}
/* properties */
/**
* Gets the state
*/
public final int getState() {
return m_state;
}
public final void setState(int value) {
m_state = value;
}
/**
* Gets or sets the information stored in the token.
*/
public final Object getData() {
return m_data;
}
public final void setData(Object value) {
m_data = value;
}
/* public methods */
/**
*
*/
public final void SetParent(Symbol p_symbol) {
CopyData(p_symbol);
}
/**
* Returns the text representation of the token's parent symbol.
* In the case of nonterminals, the name is delimited by angle brackets,
* special terminals are delimited by parenthesis and terminals are delimited
* by single quotes (if special characters are present).
*/
@Override
public String toString() {
return super.toString();
}
}