Can somebody confirm to me that this is standard procedure to run program from source code. The thing I'm woried about about is calling AnalizeCode. Is it required? Without it I get null point exception, and I see that dispatcher is not set that dispatcher
is not set in runtime object. It's probably a bit silly to ask, but what exactly AnalyzeCode for?
var grammar = new LanguageGrammar();
var compiler = new LanguageCompiler(grammar);
var tree = (ProgramNode)compiler.Parse(@"a = 150 + 28");
compiler.AnalyzeCode(tree, new CompilerContext(compiler));
tree.Scope = new Scope(tree, null);
tree.Evaluate(new EvaluationContext(new LanguageRuntime(), tree));