Get delimiter in Irony

177 views Asked by At

I have the following rule in the grammar:

NonTerminal linker = new NonTerminal("linker");
NonTerminal list = new NonTerminal("list ");
NonTerminal item = new NonTerminal("item");

KeyTerm AND = ToTerm("AND");
KeyTerm OR = ToTerm("OR");

list.Rule = MakePlusRule(list, linker, item);
linker.Rule = AND | OR | Empty;

I get the list parsed correctly and returns a list of items as ChildNodes but I was wondering how can I get the "linkers" non-terminals as well?

1

There are 1 answers

0
Moamen Mohamed On

It has been a year, i hope you have already solved it. But for whoever in the same situation. You could try something like this, list.Rule = expression | item; expression.Rule = list + linker + list linker.Rule = AND | OR | Empty;