|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object parser.Parser
public final class Parser
Generated parser class.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface parser.ParserTreeConstants |
---|
ParserTreeConstants.Kind |
Field Summary | |
---|---|
protected TreeSet<String> |
encScopeIds
The ids in the currently enclosing scope. |
protected ErrorHandler |
errorHandler
The ErrorHandler to use for reporting errors. |
protected String |
filename
The filename (possibly fake) of the file being parse. |
Token |
jj_nt
|
protected parser.JJTParserState |
jjtree
|
boolean |
lookingAhead
|
protected TreeSet<String> |
scopeIds
The ids in the current scope, that is, the declaration/accumulation now being parsed. |
protected Stack<TreeSet<String>> |
scopeStack
The scope stack is simply a stack of scopes, a scope being the set of all identifiers declared so far. |
Token |
token
|
ParserTokenManager |
token_source
|
Fields inherited from interface parser.ParserTreeConstants |
---|
JJTACCUMSTATEMENT, JJTATTRSTATEMENT, JJTBARESTRING, JJTCONTROLLERBLOCK, JJTGUIFILE, JJTHANDLERSTATEMENT, JJTIDENTIFIER, JJTSTRINGVALUE, JJTVOID, JJTWIDGETDECLARATOR, JJTWIDGETSTATEMENT |
Fields inherited from interface parser.ParserConstants |
---|
AFTERCOLON, BARESTRING, BRACE_CLOSE, BRACE_OPEN, COLON, COMMA, DEFAULT, EOF, ERROR, IDCHAR, IDENTIFIER, IDSTART, SEMICOLON, STRING, tokenImage, WHITESPACE |
Constructor Summary | |
---|---|
Parser(InputStream stream)
|
|
Parser(InputStream stream,
String encoding)
|
|
Parser(ParserTokenManager tm)
|
|
Parser(Reader stream)
|
Method Summary | |
---|---|
void |
AccumStatement()
|
void |
AttrStatement()
|
void |
AttrStatementOnly()
|
void |
AttrValue()
|
void |
BareString()
|
protected void |
continueBlock()
Skip the current statement and continue the block. |
void |
ControllerBlock()
|
void |
disable_tracing()
|
void |
enable_tracing()
|
ParseException |
generateParseException()
Make a parse exception and pass it the current state of the parser. |
Token |
getNextToken()
Get the next token parsed. |
Token |
getToken(int index)
|
protected ParserTokenManager |
getTokenSource()
Retrieve the lexer (known to JavaCC as the token manager). |
parser.GUINode |
GUIFile()
|
void |
HandlerStatement()
|
String |
Identifier()
|
protected void |
jjtreeCloseNodeScope(parser.GUINode node)
The JJTree hook called when a node scope is closed. |
protected void |
jjtreeOpenNodeScope(parser.GUINode node)
The JJTree hook called when a node scope is opened. |
protected void |
leaveBlock()
Skip to the end of the current block. |
static void |
main(String... args)
Quick command-line test functionality; reads from standard input and displays a syntax tree. |
protected void |
markBlock()
Mark the current block, so that parsing may skip to the end. |
void |
MultiAccumStatement()
|
void |
MultiWidgetStatement()
|
static GUIFile |
parse(InputStream ins)
Parse an input stream into a list of widgets. |
static GUIFile |
parse(InputStream ins,
String filename,
ErrorHandler handler)
Parse an input stream into a list of widgets. |
protected void |
raiseError(ParseException error)
Report the given error using the error handler. |
protected void |
raiseError(String msg)
Report a syntax error with the given error message using the error handler. |
void |
ReInit(InputStream stream)
|
void |
ReInit(InputStream stream,
String encoding)
|
void |
ReInit(ParserTokenManager tm)
|
void |
ReInit(Reader stream)
|
void |
SingleAccumStatement()
|
void |
SingleWidgetStatement()
|
protected Token |
skipUntil(int skipTgt,
Integer... moreTgts)
Skip parsing until a token of one of the given types is found. |
void |
Statement()
|
void |
StringValue()
|
void |
WidgetDeclarator()
|
void |
WidgetStatement()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected parser.JJTParserState jjtree
public ParserTokenManager token_source
public Token token
public Token jj_nt
public boolean lookingAhead
protected String filename
protected final Stack<TreeSet<String>> scopeStack
protected TreeSet<String> scopeIds
protected TreeSet<String> encScopeIds
protected ErrorHandler errorHandler
ErrorHandler
to use for reporting errors.
Constructor Detail |
---|
public Parser(InputStream stream)
public Parser(InputStream stream, String encoding)
public Parser(Reader stream)
public Parser(ParserTokenManager tm)
Method Detail |
---|
protected ParserTokenManager getTokenSource()
Parser
class generated by JavaCC.
public final parser.GUINode GUIFile() throws ParseException
ParseException
public final void ControllerBlock() throws ParseException
ParseException
public final void HandlerStatement() throws ParseException
ParseException
public final void Statement() throws ParseException
ParseException
public final void WidgetStatement() throws ParseException
ParseException
public final void SingleWidgetStatement() throws ParseException
ParseException
public final void MultiWidgetStatement() throws ParseException
ParseException
public final void AccumStatement() throws ParseException
ParseException
public final void SingleAccumStatement() throws ParseException
ParseException
public final void MultiAccumStatement() throws ParseException
ParseException
public final void WidgetDeclarator() throws ParseException
ParseException
public final void AttrStatement() throws ParseException
ParseException
public final void AttrStatementOnly() throws ParseException
ParseException
public final void AttrValue() throws ParseException
ParseException
public final void StringValue() throws ParseException
ParseException
public final void BareString() throws ParseException
ParseException
public final String Identifier() throws ParseException
ParseException
public void ReInit(InputStream stream)
public void ReInit(InputStream stream, String encoding)
public void ReInit(Reader stream)
public void ReInit(ParserTokenManager tm)
public final Token getNextToken()
Parser
class
generated by JavaCC.
public final Token getToken(int index)
public ParseException generateParseException()
Parser
class generated by JavaCC.
ParseException
.public final void enable_tracing()
public final void disable_tracing()
public static void main(String... args) throws Throwable
args
- Command-line arguments; ignored.
Throwable
- If bad things happen.protected final void jjtreeOpenNodeScope(parser.GUINode node)
node
- The opened node.protected final void jjtreeCloseNodeScope(parser.GUINode node)
node
- The closed node.public static GUIFile parse(InputStream ins, String filename, ErrorHandler handler) throws GUIFileException
ins
- Any input stream, to be parsed.filename
- The filename associated with the input stream. May be
faked (e.g. "<stdin>") if no true filename is known.handler
- An error handler.
null
if there were errors and the handler handled all
of them.
GUIFileException
- If the input is invalid and the error
handler couldn't handle an error.public static GUIFile parse(InputStream ins) throws GUIFileException
ins
- Any input stream, to be parsed.
GUIFileException
- If the input is invalid.protected final Token skipUntil(int skipTgt, Integer... moreTgts)
skipTgt
- A token type to stop skipping on.moreTgts
- Other token types.
protected final void raiseError(ParseException error) throws ParseException
error
- The exception representing the error to report.
ParseException
- If the error handler passes on the error.protected final void raiseError(String msg) throws ParseException
msg
- The error message.
ParseException
- If the error handler passes on the error.protected final void markBlock()
protected final void continueBlock()
protected void leaveBlock()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |