826 lines
41 KiB
Java
826 lines
41 KiB
Java
|
|
//----------------------------------------------------
|
|
// The following code was generated by CUP v0.11a beta 20060608
|
|
// Sat Sep 20 15:46:57 PDT 2008
|
|
//----------------------------------------------------
|
|
|
|
import java_cup.runtime.*;
|
|
|
|
/** CUP v0.11a beta 20060608 generated parser.
|
|
* @version Sat Sep 20 15:46:57 PDT 2008
|
|
*/
|
|
public class ASTParser extends java_cup.runtime.lr_parser {
|
|
|
|
/** Default constructor. */
|
|
public ASTParser() {super();}
|
|
|
|
/** Constructor which sets the default scanner. */
|
|
public ASTParser(java_cup.runtime.Scanner s) {super(s);}
|
|
|
|
/** Constructor which sets the default scanner. */
|
|
public ASTParser(java_cup.runtime.Scanner s, java_cup.runtime.SymbolFactory sf) {super(s,sf);}
|
|
|
|
/** Production table. */
|
|
protected static final short _production_table[][] =
|
|
unpackFromStrings(new String[] {
|
|
"\000\062\000\002\002\005\000\002\002\004\000\002\002" +
|
|
"\002\000\002\003\003\000\002\003\004\000\002\004\012" +
|
|
"\000\002\006\002\000\002\006\003\000\002\005\003\000" +
|
|
"\002\005\004\000\002\007\010\000\002\007\007\000\002" +
|
|
"\010\002\000\002\010\003\000\002\011\003\000\002\011" +
|
|
"\004\000\002\012\006\000\002\014\005\000\002\014\005" +
|
|
"\000\002\013\006\000\002\013\010\000\002\013\007\000" +
|
|
"\002\013\007\000\002\013\006\000\002\013\005\000\002" +
|
|
"\013\010\000\002\013\006\000\002\013\005\000\002\013" +
|
|
"\005\000\002\013\006\000\002\013\006\000\002\013\006" +
|
|
"\000\002\013\006\000\002\013\005\000\002\013\006\000" +
|
|
"\002\013\006\000\002\013\006\000\002\013\005\000\002" +
|
|
"\013\005\000\002\013\005\000\002\013\005\000\002\013" +
|
|
"\005\000\002\013\004\000\002\015\004\000\002\015\005" +
|
|
"\000\002\016\003\000\002\016\004\000\002\017\003\000" +
|
|
"\002\017\004\000\002\020\007" });
|
|
|
|
/** Access to production table. */
|
|
public short[][] production_table() {return _production_table;}
|
|
|
|
/** Parse-action table. */
|
|
protected static final short[][] _action_table =
|
|
unpackFromStrings(new String[] {
|
|
"\000\171\000\006\002\uffff\051\005\001\002\000\004\002" +
|
|
"\173\001\002\000\004\004\006\001\002\000\004\051\011" +
|
|
"\001\002\000\006\002\001\051\011\001\002\000\006\002" +
|
|
"\ufffe\051\ufffe\001\002\000\004\005\012\001\002\000\004" +
|
|
"\050\013\001\002\000\004\050\014\001\002\000\004\046" +
|
|
"\015\001\002\000\004\015\016\001\002\000\006\016\ufffb" +
|
|
"\051\022\001\002\000\006\016\ufff9\051\ufff9\001\002\000" +
|
|
"\004\016\171\001\002\000\006\016\ufffa\051\022\001\002" +
|
|
"\000\006\006\024\007\023\001\002\000\004\050\165\001" +
|
|
"\002\000\004\050\025\001\002\000\006\050\ufff5\051\031" +
|
|
"\001\002\000\006\050\ufff4\051\031\001\002\000\006\050" +
|
|
"\ufff3\051\ufff3\001\002\000\004\050\035\001\002\000\004" +
|
|
"\010\032\001\002\000\004\050\033\001\002\000\004\050" +
|
|
"\034\001\002\000\006\050\ufff1\051\ufff1\001\002\000\004" +
|
|
"\051\036\001\002\000\062\012\063\013\060\014\057\020" +
|
|
"\066\021\051\022\054\023\073\024\061\025\046\026\052" +
|
|
"\027\072\030\056\031\045\032\044\033\064\034\067\035" +
|
|
"\050\036\047\037\062\040\070\041\065\042\071\043\055" +
|
|
"\044\053\001\002\000\006\016\ufff7\051\ufff7\001\002\000" +
|
|
"\004\017\041\001\002\000\006\045\043\050\042\001\002" +
|
|
"\000\012\016\ufff0\017\ufff0\050\ufff0\051\ufff0\001\002\000" +
|
|
"\012\016\uffef\017\uffef\050\uffef\051\uffef\001\002\000\004" +
|
|
"\051\036\001\002\000\004\051\036\001\002\000\004\051" +
|
|
"\036\001\002\000\004\047\156\001\002\000\004\051\036" +
|
|
"\001\002\000\004\051\036\001\002\000\004\051\036\001" +
|
|
"\002\000\004\050\150\001\002\000\004\051\036\001\002" +
|
|
"\000\004\017\uffd7\001\002\000\004\051\036\001\002\000" +
|
|
"\004\051\036\001\002\000\004\051\036\001\002\000\004" +
|
|
"\050\116\001\002\000\004\046\115\001\002\000\004\050" +
|
|
"\113\001\002\000\004\051\036\001\002\000\004\050\110" +
|
|
"\001\002\000\004\051\036\001\002\000\004\051\036\001" +
|
|
"\002\000\004\047\102\001\002\000\004\051\036\001\002" +
|
|
"\000\004\051\036\001\002\000\004\051\036\001\002\000" +
|
|
"\006\017\uffe9\051\036\001\002\000\010\016\uffd4\017\uffd4" +
|
|
"\051\uffd4\001\002\000\010\016\uffd3\017\uffd3\051\uffd3\001" +
|
|
"\002\000\004\051\036\001\002\000\004\017\uffe2\001\002" +
|
|
"\000\004\017\uffe5\001\002\000\004\017\uffd9\001\002\000" +
|
|
"\004\051\036\001\002\000\004\017\uffdd\001\002\000\004" +
|
|
"\051\036\001\002\000\004\051\036\001\002\000\004\017" +
|
|
"\uffeb\001\002\000\004\017\uffe6\001\002\000\004\051\036" +
|
|
"\001\002\000\004\017\uffde\001\002\000\004\051\036\001" +
|
|
"\002\000\004\017\uffee\001\002\000\004\017\uffda\001\002" +
|
|
"\000\004\050\117\001\002\000\004\051\036\001\002\000" +
|
|
"\004\051\036\001\002\000\004\017\uffe8\001\002\000\004" +
|
|
"\050\123\001\002\000\004\050\124\001\002\000\004\015" +
|
|
"\126\001\002\000\004\017\uffed\001\002\000\006\016\127" +
|
|
"\051\036\001\002\000\004\017\uffd6\001\002\000\006\016" +
|
|
"\131\051\036\001\002\000\004\017\uffd5\001\002\000\004" +
|
|
"\050\133\001\002\000\004\015\126\001\002\000\004\017" +
|
|
"\uffec\001\002\000\004\051\036\001\002\000\004\017\uffe1" +
|
|
"\001\002\000\004\051\141\001\002\000\006\017\uffe7\051" +
|
|
"\141\001\002\000\004\011\143\001\002\000\006\017\uffd2" +
|
|
"\051\uffd2\001\002\000\004\050\144\001\002\000\004\050" +
|
|
"\145\001\002\000\004\051\036\001\002\000\006\017\uffd0" +
|
|
"\051\uffd0\001\002\000\006\017\uffd1\051\uffd1\001\002\000" +
|
|
"\004\017\uffd8\001\002\000\004\051\036\001\002\000\004" +
|
|
"\017\uffe3\001\002\000\004\051\036\001\002\000\004\017" +
|
|
"\uffea\001\002\000\004\017\uffdc\001\002\000\004\017\uffdb" +
|
|
"\001\002\000\004\051\036\001\002\000\004\017\uffe4\001" +
|
|
"\002\000\004\017\uffe0\001\002\000\004\051\036\001\002" +
|
|
"\000\004\017\uffdf\001\002\000\006\050\ufff2\051\ufff2\001" +
|
|
"\002\000\004\050\166\001\002\000\004\051\036\001\002" +
|
|
"\000\006\016\ufff6\051\ufff6\001\002\000\006\016\ufff8\051" +
|
|
"\ufff8\001\002\000\006\002\ufffc\051\ufffc\001\002\000\006" +
|
|
"\002\ufffd\051\ufffd\001\002\000\004\002\000\001\002" });
|
|
|
|
/** Access to parse-action table. */
|
|
public short[][] action_table() {return _action_table;}
|
|
|
|
/** <code>reduce_goto</code> table. */
|
|
protected static final short[][] _reduce_table =
|
|
unpackFromStrings(new String[] {
|
|
"\000\171\000\004\002\003\001\001\000\002\001\001\000" +
|
|
"\002\001\001\000\006\003\006\004\007\001\001\000\004" +
|
|
"\004\171\001\001\000\002\001\001\000\002\001\001\000" +
|
|
"\002\001\001\000\002\001\001\000\002\001\001\000\002" +
|
|
"\001\001\000\010\005\020\006\017\007\016\001\001\000" +
|
|
"\002\001\001\000\002\001\001\000\004\007\167\001\001" +
|
|
"\000\002\001\001\000\002\001\001\000\002\001\001\000" +
|
|
"\010\010\027\011\025\012\026\001\001\000\004\012\163" +
|
|
"\001\001\000\002\001\001\000\002\001\001\000\002\001" +
|
|
"\001\000\002\001\001\000\002\001\001\000\002\001\001" +
|
|
"\000\006\013\037\014\036\001\001\000\002\001\001\000" +
|
|
"\002\001\001\000\002\001\001\000\002\001\001\000\002" +
|
|
"\001\001\000\002\001\001\000\006\013\037\014\161\001" +
|
|
"\001\000\006\013\037\014\160\001\001\000\006\013\037" +
|
|
"\014\156\001\001\000\002\001\001\000\006\013\037\014" +
|
|
"\154\001\001\000\006\013\037\014\152\001\001\000\006" +
|
|
"\013\037\014\150\001\001\000\002\001\001\000\006\013" +
|
|
"\037\014\136\001\001\000\002\001\001\000\006\013\037" +
|
|
"\014\134\001\001\000\006\013\037\014\131\001\001\000" +
|
|
"\006\013\037\014\121\001\001\000\002\001\001\000\002" +
|
|
"\001\001\000\002\001\001\000\006\013\037\014\110\001" +
|
|
"\001\000\002\001\001\000\006\013\037\014\104\001\001" +
|
|
"\000\006\013\037\014\102\001\001\000\002\001\001\000" +
|
|
"\006\013\037\014\100\001\001\000\006\013\037\014\076" +
|
|
"\001\001\000\010\013\037\014\074\016\073\001\001\000" +
|
|
"\006\013\037\014\075\001\001\000\002\001\001\000\002" +
|
|
"\001\001\000\006\013\037\014\077\001\001\000\002\001" +
|
|
"\001\000\002\001\001\000\002\001\001\000\006\013\037" +
|
|
"\014\103\001\001\000\002\001\001\000\006\013\037\014" +
|
|
"\105\001\001\000\006\013\037\014\106\001\001\000\002" +
|
|
"\001\001\000\002\001\001\000\006\013\037\014\111\001" +
|
|
"\001\000\002\001\001\000\006\013\037\014\113\001\001" +
|
|
"\000\002\001\001\000\002\001\001\000\002\001\001\000" +
|
|
"\006\013\037\014\117\001\001\000\006\013\037\014\120" +
|
|
"\001\001\000\002\001\001\000\002\001\001\000\002\001" +
|
|
"\001\000\004\015\124\001\001\000\002\001\001\000\010" +
|
|
"\013\037\014\074\016\127\001\001\000\002\001\001\000" +
|
|
"\006\013\037\014\075\001\001\000\002\001\001\000\002" +
|
|
"\001\001\000\004\015\133\001\001\000\002\001\001\000" +
|
|
"\006\013\037\014\135\001\001\000\002\001\001\000\006" +
|
|
"\017\137\020\141\001\001\000\004\020\146\001\001\000" +
|
|
"\002\001\001\000\002\001\001\000\002\001\001\000\002" +
|
|
"\001\001\000\006\013\037\014\145\001\001\000\002\001" +
|
|
"\001\000\002\001\001\000\002\001\001\000\006\013\037" +
|
|
"\014\151\001\001\000\002\001\001\000\006\013\037\014" +
|
|
"\153\001\001\000\002\001\001\000\002\001\001\000\002" +
|
|
"\001\001\000\006\013\037\014\157\001\001\000\002\001" +
|
|
"\001\000\002\001\001\000\006\013\037\014\162\001\001" +
|
|
"\000\002\001\001\000\002\001\001\000\002\001\001\000" +
|
|
"\006\013\037\014\166\001\001\000\002\001\001\000\002" +
|
|
"\001\001\000\002\001\001\000\002\001\001\000\002\001" +
|
|
"\001" });
|
|
|
|
/** Access to <code>reduce_goto</code> table. */
|
|
public short[][] reduce_table() {return _reduce_table;}
|
|
|
|
/** Instance of action encapsulation class. */
|
|
protected CUP$ASTParser$actions action_obj;
|
|
|
|
/** Action encapsulation object initializer. */
|
|
protected void init_actions()
|
|
{
|
|
action_obj = new CUP$ASTParser$actions(this);
|
|
}
|
|
|
|
/** Invoke a user supplied parse action. */
|
|
public java_cup.runtime.Symbol do_action(
|
|
int act_num,
|
|
java_cup.runtime.lr_parser parser,
|
|
java.util.Stack stack,
|
|
int top)
|
|
throws java.lang.Exception
|
|
{
|
|
/* call code in generated class */
|
|
return action_obj.CUP$ASTParser$do_action(act_num, parser, stack, top);
|
|
}
|
|
|
|
/** Indicates start state. */
|
|
public int start_state() {return 0;}
|
|
/** Indicates start production. */
|
|
public int start_production() {return 1;}
|
|
|
|
/** <code>EOF</code> Symbol index. */
|
|
public int EOF_sym() {return 0;}
|
|
|
|
/** <code>error</code> Symbol index. */
|
|
public int error_sym() {return 1;}
|
|
|
|
|
|
|
|
public void syntax_error(Symbol cur_token) {
|
|
System.err.println("??? unexpected error in ast parsing: " + ((ASTLexer)getScanner()).line());
|
|
System.exit(1);
|
|
}
|
|
|
|
public void unrecovered_syntax_error(Symbol cur_token) {
|
|
}
|
|
|
|
}
|
|
|
|
/** Cup generated class to encapsulate user supplied action code.*/
|
|
class CUP$ASTParser$actions {
|
|
|
|
|
|
Integer curr_lineno = new Integer(0);
|
|
|
|
private final ASTParser parser;
|
|
|
|
/** Constructor */
|
|
CUP$ASTParser$actions(ASTParser parser) {
|
|
this.parser = parser;
|
|
}
|
|
|
|
/** Method with the actual generated action code. */
|
|
public final java_cup.runtime.Symbol CUP$ASTParser$do_action(
|
|
int CUP$ASTParser$act_num,
|
|
java_cup.runtime.lr_parser CUP$ASTParser$parser,
|
|
java.util.Stack CUP$ASTParser$stack,
|
|
int CUP$ASTParser$top)
|
|
throws java.lang.Exception
|
|
{
|
|
/* Symbol object for return from actions */
|
|
java_cup.runtime.Symbol CUP$ASTParser$result;
|
|
|
|
/* select the action based on the action number */
|
|
switch (CUP$ASTParser$act_num)
|
|
{
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 49: // simple_case ::= LINENO BRANCH ID ID expr
|
|
{
|
|
branch RESULT =null;
|
|
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-4)).value;
|
|
AbstractSymbol n = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
|
|
AbstractSymbol t = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
|
|
Expression e = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
curr_lineno = l; RESULT = new branch(l.intValue(), n, t, e);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("simple_case",14, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 48: // case_list ::= case_list simple_case
|
|
{
|
|
Cases RESULT =null;
|
|
Cases cl = (Cases)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
|
|
branch c = (branch)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
RESULT = cl.appendElement(c);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("case_list",13, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 47: // case_list ::= simple_case
|
|
{
|
|
Cases RESULT =null;
|
|
branch c = (branch)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
RESULT = (new Cases(curr_lineno.intValue())).appendElement(c);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("case_list",13, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 46: // expr_list ::= expr_list expr
|
|
{
|
|
Expressions RESULT =null;
|
|
Expressions el = (Expressions)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
|
|
Expression e = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
RESULT = el.appendElement(e);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("expr_list",12, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 45: // expr_list ::= expr
|
|
{
|
|
Expressions RESULT =null;
|
|
Expression e = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
RESULT = (new Expressions(curr_lineno.intValue())).appendElement(e);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("expr_list",12, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 44: // actuals ::= LPAREN expr_list RPAREN
|
|
{
|
|
Expressions RESULT =null;
|
|
Expressions el = (Expressions)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
|
|
RESULT = el;
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("actuals",11, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 43: // actuals ::= LPAREN RPAREN
|
|
{
|
|
Expressions RESULT =null;
|
|
RESULT = new Expressions(curr_lineno.intValue());
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("actuals",11, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 42: // expr_aux ::= LINENO NO_EXPR
|
|
{
|
|
Expression RESULT =null;
|
|
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
|
|
curr_lineno = l; RESULT = new no_expr(l.intValue());
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("expr_aux",9, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 41: // expr_aux ::= LINENO OBJECT ID
|
|
{
|
|
Expression RESULT =null;
|
|
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
|
|
AbstractSymbol n = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
curr_lineno = l; RESULT = new object(l.intValue(), n);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("expr_aux",9, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 40: // expr_aux ::= LINENO BOOL INT_CONST
|
|
{
|
|
Expression RESULT =null;
|
|
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
|
|
AbstractSymbol b = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
curr_lineno = l;
|
|
if (b.getString().charAt(0) == '1')
|
|
RESULT = new bool_const(l.intValue(), Boolean.TRUE);
|
|
else
|
|
RESULT = new bool_const(l.intValue(), Boolean.FALSE);
|
|
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("expr_aux",9, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 39: // expr_aux ::= LINENO STR STR_CONST
|
|
{
|
|
Expression RESULT =null;
|
|
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
|
|
AbstractSymbol s = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
curr_lineno = l; RESULT = new string_const(l.intValue(), s);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("expr_aux",9, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 38: // expr_aux ::= LINENO INT INT_CONST
|
|
{
|
|
Expression RESULT =null;
|
|
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
|
|
AbstractSymbol i = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
curr_lineno = l; RESULT = new int_const(l.intValue(), i);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("expr_aux",9, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 37: // expr_aux ::= LINENO COMP expr
|
|
{
|
|
Expression RESULT =null;
|
|
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
|
|
Expression e = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
curr_lineno = l; RESULT = new comp(l.intValue(), e);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("expr_aux",9, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 36: // expr_aux ::= LINENO LEQ expr expr
|
|
{
|
|
Expression RESULT =null;
|
|
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-3)).value;
|
|
Expression e1 = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
|
|
Expression e2 = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
curr_lineno = l; RESULT = new leq(l.intValue(), e1, e2);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("expr_aux",9, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 35: // expr_aux ::= LINENO EQ expr expr
|
|
{
|
|
Expression RESULT =null;
|
|
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-3)).value;
|
|
Expression e1 = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
|
|
Expression e2 = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
curr_lineno = l; RESULT = new eq(l.intValue(), e1, e2);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("expr_aux",9, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 34: // expr_aux ::= LINENO LT expr expr
|
|
{
|
|
Expression RESULT =null;
|
|
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-3)).value;
|
|
Expression e1 = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
|
|
Expression e2 = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
curr_lineno = l; RESULT = new lt(l.intValue(), e1, e2);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("expr_aux",9, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 33: // expr_aux ::= LINENO NEG expr
|
|
{
|
|
Expression RESULT =null;
|
|
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
|
|
Expression e = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
curr_lineno = l; RESULT = new neg(l.intValue(), e);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("expr_aux",9, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 32: // expr_aux ::= LINENO DIVIDE expr expr
|
|
{
|
|
Expression RESULT =null;
|
|
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-3)).value;
|
|
Expression e1 = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
|
|
Expression e2 = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
curr_lineno = l; RESULT = new divide(l.intValue(), e1, e2);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("expr_aux",9, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 31: // expr_aux ::= LINENO MUL expr expr
|
|
{
|
|
Expression RESULT =null;
|
|
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-3)).value;
|
|
Expression e1 = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
|
|
Expression e2 = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
curr_lineno = l; RESULT = new mul(l.intValue(), e1, e2);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("expr_aux",9, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 30: // expr_aux ::= LINENO SUB expr expr
|
|
{
|
|
Expression RESULT =null;
|
|
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-3)).value;
|
|
Expression e1 = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
|
|
Expression e2 = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
curr_lineno = l; RESULT = new sub(l.intValue(), e1, e2);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("expr_aux",9, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 29: // expr_aux ::= LINENO PLUS expr expr
|
|
{
|
|
Expression RESULT =null;
|
|
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-3)).value;
|
|
Expression e1 = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
|
|
Expression e2 = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
curr_lineno = l; RESULT = new plus(l.intValue(), e1, e2);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("expr_aux",9, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 28: // expr_aux ::= LINENO ISVOID expr
|
|
{
|
|
Expression RESULT =null;
|
|
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
|
|
Expression e = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
curr_lineno = l; RESULT = new isvoid(l.intValue(), e);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("expr_aux",9, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 27: // expr_aux ::= LINENO NEW ID
|
|
{
|
|
Expression RESULT =null;
|
|
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
|
|
AbstractSymbol t = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
curr_lineno = l; RESULT = new new_(l.intValue(), t);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("expr_aux",9, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 26: // expr_aux ::= LINENO TYPCASE expr case_list
|
|
{
|
|
Expression RESULT =null;
|
|
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-3)).value;
|
|
Expression e = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
|
|
Cases cl = (Cases)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
curr_lineno = l; RESULT = new typcase(l.intValue(), e, cl);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("expr_aux",9, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 25: // expr_aux ::= LINENO LET ID ID expr expr
|
|
{
|
|
Expression RESULT =null;
|
|
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-5)).value;
|
|
AbstractSymbol n = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-3)).value;
|
|
AbstractSymbol t = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
|
|
Expression i = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
|
|
Expression b = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
curr_lineno = l; RESULT = new let(l.intValue(), n, t, i, b);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("expr_aux",9, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 24: // expr_aux ::= LINENO BLOCK expr_list
|
|
{
|
|
Expression RESULT =null;
|
|
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
|
|
Expressions el = (Expressions)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
curr_lineno = l; RESULT = new block(l.intValue(), el);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("expr_aux",9, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 23: // expr_aux ::= LINENO LOOP expr expr
|
|
{
|
|
Expression RESULT =null;
|
|
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-3)).value;
|
|
Expression p = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
|
|
Expression b = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
curr_lineno = l; RESULT = new loop(l.intValue(), p, b);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("expr_aux",9, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 22: // expr_aux ::= LINENO COND expr expr expr
|
|
{
|
|
Expression RESULT =null;
|
|
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-4)).value;
|
|
Expression p = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
|
|
Expression t = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
|
|
Expression e = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
curr_lineno = l; RESULT = new cond(l.intValue(), p, t, e);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("expr_aux",9, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 21: // expr_aux ::= LINENO DISPATCH expr ID actuals
|
|
{
|
|
Expression RESULT =null;
|
|
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-4)).value;
|
|
Expression e = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
|
|
AbstractSymbol n = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
|
|
Expressions a = (Expressions)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
curr_lineno = l; RESULT = new dispatch(l.intValue(), e, n, a);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("expr_aux",9, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 20: // expr_aux ::= LINENO STATIC_DISPATCH expr ID ID actuals
|
|
{
|
|
Expression RESULT =null;
|
|
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-5)).value;
|
|
Expression e = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-3)).value;
|
|
AbstractSymbol t = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
|
|
AbstractSymbol n = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
|
|
Expressions a = (Expressions)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
curr_lineno = l; RESULT = new static_dispatch(l.intValue(), e, t, n, a);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("expr_aux",9, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 19: // expr_aux ::= LINENO ASSIGN ID expr
|
|
{
|
|
Expression RESULT =null;
|
|
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-3)).value;
|
|
AbstractSymbol n = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
|
|
Expression e = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
curr_lineno = l; RESULT = new assign(l.intValue(), n,e);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("expr_aux",9, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 18: // expr ::= expr_aux COLON NO_TYPE
|
|
{
|
|
Expression RESULT =null;
|
|
Expression e = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
|
|
RESULT = e;
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("expr",10, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 17: // expr ::= expr_aux COLON ID
|
|
{
|
|
Expression RESULT =null;
|
|
Expression e = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
|
|
AbstractSymbol t = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
RESULT = e; e.set_type(t);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("expr",10, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 16: // formal ::= LINENO FORMAL ID ID
|
|
{
|
|
Formal RESULT =null;
|
|
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-3)).value;
|
|
AbstractSymbol n = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
|
|
AbstractSymbol t = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
curr_lineno = l; RESULT = new formalc(l.intValue(), n, t);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("formal",8, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 15: // formal_list ::= formal_list formal
|
|
{
|
|
Formals RESULT =null;
|
|
Formals fl = (Formals)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
|
|
Formal f = (Formal)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
RESULT = fl.appendElement(f);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("formal_list",7, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 14: // formal_list ::= formal
|
|
{
|
|
Formals RESULT =null;
|
|
Formal f = (Formal)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
RESULT = (new Formals(curr_lineno.intValue())).appendElement(f);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("formal_list",7, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 13: // formals ::= formal_list
|
|
{
|
|
Formals RESULT =null;
|
|
Formals fl = (Formals)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
RESULT = fl;
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("formals",6, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 12: // formals ::=
|
|
{
|
|
Formals RESULT =null;
|
|
RESULT = new Formals(curr_lineno.intValue());
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("formals",6, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 11: // feature ::= LINENO ATTR ID ID expr
|
|
{
|
|
Feature RESULT =null;
|
|
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-4)).value;
|
|
AbstractSymbol n = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
|
|
AbstractSymbol t = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
|
|
Expression i = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
curr_lineno = l; RESULT = new attr(l.intValue(), n, t, i);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("feature",5, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 10: // feature ::= LINENO METHOD ID formals ID expr
|
|
{
|
|
Feature RESULT =null;
|
|
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-5)).value;
|
|
AbstractSymbol n = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-3)).value;
|
|
Formals f = (Formals)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
|
|
AbstractSymbol t = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
|
|
Expression b = (Expression)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
curr_lineno = l; RESULT = new method(l.intValue(), n,f,t,b);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("feature",5, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 9: // feature_list ::= feature_list feature
|
|
{
|
|
Features RESULT =null;
|
|
Features fl = (Features)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
|
|
Feature f = (Feature)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
RESULT = fl.appendElement(f);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("feature_list",3, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 8: // feature_list ::= feature
|
|
{
|
|
Features RESULT =null;
|
|
Feature f = (Feature)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
RESULT = (new Features(curr_lineno.intValue())).appendElement(f);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("feature_list",3, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 7: // optional_feature_list ::= feature_list
|
|
{
|
|
Features RESULT =null;
|
|
Features fl = (Features)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
RESULT = fl;
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("optional_feature_list",4, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 6: // optional_feature_list ::=
|
|
{
|
|
Features RESULT =null;
|
|
RESULT = new Features(curr_lineno.intValue());
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("optional_feature_list",4, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 5: // class ::= LINENO CLASS ID ID STR_CONST LPAREN optional_feature_list RPAREN
|
|
{
|
|
class_c RESULT =null;
|
|
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-7)).value;
|
|
AbstractSymbol n = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-5)).value;
|
|
AbstractSymbol p = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-4)).value;
|
|
AbstractSymbol file = (AbstractSymbol)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-3)).value;
|
|
Features f = (Features)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
|
|
curr_lineno = l; RESULT = new class_c(l.intValue(), n, p, f, file);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("class",2, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 4: // class_list ::= class_list class
|
|
{
|
|
Classes RESULT =null;
|
|
Classes cl = (Classes)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
|
|
class_c c = (class_c)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
RESULT = cl.appendElement(c);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("class_list",1, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 3: // class_list ::= class
|
|
{
|
|
Classes RESULT =null;
|
|
class_c c = (class_c)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
RESULT = (new Classes(curr_lineno.intValue())).appendElement(c);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("class_list",1, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 2: // program ::=
|
|
{
|
|
programc RESULT =null;
|
|
RESULT = null; System.exit(1);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("program",0, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 1: // $START ::= program EOF
|
|
{
|
|
Object RESULT =null;
|
|
programc start_val = (programc)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-1)).value;
|
|
RESULT = start_val;
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("$START",0, RESULT);
|
|
}
|
|
/* ACCEPT */
|
|
CUP$ASTParser$parser.done_parsing();
|
|
return CUP$ASTParser$result;
|
|
|
|
/*. . . . . . . . . . . . . . . . . . . .*/
|
|
case 0: // program ::= LINENO PROGRAM class_list
|
|
{
|
|
programc RESULT =null;
|
|
Integer l = (Integer)((java_cup.runtime.Symbol) CUP$ASTParser$stack.elementAt(CUP$ASTParser$top-2)).value;
|
|
Classes cl = (Classes)((java_cup.runtime.Symbol) CUP$ASTParser$stack.peek()).value;
|
|
curr_lineno = l; RESULT = new programc(l.intValue(), cl);
|
|
CUP$ASTParser$result = parser.getSymbolFactory().newSymbol("program",0, RESULT);
|
|
}
|
|
return CUP$ASTParser$result;
|
|
|
|
/* . . . . . .*/
|
|
default:
|
|
throw new Exception(
|
|
"Invalid action number found in internal parse table");
|
|
|
|
}
|
|
}
|
|
}
|
|
|