I use a mixed language since I can cleanly segregate the sub-grammar into a single token of the base grammar. Can child/sub tokens appear in the parse tree? - #3 by AlexErrant
Concretely, I’m building a search grammar similar to github’s search syntax. In addition to syntax like somesearchword stars:>100
, somesearchword
may be a glob or regex, which are (obviously) their own sub-grammars. As such I made a separate glob grammar. Your ISE and IIE might be better off as separate grammars.
Trying to integrate that glob grammar into my query grammar resulted in many “Inconsistent skip sets” and “shift/reduce conflict between” which I was unable to resolve. This might mean having to duplicate rules from one of your grammars into the other, but this is just an idea for you to explore.