Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
529 views
in Technique[技术] by (71.8m points)

parsing - Parser, Generator for Java with the following requirements

I am looking for a parser generator for Java that does the following: My language project is pretty simple and only contains a small set of tokens.

Output in pure READABLE Java code so that I can modify it (this why I wouldn't use ANTLR) Mature library, that will run and work with at least Java 1.4

I have looked at the following and they might work: JavaCC, jlex, Ragel?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Maybe you're looking for parser combinators instead of parser generators? See this paper and JParsec.

It's a really bad idea to edit generated parser code--it's a lot easier to edit the grammar file and then recompile it. Unless you're doing it for educational purposes, in which case ANTLR prides itself in generating pretty readable code for such a powerful parser generator.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...