[ 
http://jira.codehaus.org/browse/MOJO-905?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_107443
 ] 

Jochen Kuhnle edited comment on MOJO-905 at 9/15/07 6:08 AM:
-------------------------------------------------------------

This patch allows the configuration of the lib directory with mojo parameter 
"libDirectory", thus allowing the user to specify where files are imported from.

If you e.g. want to import a token vocabulary from a lexer in package "my.pkg", 
just put the following in the mojo configuration:

{noformat}
<configuration>
                 
<libDirectory>target/generated-sources/antlr/my/pkg</libDirectory>
</configuration>
{noformat}

Also includes test case.


 was:
This patch allows the manual of the lib directory with mojo parameter 
"libDirectory", thus allowing the user to specify where files are imported from.

If you e.g. want to import a token vocabulary from a lexer in package "my.pkg", 
just put the following in the mojo configuration:

{noformat}
<configuration>
                 
<libDirectory>target/generated-sources/antlr/my/pkg</libDirectory>
</configuration>
{noformat}

Also includes test case.

> [antlr3] .tokens files for tokenVocab can't be found in package subfolders
> --------------------------------------------------------------------------
>
>                 Key: MOJO-905
>                 URL: http://jira.codehaus.org/browse/MOJO-905
>             Project: Mojo
>          Issue Type: Bug
>            Reporter: David Holroyd
>         Attachments: MOJO-905.patch
>
>
> Due to the plugin arranging the output files into a folder structure that 
> matches the package structure of the source folder, ANTLR end's up not being 
> able to find the .tokens file specified by a tokenVocab option (unless the 
> 'imported' grammar, and therefore the generated java classes, are in the 
> default top-level package).
> This issue has been reported on antlr-interest (as ideally ANTLR would 
> support this use case directly),
>   http://www.antlr.org:8080/pipermail/antlr-interest/2007-August/023196.html
> It isn't clear if this is something that the antlr3-maven-plugin can work 
> around, since ANTLR only allows the specification of a single folder to 
> search for .tokens files.  In a multi-grammar build with grammars a.A, b.B 
> and c.C, the plugin could not know which of 'a' or 'b' to specify as the lib 
> folder when processing grammar C.  We could inspect the dependencies of 
> grammar C, and on seeing a dependence on 'B.tokens' infer that the lib option 
> should be set to 'b', but this will still be defeated in the pathological 
> case of multiple grammars with the same name but in different 'packages'.
> I think the cause for all this confusion is that 'packages' are a 
> Java-output-specific concept that ANTLR itself doesn't have direct support 
> for (as it is intended to be able to generate code in arbitrary languages).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to