Site icon i2tutorials

Compiler Design-Augmented Grammer, Closure, and Goto Operation

Augmented Grammer, Closure, and Goto Operation

 

Augmented Grammar

If a grammar G is having a start symbol S, then augmented grammar is a new grammar G’ , in which S’ is a new start symbol such that 

S’ → S

 

The purpose of this grammar is to indicate the acceptance of input. 

 

Closure Operation

If ‘I’ is a set of items for a grammar G then closure of I (closure (I)) is set of items constructed from I by 2 rules:

 

Goto Operation

The function goto can be defined as, if there is a production A → α • B β then goto ( A → α • B β , B) = A → α B • β. That means, simply shifting of “•” one position a head over grammar symbol.

 

Reference Link

Augmented Grammer, Closure, and Goto Operation

Exit mobile version