Skip to content

Instantly share code, notes, and snippets.

@wbars
Last active January 6, 2016 12:09
Show Gist options
  • Save wbars/30edbc5fad9e900c9564 to your computer and use it in GitHub Desktop.
Save wbars/30edbc5fad9e900c9564 to your computer and use it in GitHub Desktop.
/*constant : cexpression ; /* good stuff! */
cexpression : csimple_expression
| csimple_expression relop csimple_expression
;
csimple_expression : cterm
| csimple_expression addop cterm
;
cterm : cfactor
| cterm mulop cfactor
;
cfactor : sign cfactor
| cexponentiation
;
cexponentiation : cprimary
| cprimary STARSTAR cexponentiation
;
cprimary : identifier
| LPAREN cexpression RPAREN
| unsigned_constant
| NOT cprimary
;
constant : non_string
| sign non_string
| CHARACTER_STRING
;
sign : PLUS
| MINUS
;
non_string : DIGSEQ
| identifier
| REALNUMBER
;
addop: PLUS
| MINUS
| OR
;
mulop : STAR
| SLASH
| DIV
| MOD
| AND
;
relop : EQUAL
| NOTEQUAL
| LT
| GT
| LE
| GE
| IN
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment