HAVM
HAVM is a Tree
(HIR or LIR)
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:
Required version is HAVM 0.28
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
jump
break the recursive structure of the program, i.e., when ajump
goes outside its enclosing structure (seq
, oreseq
etc.).Examples of Tiger sources onto which HAVM is likely to behave incorrectly include:
while 1 do print_int((break; 1))
or
if 0 | 0 then 0 else 1
See HAVM Documentation for details, node “Known Problems”.
- How to use HAVM:
To invoke havm run:
havm OPTIONS FILE
.- Where
FILE
is a simple text file, andOPTIONS
is 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 theFILE
on the file descriptorFD
, defaulting to 2 (standard error output).-p [FD]
, :code:``--profile[=FD]`: Report simple profiling information onFD
, defaulting to 2 (stderr).-t [FD]
,--trace[=FD]
: Display each instruction before execting it onFD
, defaulting to 2 (stderr).-l [FD]
,--low[=FD]
Reject high level constructs.
- Where