>>>>> "AB" == Artur Biesiadowski <[EMAIL PROTECTED]> writes:

    AB> Is there any compiler-compiler available for java that takes
    AB> bison-like grammar as input ? I don't think only about same
    AB> type of grammar, but exactly same definitions (of course
    AB> without action bodies).

    AB> I was browsing through bison source and I was struck by some
    AB> idea. How much work would take to make bison to generate java
    AB> code ?  State tables would be read from external files
    AB> (because of the max size of static initializer in
    AB> class). bison.simple would have to be rewritten in java. $1
    AB> for type <node> would change from yyvsp[-1].node to
    AB> (Node)yyvsp[yyvsphead-1]

    AB> Any comments ?

Only that LALR and Bison-like grammars have been superceeded by LL(k)
ones. The notation is simpler and more powerful. Instead of looking at
JavaCC go to http://www.antlr.org. Antlr is the original tools that
was used to "inspire" JavaCC. Key benefits:

- EBNF grammar with single notation for Parser, Scanner and Tree walker (for ASTs).
- Unlimited number of lookahaead symbols.
- Built-in notation to automatically generate ASTs
- Visual debugging support.
- C++ and Java generation from the same grammar definition
- Java 1.1, HTML and C++ grammars included.
- Totally free.

--Paolo

Reply via email to