[antlr-interest] Urgent: how to "include" a grammar defined inaseparate file

Micheal J open.zone at virgin.net
Wed Jun 15 08:11:50 PDT 2005


The annotation tool is a basic preprocessor.
 
Cheers,
 
Micheal

-----Original Message-----
From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Rupinder S. Gill
Sent: 15 June 2005 15:48
To: antlr-interest at antlr.org
Subject: RE: [antlr-interest] Urgent: how to "include" a grammar defined
inaseparate file 


Thanks folks,
 
I figured out how to do the two independent tree-walkers and one common
lexer+parser .g file for java using exportVocab/importVocab (I just didn't
understand these options before).  Still need to se how to build C#
parser/lexer from the same grammar used by java tools.  As suggested by Ric,
a pre-processor might be the best way.
 
Thanks again,
R.G. 
 



  _____  

From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Micheal J
Sent: Wednesday, June 15, 2005 8:06 AM
To: antlr-interest at antlr.org
Subject: RE: [antlr-interest] Urgent: how to "include" a grammar defined in
aseparate file 


Rupinder,
 
Have a look here at the ANTLR project here and especially the annotation
tool. The author uses it to maintain a single tree parser grammar for
multiple walks. You can adapt it for single grammar and multiple languages
too. You would probably want to move to a one-grammar-per-*.g-file
arrangement for this to work smoothly.
 
http://storm.cs.unipi.gr/~anakreon/aspa.html
 
Incidentally, there is no guarantee that you will receive a response (let
alone a "satisfactory response") from any mailing list staffed by
volunteers. ;-)
 
 
Cheers,
 
Micheal
 

-----Original Message-----
From: antlr-interest-bounces at antlr.org
[mailto:antlr-interest-bounces at antlr.org] On Behalf Of Rupinder S. Gill
Sent: 15 June 2005 04:56
To: antlr-interest at antlr.org
Subject: [antlr-interest] Urgent: how to "include" a grammar defined in
aseparate file 



(I posted a query a week ago but didn't receive a satisfactory response.) 
I have a grammar for logical-expressions from which I need to build the
following: 
- Java lexer and parser 
- C# lexer and parser 
- Two java tree-walkers 
- One C# tree-walkers 

The two java tree-walkers are in independent projects; both projects do
depend on the project that defines the grammar (and contains lexer and
parser).  C# lexer, parser and tree-walker can be in the same project.  I
want to keep only one copy of the common.g file (one containing parser and
lexer sections).  How do I this?

Grammar inheritance nor importVocab seem to be up to the task.  Or am I
missing something? 

Thanks, 
R.G. 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.antlr.org/pipermail/antlr-interest/attachments/20050615/f30756b4/attachment-0001.html


More information about the antlr-interest mailing list