Skip to content

Commit

Permalink
can't printout in ast building ...
Browse files Browse the repository at this point in the history
  • Loading branch information
Swizec committed Apr 16, 2012
1 parent 714a538 commit 8a1f6a3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
9 changes: 4 additions & 5 deletions pascal/src/compiler/synanal/PascalSyn.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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 {

Expand Down Expand Up @@ -1303,8 +1303,7 @@ class CUP$PascalSyn$actions {
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);
Expand Down Expand Up @@ -1351,7 +1350,7 @@ class CUP$PascalSyn$actions {
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
Expand Down
2 changes: 1 addition & 1 deletion pascal/src/compiler/synanal/PascalTok.java
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
1 change: 1 addition & 0 deletions pascal/src/compiler/synanal/pascal.cup
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 6 additions & 3 deletions test_commons.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.