|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--elan.parser.ElanParser
A singleton; uses the StreamTokenizer class to parse an input file based on set options.
| Field Summary | |
protected Token |
myToken
|
protected java.io.StreamTokenizer |
myTokenizer
|
| Constructor Summary | |
ElanParser()
|
|
| Method Summary | |
void |
error(Token t)
|
int |
getCurrentLineNumber()
Returns the current line number where the parser is. |
static ElanParser |
getInstance()
returns the ElanParser instance. |
java.util.ArrayList |
getInstructions()
Returns the instructions that are stored while parsing. |
Token |
getToken()
|
void |
incrementLineNumber()
Increments the internal line number counter. |
Token |
match(Token rhs)
try to match a token, if unsuccessful throw an exception, otherwise match succeeds, and next token is obtained and returned |
protected Token |
nextToken()
get the next token and store it for retrieval by getToken() |
boolean |
parse(java.io.Reader r)
parses an expression and prints the result of evaluating the expression. |
protected void |
skipLines()
skip EOL tokens, the next call of getToken() returns something other than EOLToken |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected java.io.StreamTokenizer myTokenizer
protected Token myToken
| Constructor Detail |
public ElanParser()
| Method Detail |
public static ElanParser getInstance()
public boolean parse(java.io.Reader r)
r - is the reader that will be tokenizedprotected void skipLines()
protected Token nextToken()
getTokenpublic Token getToken()
public Token match(Token rhs)
rhs - is the token being matched
ParseException - (RunTime) if match failspublic void error(Token t)
t - is included in expeption thrown
a - ParseException labelled by tpublic java.util.ArrayList getInstructions()
public int getCurrentLineNumber()
public void incrementLineNumber()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||