[antlr-interest] Lexer and Parser class packaging

Jim Idle jimi at intersystems.com
Tue Jan 30 15:26:13 PST 2007


You need to use @header::lexer and @header::parser. Otherwise the header element will only appear in one of them (can’t remember which it is now by default ;-).

Jim

-----Original Message-----
From: antlr-interest-bounces at antlr.org [mailto:antlr-interest-bounces at antlr.org] On Behalf Of Vadim Tropashko
Sent: Tuesday, January 30, 2007 3:15 PM
To: antlr-interest at antlr.org
Subject: [antlr-interest] Lexer and Parser class packaging

As a general rule default packaging in java doest't
work (or rather gives you such a headache that you'll
never use default pakages). Therefore it is a good
idea to wrap grammar file into a package. 

grammar MyGrammar;

@header {
    package company.dir;
}

However, after I run antlr Tool, it generates two
classes Lexer and Parser, one packaged properly, and
the other one is not! Is it a bug? (I'm on v.3)




 
____________________________________________________________________________________
Expecting? Get great news right away with email Auto-Check. 
Try the Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html 

-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.17.14/658 - Release Date: 1/29/2007 2:49 PM
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.17.14/658 - Release Date: 1/29/2007 2:49 PM
 


More information about the antlr-interest mailing list