compilers-aho/04-syntax-analysis.md
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
--- geometry: - lmargin=0.9in - rmargin=0.3in - tmargin=0.3in - bmargin=0.5in - twoside papersize: A4 ... \begin{huge} \textbf{Chapter 4 - Syntax Analysis} \end{huge} ``` Intro ..Role of the Parser ..Representative Grammars ..Syntax Error Handling ..Error-Recovery Strategies ....Panic-Mode Recovery ....Phrase-Level Recovery ....Error Productions ....Global Correction Context-Free Grammars ..The Formal Definition of a Context-Free Grammar ..Notational Conventions ..Derivations ..Parse Trees and Derivations ..Ambiguity ..Verifying the Language Generated by a Grammar ..Context-Free Grammars Versus Regular Expressions Writing a Grammar ..Lexical Versus Syntactic Analysis ..Eliminating Ambiguity ..Elimination of Left Recursion ..Left Factoring ..Non-Context-Free Language Constructs Top-Down Parsing ..Recursive-Descent Parsing ..FIRST and FOLLOW ..LL(1) Grammars ..Nonrecursive Predictive Parsing ..Error Recovery in Predictive Parsing ....Panic Mode ....Phrase-level Recovery Bottom-Up Parsing ..Reductions ..Handle Pruning ..Shift-Reduce Parsing ..Conflicts During Shift-Reduce Parsing Introduction to LR Parsing: Simple LR ..Why LR Parsers ..Items and the LR(0) Automaton ..The LR-Parsing Algorithm ....Structure of the LR Parsing Table ....LR-Parser Configurations ....Behavior of the LR Parser ....Constructing SLR-Parsing Tables ....Viable Prefixes ```