[antlr-interest] Antlr 2.7 Header sectiond

Wigg, J D wiggjd at lsbu.ac.uk
Thu Feb 1 05:55:41 PST 2007


Is it possible to declare separate header sections for lexer and
parser (even when lexer and parser are within the same *.g file)? I
seem to remember this being possible (in the past?).
 
I have had a look at the Antlr documentation under Header Section. It
refers to "respective addendums". Where are these?
 
A problem I see with the (standard?) header file is that as it appears
in both the CPPLexer and CPPparser we can't declare any variables in
it, only externs.
 
What I would like to do is to declare a variable set in the lexer
which I can use in the parser. To do this I think I need to declare it
as a global in the lexer and use it as an extern in the parser (or
vice versa). to do that I need separate headers for lexer and parser.
 
Can anyone point me in the right direction please?
 
David Wigg
CPP_parser.g
 
 
 
 



This e-mail message may be confidential and is intended only for the use of the individual(s) to whom it is addressed.  It may contain information which is or may be confidential, non-public or legally privileged. Please do not disseminate or distribute this message other than to its intended recipient without permission of the author. You should not copy it or use it for any purpose nor disclose its contents to any other person. If you have received this message in error, please notify me by email immediately and delete the original message and all copies in your computer systems.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20070201/5e982926/attachment.html 


More information about the antlr-interest mailing list