On Fri, 2008-12-05 at 11:47 -0800, Howard Lewis Ship wrote:
> I'm having a problem; I need to split my grammar into a lexer grammar
> and a parser grammar so I can specify a superClass option for the
> lexer grammar.
>
> My source files are
> src/main/antlr/org/apache/tapestry5/internal/antlr/PropertyTokens.g
> and PropertyExpression.g.
>
> The plugin generates a PropertyTokens.tokens file as
> target/generated-sources/antlr/org/apache/tapestry5/internal/antlr/PropertyTokens.token
>
> So far, so good.
>
> However, in my PropertyExpression.g file I've tried
>
> options { tokenVocab=PropertyTokens; }
>
> and
>
> options {
> tokenVocab="org/apache/tapestry5/internal/antlr/PropertyTokens";
> }
>
> and both fail. The first should work, but gets:
>
> [INFO] [antlr3:antlr {execution: default}]
> org/apache/tapestry5/internal/antlr/PropertyTokens.g
> org/apache/tapestry5/internal/antlr/PropertyExpression.g
> [ERROR] error(3): cannot find tokens file
> /Users/Howard/work/tapestry5/tapestry-core/target/generated-sources/antlr/PropertyTokens.tokens
If you are using an IDE like Netbeans, then when you edit pom.xml, and
type a '<' inside the configuration, you will see that it gives you all
the options. In this case, as your grammar files are in a package, it
cannot infer the lib directory. So you need:
<plugin>
<groupId>org.antlr</groupId>
<artifactId>antlr3-maven-plugin</artifactId>
<version>3.1.1.2</version>
<configuration>
<libDirectory>${basedir}/target/generated-sources/antlr/org/apache/tapestry5/internal/antlr</libDirectory>
</configuration>
<executions>
<execution>
<goals>
<goal>antlr</goal>
</goals>
</execution>
</executions>
</plugin>
I was playing with trying to make the plugin perform a better guess for
the lib directory and may come up with something yet, but for now, you
must specify it if it is not antlr/
Jim
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"il-antlr-interest" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/il-antlr-interest?hl=en
-~----------~----~----~----~------~----~------~--~---
List: http://www.antlr.org:8080/mailman/listinfo/antlr-interest
Unsubscribe:
http://www.antlr.org:8080/mailman/options/antlr-interest/your-email-address