Skip to Content
Programming Languages: Concepts and Implementation
book

Programming Languages: Concepts and Implementation

by Saverio Perugini
December 2021
Beginner
840 pages
47h 29m
English
Jones & Bartlett Learning
Content preview from Programming Languages: Concepts and Implementation

3.5 Bottom-up, Shift-Reduce Parsing and Parser Generators

We engage in bottom-up parsing when we parse a string using the shift-reduce method (as we demonstrated in Section 2.7). The bottom-up nature refers to starting the parse with the terminals of the string and working backward (or bottom-up) toward the start symbol of the grammar. In other words, a bottom-up parse of a string attempts to construct a rightmost derivation of the string in reverse (i.e., bottom-up). While parsing a string in this bottom-up fashion, we can also construct a parse tree for the sentence, if desired, by allocating nodes of the tree as we shift and setting pointers to pre-allocated nodes in the newly created internal nodes as we reduce. (We need not always build ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Concepts and Semantics of Programming Languages 1

Concepts and Semantics of Programming Languages 1

Therese Hardin, Mathieu Jaume, Francois Pessaux, Veronique Viguie Donzeau-Gouge
Programming C# 10

Programming C# 10

Ian Griffiths

Publisher Resources

ISBN: 9781284222739