Skip to content

Commit

Permalink
more working examples
Browse files Browse the repository at this point in the history
  • Loading branch information
teverett committed Dec 18, 2018
1 parent cb74779 commit 4d8b9b5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
24 changes: 19 additions & 5 deletions b/b.g4
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ statement
| gotostmt
| returnstmt
| expressionstmt
| nullstmt
;

nullstmt
: ';'
;

expressionstmt
Expand Down Expand Up @@ -104,7 +109,6 @@ rvalue
: expression
| comparison
| ternary
| functioninvocation
| assignment
;

Expand All @@ -116,10 +120,6 @@ comparison
: expression binary rvalue
;

functioninvocation
: expression '(' (rvalue (',' rvalue)*)? ')'
;

assignment
: name assign rvalue
;
Expand All @@ -132,6 +132,15 @@ expression
| (name incdec)
| (unary rvalue)
| ('&' name)
| functioninvocation
;

functioninvocation
: name '(' functionparameters? ')'
;

functionparameters
: rvalue (',' rvalue)*
;

assign
Expand Down Expand Up @@ -203,6 +212,11 @@ STRING2
;


BLOCKCOMMENT
: '/*' .*? '*/' -> skip
;


WS
: [ \t\r\n] -> skip
;
File renamed without changes.

0 comments on commit 4d8b9b5

Please sign in to comment.