Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 978
Berlin Brown Avatar asked Jan 24 '23 15:01

Berlin Brown


1 Answers

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.

like image 65
Martijn Avatar answered Jan 26 '23 04:01

Martijn