Nodes not appearing in parse tree.

May 3, 2014 at 9:00 AM
Edited May 3, 2014 at 9:03 AM
Hi I've modified the sql example parser slightly to permit UNIONS etc.
Dim UNION = ToTerm("UNION")
Dim stmtOp = New NonTerminal("stmtOp")
stmtOp.Rule = UNION Or UNION + "ALL"
...
selectStmt.Rule = MakePlusRule(selectStmt, stmtOp, atomicSelectStmt, TermListOptions.None)
atomicSelectStmt.Rule = [SELECT] + selRestrOpt + selList + intoClauseOpt + fromClauseOpt + whereClauseOpt + groupClauseOpt + havingClauseOpt + orderClauseOpt
Everything parses fine. However, when I look at the parse tree there is no node for the UNION/UNION ALL operator. I have not added anything to make it transient.
MyBase.MarkTransient(stmt, term, asOpt, aliasOpt, stmtLine, expression, unOp, tuple)
I'll be translating this parse tree and so need to know what type of UNION to translate to.

So how can I get that operator to appear in the parse tree?

Many thx

S
May 3, 2014 at 11:28 AM
Edited May 3, 2014 at 11:41 AM
OK found my answer in https://irony.codeplex.com/discussions/399061 (thx pgeerkens!) so my select statement became
selectStmt.Rule = atomicSelectStmt Or selectStmt + stmtOp + atomicSelectStmt
Thx
Marked as answer by woopsie on 5/3/2014 at 3:41 AM