how to change the context ?

Apr 3, 2012 at 11:03 AM

Hi,

this is a sample grammar:

var Change = new NonTerminal("Change",typeof(ChangeNode));

var blockForany = new NonTerminal("blockForany", typeof(BlockForanyNode));

Change.Rule = ToTerm("change") + "the" + identifier + "of" + identifier + identifier + "to" + identifier + "of" + identifier + identifier + BinOp+Expr;

blockForany.Rule = ToTerm("for") + "any" + identifier + identifier + NewLine + "do" + NewLine + listStatement+NewLine+"end";

 

how to change the context in the  methode DoEvaluate(ScriptThread thread) of class BlockForanyNode ?

Coordinator
Apr 4, 2012 at 4:26 PM

what do you mean - change the context?

Apr 4, 2012 at 4:37 PM

sorry, i mean to change the thread in the methode DoEvaluate(ScriptThread thread) of class BlockForAnyNode

Coordinator
Apr 4, 2012 at 4:39 PM

why you want to do that? ScriptThread is your current context of execution, with your call stack and entire environment (local and global variables). You just need to implement the functionality you need, do this "for any" stuff

Apr 5, 2012 at 8:43 AM

thank you