|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.agentfactory.common.parser.Token
public class Token
Tokens are the basic units of the scanning and parsing process. Tokens are created by the syntax scanner implementations in compliance with a given syntax for the source language. lists of tokens representing statements that are written in the source language are passed to the handlers, which attempt to construct a parse-tree for the statement. If successful, the parser takes the generated parse-tree and adds it to the program model.
| Constructor Summary | |
|---|---|
Token(java.lang.String content,
int row,
java.lang.String source)
Creates a new instance of Token |
|
| Method Summary | |
|---|---|
boolean |
contentEquals(java.lang.String text)
Comparator that compares some text with the content stored in the token. |
java.lang.String |
getContent()
Accessor that returns the content associated with the token |
int |
getRow()
Accessor that returns the row that the token was found on |
java.lang.String |
getSource()
Accessor that returns the name of the source from which the token was retrieved. |
java.lang.String |
toString()
String representation fo a token |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Token(java.lang.String content,
int row,
java.lang.String source)
content - the content associated with the token.row - the row (line) on which the token occurred.source - the name of the source from which the token was taken.| Method Detail |
|---|
public int getRow()
public java.lang.String getContent()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean contentEquals(java.lang.String text)
text - some text that is to be used for a comparison with the token.
public java.lang.String getSource()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||