|Basic-Like PCODE Compiler and Virtual Host/Interpreter firstname.lastname@example.org (2004-04-15)|
|Re: Basic-Like PCODE Compiler and Virtual Host/Interpreter email@example.com (Timothy Knox) (2004-04-21)|
|Re: Basic-Like PCODE Compiler and Virtual Host/Interpreter firstname.lastname@example.org (2004-04-21)|
|Re: Basic-Like PCODE Compiler and Virtual Host/Interpreter email@example.com (Lex Spoon) (2004-04-21)|
|Re: Basic-Like PCODE Compiler and Virtual Host/Interpreter firstname.lastname@example.org (2004-04-21)|
|Basic-Like PCODE Compiler and Virtual Host/Interpreter email@example.com (2004-04-21)|
|Re: Basic-Like PCODE Compiler and Virtual Host/Interpreter firstname.lastname@example.org (2004-04-28)|
|[8 later articles]|
|From:||email@example.com (JA Peele)|
|Date:||15 Apr 2004 12:26:33 -0400|
|Posted-Date:||15 Apr 2004 12:26:33 EDT|
I am looking for some hints/tips or possibly source if its available
(even as a guide) to explain how I can complete the following tasks.
Any input is greatly appreciative:
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. An example of a BASIC-Like script would
// Test script
Dim x as Integer = 2
Print "Hello World From my test script."
Print "X was initialized to a value of "; x
What I am expecting to do is have the customer save the above in a
file, for example called test.bas. The customer would have a tool
that does syntax, compiler analysis on the code and would notify them
of where syntax errors exist in the code. If all the syntatical
checks pass, the contents of the source file are then stored in a
bytecode/pcode type file like test.pbc.
In my C++ program, I could then create a host VM environment, pass the
VM the pcode/bytecode filename and it would execute the instructions
in realtime. Here is what I would expect in my C++ application:
const MAX_MEMORY_SIZE=1024*32; // 32k
CBasicVM* pVM = new CBasicVM(MAX_MEMORY_SIZE);
if (pVM != NULL)
// args is a character string of arguments that are passed
// into the host VM environment as parameters to the program
// being executed.
// ie: test.pbc [arg1] [arg2] [arg3] ... [argX]
printf("Virtual machine ran program ok.\n");
printf("Virtual machine detected errors during runtime.\n");
pVM = NULL;
Can anyone help with this topic? If this isn't applicable for this
newsgroup, please let me know which is applicable.
Thanks in advance!
Return to the
Search the comp.compilers archives again.