This project has moved and is read-only. For the latest updates, please go here.

Transient behaviour

May 2, 2010 at 1:17 PM


I'm parsing based on a simple grammar. Essentially, if I make ListOfIdsInPar transient, then I can't walk the parse tree to find children of the transient node. Also, the parse tree contains some unexpected nodes such as "Keyword". Have you seen anything like this?   

var IdAtom = TerminalFactory.CreatePythonIdentifier("IdAtom");

ListOfIdsInPar.Rule ="(" + ListOfIds + ")";

ListOfIds.Rule = MakePlusRule(ListOfIds, comma, Id);

Id.Rule = MakePlusRule(Id, dot, IdAtom);


Okay. I've just downloaded the latest code via SVN. Hopefully the problem will go away. Maybe it's me. Not sure yet.




May 3, 2010 at 4:26 PM

Hi Again,

I've got the most recent version of Irony installed with SVN. Here's the error from the Grammar Explorer: "Transient non-terminal must have zero or one non-punctuation child nodes; non-terminals: ListOfIdsInPar"

So, I removed all of my Transients (it worked), then put them back in one by one (it worked bar one... almost there).

To cut a long story short, I hunted through the Irony code + examples one more time; use use NonGrammarTerminals.Add.

At least it forced me to hook up SVN.


May 3, 2010 at 4:59 PM

You should register "(" and ")" as punctuation nodes, that will do it.


May 3, 2010 at 11:03 PM

That's fantastic, I've been able to use "punctuation nodes" elsewhere for keywords that I see as markers and don't want ot see in parse tree. It's taking shape.