[antlr-interest] Importing problems
Ron Hunter-Duvar
ron.hunter-duvar at oracle.com
Wed Mar 31 16:57:34 PDT 2010
Luigi,
Are you trying to import your lexer grammar into your parser grammar? If
so, I don't think that is correct. What you should do to have your
parser grammar use the tokens defined by your lexer is to use the
tokenVocab option, something like this:
grammar ManchesterOWLSyntax;
options {
tokenVocab=ManchesterOWLSyntaxLexer;
}
Ron
Luigi Iannone wrote:
> Hi
>
> I have built a lexer grammar, and a combined one which should import it.
> The problem is that as soon as I try to import using the following code in my combined grammar
>
> grammar ManchesterOWLSyntax;
> import ManchesterOWLSyntaxLexer ;
>
>
> main:
> IDENTIFIER
> ;
>
> I get the following error
>
> ANTLR Parser Generator 3.2 Sep 23, 2009 12:02:23.
> Using project classpath: Yes.
> Grammar: /Users/luigi/Documents/workspace/Parsers/src/ManchesterOWLSyntax.g
> error(163): /Parsers/src/ManchesterOWLSyntax.g:2:9: combined grammar ManchesterOWLSyntax and imported lexer grammar ManchesterOWLSyntaxLexer both generate ManchesterOWLSyntax_ManchesterOWLSyntaxLexer; import ignored
> |---> import ManchesterOWLSyntaxLexer ;
>
>
> I wonder what am I doing wrong. Any clue?
>
> Thanks,
>
> Luigi
>
> List: http://www.antlr.org/mailman/listinfo/antlr-interest
> Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address
>
>
--
Ron Hunter-Duvar | Software Developer V | 403-272-6580
Oracle Service Engineering
Gulf Canada Square 401 - 9th Avenue S.W., Calgary, AB, Canada T2P 3C5
All opinions expressed here are mine, and do not necessarily represent
those of my employer.
More information about the antlr-interest
mailing list