Skip to main content
Top

1979 | OriginalPaper | Chapter

Operator Precedence Analysis of Expressions

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 bottom-up syntax analysis algorithm of chapter 3 handles a subset of programming language arithmetic expressions using a system of numerical priorities. This is the basis of the operator-precedence mechanism. It is one of the oldest forms of syntax analysis, now less popular because it is not as flexible or as good at error detection as the one-track technique nor applicable to as many grammars as the LR (1) technique described in chapter 18, but still very useful in practice in the analysis of expressions of a programming language. It is useful in part because of its efficiency and in part because an operator-precedence analyser can usually be generated direct from the unmodified ‘reference’ grammar for expressions. Its error-processing performance is deficient in theory but with care and some simple pragmatic adjustments it can be made acceptable, given the simple syntactic structure of programming language expressions.

Metadata
Title
Operator Precedence Analysis of Expressions
Author
Richard Bornat
Copyright Year
1979
Publisher
Macmillan Education UK
DOI
https://doi.org/10.1007/978-1-349-16178-2_18

Premium Partner