Bottom-Up ParsingShift-Reduce Parsing
push '$' onto the stack;
token = nextToken();
repeat
if (there is a handle A::=b on top of the stack){
reduce b to A; /* reduce */
pop b off the stack;
push A onto the stack;
} else {/* shift */
shift token onto the stack;
token = nextToken();
}
until (top of stack is S and token is eof)
Previous slide
Next slide
Back to first slide
View graphic version