Skip to content

Commit

Permalink
Mode program node creation
Browse files Browse the repository at this point in the history
  • Loading branch information
jimtahu committed May 23, 2013
1 parent c9df973 commit b675e74
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion LangS.ypp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Program *theProg;
%%

Prog: Stm ';' Prog { theProg->add((Statement *)$1); }
| Stm ';' { theProg->add((Statement *)$1); }
| Stm ';' { theProg = new ParseTree::Program(); theProg->add((Statement *)$1); }

Stm: Exit { $$ = new ExitStatement();}
| Ident '=' Value { $$ = new AssingmentStatement((Identifier*)$1,(Value*)$3); }
Expand Down
2 changes: 0 additions & 2 deletions Util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ string num2str(double val){
extern ParseTree::Program *theProg;

int main(int argc, char *argv[]) {
theProg = new ParseTree::Program();
try{
yyparse();
theProg->run();
Expand All @@ -50,4 +49,3 @@ int main(int argc, char *argv[]) {
RunTime::cleanScalars();
return 0;
}//end main

0 comments on commit b675e74

Please sign in to comment.