The problem occurs because both ANTLR and the semantic action are building
sub-trees in hql-sql.g. Before my most recent changes, this actually
resulted in some AST nodes being completely discarded (i.e. not in the tree,
anywhere), which was just plain wrong.
What I plan to do is to have hql-sql.
A query like this:
from Dog d join d.owner h join h.friends f
Results in the following broken subtree:
+-[FROM] 'from' FromClause{from}
| +-[FROM_FRAGMENT] 'Dog dog0_ inner join DomesticAnimal dog0_1_ …
| | +-[JOIN_FRAGMENT] 'inner join Human human1_ on
dog0_1_.owner=human1_.mammal inner join Mamm