|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectname.angoca.db2sa.core.syntax.graph.GraphToken
public class GraphToken
This is the representation of a word in the grammar graph. A token can be a
reserved word, a parenthesis, a comma, or a variable word, like a name or a
number.
The grammar is represented by a graph, and this graph has the possibles ways
that a command can have.
A token has the following elements:
Constructor Summary | |
---|---|
GraphToken(String name,
boolean reservedWord)
Constructor that defines a token object. |
|
GraphToken(String tokenId,
String name,
boolean reservedWord)
Constructor that defines a token object. |
Method Summary | |
---|---|
void |
addWay(GraphToken token)
Adds a possible way to the current token. |
boolean |
equals(Object object)
|
String |
getId()
Returns the identifier of this token. |
String |
getName()
Returns the name of the token. |
List<GraphToken> |
getWays()
This method retrieves all the possibles ways that can be taken from this node. |
int |
hashCode()
|
boolean |
isReservedWord()
Returns true if the token represents a reserved word in the grammar. |
boolean |
represent(String token)
Analyzes the given token, and returns true if the current graph token represents that token. |
String |
toString()
Returns a string representation of a graph token. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GraphToken(String name, boolean reservedWord)
name
- Name of the token.reservedWord
- Indicates if the token is a reserved word in the grammar.public GraphToken(String tokenId, String name, boolean reservedWord)
tokenId
- Unique id of the token.name
- Name of the token.reservedWord
- Indicates if the token is a reserved word in the grammar.Method Detail |
---|
public final void addWay(GraphToken token)
token
- to connect with the current token.public final boolean represent(String token)
token
- token to analyze.
public final String getId()
public final String getName()
public final boolean isReservedWord()
public final List<GraphToken> getWays()
public boolean equals(Object object)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
Object.toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |