A lightweight Prolog-based framework for
developing language processors such as
pre-processors, front-ends, evaluators,
and tools for software modification and
analysis.
Eliminating dead let clauses from a program
is used as a running example.
Concise frontends and backends written in concise Prolog
parse and unparse the source code of a language into a
Prolog representation on which transformations
are performed.
The first transformation code given for the example is a
concise 5 lines.
(compare
compiler example in the "Art of Prolog", ch 19
).
Higher order logic programming features such as
a generic bottom-up traversal predicate
allow for even higher levels of abstraction and conciseness.
The dead let elimination example is reduced to 2 lines
when this predicate is used.
An optional soft type system extended with polymorphism is provided.
The authors note that
"without types the development of language processors
gets very tedious. The resulting Prolog programs will just fail too often
and too much development time is spent on debugging."
The system was written with SWI-Prolog, but is not yet open-sourced.
(see also:
Formal Syntax and Semantics of Programming Languages: A Laboratory Based Approach
Ken Slonneger and Barry L. Kurtz)
Posted to Logic/Declerative by jon fernquest on 7/25/02; 12:54:11 AM
|