On 28/02/2011 17:07, Yue Li wrote:
On 02/28/2011 07:55 AM, David Matthews wrote:
I've added a CodeTree sub-structure to the PolyML structure which
makes the codetree available to ML programs. This just passes through
the internal construction functions. To build a codetree you just call
the constructor functions and then call PolyML.CodeTree.genCode to
generate the machine code. You can turn on switches such as
PolyML.Compiler.codetree and PolyML.Compiler.assemblyCode to display
the code you've built and the machine code that the code generator has
produced from it. To use this you will need to rebuild the compiler with
make compiler
in the polyml directory.
There's a little example in the samplecode directory to get you started.
I've updated my version and tried out the sample code which works quite
well. Thank you very much David!
I've added a little bit to this to make it possible to extract the
codetree from an ML variable. It was already possible to use an ML
variable as a constant but this works better when the ML is an inline
function. I've updated the sample code with an example of "Hello World"
using TextIO.print and string concatenation.
Regards,
David
_______________________________________________
polyml mailing list
[email protected]
http://lists.inf.ed.ac.uk/mailman/listinfo/polyml