Last active
August 29, 2015 14:12
-
-
Save arielqw/5db28a7c135e91c24914 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
If you have: | |
MyThings ::= { thing [X] ,} | |
[ meaning MyThings can be an empty list or a list of one or more Thing separated by comma ] | |
Then you can write the following grammer : | |
MyThings ::= { ThingsList:things } {: RESULT = new MyThings(things); :} | |
| { } {: RESULT = new MyThings( new ThingsList() ); :} | |
; | |
ThingsList ::= ThingsList : things , Thing : e {: things.append(thing); RESULT = things; :} | |
| Thing : thing {: ThingsList things = new ThingsList(); things.append(thing); RESULT = things ; :} | |
; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment