Please enable JavaScript.
Coggle requires JavaScript to display documents.
SYNTAX ANALYSIS AND SEMANTIC ANALYSIS 4C (SYNTAX DIRECTED TRANSLATION…
SYNTAX ANALYSIS AND SEMANTIC ANALYSIS 4C
DECAF EXPRESSION
TRANSLATING CONTROL STRUCTURE
Atoms used
JMP
:pen: Unconditional branch to the label specifed
TST
:pen: Comapre Expr1 and Expr2 using the comparison code. Branch to the label if the result is TRUE.
LBL
:pen: Mark a spot to be used as a branch destination
MOV
:pen: Trg=Src
SYNTAX DIRECTED TRANSLATION
TRANSLATION SYMBOL :
A grammar containing action symbols
UNDERLYING GRAMMAR :
Translation grammar with action symbols removed
ACTION SYMBOL
Producing output and/or calling other methods while parsing an input string
Action symbol is enclosed in curly bracket { }
ATTRIBUTES GRAMMAR
context free grammar that has been extended to provide context sensitive information by depending attributes to some of its terminal and non terminal.
Attribute grammar can pass values through two ways:
Synthesized attribute (From child node to parent):
Inherited attribute ( From parent node to child): All attribute values are taken from higher node in the tree
Rules to construct a pushdown machine for translation grammar
Fill up every column in that row with Out(A), Pop, Retain
Each action symbols {A} representing output have a row on its own on a pushdown machine.
Action Symbols should be treated as stack symbols and are pushed onto the stack symbols