[antlr-interest] Q: Eclipse AntlrDT plugin - cannot open file

Austin Hastings Austin_Hastings at Yahoo.com
Wed Aug 13 16:55:03 PDT 2008


Gerald Rosenberg wrote:
> At 09:26 PM 8/12/2008, you wrote:
>> Thanks for that. I've got it somewhat working. An exception occurs 
>> when I try to open either of the Template pages under the AntlrDT 
>> Preferences.
>
> Yes, that is one of the API bugs I mentioned.  Attached is a 
> pre-release that should fix that bug, and a few others that are much 
> less noticeable.  Please do let me know of any other problems.

Okay. As long as you're aware of it, I don't actually need that at the 
moment.

>> Also, it would be nice if the output path could make use of the 
>> standard variables. Because I'm using maven, I want to the output 
>> into 
>> ${build_project}/target/generated-blah-blah-blah/<source-path-hierarchy>/*.java. 
>>
>
> Not sure what standard variables you are referring to.  What is your 
> path to the *.g3?  I am not that familiar with Maven, so I am not sure 
> what constraints it is placing on your chosen hierarchy configuration.
>

Maven is a build tool, with attached Kool-Aid. There is a "standard 
directory layout" involved, that it wants everything to fit into. (Of 
course you can change this, blah blah freedom blah blah artistic 
creativity blah blah) Eclipse, when building and when running external 
programs, supports the use of $(...) variables for providing workspace- 
and project- information. Check the Run > External Tools > External 
Tools Configurations ... dialog box for several controls that have an 
attached [Variables] button, which lists the defined variables.

Since AntlrDT is automatically invoking antlr, I wanted to tell it to 
output the generated files to the directory that maven uses -- in 
Eclipse parlance that would be 
$(build_project)/target/generated-sources/antlr. In addition, I want it 
to use the same subdirectory tree that the source file uses: If my .g3 
file is in $(ROOT)/com/example/program/P.g3, then I want the output 
file(s) to go in $(OUTPUT)/com/example/program/P*.java.

None of this is show-stopping, of course -- I've already got it 
functioning. It's "making it work better-er" stuff.

=Austin


More information about the antlr-interest mailing list