The imperative langage IMP front-end for Guile, which is a tutorial project for Guile for adding new language
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
language/imp
.gitignore
COPYING
README
README.md

README.md

A simple toy language IMP. Only for Guile-2.1+

=== BNF ===

Int  ::= the domain of (unbounded) integer numbers, with usual operations on them
Bool ::= the domain of Booleans
Id   ::= standard identifiers
AExp ::= Int
       | Id
       | AExp + AExp
       | AExp - AExp
       | AExp * AExp
       | AExp / AExp
BExp ::= Bool
       | AExp <= AExp   // less than
       | AExp = AExp    // equal?
       | not BExp
       | BExp ^ BExp    // and
       | BExp | BExp    // or   
Stmt ::= skip
       | Id := AExp     // assignment operation
       | Stmt;Stmt
       | if BExp then Stmt else Stmt
       | while BExp do Stmt
Pgm  ::= var List{Id};Stmt

Reference: http://fsl.cs.uiuc.edu/images/0/0d/CS522-Spring-2011-PL-book-imp.pdf