[antlr-interest] Grammar inheritance

Boulanger Jean-Louis jean-louis.boulanger at hds.utc.fr
Tue Aug 5 23:58:03 PDT 2003


Hello,

 I work on a formal language called "B" (developped by J.R. Abrial) which based
on some formal sub-language such 
 a. First order logic  and set theory
 b. Substitution (Dijkstra)

 For modelize it, I created 
 1. a first grammar called expression which contains first order logic and set
theory (defined exportVocab).
 2. a second grammar called B which defined the B language and inherited the
first grammar (use importVocab).


In my makefile i passed the argument -glib "expression.g" to antlr tools and all
work fine.

 Questions: 
 a. Why the iniherited information is done two (in grammar file and in command
line)? 
 b. Is not possible to simplify this ?
 c. When you inherited why the Java code in headfile is not inherited ? (I copy
this but it's not a good solution).


 I purposed some extension for B language and described a third language Bprime
which inherited grammar B.

 But I have BPrime that inherite B and B that inherite Expression. I can't give
two file in Antlr tool command line (-glib "expression.g" -glib "B.g doesn't
work) and I have some errors.

 Why isn't possible to describe a language which is based on many iheritance ?

Boulanger Jean-Louis




-------------------------------------------------
Laboratoire Heudiasyc. UMR CNRS 6599
http://www.hds.utc.fr


 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ 




More information about the antlr-interest mailing list