Handels Computer Science Engineering (CSE) Notes | EduRev

Compiler Design

Computer Science Engineering (CSE) : Handels Computer Science Engineering (CSE) Notes | EduRev

The document Handels Computer Science Engineering (CSE) Notes | EduRev is a part of the Computer Science Engineering (CSE) Course Compiler Design.
All you need of Computer Science Engineering (CSE) at this link: Computer Science Engineering (CSE)

HANDLES:

Always making progress by replacing a substring with LHS of a matching production will not lead to the goal/start symbol.

For example:

abbcde

aAbcde                    A→b
aAAcde                   A→b

struck

Informally, A Handle of a string is a substring that matches the right side of a production, and whose reduction to the non-terminal on the left side of the production represents one step along the reverse of a right most derivation.

If the grammar is unambiguous, every right sentential form has exactly one handle.

More formally, A handle is a production A→b and a position in the current right-sentential form abw such that: SÞaAwÞa/bw

For example grammar, if current right-sentential form is
a/Abcde
Then the handle is A→Ab at the marked position.  a never contains non-terminals.

HANDLE PRUNING:
Keep removing handles, replacing them with corresponding LHS of production, until we reach S.

Example:

E→E+E/E*E/(E)/id

Handels Computer Science Engineering (CSE) Notes | EduRev

Handels Computer Science Engineering (CSE) Notes | EduRev
The grammar is ambiguous, so there are actually two handles at next-to-last step. We can use parser-generators that compute the handles for us.

Offer running on EduRev: Apply code STAYHOME200 to get INR 200 off on our premium plan EduRev Infinity!

Related Searches

Important questions

,

past year papers

,

study material

,

Exam

,

Semester Notes

,

Extra Questions

,

MCQs

,

Free

,

Handels Computer Science Engineering (CSE) Notes | EduRev

,

ppt

,

Handels Computer Science Engineering (CSE) Notes | EduRev

,

pdf

,

shortcuts and tricks

,

Viva Questions

,

Sample Paper

,

video lectures

,

Objective type Questions

,

practice quizzes

,

mock tests for examination

,

Handels Computer Science Engineering (CSE) Notes | EduRev

,

Previous Year Questions with Solutions

,

Summary

;