AlanMacek.com AlanMacek.com | Print | Contact Me
Alan's Corner of the Internet

Simple Interpreter

From AlanMacek.com

Summary

This program is an interpreter for a simple programming language. It type checks and has informative error messages. It uses 'Bison' and 'Flex' to create the parser. The type checker and interpreter are written in C++. I wrote it mostly to see if I could. At this time it has very little practical use.

Author:

Alan Macek

Language:

The program is written in C++.

Requirements:

Warranty:

This software comes with absolutely NO WARRANTY. Use this software at your own risk. If you come across any problems please let me know but I take no responsibility for any problems or damage that may happen.

Download:

License

Emailware - please check out the program and source code. Send me an email if you plan on using it or modifying it.

Acknowledgements

This project grew out of a class I took on Programming Languages at the University of British Columbia (CPSC 311 taught by Gregor Kiczales). The simple language and interpreter ideas are straight out of the interpreter we wrote in class (in Scheme) but the implementation in C++ is my own.

Other Notes:

Examples:

let x = 5
  in x
Result Type: int
Result Value: 5
let p = proc (int a)
          if =(a, 5) then false else true
  in call p(6)
Result Type: bool
Result Value: true
let p = proc ([int - int] q, int a)
          =(call q(a), a)
  in call p( proc (int b) b, 5)
Result Type: bool Result Value: true

let x = 3
  in begin
      set x = 4,
      x
     end
Result Type: int
Result Value: 4

Main Page:
AlanMacek.com
Popular Pages:
USB
CPR in BC
Software:
Software
Interpreter
Calendar Maker