|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.neoworks.rdc.Parser
The purpose of this abstract class is to provide the framework upon which concrete versions of the class are instantiated. The parser will create handles for lexed input, as well as for the output of target code. There will also be a handle for Source code. Contains the basif functions for getting the next token, matching the next token and generating pars error.
Field Summary | |
static int |
DUMMY
|
protected boolean |
fVerbose
Set to true to see verbose output |
static int |
ID
|
protected static int |
LOOKAHEAD_TYPE
|
protected static int |
LOOKAHEAD_VALUE
|
static int |
NONE
|
static int |
NUM
|
static int |
STRING
|
Constructor Summary | |
protected |
Parser(java.lang.String sourceCode,
java.util.Vector tokens)
Protected constructor to make sure there can be instantiation of the class only by derived classes |
Method Summary | |
protected void |
configure(java.lang.String sourceCode,
java.util.Vector tokens)
Configure the parser. |
protected void |
displayMessageVerbose(java.lang.String verboseStr,
java.lang.String shortStr)
|
protected java.lang.String |
getLookAheadData()
|
protected int |
getLookAheadType()
|
protected int |
getLookAheadValue()
|
boolean |
getVerbose()
Get the current verbose logging flag |
protected boolean |
lookAhead(int type)
|
protected boolean |
lookAhead(int type,
int value)
|
protected java.lang.String |
lookupTokenID(int token_id)
Lookup a meaningful name for a token based on its number by introspecting the class object. |
protected void |
match()
Match any token from the input stream. |
protected void |
match(int tokenType)
Match a token from the input stream with a given type. |
protected void |
match(int tokenType,
int tokenValue)
Match a token from the input stream with a given type and value. |
protected void |
parseError()
Simple parse error on the current token |
protected void |
parseError(int errorToken)
Generate a parss error for the given token index |
protected void |
parseError(int errorTokenIndex,
java.lang.String errorString)
Generate a parss error for the given token index with additional error string |
protected void |
parseError(java.lang.String errorString)
Simple parse error on the current token with additional error string |
void |
setVerbose(boolean b)
Set the verbose logging flag |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DUMMY
public static final int NUM
public static final int ID
public static final int STRING
public static final int NONE
protected static final int LOOKAHEAD_TYPE
protected static final int LOOKAHEAD_VALUE
protected boolean fVerbose
Constructor Detail |
protected Parser(java.lang.String sourceCode, java.util.Vector tokens)
sourceCode
- The source codetokens
- List of tokens to parseMethod Detail |
protected void configure(java.lang.String sourceCode, java.util.Vector tokens)
sourceCode
- Source codetokens
- List of tokens to matchprotected boolean lookAhead(int type, int value)
protected boolean lookAhead(int type)
protected int getLookAheadValue()
protected int getLookAheadType()
protected java.lang.String getLookAheadData()
protected void match() throws ParserException
ParserException
protected void match(int tokenType) throws ParserException
tokenType
- The type of the token to match
ParserException
protected void match(int tokenType, int tokenValue) throws ParserException
tokenType
- The type of the token to matchtokenValue
- The value of the token to match
ParserException
protected java.lang.String lookupTokenID(int token_id)
token_id
- ID of token look up.protected void parseError() throws ParserException
ParserException
protected void parseError(java.lang.String errorString) throws ParserException
errorString
- The optional string to show in the error
ParserException
protected void parseError(int errorToken) throws ParserException
errorToken
- The index of the token which is in error
ParserException
protected void parseError(int errorTokenIndex, java.lang.String errorString) throws ParserException
errorString
- The optional string to show in the error
ParserException
public void setVerbose(boolean b)
b
- Verbosity flag valuepublic boolean getVerbose()
protected void displayMessageVerbose(java.lang.String verboseStr, java.lang.String shortStr)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |