Introduction to Parsing in Compiler

In this class, We discuss Introduction to Parsing in Compiler.

For Complete YouTube Video: Click Here

The reader should have prior knowledge of syntax analysis basics. Click Here.

The syntax analysis phase is also called as parsing phase.

First, we refresh the example used in identifying the expressions.

The below example is used to identify expressions.

E – TE’

E’ – +TE’ | ε

T – FT’

T’ – *FT’ | ε

F – id

F – (E)

The output generated by the syntax phase is a tree.

The tree generated in the syntax phase is called syntax, parse, or derivation.

So, we can call it the parse phase or syntax analysis phase.

Parsing: Parsing is a technique used to identify a parse or syntax tree.

The below diagram shows the different parsing techniques.

Mainly divided into two ways.

1) Top-Down Parsing

2) Bottom-Up Parsing

In the top-down approach, we have two ways.

1) Recursive

The recursive way is of two types.

a) With Back Tracking

b) Without Back Tracking

2) Non-Recursive

The non-recursive way Uses table.

We have an LL(1) Technique.

In the bottom-up parsing, we have LR(0), LR(1), CALR(1), and LALR(1).