Permalink
Browse files

accepting program <x>; into ast

  • Loading branch information...
Swizec committed Apr 16, 2012
1 parent 0503fbe commit 714a538dd4dab56083cd7e4da9504df7b50863b9
@@ -1,7 +1,7 @@
//----------------------------------------------------
// The following code was generated by CUP v0.11a beta 20060608
-// Sun Apr 15 01:29:44 CEST 2012
+// Mon Apr 16 10:59:34 CEST 2012
//----------------------------------------------------
package compiler.synanal;
@@ -12,7 +12,7 @@
import compiler.abstree.tree.*;
/** CUP v0.11a beta 20060608 generated parser.
- * @version Sun Apr 15 01:29:44 CEST 2012
+ * @version Mon Apr 16 10:59:34 CEST 2012
*/
public class PascalSyn extends java_cup.runtime.lr_parser {
@@ -1304,13 +1304,13 @@ public void report_fatal_error(String message, Object info) throws Exception {
Object subs = (Object)((java_cup.runtime.Symbol) CUP$PascalSyn$stack.peek()).value;
System.out.println("HELLO WORLD");
- AbsDecls decls = new AbsDecls();
- decls.decls.addAll(((AbsDecls)consts).decls);
+ /* AbsDecls decls = new AbsDecls();
+ /* decls.decls.addAll(((AbsDecls)consts).decls);
/* decls.decls.addAll(((AbsDecls)types).decls);
decls.decls.addAll(((AbsDecls)vars).decls);
decls.decls.addAll(((AbsDecls)subs).decls);*/
- RESULT = decls;
+ // RESULT = decls;
CUP$PascalSyn$result = parser.getSymbolFactory().newSymbol("declaration",2, ((java_cup.runtime.Symbol)CUP$PascalSyn$stack.elementAt(CUP$PascalSyn$top-3)), ((java_cup.runtime.Symbol)CUP$PascalSyn$stack.peek()), RESULT);
}
@@ -1351,7 +1351,7 @@ public void report_fatal_error(String message, Object info) throws Exception {
int mainblockright = ((java_cup.runtime.Symbol)CUP$PascalSyn$stack.elementAt(CUP$PascalSyn$top-1)).right;
Object mainblock = (Object)((java_cup.runtime.Symbol) CUP$PascalSyn$stack.elementAt(CUP$PascalSyn$top-1)).value;
- System.out.println("HELLO WORLD");
+ System.out.println("HELLO WORLD 1");
AbsProgram program = new AbsProgram((AbsDeclName)p,
(AbsDecls)decl,
(AbsBlockStmt)mainblock
@@ -1,7 +1,7 @@
//----------------------------------------------------
// The following code was generated by CUP v0.11a beta 20060608
-// Sun Apr 15 01:29:44 CEST 2012
+// Mon Apr 16 10:59:34 CEST 2012
//----------------------------------------------------
package compiler.synanal;
@@ -50,7 +50,6 @@ start with source;
source ::= program:p declaration:decl block_statement:mainblock DOT
{:
- System.out.println("HELLO WORLD");
AbsProgram program = new AbsProgram((AbsDeclName)p,
(AbsDecls)decl,
(AbsBlockStmt)mainblock
@@ -61,14 +60,13 @@ source ::= program:p declaration:decl block_statement:mainblock DOT
program ::= | PROGRAM IDENTIFIER:id SEMIC {: RESULT = new AbsDeclName(id); :};
declaration ::= constant:consts type:types var:vars subroutine:subs
{:
- System.out.println("HELLO WORLD");
- AbsDecls decls = new AbsDecls();
- decls.decls.addAll(((AbsDecls)consts).decls);
+ /*AbsDecls decls = new AbsDecls();
+ /* decls.decls.addAll(((AbsDecls)consts).decls);
/* decls.decls.addAll(((AbsDecls)types).decls);
decls.decls.addAll(((AbsDecls)vars).decls);
decls.decls.addAll(((AbsDecls)subs).decls);*/
- RESULT = decls;
+ // RESULT = decls;
:};
/*
View
@@ -1,5 +1,7 @@
-const a=5;
+program abstree;
+
+{const a=5;}
begin
end.

0 comments on commit 714a538

Please sign in to comment.