Skip to content

Instantly share code, notes, and snippets.

@madfriend
Created March 3, 2015 10:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save madfriend/f0adff1d6d681baf9a75 to your computer and use it in GitHub Desktop.
Save madfriend/f0adff1d6d681baf9a75 to your computer and use it in GitHub Desktop.
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