[antlr-interest] ANTLR 3 Eclipse Plugin

Shmuel Siegel ssiegel at finjan.com
Tue Jun 19 07:26:05 PDT 2007


There are three issues that concern me.
1) Separation of source and generated files, definitely a plus when it
comes to re-distribution.
2) Output file(s) need to be in a folder hierarchy that is compatible
with the package statement.
3) Living in existing project structures.

Your suggestion solves items 1 and 2. Item three can wait.


-----Original Message-----
From: scott at javadude.com [mailto:scott at javadude.com] 
Sent: Tuesday, June 19, 2007 4:38 PM
To: Shmuel Siegel
Cc: antlr-interest at antlr.org
Subject: Re: [antlr-interest] ANTLR 3 Eclipse Plugin

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