Embedding Cobra as a scripting language.
Posted: Thu Apr 17, 2008 11:59 pm
Hi all,
this is my first post to this forum, so let me start by stating that I'm pretty impressed by the capabilities of the Cobra language, which for me combines the most favorable aspects of my preferred programming languages, Python and C#.
After playing around a little bit with the language's compiler/interpreter, I decided to try out cobra on a somewhat larger scale. I want to integrate the interpreter into an existing .NET application as an additional scripting language to allow product automation. Since Cobra uses C# as a backend, I would assume that this simply means to incorporate a reference to the Cobra runtime dll, instantiate a DOM CodeProvider for C#, and compile a little bit of C# code which reads the script and executes it in the Cobra runtime.
Actually, I'm stucked on the last one. Most likely, I assume, there is some kind of static method inside one of the Cobra classes which takes the script code as an input and would execute it, but I cannot find anything like that inside Cobra.Lang or the CobraLang source file. Maybe somebody could be of assistance here and point me into the right direction?
Best regards
Hendrik
this is my first post to this forum, so let me start by stating that I'm pretty impressed by the capabilities of the Cobra language, which for me combines the most favorable aspects of my preferred programming languages, Python and C#.
After playing around a little bit with the language's compiler/interpreter, I decided to try out cobra on a somewhat larger scale. I want to integrate the interpreter into an existing .NET application as an additional scripting language to allow product automation. Since Cobra uses C# as a backend, I would assume that this simply means to incorporate a reference to the Cobra runtime dll, instantiate a DOM CodeProvider for C#, and compile a little bit of C# code which reads the script and executes it in the Cobra runtime.
Actually, I'm stucked on the last one. Most likely, I assume, there is some kind of static method inside one of the Cobra classes which takes the script code as an input and would execute it, but I cannot find anything like that inside Cobra.Lang or the CobraLang source file. Maybe somebody could be of assistance here and point me into the right direction?
Best regards
Hendrik