Skip to main content
Top

1979 | OriginalPaper | Chapter

Top-down Syntax Analysis

Author : Richard Bornat

Published in: Understanding and Writing Compilers

Publisher: Macmillan Education UK

Activate our intelligent search to find suitable subject content or patents.

search-config
loading …

The most difficult task when writing a top-down syntax analyser is that of preparing a grammar which is suitable for top-down analysis. Once you have manipulated the grammar so that it possesses certain simple properties, which I describe below, it is trivially easy to write a syntax analyser as a collection of mutually recursive procedures, one for each non-terminal symbol in the grammar. Each procedure has the task of recognising and analysing a section of the input which represents a phrase described by its particular non-terminal symbol. It does so by checking the output of the lexical analyser, and by calling procedures associated with the non-terminals of the grammar, in the sequence defined by the production on which it is based.

Metadata
Title
Top-down Syntax Analysis
Author
Richard Bornat
Copyright Year
1979
Publisher
Macmillan Education UK
DOI
https://doi.org/10.1007/978-1-349-16178-2_17

Premium Partner