Skip to content

Instantly share code, notes, and snippets.

@niconii
Created May 26, 2016 02:37
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 niconii/92ea4f6dd7df5a39292642bf690259e0 to your computer and use it in GitHub Desktop.
Save niconii/92ea4f6dd7df5a39292642bf690259e0 to your computer and use it in GitHub Desktop.
ident:
/[A-Za-z_.][A-Za-z0-9_.]*/
expr:
ident |
expr '+' expr |
etc.
nl:
'\' | '\r' | '\n' | EOF
label:
ident ':'
let:
'.let' ident '=' expr nl
assign:
ident '=' expr nl
db:
'.db' (expr ',')* expr nl
macro:
ident token* nl
scope:
'{' line* '}'
line:
label* (let | assign | macro | scope | nl)
program:
line*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment