Results 1 -
3 of
3
Parsing and Compiling Using Prolog
- ACM Transactions on Programming Languages and Systems
, 1987
"... This paper presents the material needed for exposing the reader to the advantages of using Prolog as a language for describing succinctly most of the algorithms needed in prototyping and implementing compilers or producing tools that facilitate this task. The available published material on the subj ..."
Abstract
-
Cited by 26 (2 self)
- Add to MetaCart
This paper presents the material needed for exposing the reader to the advantages of using Prolog as a language for describing succinctly most of the algorithms needed in prototyping and implementing compilers or producing tools that facilitate this task. The available published material on the subject describes one particular approach in implementing compilers using Prolog. It consists of coupling actions to recursive descent parsers to produce syntax-trees which are subsequently utilized in guiding the generation of assembly language code. Although this remains a worthwhile approach, there is a host of possibilities for Prolog usage in compiler construction. The primary aim of this paper is to demonstrate the use of Prolog in parsing and compiling. A second, but equally important, goal of this paper is to show that Prolog is a labor-saving tool in prototyping and implementing many non-numerical algorithms which arise in compiling, and whose description using Prolog is not available in the literature. The paper discusses the use of unification and nondeterminism in compiler writing as well as means to bypass these (costly) features when they are deemed unnecessary. Topics covered include bottom-up and top-down parsers, syntax-directed translation, grammar properties, parser generation, code generation, and optimixations. Newly proposed features that are useful in compiler construction are also discussed. A knowledge of Prolog is assumed.
A Deterministic Shift-Reduce Parser Generator for a Logic Programming Language
- Proceedings of the First International Conference on Computational Logic --- CL 2000, volume 1861 of Lecture Notes in Artificial Intelligence
"... This paper addresses efficient parsing in the context of logical inference for the purpose of using logic programming languages in compiler writing. A bottom-up, deterministic parsing mechanism is formulated for "bounded right context" grammars, a subclass of LR(k) grammars with characteristics ..."
Abstract
-
Cited by 2 (1 self)
- Add to MetaCart
This paper addresses efficient parsing in the context of logical inference for the purpose of using logic programming languages in compiler writing. A bottom-up, deterministic parsing mechanism is formulated for "bounded right context" grammars, a subclass of LR(k) grammars with characteristics amenable to declarative parser specification. A working parser generator for Prolog is described, although the basic parsing mechanism is applicable to logic programming in general. 1
A Formulation of Deterministic Bottom-Up Parsing and Parser Generation In Logic Programming
, 1999
"... . This paper addresses efficient parsing in the context of logical inference for the purpose of using logic programming languages in compiler writing. A bottom-up, deterministic parsing mechanism is formulated for "bounded right context" grammars, a subclass of LR(k) grammars with characteristic ..."
Abstract
-
Cited by 1 (0 self)
- Add to MetaCart
. This paper addresses efficient parsing in the context of logical inference for the purpose of using logic programming languages in compiler writing. A bottom-up, deterministic parsing mechanism is formulated for "bounded right context" grammars, a subclass of LR(k) grammars with characteristics amenable to declarative parser specification. A working parser generator for a logic programming language is described. 1 Introduction The overall aim of this paper is to use logic programming as a practical instrument for compiler writing and other activities concerning programming languages and systems. Many declarative methods in logic programming (e.g., higher order abstract syntax) have been developed for the representation and analysis of programming language constructs. However, logic programming is still not as widely used as conventional languages in compiler writing. One reason for this has been the lack of general and efficient parsing schemes. Parsing in Prolog has traditio...

