net.hydromatic.clapham.parser.bnf
Class BnfParser

java.lang.Object
  extended by 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
 

Field Summary
 Token jj_nt
           
 boolean lookingAhead
           
 Token token
           
 BnfParserTokenManager token_source
           
 
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
 
Constructor Summary
BnfParser(BnfParserTokenManager tm)
           
BnfParser(InputStream stream)
           
BnfParser(InputStream stream, String encoding)
           
BnfParser(Reader stream)
           
 
Method Summary
 void disable_tracing()
           
 void enable_tracing()
           
 EbnfNode Expression()
           
 EbnfNode Factor()
           
 EbnfNode Factor2()
           
 EbnfNode Factor3()
           
 ParseException generateParseException()
           
 Token getNextToken()
           
 Token getToken(int index)
           
 IdentifierNode Identifier()
           
 LiteralNode Literal()
           
 ProductionNode Production()
           
 void ReInit(BnfParserTokenManager tm)
           
 void ReInit(InputStream stream)
           
 void ReInit(InputStream stream, String encoding)
           
 void ReInit(Reader stream)
           
 List<ProductionNode> Syntax()
          Syntactical Descriptions *
 EbnfNode Term()
           
static
<E extends EbnfNode>
void
toString(StringBuilder buf, String start, List<E> list, String end)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

token_source

public BnfParserTokenManager token_source

token

public Token token

jj_nt

public Token jj_nt

lookingAhead

public boolean lookingAhead
Constructor Detail

BnfParser

public BnfParser(InputStream stream)

BnfParser

public BnfParser(InputStream stream,
                 String encoding)

BnfParser

public BnfParser(Reader stream)

BnfParser

public BnfParser(BnfParserTokenManager tm)
Method Detail

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()

SourceForge.net_Logo