[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: seeking an OO or functional parser generator for Java
For tokenizing, and even some parsing tasks, i like to use a technique i learned from Henry Baker:
Basically write the lexer directly as a state machine. This can be suprisingly compact. Its very convenient to do in languages that do tail call optimization. I've done this several different ways in Java and can send a talk i once gave on it if you'd like.
At 09:22 AM 1/9/2004 -0500, Seth Gordon wrote:
>I need to write a lexer and parser in Java. I've looked at JFlex/CUP and ANTLR, but I'm wondering if anyone has made a decent parser generator in Java that uses Java objects, not text files with snippets of Java code, to describe the grammars.
>It seems like taking such an approach would follow "the grain of the language" more than the lex-and-yacc approach. But maybe other people have tried to write a parser this way and discovered good reasons for sticking with the old ways.
>// seth gordon // firstname.lastname@example.org // http://dynamic.ropine.com/yo/ //