Irony Extract Rule

Dec 27, 2016 at 10:06 AM

The first code works well done. But the second code doesn't work. What is the reason? I tried to extract a NonTerminal expression to be more clearer.
Code 1:
ifCond.Rule = (("if("+ expr + "){"+ stmtList + "}else{" + stmtList + "}");
Code 2:
ifSimplyCond.Rule = (("if("+ expr + "){"+ stmtList + "}else{" + stmtList + "}");
ifCond.Rule = ifSimplyCond;

Thank you for the answers.
Dec 27, 2016 at 5:29 PM
what do you mean 'does not work'?! please be more clear.
On general note, it is not right thing to do - to merge braces and keywords in one combined token: "}else{"
you should split it, and define 'stmtBlock' as "{" + stmtList + "}", and then use stmtBlock to define IF statement and other statement types
Dec 27, 2016 at 5:37 PM
it throw an exception: Root AST node is null, cannot evaluate script. Create AST tree first.