Spread Knowledge

Virtual University of Pakistan Video Lectures, Handouts, PPT, Quizzes, Assignments & Papers

CS606 - Compiler Construction - Lecture Handout 28

User Rating:  / 0

Related Content: CS606 - VU Lectures, Handouts, PPT Slides, Assignments, Quizzes, Papers & Books of Compiler Construction

LR(1) Skeleton Parser

stack.push(dummy); stack.push(0);
done = false; token = scanner.next();
while (!done) {
s = stack.top();
if( Action[s,token] == “reduce A→β”) {
stack.pop(2×|β|);
s = stack.top();
stack.push(A);
stack.push(Goto[s,A]);
}

Read more: CS606 - Compiler Construction - Lecture Handout 28

CS606 - Compiler Construction - Lecture Handout 24

User Rating:  / 0

Related Content: CS606 - VU Lectures, Handouts, PPT Slides, Assignments, Quizzes, Papers & Books of Compiler Construction

An LR(1) item is a pair [X → α•β, a] where X → αβ is a production and a∈T (terminals) is look-ahead symbol. The model uses a set of LR(1) items to represent each parser state. The model is called the canonical collection (CC) of set of LR(1) items.

Read more: CS606 - Compiler Construction - Lecture Handout 24