Contrary to a widely‐held belief, it is possible to construct executable specifications of language processors that use a top‐down parsing strategy and which have structures that directly reflect the structure of grammars containing left‐recursive productions. A novel technique has been discovered by which the non‐termination that would otherwise occur is avoided by ‘guarding’ top‐down left‐recursive language processors by non‐left‐recursive recognizers. The use of a top‐down parsing strategy increases modularity and the use of left‐recursive productions facilitates specification of semantic equations. A combination of the two is of significant practical value because it results in modular and expressively clear executable specifications of language processors. The new approach has been tested in an attribute grammar programming environment that has been used in a number of projects including the development of natural language interfaces, SQL processors and circuit design transformers within a VLSI design package.
[1]
Göran O. Uddeborg.
A functional parser generator
,
1988
.
[2]
Otto C. Juelich,et al.
On the recursive programming techniques
,
1964,
CACM.
[3]
Richard A. Frost,et al.
Constructing Programs as Executable Attribute Grammars
,
1992,
Comput. J..
[4]
Joseph E. Stoy,et al.
Denotational Semantics: The Scott-Strachey Approach to Programming Language Theory
,
1981
.
[5]
Thomas Johnsson,et al.
Attribute grammars as a functional programming paradigm
,
1987,
FPCA.
[6]
J. C. Shepherdson,et al.
Mathematical Logic and Programming Languages
,
1985
.
[7]
Kai Koskimies.
Lazy recursive descent parsing for modular language implementation
,
1990,
Softw. Pract. Exp..
[8]
Philip Wadler,et al.
Packrat parsing:: simple, powerful, lazy, linear time, functional pearl
,
2002,
ICFP '02.
[9]
Pieter Koopman,et al.
Functional programs as executable specifications
,
1990
.