net.hydromatic.clapham.parser.bnf
Class BnfParser
java.lang.Object
net.hydromatic.clapham.parser.bnf.BnfParser
- All Implemented Interfaces:
- BnfParserConstants
public class BnfParser
- extends Object
- implements BnfParserConstants
Parser for grammars in Backus-Naur Form (BNF) notation.
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).
- Author:
- Julian Hyde
-
-
Fields inherited from interface net.hydromatic.clapham.parser.bnf.BnfParserConstants |
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 |
token_source
public BnfParserTokenManager token_source
token
public Token token
jj_nt
public Token jj_nt
lookingAhead
public boolean lookingAhead
BnfParser
public BnfParser(InputStream stream)
BnfParser
public BnfParser(InputStream stream,
String encoding)
BnfParser
public BnfParser(Reader stream)
BnfParser
public BnfParser(BnfParserTokenManager tm)
toString
public static <E extends EbnfNode> void toString(StringBuilder buf,
String start,
List<E> list,
String end)
Syntax
public final List<ProductionNode> Syntax()
throws ParseException
- Syntactical Descriptions *
- Throws:
ParseException
Production
public final ProductionNode Production()
throws ParseException
- Throws:
ParseException
Expression
public final EbnfNode Expression()
throws ParseException
- Throws:
ParseException
Term
public final EbnfNode Term()
throws ParseException
- Throws:
ParseException
Factor
public final EbnfNode Factor()
throws ParseException
- Throws:
ParseException
Factor2
public final EbnfNode Factor2()
throws ParseException
- Throws:
ParseException
Factor3
public final EbnfNode Factor3()
throws ParseException
- Throws:
ParseException
Identifier
public final IdentifierNode Identifier()
throws ParseException
- Throws:
ParseException
Literal
public final LiteralNode Literal()
throws ParseException
- Throws:
ParseException
ReInit
public void ReInit(InputStream stream)
ReInit
public void ReInit(InputStream stream,
String encoding)
ReInit
public void ReInit(Reader stream)
ReInit
public void ReInit(BnfParserTokenManager tm)
getNextToken
public final Token getNextToken()
getToken
public final Token getToken(int index)
generateParseException
public ParseException generateParseException()
enable_tracing
public final void enable_tracing()
disable_tracing
public final void disable_tracing()