Create a new parsetree node

Oct 10, 2013 at 11:04 AM
Hi there,

I am using SQLGrammar to parse sql statements. My goal is to add where clauses to the original statement. After parsing successfully the original sql, how can i add new parsetree nodes?

Oct 10, 2013 at 4:56 PM
you just take the result parse tree, search for "WHERE" node and modify the tree (add/remove children) the way you want. Look at the code that 'displays' the tree in the treeView in Grammar Explorer - it is very simple to iterate; and to modify it is not a problem - all child lists are open for add/remove
Oct 10, 2013 at 5:01 PM
Thanks for the help.

Oct 11, 2013 at 9:30 AM
Hi again,

Is there any tutorial for the operation i want to do?

My problem now is what i need to create, a new Token?

Can you please tell me where i can search for "examples"?

Oct 15, 2013 at 5:12 PM
I don't think there're any examples or tutorials, but basically, you're free to do what you want, construct nodes with terminals/nonterminals inside, using available constructors. Once parsing is done, Irony parser produces the tree and you can do whatever you want there.