Adaptive grammar

[1] The first description of grammar adaptivity (though not under that name) in the literature is generally[2][3][4] taken to be in a paper by Alfonso Caracciolo di Forino published in 1963.

[9] While early efforts made reference to dynamic syntax[7] and extensible,[6] modifiable,[10] dynamic,[11] and adaptable[2][12] grammars, more recent usage has tended towards the use of the term adaptive (or some variant such as adaptativa,[13][14] depending on the publication language of the literature).

Described in Wegbreit's doctoral dissertation in 1970,[6] an extensible context-free grammar consists of a context-free grammar whose rule set is modified according to instructions output by a finite state transducer when reading the terminal prefix during a leftmost derivation.

Thus, the rule set varies over position in the generated string, but this variation ignores the hierarchical structure of the syntax tree.

is demonstrated as follows:[17] First introduced in May 1990[8] and later expanded upon in December 1990,[10] modifiable grammars explicitly provide a mechanism for the addition and deletion of rules during a parse.

Boullier's main paper on dynamic grammars also defines a dynamic parser, the machine that effects a parse against these grammars, and shows examples of how his formalism can handle such things as type checking, extensible languages, polymorphism, and other constructs typically considered to be in the semantic domain of programming language translation.

Iwai's adaptive grammars (note the qualifier by name) allow for three operations during a parse: ?

query (similar in some respects to a syntactic predicate, but tied to inspection of rules from which modifications are chosen), + addition, and - deletion (which it shares with its predecessor adaptive automata).

Introduced in 2000[20] and most fully discussed in 2006,[4] the §-Calculus (§ here pronounced meta-ess) allows for the explicit addition, deletion, and modification of productions within a grammar, as well as providing for syntactic predicates.

is demonstrated as follows: (Note on notation: In the above example, the #phi(...) statements identify the points in the production R that modify the grammar explicitly.

[23] In 2002,[24] Adam Carmi introduced an LALR(1)-based adaptive grammar formalism known as Adapser.