Skip to main content

Top-down Syntax Analysis

  • Chapter
Understanding and Writing Compilers

Part of the book series: Macmillan Computer Science Series

  • 59 Accesses

Abstract

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Author information

Authors and Affiliations

Authors

Copyright information

© 1979 Richard Bornat

About this chapter

Cite this chapter

Bornat, R. (1979). Top-down Syntax Analysis. In: Understanding and Writing Compilers. Macmillan Computer Science Series. Palgrave, London. https://doi.org/10.1007/978-1-349-16178-2_17

Download citation

  • DOI: https://doi.org/10.1007/978-1-349-16178-2_17

  • Publisher Name: Palgrave, London

  • Print ISBN: 978-0-333-21732-0

  • Online ISBN: 978-1-349-16178-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics