Skip to content

Instantly share code, notes, and snippets.

@dineshappavoo
Last active August 29, 2015 14:11
Show Gist options
  • Save dineshappavoo/d14c41f5ef60743cca6e to your computer and use it in GitHub Desktop.
Save dineshappavoo/d14c41f5ef60743cca6e to your computer and use it in GitHub Desktop.
dcg-grammar
P ::= K.
K ::= begin D; C end
D ::= const I = N D' | var I D'
D' ::= ε | ; D D'
C ::= I := E C' | if B then C else C endif C' | while B do C endwhile C' | K C'
C' ::= ε | ; C C'
B ::= true | false | E = E | not B
E ::= I := E E' |I E' | N E'
E' ::= ε | + E E' | - E E' | * E E' | / E E'
I ::= x | y | z | u | v
N ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment