SDT: Synthetized and Inherited attributes
Synthetized:
Are evaluated in rules where the associated symbol is on the left side of the production.
(Once all the symbols in the production have been evaluated).
Example on simple declarations:
T -> int {T.type = integer} | float {T.type = real};
Inherited:
Are evaluated where the associated symbols is on the right side (A production is evaluating symbol by symbol)
Example on simple declarations:
D -> T L {L.inh = T.type}
L -> id {addtype(L.inh, id.entry)}
L -> L1, id {L1.inh = L.inh; addtype(L.inh, id.entry);}

SDD
Syntax-Directed Definition is a context-free grammar in which:
SDT: Evaluation orders for SDD’s
SDT Schemes
Syntax-directed translation can be performed:
A syntax-directed Translation Scheme in an SDD with action of each semantic rule embedded at some positions in the right side of the associated production:

S-attributes SDD

S-attributed SDD’s conversion to postfix SDT
L-attributed SDDs
Bottom-up evaluation of L-attributed defintions
a bottom-up parser is aware of the production it is using only when it performs a reduction, therefore can be executed only at the end of the production
But, action that compute inherited attriutes are not placed at the end of productions… we need to transform L-attribyted defintion into equivalent defintion where all actions are executed at the end of the production.
Inheriting attributes on the parser stack:
Simulating the evaluation of inherited attributes:
Markers make possible to evaluate L-attributed translation schemes with bottom-up parsing, but:

LL(1) grammars
A grammar is said to be LL(1) if its predictive parsing table has no multily-defined entries:
No ambiguos or left-recursive grammar can be LL(1).
LL(1) parser:
The class of languages that can be parsed with LL(1) parsers a proper subset off the deterministic CFL’s.
SA: left recursive grammars
Replacing left-recursive productions:
A → A 𝛂 | β ===
SLR
SLR parsing tables for the same languages are much smaller respect to LR(1) parsing tables (several hundred states) but can contain conflicts.

LR parsers
LALR(1) parsing
Core:
Union:
Conflicts:

Predictive parsing
