tags:

views:

460

answers:

1

I'm looking for an Earley parser generator that is able to generate Java output code, i.e. that generates Java code for the lexer and parser, and allows to include actions (realised as Java code) that are performed for the grammar rules.

I looked at two Earley parser generators that generate Java code (Pep and PEN) but none of them seems to allow embedding actions into the grammar.

+1  A: 

Not sure if this is an answer, but one of the scanner generators I regularly use is JFlex, which outputs Java code.

It works closely with CUP, which is a bit closer regarding actions.

Josh
Well, telling from the name (JFlex) and a quick look at the documentation I'd say it's only a lexer and the syntactical analysis part is missing.
Frank Grimm
Sure, I added the CUP link which may be a little closer.
Josh
Cheers, will try CUP together with JFlex.
Frank Grimm
I know this is from a long time ago, but isn't CUP for creating a LALR parser? Earley algorithm is for general CFG isn't it? I was coincidentally looking for the answer to the OP's original question and it seems the answer is still "no such thing" as of 1 year later.
artif