net.hydromatic.clapham.parser.wirth
Class WirthParser

java.lang.Object
  extended by net.hydromatic.clapham.parser.wirth.WirthParser
All Implemented Interfaces:
WirthParserConstants

public class WirthParser
extends java.lang.Object
implements WirthParserConstants

Parser for grammars in Wirth Syntax Notation.

Wirth Syntax Notation (WSN) is an alternative to Backus-Naur Form.

Version:
$Id: WirthParser.jj 3 2009-05-11 08:11:57Z jhyde $
Author:
Julian Hyde

Field Summary
 Token jj_nt
          Next token.
 Token token
          Current token.
 WirthParserTokenManager token_source
          Generated Token Manager.
 
Fields inherited from interface net.hydromatic.clapham.parser.wirth.WirthParserConstants
BAR, DEFAULT, DIGIT, DOT, EOF, EQ, IDENTIFIER, LBRACE, LBRACKET, LETTER, LITERAL, LPAREN, QUOT, RBRACE, RBRACKET, RPAREN, tokenImage
 
Constructor Summary
WirthParser(java.io.InputStream stream)
          Constructor with InputStream.
WirthParser(java.io.InputStream stream, java.lang.String encoding)
          Constructor with InputStream and supplied encoding
WirthParser(java.io.Reader stream)
          Constructor.
WirthParser(WirthParserTokenManager tm)
          Constructor with generated Token Manager.
 
Method Summary
 void disable_tracing()
          Disable tracing.
 void enable_tracing()
          Enable tracing.
 EbnfNode Expression()
           
 EbnfNode Factor()
           
 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(java.io.InputStream stream)
          Reinitialise.
 void ReInit(java.io.InputStream stream, java.lang.String encoding)
          Reinitialise.
 void ReInit(java.io.Reader stream)
          Reinitialise.
 void ReInit(WirthParserTokenManager tm)
          Reinitialise.
 java.util.List<ProductionNode> Syntax()
          Syntactical Descriptions *
 EbnfNode Term()
           
static
<E extends EbnfNode>
void
toString(java.lang.StringBuilder buf, java.lang.String start, java.util.List<E> list, java.lang.String end)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

token_source

public WirthParserTokenManager token_source
Generated Token Manager.


token

public Token token
Current token.


jj_nt

public Token jj_nt
Next token.

Constructor Detail

WirthParser

public WirthParser(java.io.InputStream stream)
Constructor with InputStream.


WirthParser

public WirthParser(java.io.InputStream stream,
                   java.lang.String encoding)
Constructor with InputStream and supplied encoding


WirthParser

public WirthParser(java.io.Reader stream)
Constructor.


WirthParser

public WirthParser(WirthParserTokenManager tm)
Constructor with generated Token Manager.

Method Detail

toString

public static <E extends EbnfNode> void toString(java.lang.StringBuilder buf,
                                                 java.lang.String start,
                                                 java.util.List<E> list,
                                                 java.lang.String end)

Syntax

public final java.util.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

Identifier

public final IdentifierNode Identifier()
                                throws ParseException
Throws:
ParseException

Literal

public final LiteralNode Literal()
                          throws ParseException
Throws:
ParseException

ReInit

public void ReInit(java.io.InputStream stream)
Reinitialise.


ReInit

public void ReInit(java.io.InputStream stream,
                   java.lang.String encoding)
Reinitialise.


ReInit

public void ReInit(java.io.Reader stream)
Reinitialise.


ReInit

public void ReInit(WirthParserTokenManager tm)
Reinitialise.


getNextToken

public final Token getNextToken()
Get the next Token.


getToken

public final Token getToken(int index)
Get the specific Token.


generateParseException

public ParseException generateParseException()
Generate ParseException.


enable_tracing

public final void enable_tracing()
Enable tracing.


disable_tracing

public final void disable_tracing()
Disable tracing.


SourceForge.net_Logo