CFG Derivation

Creator
Creator
Seonglae Cho
Created
Created
2022 Oct 5 3:49
Editor
Edited
Edited
2022 Oct 5 4:3
Refs
Refs
ㅁ sequence of replacements of structure names by layouts on RHS, starting from the start nonterminal
Replacement by grammar and transition order determines derivation type
Is called a derivation in G of math: w_n \, from \,\, w_0 with derivation length n - so w is Sentential Form
  • Since CFG has ambiguity(make logical error) in derivation order (so we can pre-detect by syntax error)
 
 

Left-most derivation

Always replace(terminalize) left-most variable

Right-most derivation

Always replace right-most variable
  • make different Parse tree
 
 
Top-down approach 1. left-recursive grammar - can occur infinite recursive → so make prime and divide to right-recursive 2. right-recursive grammar
 
 
 

Recommendations