Skip to content

Instantly share code, notes, and snippets.

@justarandomgeek
Last active July 30, 2016 19:44
Show Gist options
  • Save justarandomgeek/37aab2eb9ea1c375b92fffbab1ec2008 to your computer and use it in GitHub Desktop.
Save justarandomgeek/37aab2eb9ea1c375b92fffbab1ec2008 to your computer and use it in GitHub Desktop.
program: statementlist;
statementlist: statementlist statement | statement;
statement: taglist statementop|statementop;
taglist: taglist tag | tag;
tag: label|site;
label: STRING ':';
site: INTEGER '@';
arithop: '*'|'/'|'+'|'-';
compop: '>'|'='|'<';
assignop: '=' | '+' '=';
addrspec: INTEGER;
addrspec: STRING;
addrspec: STRING '+' INTEGER;
addrspec: STRING '-' INTEGER;
memspec: SIGNAL | SIGNAL '+' '+' | '-' '-' SIGNAL;
assignspec: REGISTER assignop;
assignspec: SIGNAL assignop;
assignspec: memspec '=';
expr: arithexpr | compexpr | REGISTER | SIGNAL ;
arithexpr: REGISTER arithop SIGNAL;
compexpr: SIGNAL compop REGISTER;
statementop: STRING;
statementop: JUMP addrspec;
statementop: RJUMP addrspec;
statementop: CALL addrspec;
statementop: RCALL addrspec;
statementop: assignspec assignop expr;
statementop: BRANCH SIGNAL INTEGER;
statementop: MEMSET REGISTER SIGNAL INTEGER;
statementop: MEMCPY REGISTER REGISTER;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment