/IMPinterpreter

A small and very basic imterpreter for the IMP language (a fake langage not any of the one returned returned by your search engine)

Primary LanguageGo

IMP is a test language described by simple semantic

  • arithmetical expression
a ::=n
    |a '+' a
    |a '*' a
    |a '-' a
  • boolean expression
a ::=true
    |false
    |a = a
    |a <= a
    |!b
    |b||b
    |b&&b
  • instruction
c ::=skip
    |X ::= a
    |c ; c
    |if b then c else c
    |while b do c

This is a go program to interpret and execute program written in IMP. It only takes one argument, the name of a source file.