Writing a scripting language
-
I have run into some problems while trying to write a scripting language in VC++ 7. I want it to all be in an edit box. For example, if the user types this in the edit box: String MyString = "Hello"; if (MyString == "Hello") sendkeys(Hello); else MoveMouse(160,480); end; Quite a pointless program, but I am having a hard time handling it with C++. How do I handle the boolean logic, and how would I get both of the parameters of the MouseMove function. I would like the program to execute from the top to the bottom. Anyone have any idea how to do this? I just need the basic idea of how to do it. Any help would be appreciated:) -Dev578
-
I have run into some problems while trying to write a scripting language in VC++ 7. I want it to all be in an edit box. For example, if the user types this in the edit box: String MyString = "Hello"; if (MyString == "Hello") sendkeys(Hello); else MoveMouse(160,480); end; Quite a pointless program, but I am having a hard time handling it with C++. How do I handle the boolean logic, and how would I get both of the parameters of the MouseMove function. I would like the program to execute from the top to the bottom. Anyone have any idea how to do this? I just need the basic idea of how to do it. Any help would be appreciated:) -Dev578
writing an interpreter is a huge task. if you don't know where to begin, you're much better off using an interpreter that's already written. there are free interpreters for many languages out there, including things like VBScript, Tcl, Lua, Python, Ruby, etc.. try Google. Cleek | Losinger Designs | ClickPic | ThumbNailer
-
I have run into some problems while trying to write a scripting language in VC++ 7. I want it to all be in an edit box. For example, if the user types this in the edit box: String MyString = "Hello"; if (MyString == "Hello") sendkeys(Hello); else MoveMouse(160,480); end; Quite a pointless program, but I am having a hard time handling it with C++. How do I handle the boolean logic, and how would I get both of the parameters of the MouseMove function. I would like the program to execute from the top to the bottom. Anyone have any idea how to do this? I just need the basic idea of how to do it. Any help would be appreciated:) -Dev578
Chris is right. It's really a huge task. But if you insist, books like this kind would be very helpful to you : Writing compilers and interpreters[^]. After all, innovation drives the world to get better and better. :-D Maxwell Chen