What I do is generate the lexer standalone and use vocab import. Then your parser is a parser grammar T;
Jim Sent from my iPhone On May 26, 2009, at 9:04 PM, T Stotts <timoth...@tstotts.net> wrote: > > Hello. I have written a simple composite grammar. Antlr 3.1 fails to > generate a lexer when the lexer grammar is in its own file; but > generates a lexer when the grammar is combined into one file. The > eventual grammar will be very large, so I need to implement it as a > composite grammar. What do I do? Is this a bug in the software, and > why > does this problem not show up for the antlr v3 examples? > > Clarification: by failing to generate a lexer, I do mean that the tool > fails to create a Vhdl2008Lexer.java file. > > > /* File Vhdl2008.g */ > grammar Vhdl2008; > > options { > language='Java'; > } > > import Vhdl2008LexerRules; > > entity_declaration : > ENTITY Identifier IS > END (ENTITY)? (Identifier)? SEMICOLON > ; > > > /* File Vhdl2008LexerRules.g */ > lexer grammar Vhdl2008LexerRules; > > END : ('E'|'e')('N'|'n')('D'|'d') ; > ENTITY : ('E'|'e')('N'|'n')('T'|'t')('I'|'i')('T'|'t')('Y'|'y') ; > IS : ('I'|'i')('S'|'s') ; > > SEMICOLON : ';'; > > Identifier : ('A'..'Z'|'a'..'z') ( ('_')? > 'A'..'Z'|'a'..'z'|'0'..'9' )*; > > WS : (' '|'\t'|'\r'|'\n')+ {$channel=HIDDEN;}; > > > -- > aka: timotheus > web: http://tstotts.net/ > > List: http://www.antlr.org/mailman/listinfo/antlr-interest > Unsubscribe: > http://www.antlr.org/mailman/options/antlr-interest/your-email-address List: http://www.antlr.org/mailman/listinfo/antlr-interest Unsubscribe: http://www.antlr.org/mailman/options/antlr-interest/your-email-address --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "il-antlr-interest" group. To post to this group, send email to il-antlr-interest@googlegroups.com To unsubscribe from this group, send email to il-antlr-interest+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/il-antlr-interest?hl=en -~----------~----~----~----~------~----~------~--~---