| View previous topic :: View next topic |
| Author |
Message |
Michael Saunders Posted via mailing list.
|
Posted: Thu Jan 15, 2009 3:45 pm Post subject: How do I use antlr tasks within Netbeans |
|
|
I see that Netbeans includes an antlr task for ant but I don’t see the ability to add an antlr grammar file via the “New File” wizard. I tried to work around this by choosing the “New File” wizard’s “Other” option to simply add an empty file into which I placed my grammer. Then I edited my project’s build.xml file and added a “–pre-compile” antlr task. This kind of works but it isn’t very well integrated because antlr tool when run from the antlr task in the pre-compile step generates numerous .java files which Netbeans thinks are just new files which could be accidentally edited. Really these files should be read-only from the perspective of the IDE. In addition, because Netbeans doesn’t know that the grammar file will produce a java file with a main method you have to run a full build before attempting to run the project. If you had simply attempted to “run” the project without first performing a build Netbeans (reasonably) reports it doesn’t have a java file with a main to execute. In addition I had to add an additional “-post-clean” target to remove the generated source.
So my question: Is there a better way to add an antlr grammer file into my Netbeans project so that Netbeans is aware that the generated java files are indeed generated and that it knows how to build and run the grammar target? Perhaps there is an antlr module somewhere? Any assistance would be greatly appreciated.
Thanks,
Michael |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|
|
|