4

Basic Parsing Techniques

1. Define parsing. What is the role of a parser?

Ans: Parsing (also known as syntax analysis) can be defined as a process of analyzing a text which contains a sequence of tokens, to determine its grammatical structure with respect to a given grammar.

images

Figure 4.1 Parsing

Depending upon how the parse tree is built, parsing techniques are classified into three general categories, namely, universal parsing, top-down parsing, and bottom-up parsing. The most commonly used parsing techniques are top-down parsing and bottom-up parsing. Universal parsing is not used as it is not an efficient technique. The hierarchical classification ...

Get Express Learning: Principles of Compiler Design now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.