HAVM
HAVM is a Tree (HIR or LIR, see Intermediate representation TREE)
programs interpreter. It was written by Robert Anisko so that
EPITA students could exercise their compiler projects before
the final jump to assembly code. It is implemented in Haskell, a pure
non-strict functional language very well suited for this kind of
symbolic processing. HAVM was coined on both Haskell, and
VM standing for Virtual Machine.
- Resources:
Feedback can be sent to LRE’s Projects Address.
There are some known bugs that cause HAVM to execute incorrectly HIR programs. This happens when some
jumpbreak the recursive structure of the program, i.e., when ajumpgoes outside its enclosing structure (seq, oreseqetc.).Examples of Tiger sources onto which HAVM is likely to behave incorrectly include:
ineffective-break.tigwhile 1 do print_int((break; 1))
or
ineffective-if.tigif 0 | 0 then 0 else 1
See HAVM Documentation for details, node “Known Problems”.
- How to use HAVM:
To invoke
havmrun:havm OPTIONS FILE.- Where
FILEis a simple text file, andOPTIONSis any combination of the following options: -h,--help: Display a help message and exit successfully.-V,--version: Display the version number and exit successfully.-d,--display: Unparse the content of theFILEon the file descriptorFD, defaulting to 2 (standard error output).-p [FD],--profile[=FD]: Report simple profiling information onFD, defaulting to 2 (stderr).-t [FD],--trace[=FD]: Display each instruction before executing it onFD, defaulting to 2 (stderr).-l [FD],--low[=FD]Reject high level constructs.
- Where