Skip to content

Commit

Permalink
Merge branch 'master' of github.com:jimtahu/LangS
Browse files Browse the repository at this point in the history
  • Loading branch information
jimtahu committed May 10, 2013
2 parents 9581d46 + 5afef81 commit 88fde55
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions LangS.ypp
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ Prog: Stm ';' Prog { theProg->add((Statement *)$1); }

Stm: Exit { $$ = new ExitStatement();}
| Scalar '=' Value { $$ = new AssingmentStatement((Identifier*)$1,(Value*)$3); }
| Vector '=' List { }
| Vector '=' List { $$ = new AssingmentStatement((Identifier*)$1,new StringValue("#list#")); }
| Value { }
| Print Value { $$ = new PrintStatement((Value*)$2); }

Value: Scalar { $$ = $1; }
| STRING { $$ = $1; }
Value: STRING { $$ = $1; }
| Vector { $$ = $1; }
| Scalar { $$ = $1; }
| Value BinOP Value { $$ = new BinOpValue(((Identifier*)$2)->getName(),(Value*)$1,(Value*)$3); }

List: '[' Items ']'
Expand Down

0 comments on commit 88fde55

Please sign in to comment.