[antlr-interest] Support to Ter, questions
Christian.Boitet at imag.fr
Sun Jul 1 18:04:21 PDT 2007
Hi form Grenoble, 2/7/07
To those "complaining" about this and that concerning ANTLR-3.0:
- ANTLR-3 is certainly an "ongoing" progress on ANTLR-2.
- We should THANK Terence and HELP him continue
this HUGE and FREE work. Maybe some knowledgeable
users could help him with the doc, with examples,
- Terence says and writes clearly that ANTLR-3.0
is not yet as complete as ANTLR-2. That is why
the version number ends in ".0". A huge work
- We still may use the previous versions while
this new one is not yet complete as far as target
languages are concerned.
Our case: Jean-Claude Durand and I have been
building C++ compilers with ANTLR and previously
C compilers with PCCTS for some time: knowing
ANTLR-3.0 cannot yet generate C++, we simply
continue to use ANTLR-2.
I am afraid we did not contribute anything
concrete yet beyond (what we think are) 1 or 2
bug reports. We then hope Terence will take the
above as some kind of (psychological)
contribution or at least support! His 20-year
dedication to that project is truly remarkable.
Questions (or remarks?):
To recap what we suspect are bugs in ANTRL-2:
- using the "à" character (à) anywhere in
a xxx.g file, even if only in a comment, causes
ANTLR to abort.
- when trying to call a grammar not by its axiom,
but by another non-terminal, for example to do
some incremental parsing, we noticed an
unexpected behavior. I guess this is because the
FOLLOW sets are computed only with the first
non-terminal as axiom. For example, with s: u+
END v+ END ; u:AA; v:BB; a call to u on input AA
(ended by EOF) did not work because ANTLR expects
to see AA or END after a u string. There may
exist workarounds but we did not figure them out
and went for another solution, namely write build
a compier for each "increment".
That leads to the following question: is there a
way in ANTLR-2 to include rules from files?
- #include is used by the C or C++ preprocessor,
but apparently not by the ANTLR preprocessor.
- What we want is to build several compilers (for
reengineering a variety of existing specialized
programming languages sharing many parts of their
syntax), and not to build one huge compiler with
many options, and smaller compilers for
- For instance, we have a compiler for a whole
tree rewriting system, containing a block of
procedures, another one for a "control graph",
and one for a set of rules. An increment may be a
whole such block, or a rule, or various parts of
a rule (nome+parameters, lhs, rhs).
At 10:22 -0600 1/07/07, David Piepgrass wrote:
>>Getting started with ANTLR v3 is a frustrating experience for its lack of
>>coherent documentation and non-trivial example code.
>>I've been using ANTLR since the good old times when it used to be called
>>PCCTS, and I always used to be fond of it, but I am disappointed with v3.
> (mind you, there is a lot of useful
>information despite these problems.)
(Pr. Universite' Joseph Fourier)
======= Notez svp /Please note ======= GETA --> GETALP ============
Groupe d'Etude pour la Traduction Automatique
et le Traitement Automatisé des Langues et de la Parole
G E T A L P
GETALP, LIG, IMAG-campus, BP 53 (ex: GETA, CLIPS, IMAG-campus)
Tel: +33 (0)4 76 51 43 55 / 51 48 17 Fax: +33 (0)4 76 44 66 75 / 51 44 05
385, rue de la Bibliothe`que Mel: Christian.Boitet at imag.fr
38041 Grenoble Cedex 9, France
More information about the antlr-interest