Skip to content

Instantly share code, notes, and snippets.

@adkron
Created March 24, 2009 19:29
Show Gist options
  • Save adkron/84319 to your computer and use it in GitHub Desktop.
Save adkron/84319 to your computer and use it in GitHub Desktop.
# tokens/termials
EQ
LBRACE
RBRACE
LPAREN
RPAREN
DOT
COMMA
PIPE
COMMENT
STRING
NUMBER
ID
CLASSNAME
# non-terminals/productions
stmtlist = stmt stmtlist
| <empty>
stmt = value
| class_def
| assign
value = STRING
| NUMBER
| ID
| object_ref
| funk
| method_call
class_def = CLASSNAME EQ LBRACE assign_list RBRACE
| CLASSNAME EQ LBRACE CLASSNAME RBRACE LBRACE assign_list RBRACE
assign_list = assign assign_list
| <empty>
assign = ID EQ value
| object_ref EQ value
object_ref = ID DOT ID
| object_ref DOT ID
funk = LBRACE stmtlist RBRACE
| LBRACE PIPE params PIPE stmtlist RBRACE
params = ID
| ID COMMA params
method_call = method
| method value
| method LPAREN arguments RPAREN
method = ID
| object_ref
arguments = value
| value COMMA arguments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment