Permalink
Browse files

can't printout in ast building ...

  • Loading branch information...
1 parent 714a538 commit 8a1f6a315cd3b75b9c4a6f16cde7966a7f19a420 @Swizec committed Apr 16, 2012
@@ -1,7 +1,7 @@
//----------------------------------------------------
// The following code was generated by CUP v0.11a beta 20060608
-// Mon Apr 16 10:59:34 CEST 2012
+// Mon Apr 16 11:04:56 CEST 2012
//----------------------------------------------------
package compiler.synanal;
@@ -12,7 +12,7 @@
import compiler.abstree.tree.*;
/** CUP v0.11a beta 20060608 generated parser.
- * @version Mon Apr 16 10:59:34 CEST 2012
+ * @version Mon Apr 16 11:04:56 CEST 2012
*/
public class PascalSyn extends java_cup.runtime.lr_parser {
@@ -1303,8 +1303,7 @@ public void report_fatal_error(String message, Object info) throws Exception {
int subsright = ((java_cup.runtime.Symbol)CUP$PascalSyn$stack.peek()).right;
Object subs = (Object)((java_cup.runtime.Symbol) CUP$PascalSyn$stack.peek()).value;
- System.out.println("HELLO WORLD");
- /* AbsDecls decls = new AbsDecls();
+ /*AbsDecls decls = new AbsDecls();
/* decls.decls.addAll(((AbsDecls)consts).decls);
/* decls.decls.addAll(((AbsDecls)types).decls);
decls.decls.addAll(((AbsDecls)vars).decls);
@@ -1351,7 +1350,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 1");
+ System.out.println("HELLO AST");
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
-// Mon Apr 16 10:59:34 CEST 2012
+// Mon Apr 16 11:04:56 CEST 2012
//----------------------------------------------------
package compiler.synanal;
@@ -50,6 +50,7 @@ start with source;
source ::= program:p declaration:decl block_statement:mainblock DOT
{:
+ System.out.println("HELLO AST");
AbsProgram program = new AbsProgram((AbsDeclName)p,
(AbsDecls)decl,
(AbsBlockStmt)mainblock
View
@@ -13,6 +13,9 @@ def setUpClass(cls):
pass
if cls.source != None:
- cls.output = subprocess.check_output("export PASCALXSL=pascal/xsl && java -cp pascal/bin/java_cup/runtime:lib/java-cup-11a.jar:pascal/bin/compiler/.. compiler.Main test/"+cls.source.replace(".pascal", "")+" "+cls.stage,
- shell=True)
-
+ try:
+ cls.output = subprocess.check_output("export PASCALXSL=pascal/xsl && java -cp pascal/bin/java_cup/runtime:lib/java-cup-11a.jar:pascal/bin/compiler/.. compiler.Main test/"+cls.source.replace(".pascal", "")+" "+cls.stage,
+ shell=True)
+ except subprocess.CalledProcessError:
+ print "There was a subprocess error"
+ print "OUTPUT", cls.output

0 comments on commit 8a1f6a3

Please sign in to comment.