Please enable JavaScript.
Coggle requires JavaScript to display documents.
BOTTOM UP PARSING (Shift Reduce Parsing Step (triangle (Begin with an…
BOTTOM UP PARSING
Shift Reduce Parsing Step
Begin with an empty stack
input symbol are moved to the stack
3.Symbols on the stack replaced by non terminals according to grammar rules
4.When all input symbols have been read and the symbol on top of the stack is the starting non terminal
SableCC
Grammar File-New Compiler
Source Code-Abstract Syntax Tree
Sections:
States
Tokens
Helpers
Ignored Tokens
Package
Productions
Reduce Action
Implemented by a replace operation
Stack symbols on the right side of the grammar rule are replaced by stack symbol from goto table
Input pointer is retained
How to resolve the conflict
Make an assumption
Rewrite the grammar
Look ahead at additional input character
TWO FUNDAMENTAL OPERATION
Shift Operation
Reduce Operation
TYPES OF CONFLICT
Shift/Reduce Conflict
Reduce/Reduce conflict
LR Parsing with Tables
Action Table
GOTO Table
Shift Action
Implemented by a push operation
Followed by an advance input (pointer) operation
Shift/Reduce Conflict
parser does not know whether
Shift an input symbol
Reduce the handle on the stack
Reduce/Reduce Conflict
it clear reduce sholud be performed but
There is more than one grammar rule
it is not clear which rule to be used