We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
C开发者_如何学编程losed 7 years ago.
Improve this questionAbout 13 years ago I needed a way to script an application I was writing in Borland C++. I found a C interpreter and embedded that in my application. This has been working fine and I have quite a number of scripts.
I now need to rework the app and will do this in C#. Does anyone know of a C interpreter for C#? I have the sources for the original interpreter but I just need to save some time.
Edit Here is an extract from a script:
main()
{
LwSet( "STUFE", "00.00" );
LwSet( "STATUS", "Warten", "AUS" );
do
{
LwSet( "DEBUG", "OFF" );
LwSet( "FUNKTION", "Warten auf Start" );
do
{
rc = LwGet( "Event" );
if( rc == "QUIT" ) {
...
The LwSet/LwGet calls a functions which I registered with the interpreter and are features of my application.
Edit2
Before anyone feels the need to tell me what other language I should have used, here is my comment from below:
At the time, and considering the skills available it was not an annoying choice. Now, 13 years later, a lot of things look a whole lot different! I'm just stuck with a pile of quasi-C scripts which I would like to use without having to convert them all somehow.
How about using the same existing C interpreter from C# via interop?
The excellent ANTLR parser generator has support for C#. Its examples include a C grammar for C#.
This obviously isn't a full interpreter, but the grammar, lexer and parser would make a good starting point.
I don't know of any C interpreter for C# but there is a c# scripting engine that you might be able to use.
http://www.csscript.net/index.html
The nearist think I'm aware of is: http://www.softintegration.com/
Added the following Link Is there an interpreter for C?
Regards Friedrich
精彩评论