TL;DR: This paper uses the syntax definition as defined by the ISO standard for the Prolog language, highlighting some aspects that are important for the parser, such as the restrictions on the use of operators as imposed by the standard in order to make the parsing deterministic.
Abstract: Prolog is a language with a dynamic grammar which is the result of embedded operator declarations. The parsing of such a language cannot be done easily by means of standard tools. Most often, an existing parsing technique for a static grammar is adapted to deal with the dynamic constructs. This paper uses the syntax definition as defined by the ISO standard for the Prolog language. It starts with a brief discussion of the standard, highlighting some aspects that are important for the parser, such as the restrictions on the use of operators as imposed by the standard in order to make the parsing deterministic. Some possible problem areas are also indicated. As output is closely related to input in Prolog, both are treated in this paper. Some parsing techniques are compared and an operator precedence parser is chosen to be modified to deal with the dynamic operator declarations. The necessary modifications are discussed and an implementation in C is presented. Performance data are collected and compared with a public domain Prolog parser written in Prolog. It is the first efficient public domain parser for Standard Prolog that actually works and deals with all the details of the syntax.
TL;DR: An in‐depth study of the built‐in classical dynamic operator parser in Prolog systems, a powerful operator precedence parser covering pre/in/postfix operators, and how to encode the parser as a plug‐in component in procedural languages.
TL;DR: This paper presents an in-depth study of the built-in classical dynamic operator parser in Prolog systems, a powerful operator precedence parser covering pre/in/postfix operators that is widely used as a standard parser by the logic programming community.
TL;DR: In this paper, an operator-precedence parser for arithmetic expressions in calculators is presented, which allows the result of applying an operator to another operator to be another operator, allowing elements to have a priority as an operator and an operand, and allowing operands to have their priority determined by context.
Abstract: An operator-precedence parser is disclosed that incorporates enhancements that support analysis of human languages. Operator-precedence parser are typically used to analyze arithmetic expression in calculators. Enhancements include allowing the result of applying an operator to be another operator; allowing elements to have a priority as an operator and a priority as an operand; allowing operands to have their priority determined by context; allowing a series of priorities to be specified for operators. These series of enhancements enable analysis of sentences that are more complex than can typically be handled by declaration based parsers. For example, the utterance “move tank1 and tank2 to position1 move tank2 to position1 fire tank2 at tank1 fire tank3 at tank1 6*6” can be successfully analyzed by a working system.