next next up down toc toc mail

10.  Context-Free Grammars, Parse Tree and Parser

This chapter focus on the following topics:

Generating and recognizing recursive descriptions of patterns with context-free grammars,
Parse tree and

A context-free grammar is a set of recursive rewriting rules (or productions) used to generate patterns of strings. Context-free grammars are often used to define the syntax of programming languages.

A parse tree displays the structure used by a grammar to generate an input string. Parse trees are typically used within a compiler to give structure to an input program in terms of the syntactic rules used to define valid programs.

A parser is an algorithm that determines if a given input string is in a correct sentence in a given language (and, as a side-effect, usually produces a parse tree for the input). There is a procedure for generating a parser of a given context-free grammar.

back next up down toc toc mail

Created by unroff & hp-tools. © by Hans-Peter Bischof. All Rights Reserved (1998).

Last modified: 27/July/98 (12:14)