Next: , Previous: , Up: Terms   [Contents][Index]


4.2 Parsing theory preliminaries

This document assumes the reader is familiar with parsing theory. The following exposition is not intended an introduction or a reference. Instead, it is intended to serve as a guide to the definitions of parsing terms as used in this document.

Where a narrow or specialized sense of the term is the one that applies within Marpa, that is the only definition given. Marpa also sometimes uses a standard term with a definition which is slightly different from the standard one. “Ambiguous grammar” is one example: See Ambiguity. The term “grammar” itself is another. See grammar-non-standard. When a definition is non-standard, this is explicitly pointed out.

Readers who want a textbook or tutorial in parsing theory can look at Mark Jason Dominus’s excellent chapter on parsing in the Perl context. See Bibliography-Dominus-2005. It is available on-line. Wikipedia is also an excellent place to start. See Bibliography-Wikipedia.

A grammar is a set of rules, associated with a set of symbols, one of which is distinguished as the start symbol. A symbol string, or simply string where the meaning is clear, is an ordered series of symbols. The length of a string is the number of symbols in it. A symbol string is also called a sentential form.

Some of the symbols are terminals. For the purposes of this subsection, a terminal is a symbol which may occur in an input to a parse of a grammar. In a parse, an input is either accepted or rejected. A potential input string, that is, a sentential form which is made up entirely of terminal symbols, is called a sentence. The set of sentences that a grammar accepts is the language of the grammar.

It is important to note that the term language, as it is used in parsing theory, means something very different from what it means in ordinary use. The meaning of the strings is an essential part of the ordinary idea of what a language is. In ordinary use, the word “language” means far more than a unordered list of its sentences. In parsing terminology, meaning (or semantics as it is called) is a separate issue. For parsing theory a language is exactly a set of strings – that and nothing more.

The Marpa definition of a grammar differs slightly from the various standard ones. Standard definitions usually sharply distinguish terminal symbols from non-terminals. Marpa does not. Further discussion of Marpa’s handling of terminal is below (see Terminals).


Next: , Previous: , Up: Terms   [Contents][Index]