public class BnfParser extends java.lang.Object implements BnfParserConstants
The supported grammar is Backus-Naur Form, extended with '*' (closure operator), '+' (mandatory repetition), but is not the grammar officially known as 'Extended Backus-Naur Form' (EBNF).
Modifier and Type | Field and Description |
---|---|
Token |
jj_nt
Next token.
|
Token |
token
Current token.
|
BnfParserTokenManager |
token_source
Generated Token Manager.
|
ASTERISK, BAR, BRACKETED_IDENTIFIER, COLCOLEQ, DEFAULT, DIGIT, EOF, HOOK, IDENTIFIER, IN_MULTI_LINE_COMMENT, IN_SINGLE_LINE_COMMENT, LETTER, LITERAL, LPAREN, MULTI_LINE_COMMENT, PLUS, QUOT, RPAREN, SINGLE_LINE_COMMENT, tokenImage
Constructor and Description |
---|
BnfParser(BnfParserTokenManager tm)
Constructor with generated Token Manager.
|
BnfParser(java.io.InputStream stream)
Constructor with InputStream.
|
BnfParser(java.io.InputStream stream,
java.lang.String encoding)
Constructor with InputStream and supplied encoding
|
BnfParser(java.io.Reader stream)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
disable_tracing()
Disable tracing.
|
void |
enable_tracing()
Enable tracing.
|
EbnfNode |
Expression() |
EbnfNode |
Factor() |
EbnfNode |
Factor2() |
EbnfNode |
Factor3() |
ParseException |
generateParseException()
Generate ParseException.
|
Token |
getNextToken()
Get the next Token.
|
Token |
getToken(int index)
Get the specific Token.
|
IdentifierNode |
Identifier() |
LiteralNode |
Literal() |
ProductionNode |
Production() |
void |
ReInit(BnfParserTokenManager tm)
Reinitialise.
|
void |
ReInit(java.io.InputStream stream)
Reinitialise.
|
void |
ReInit(java.io.InputStream stream,
java.lang.String encoding)
Reinitialise.
|
void |
ReInit(java.io.Reader stream)
Reinitialise.
|
java.util.List<ProductionNode> |
Syntax()
Syntactical Descriptions *
|
EbnfNode |
Term() |
static <E extends EbnfNode> |
toString(java.lang.StringBuilder buf,
java.lang.String start,
java.util.List<E> list,
java.lang.String end) |
boolean |
trace_enabled()
Trace enabled.
|
public BnfParserTokenManager token_source
public BnfParser(java.io.InputStream stream)
public BnfParser(java.io.InputStream stream, java.lang.String encoding)
public BnfParser(java.io.Reader stream)
public BnfParser(BnfParserTokenManager tm)
public static <E extends EbnfNode> void toString(java.lang.StringBuilder buf, java.lang.String start, java.util.List<E> list, java.lang.String end)
public final java.util.List<ProductionNode> Syntax() throws ParseException
ParseException
public final ProductionNode Production() throws ParseException
ParseException
public final EbnfNode Expression() throws ParseException
ParseException
public final EbnfNode Term() throws ParseException
ParseException
public final EbnfNode Factor() throws ParseException
ParseException
public final EbnfNode Factor2() throws ParseException
ParseException
public final EbnfNode Factor3() throws ParseException
ParseException
public final IdentifierNode Identifier() throws ParseException
ParseException
public final LiteralNode Literal() throws ParseException
ParseException
public void ReInit(java.io.InputStream stream)
public void ReInit(java.io.InputStream stream, java.lang.String encoding)
public void ReInit(java.io.Reader stream)
public void ReInit(BnfParserTokenManager tm)
public final Token getNextToken()
public ParseException generateParseException()
public final boolean trace_enabled()
public final void enable_tracing()
public final void disable_tracing()