Grammar with multiple entry points (start rules)

Nov 10, 2014 at 11:21 AM
Hi, everybody
I have several closely related grammars with common lexer rules.
I want merge their. How I can do this?
For example, I would like manually set up parser state in required state and begin parse from this specified state. Is this possible? Could you provide any examples for this?
Thanks
Nov 10, 2014 at 11:28 AM
I found some examples with pseudo start-symbols like this
http://stackoverflow.com/questions/18594960/make-bison-start-parsing-with-a-rule-other-than-the-start-rule
and this
http://www.gnu.org/software/bison/manual/html_node/Multiple-start_002dsymbols.html
but I think that use tokens for switch the start rule not very good solution.
Thanks