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


4.3 Stages of parsing

A recognizer is a program that determines whether its input is in the language of a grammar and a start symbol. A parser is a program which finds the structure of that input.

The term parsing is used in a strict and a loose sense. Parsing in the loose sense is all phases of finding a grammar’s structure, including a separate recognition phase if the parser has one. (Marpa does.) If a parser has phases, parsing in the strict sense refers specifically to the phase that finds the structure of the input. When the Marpa documents use the term parsing in its strict sense, they will speak explicitly of “parsing in the strict sense”. Otherwise, parsing will mean parsing in the loose sense.

Parsers often use a lexical analyzer to convert raw input, usually input text, into a token stream, which is a series of tokens. Each token represents a symbol of the grammar and has a value. A lexical analyzer is often called a lexer or a scanner, and lexical analysis is often called lexing or scanning.

The series of symbols represented by the series of tokens becomes the symbol string input seen by the recognizer. The symbol string input is more often called the input sentence.

The output of the Marpa parser is a parse forest. See def-forest.


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