Skip to content

Instantly share code, notes, and snippets.

@madfriend
Created Mar 3, 2015
Embed
What would you like to do?
start: program;
program: outer_block*;
outer_block: (outer_line NEWLINE)*
outer_line?;
@outer_line: initialization
| assignment
';';
assignment: name '='
('\-' digits
| value);
initialization: global? type assignment
(',' assignment)*;
global: 'global';
type: 'int' | 'bool';
value: digits | 'true' | 'false';
digits: '\d+';
name: '(?i)[\w_]+';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment