Main Page   Packages   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

CUP$parser$actions.java

00001 package edu.ksu.cis.bandera.specification.nnf.ltl;
00002 
00003 
00004 //----------------------------------------------------
00005 // The following code was generated by CUP v0.10k
00006 // Tue Jul 17 20:49:43 CDT 2001
00007 //----------------------------------------------------
00008 
00009 import java_cup.runtime.*;
00010 import java.io.*;
00011 import java.util.*;
00012 
00013 /** Cup generated class to encapsulate user supplied action code.*/
00014 class CUP$parser$actions {
00015   private final parser parser;
00016 
00017   /** Constructor */
00018   CUP$parser$actions(parser parser) {
00019     this.parser = parser;
00020   }  
00021   /** Method with the actual generated action code. */
00022   public final java_cup.runtime.Symbol CUP$parser$do_action(
00023     int                        CUP$parser$act_num,
00024     java_cup.runtime.lr_parser CUP$parser$parser,
00025     java.util.Stack            CUP$parser$stack,
00026     int                        CUP$parser$top)
00027     throws java.lang.Exception
00028     {
00029       /* Symbol object for return from actions */
00030       java_cup.runtime.Symbol CUP$parser$result;
00031 
00032       /* select the action based on the action number */
00033       switch (CUP$parser$act_num)
00034         {
00035           /*. . . . . . . . . . . . . . . . . . . .*/
00036           case 11: // ltlexpr ::= ltlexpr UNTIL ltlexpr 
00037             {
00038               Node RESULT = null;
00039         int lleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left;
00040         int lright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).right;
00041         Node l = (Node)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-2)).value;
00042         int rleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;
00043         int rright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;
00044         Node r = (Node)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;
00045          RESULT= new Node(sym.UNTIL,l,r); 
00046               CUP$parser$result = new java_cup.runtime.Symbol(2/*ltlexpr*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
00047             }
00048           return CUP$parser$result;
00049 
00050           /*. . . . . . . . . . . . . . . . . . . .*/
00051           case 10: // ltlexpr ::= G ltlexpr 
00052             {
00053               Node RESULT = null;
00054         int eleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;
00055         int eright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;
00056         Node e = (Node)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;
00057          RESULT= new Node(sym.G,e); 
00058               CUP$parser$result = new java_cup.runtime.Symbol(2/*ltlexpr*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
00059             }
00060           return CUP$parser$result;
00061 
00062           /*. . . . . . . . . . . . . . . . . . . .*/
00063           case 9: // ltlexpr ::= X ltlexpr 
00064             {
00065               Node RESULT = null;
00066         int eleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;
00067         int eright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;
00068         Node e = (Node)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;
00069          RESULT= new Node(sym.X,e); 
00070               CUP$parser$result = new java_cup.runtime.Symbol(2/*ltlexpr*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
00071             }
00072           return CUP$parser$result;
00073 
00074           /*. . . . . . . . . . . . . . . . . . . .*/
00075           case 8: // ltlexpr ::= F ltlexpr 
00076             {
00077               Node RESULT = null;
00078         int eleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;
00079         int eright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;
00080         Node e = (Node)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;
00081          RESULT= new Node(sym.F,e); 
00082               CUP$parser$result = new java_cup.runtime.Symbol(2/*ltlexpr*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
00083             }
00084           return CUP$parser$result;
00085 
00086           /*. . . . . . . . . . . . . . . . . . . .*/
00087           case 7: // ltlexpr ::= NOT ltlexpr 
00088             {
00089               Node RESULT = null;
00090         int eleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;
00091         int eright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;
00092         Node e = (Node)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;
00093          RESULT= new Node(sym.NOT,e); 
00094               CUP$parser$result = new java_cup.runtime.Symbol(2/*ltlexpr*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
00095             }
00096           return CUP$parser$result;
00097 
00098           /*. . . . . . . . . . . . . . . . . . . .*/
00099           case 6: // ltlexpr ::= ltlexpr AND ltlexpr 
00100             {
00101               Node RESULT = null;
00102         int lleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left;
00103         int lright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).right;
00104         Node l = (Node)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-2)).value;
00105         int rleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;
00106         int rright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;
00107         Node r = (Node)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;
00108          RESULT= new Node(sym.AND,l,r); 
00109               CUP$parser$result = new java_cup.runtime.Symbol(2/*ltlexpr*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
00110             }
00111           return CUP$parser$result;
00112 
00113           /*. . . . . . . . . . . . . . . . . . . .*/
00114           case 5: // ltlexpr ::= ltlexpr OR ltlexpr 
00115             {
00116               Node RESULT = null;
00117         int lleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left;
00118         int lright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).right;
00119         Node l = (Node)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-2)).value;
00120         int rleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;
00121         int rright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;
00122         Node r = (Node)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;
00123          RESULT= new Node(sym.OR,l,r); 
00124               CUP$parser$result = new java_cup.runtime.Symbol(2/*ltlexpr*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
00125             }
00126           return CUP$parser$result;
00127 
00128           /*. . . . . . . . . . . . . . . . . . . .*/
00129           case 4: // ltlexpr ::= ltlexpr IMPLIES ltlexpr 
00130             {
00131               Node RESULT = null;
00132         int lleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left;
00133         int lright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).right;
00134         Node l = (Node)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-2)).value;
00135         int rleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;
00136         int rright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;
00137         Node r = (Node)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;
00138          RESULT= new Node(sym.OR,new Node(sym.NOT,l),r); 
00139               CUP$parser$result = new java_cup.runtime.Symbol(2/*ltlexpr*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
00140             }
00141           return CUP$parser$result;
00142 
00143           /*. . . . . . . . . . . . . . . . . . . .*/
00144           case 3: // ltlexpr ::= LP ltlexpr RP 
00145             {
00146               Node RESULT = null;
00147         int eleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
00148         int eright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
00149         Node e = (Node)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
00150          RESULT= e; 
00151               CUP$parser$result = new java_cup.runtime.Symbol(2/*ltlexpr*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-2)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
00152             }
00153           return CUP$parser$result;
00154 
00155           /*. . . . . . . . . . . . . . . . . . . .*/
00156           case 2: // ltlexpr ::= ATOM 
00157             {
00158               Node RESULT = null;
00159         int atomleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;
00160         int atomright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;
00161         String atom = (String)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;
00162          RESULT= new Node(sym.ATOM,atom); 
00163               CUP$parser$result = new java_cup.runtime.Symbol(2/*ltlexpr*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
00164             }
00165           return CUP$parser$result;
00166 
00167           /*. . . . . . . . . . . . . . . . . . . .*/
00168           case 1: // $START ::= spec EOF 
00169             {
00170               Object RESULT = null;
00171         int start_valleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left;
00172         int start_valright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).right;
00173         Object start_val = (Object)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-1)).value;
00174         RESULT = start_val;
00175               CUP$parser$result = new java_cup.runtime.Symbol(0/*$START*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-1)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
00176             }
00177           /* ACCEPT */
00178           CUP$parser$parser.done_parsing();
00179           return CUP$parser$result;
00180 
00181           /*. . . . . . . . . . . . . . . . . . . .*/
00182           case 0: // spec ::= ltlexpr 
00183             {
00184               Object RESULT = null;
00185         int eleft = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left;
00186         int eright = ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right;
00187         Node e = (Node)((java_cup.runtime.Symbol) CUP$parser$stack.elementAt(CUP$parser$top-0)).value;
00188          parser.tree=e; 
00189               CUP$parser$result = new java_cup.runtime.Symbol(1/*spec*/, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).left, ((java_cup.runtime.Symbol)CUP$parser$stack.elementAt(CUP$parser$top-0)).right, RESULT);
00190             }
00191           return CUP$parser$result;
00192 
00193           /* . . . . . .*/
00194           default:
00195             throw new Exception(
00196                "Invalid action number found in internal parse table");
00197 
00198         }
00199     }
00200 }

Generated at Thu Feb 7 06:43:14 2002 for Bandera by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001