eece496.parsetree
Class Parser

java.lang.Object
  extended byeece496.parsetree.Parser

public class Parser
extends java.lang.Object

Encapsulates yacc() parser functionality in a Java class for quick code development


Field Summary
static short ALL
           
static short AND
           
static short IF
           
(package private) static boolean interactive
           
static short IS_PRODUCED
           
static short IS_TRUE_IF
           
static short MUTUALLY_EXCLUSIVE_CONDITIONS
           
static short NONTEXT
           
static short NOT
           
static short NUM
           
static short OF_FOLLOWING_CONDITIONS_ARE_TRUE
           
static short ONE_OR_MORE
           
static short OR
           
(package private)  int statemax
           
(package private)  int stateptr
           
(package private)  int stateptrmax
           
(package private)  int[] statestk
           
static short TEXT
           
static short THE_SYSTEM_SHALL
           
static short UPON_INTERNAL_EVENT
           
static short UPON_RECEIPT_OF_A
           
(package private)  int valptr
           
(package private)  ParserVal[] valstk
           
static short WHEN
           
(package private)  int yychar
           
(package private) static short[] yycheck
           
(package private)  boolean yydebug
           
(package private) static short[] yydefred
           
(package private) static short[] yydgoto
           
static short YYERRCODE
           
(package private)  int yyerrflag
           
(package private) static short YYFINAL
           
(package private) static short[] yygindex
           
(package private) static short[] yylen
           
(package private) static short[] yylhs
           
(package private)  ParserVal yylval
           
(package private)  int yym
           
(package private) static short YYMAXTOKEN
           
(package private)  int yyn
           
(package private) static java.lang.String[] yyname
           
(package private)  int yynerrs
           
(package private) static short[] yyrindex
           
(package private) static java.lang.String[] yyrule
           
(package private)  java.lang.String yys
           
(package private) static short[] yysindex
           
(package private) static int YYSTACKSIZE
           
(package private)  int yystate
           
(package private) static short[] yytable
           
(package private) static int YYTABLESIZE
           
(package private)  java.lang.String yytext
           
(package private)  ParserVal yyval
           
 
Constructor Summary
Parser()
          Default constructor.
Parser(boolean debugMe)
          Create a parser, setting the debug to true or false.
Parser(java.io.Reader r)
           
 
Method Summary
(package private)  void debug(java.lang.String msg)
           
(package private)  void dump_stacks(int count)
           
(package private)  boolean init_stacks()
           
static void main(java.lang.String[] args)
           
 void run()
          A default run method, used for operating this parser object in the background.
(package private)  void state_drop(int cnt)
           
(package private)  int state_peek(int relative)
           
(package private)  int state_pop()
           
(package private)  void state_push(int state)
           
(package private)  void val_drop(int cnt)
           
(package private)  void val_init()
           
(package private)  ParserVal val_peek(int relative)
           
(package private)  ParserVal val_pop()
           
(package private)  void val_push(ParserVal val)
           
 void yyerror(java.lang.String error)
           
(package private)  void yylexdebug(int state, int ch)
           
 int yyparse()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

yydebug

boolean yydebug

yynerrs

int yynerrs

yyerrflag

int yyerrflag

yychar

int yychar

YYSTACKSIZE

static final int YYSTACKSIZE
See Also:
Constant Field Values

statestk

int[] statestk

stateptr

int stateptr

stateptrmax

int stateptrmax

statemax

int statemax

yytext

java.lang.String yytext

yyval

ParserVal yyval

yylval

ParserVal yylval

valstk

ParserVal[] valstk

valptr

int valptr

IF

public static final short IF
See Also:
Constant Field Values

THE_SYSTEM_SHALL

public static final short THE_SYSTEM_SHALL
See Also:
Constant Field Values

ONE_OR_MORE

public static final short ONE_OR_MORE
See Also:
Constant Field Values

ALL

public static final short ALL
See Also:
Constant Field Values

OF_FOLLOWING_CONDITIONS_ARE_TRUE

public static final short OF_FOLLOWING_CONDITIONS_ARE_TRUE
See Also:
Constant Field Values

IS_TRUE_IF

public static final short IS_TRUE_IF
See Also:
Constant Field Values

MUTUALLY_EXCLUSIVE_CONDITIONS

public static final short MUTUALLY_EXCLUSIVE_CONDITIONS
See Also:
Constant Field Values

UPON_RECEIPT_OF_A

public static final short UPON_RECEIPT_OF_A
See Also:
Constant Field Values

WHEN

public static final short WHEN
See Also:
Constant Field Values

IS_PRODUCED

public static final short IS_PRODUCED
See Also:
Constant Field Values

UPON_INTERNAL_EVENT

public static final short UPON_INTERNAL_EVENT
See Also:
Constant Field Values

AND

public static final short AND
See Also:
Constant Field Values

OR

public static final short OR
See Also:
Constant Field Values

NOT

public static final short NOT
See Also:
Constant Field Values

TEXT

public static final short TEXT
See Also:
Constant Field Values

NONTEXT

public static final short NONTEXT
See Also:
Constant Field Values

NUM

public static final short NUM
See Also:
Constant Field Values

YYERRCODE

public static final short YYERRCODE
See Also:
Constant Field Values

yylhs

static final short[] yylhs

yylen

static final short[] yylen

yydefred

static final short[] yydefred

yydgoto

static final short[] yydgoto

yysindex

static final short[] yysindex

yyrindex

static final short[] yyrindex

yygindex

static final short[] yygindex

YYTABLESIZE

static final int YYTABLESIZE
See Also:
Constant Field Values

yytable

static final short[] yytable

yycheck

static final short[] yycheck

YYFINAL

static final short YYFINAL
See Also:
Constant Field Values

YYMAXTOKEN

static final short YYMAXTOKEN
See Also:
Constant Field Values

yyname

static final java.lang.String[] yyname

yyrule

static final java.lang.String[] yyrule

interactive

static boolean interactive

yyn

int yyn

yym

int yym

yystate

int yystate

yys

java.lang.String yys
Constructor Detail

Parser

public Parser(java.io.Reader r)

Parser

public Parser()
Default constructor. Turn off with -Jnoconstruct .


Parser

public Parser(boolean debugMe)
Create a parser, setting the debug to true or false.

Parameters:
debugMe - true for debugging, false for no debug.
Method Detail

debug

void debug(java.lang.String msg)

state_push

void state_push(int state)

state_pop

int state_pop()

state_drop

void state_drop(int cnt)

state_peek

int state_peek(int relative)

init_stacks

boolean init_stacks()

dump_stacks

void dump_stacks(int count)

val_init

void val_init()

val_push

void val_push(ParserVal val)

val_pop

ParserVal val_pop()

val_drop

void val_drop(int cnt)

val_peek

ParserVal val_peek(int relative)

yyerror

public void yyerror(java.lang.String error)
             throws java.lang.Exception
Throws:
java.lang.Exception

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception

yylexdebug

void yylexdebug(int state,
                int ch)

yyparse

public int yyparse()
            throws java.lang.Exception
Throws:
java.lang.Exception

run

public void run()
         throws java.lang.Exception
A default run method, used for operating this parser object in the background. It is intended for extending Thread or implementing Runnable. Turn off with -Jnorun .

Throws:
java.lang.Exception