From: | alex@iliasov.org (alessio) |
Newsgroups: | comp.compilers |
Date: | 21 Apr 2004 00:49:52 -0400 |
Organization: | http://groups.google.com |
References: | 04-04-041 |
Keywords: | interpreter |
Posted-Date: | 21 Apr 2004 00:49:52 EDT |
chris.cranford@tkdsoftware.com (JA Peele) wrote
> I need to embed a BASIC-like BYTECODE/PCODE host engine in my
> application framework so customers can write simple BASIC-like scripts
> to customize the application.
I am the author of Lemick project, it is an open source Basic-like
programming language project. It has compiler from source into to
lemick VM bytecode and run-time environment with just-in-time
compiler.
Links: http://lb.to.kg/, http://sourceforge.net/projects/lemick
In your case you would have first to compile source code, create a VM
instance and execute the code.
> An example of a BASIC-Like script would
> be:
>
> // Test script
> Dim x as Integer = 2
> Print "Hello World From my test script."
> Print "X was initialized to a value of "; x
>
Lemick equivalent for the code above is the following:
' Test script
Use io.console
Dim x as Integer = 2
Println "Hello World From my test script."
Println "X was initialized to a value of " + x
Lemick has OOP, multitasking, packages and etc. It is written in C and
it should be not very hard to make libraries from the compiler and
run-time for embedded use. Thanks to JIT compiler it is very
efficient, times faster then any interprter. Since it is open-source
you can adopt grammar and syntax to your needs.
Hope this is helpful,
Alex
Return to the
comp.compilers page.
Search the
comp.compilers archives again.