[antlr-interest] ANTLR 3 Eclipse Plugin

scott at javadude.com scott at javadude.com
Tue Jun 19 06:38:08 PDT 2007


Definitely possible. I'll see what I can do.

I was thinking more along the lines of:

  src/some/pkg/name/Foo.g3
  generated/some/pkg/name/FooLexer.java et al

What do you think? I could make it

  antlr-generated/some/pkg/name/FooLexer.java et al

Toggling the antlr 3 nature would set up the "generated" dir automatically.

The builder currently marks the generated files as "derived". In Eclipse
3.3 there's an option to warn you if you try to edit a derived file.

As long as the grammar is in some source dir, it will be picked up; you
don't need to specify it. I just need to check the classpath to find what
prefix to chop off from the grammar's path name when setting up the output
dir.

Thoughts?
-- Scott

> I would be very happy with having a "grammar" folder marked as an
> eclipse source folder and having the java files generated in "src" with
> the same structure. So, for instance, if my package is "prog.generated"
> the grammar will be grammar/prog/generated/prog.g3 and it will generate
> the file in src/prog/generated/progParser.java. Is this possible? Maybe
> there will need to be a workspace/project/file option that declares the
> source folder to use for the generated java file.



More information about the antlr-interest mailing list