|
CS 536 Fall 2007, Project 5 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectParser
class Parser
Field Summary | |
---|---|
(package private) boolean |
acceptPrefix
If true, accept when a prefix of the input matches. |
static String[] |
name
String names of terminal symbols, for debugging. |
(package private) boolean |
tracing
Set to true if parsing actions should be traced. |
Constructor Summary | |
---|---|
Parser(String fname)
|
Method Summary | |
---|---|
boolean |
enableTracing(boolean on)
Turn debug tracing on or off. |
Object |
parse()
Check whether the the unconsumed input is a syntactically valid phrase according to the grammar. |
Object |
parse(boolean acceptPrefix)
Check whether the the unconsumed input is a syntactically valid phrase according to the grammar. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String[] name
public static final short FOO = nn;for some integer nn, and name[nn] = "FOO". Codes that do not correspond to tokens are either out of range (nn >= name.length), or have
name[nn] == null
.
boolean tracing
boolean acceptPrefix
Constructor Detail |
---|
public Parser(String fname) throws IOException
IOException
Method Detail |
---|
public Object parse(boolean acceptPrefix)
If the input is already at end of file when this method is called, it silently returns null. If an error occurs, a message is printed by calling the user-supplied method error(String) and the result is null. On success, the return value is the "semantic value" assigned by semantic routines to the start symbol.
acceptPrefix
- if true, the input does not to be completely consumed.
public Object parse()
public boolean enableTracing(boolean on)
on
- if true, turn tracing on; otherwise turn it off.
|
CS 536 Fall 2007, Project 5 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |