Comments
In his survey article on the subject
[Chri 90],
Christiansen identified six potential problems with grammar adaptability.
-
Block-oriented lexical scope is not handled gracefully by any of the
imperative adaptable grammar models surveyed. In Christiansen grammars,
and in RAGs, block scope is a natural consequence of the way
meta-syntactic information is locally distributed through the parse tree.
-
In addition to immediately adding a new rule to the grammar,
a declaration may entail the addition of new rules at some later point
in the program. Christiansen's handling of this situation introduces
an explicit distinction between variables, meta-variables,
meta-meta-variables, and so on.
The RAG model does not require such a distinction.
-
For two of the problems (visibility and recursive declarations),
Christiansen offered no solution that he himself considered satisfactory;
his implemented parser addresses both problems through the introduction of
logical operators that are alien to the conceptual framework of his grammar
model. The RAG model can handle both problems within its normal
framework; whether it admits elegant solutions has yet to be determined.
-
All of the adaptable grammar models surveyed (including Christiansen's)
have some difficulty expressing the constraint that a variable cannot be
declared more than once in the same block.
A RAG solution to this problem is given in section 4.3.
-
Christiansen suggests that the use of an adaptable grammar may prohibit
a language parser from constructing meaningful diagnostic messages for
syntax errors. Based on previous experience with a parser for a grammar
with limited adaptability, the current author is more optimistic than
Christiansen on this point.
For the immediate future, implementation of a
RAG-based parser generator should be a research priority,
as the availability of such a system would facilitate practical,
and to some extent theoretical, investigation of the RAG model.
There are also a variety of purely theoretical conjectures regarding the
RAG model that could be explored, although at the moment there seems no
specific reason to assign high priority to them.
In the longer term, the author hopes to use the
RAG model to develop a solid formal basis on which to analyze the
abstraction mechanisms of arbitrary programming languages.
Here, abstraction is meant in its most general and comprehensive sense
applicable to programming, encompassing the entire evolutionary process by
which new program entities are created and old ones are hidden.
The criterion of strong answer-encapsulation was developed with this
long-term goal specifically in mind.
Prev:
Recursive Adaptable Grammars
Up:
Chapter 0
See also:
my thesis page.