tags:

views:

45

answers:

1

Is there a tool for converting an ANTLR grammar to a Bison grmmar?

+2  A: 

I doubt it. Since ANTLR supports a broader class of grammars than Bison, it's only even possible for a subset of ANTLR grammars. At least from what I've seen, relatively few ANTLR grammars fit in the subset that could be directly converted to Bison.

Jerry Coffin
ANTLR can have "infinite" lookahead, which I think is what you are referrring to when you say ANTLR is more powerful than Bison (LALR(1)). It isn't hard to find backtracking LR parsers, or use Bison's GLR option, which in effect have infinite lookahead. At that point, Bison is strictly more powerful than ANTLR, in that ANTLR cannot handle left recursive rules and Bision (LR parsers) can do this just fine.
Ira Baxter