pj
Class Rfc

java.lang.Object
  extended by pj.Rfc

public class Rfc
extends Object

RFC-style grammar for pj.


Nested Class Summary
static class Rfc.Scanner
          embedded pj scanner.
static interface Rfc.yyActions
          interface between grammar and actions.
static class Rfc.yyException
          thrown for irrecoverable syntax errors and stack overflow.
static interface Rfc.yyInput
          must be implemented by a scanner object to supply input to the parser.
 
Field Summary
static int __error
           
static int Epilog
           
static int Id
           
static int LEFT
           
static int Lex
           
static int Lit
           
static int Lit1
           
static int Mac
           
static int NONASSOC
           
static int PACKAGE
           
static int PREC
           
static int RIGHT
           
static int SCAN
           
static int SCREEN
           
static int SEP
           
static int SKIP
           
static int Sym
           
static int TOKEN
           
protected  Rfc.yyActions yyAct
          current factory.
protected static short[] yyCheck
          parser tables.
protected static short[] yyDefRed
          parser tables.
protected static short[] yyDgoto
          parser tables.
static int yyErrorCode
           
protected static int yyFinal
          number of final state.
protected static short[] yyGindex
          parser tables.
protected static short[] yyLen
          parser tables.
protected static short[] yyLhs
          parser tables.
protected  int yyMax
          initial size and increment of the state/value stack [default 256].
protected static String[] yyNames
          maps symbol value to printable name.
protected static short[] yyRindex
          parser tables.
protected static short[] yySindex
          parser tables.
protected static short[] yyTable
          parser tables.
 
Constructor Summary
Rfc()
           
 
Method Summary
protected  Object yyDefault(Object first)
          executed at the beginning of a reduce action.
 void yyerror(String message)
          simplified error message.
 void yyerror(String message, String[] expected)
          (syntax) error message.
protected  String[] yyExpecting(int state)
          computes list of expected tokens on error by tracing the tables.
 Object yyparse(Rfc.yyInput yyLex)
          the generated parser.
 Object yyparse(Rfc.yyInput yyLex, Object yydebug)
          the generated parser, with debugging messages.
 List yyparse(Rfc.yyInput yyLex, Object yydebug, Rfc.yyActions yyAct)
          entry point for parser with trace.
 List yyparse(Rfc.yyInput yyLex, Rfc.yyActions yyAct)
          entry point for parser without trace.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

yyAct

protected Rfc.yyActions yyAct
current factory.


Epilog

public static final int Epilog
See Also:
Constant Field Values

Id

public static final int Id
See Also:
Constant Field Values

LEFT

public static final int LEFT
See Also:
Constant Field Values

Lex

public static final int Lex
See Also:
Constant Field Values

Lit

public static final int Lit
See Also:
Constant Field Values

Lit1

public static final int Lit1
See Also:
Constant Field Values

Mac

public static final int Mac
See Also:
Constant Field Values

NONASSOC

public static final int NONASSOC
See Also:
Constant Field Values

PACKAGE

public static final int PACKAGE
See Also:
Constant Field Values

PREC

public static final int PREC
See Also:
Constant Field Values

RIGHT

public static final int RIGHT
See Also:
Constant Field Values

SCAN

public static final int SCAN
See Also:
Constant Field Values

SCREEN

public static final int SCREEN
See Also:
Constant Field Values

SEP

public static final int SEP
See Also:
Constant Field Values

SKIP

public static final int SKIP
See Also:
Constant Field Values

Sym

public static final int Sym
See Also:
Constant Field Values

TOKEN

public static final int TOKEN
See Also:
Constant Field Values

__error

public static final int __error
See Also:
Constant Field Values

yyErrorCode

public static final int yyErrorCode
See Also:
Constant Field Values

yyFinal

protected static final int yyFinal
number of final state.

See Also:
Constant Field Values

yyLhs

protected static final short[] yyLhs
parser tables. Order is mandated by jay.


yyLen

protected static final short[] yyLen
parser tables. Order is mandated by jay.


yyDefRed

protected static final short[] yyDefRed
parser tables. Order is mandated by jay.


yyDgoto

protected static final short[] yyDgoto
parser tables. Order is mandated by jay.


yySindex

protected static final short[] yySindex
parser tables. Order is mandated by jay.


yyRindex

protected static final short[] yyRindex
parser tables. Order is mandated by jay.


yyGindex

protected static final short[] yyGindex
parser tables. Order is mandated by jay.


yyTable

protected static final short[] yyTable
parser tables. Order is mandated by jay.


yyCheck

protected static final short[] yyCheck
parser tables. Order is mandated by jay.


yyNames

protected static final String[] yyNames
maps symbol value to printable name.

See Also:
yyExpecting(int)

yyMax

protected int yyMax
initial size and increment of the state/value stack [default 256]. This is not final so that it can be overwritten outside of invocations of yyparse(pj.Rfc.yyInput, java.lang.Object, pj.Rfc.yyActions).

Constructor Detail

Rfc

public Rfc()
Method Detail

yyparse

public List yyparse(Rfc.yyInput yyLex,
                    Object yydebug,
                    Rfc.yyActions yyAct)
             throws IOException,
                    Rfc.yyException
entry point for parser with trace.

Throws:
IOException
Rfc.yyException

yyparse

public List yyparse(Rfc.yyInput yyLex,
                    Rfc.yyActions yyAct)
             throws IOException,
                    Rfc.yyException
entry point for parser without trace.

Throws:
IOException
Rfc.yyException

yyerror

public void yyerror(String message)
simplified error message.

See Also:
yyerror(java.lang.String, java.lang.String[])

yyerror

public void yyerror(String message,
                    String[] expected)
(syntax) error message. Can be overwritten to control message format.

Parameters:
message - text to be displayed.
expected - list of acceptable tokens, if available.

yyExpecting

protected String[] yyExpecting(int state)
computes list of expected tokens on error by tracing the tables.

Parameters:
state - for which to compute the list.
Returns:
list of token names.

yyparse

public Object yyparse(Rfc.yyInput yyLex,
                      Object yydebug)
               throws IOException,
                      Rfc.yyException
the generated parser, with debugging messages. Maintains a dynamic state and value stack.

Parameters:
yyLex - scanner.
yydebug - debug message writer implementing yyDebug, or null.
Returns:
result of the last reduction, if any.
Throws:
Rfc.yyException - on irrecoverable parse error.
IOException

yyDefault

protected Object yyDefault(Object first)
executed at the beginning of a reduce action. Used as $$ = yyDefault($1), prior to the user-specified action, if any. Can be overwritten to provide deep copy, etc.

Parameters:
first - value for $1, or null.
Returns:
first.

yyparse

public Object yyparse(Rfc.yyInput yyLex)
               throws IOException,
                      Rfc.yyException
the generated parser. Maintains a dynamic state and value stack.

Parameters:
yyLex - scanner.
Returns:
result of the last reduction, if any.
Throws:
Rfc.yyException - on irrecoverable parse error.
IOException