1. Introduction
1) The status of grammatical analysis: is the core part of the compiler program.
2) The task of parsing: to identify whether the word sequence obtained by lexical analysis is a sentence of a given grammar.
3) Theoretical basis of grammatical analysis: context-independent grammar and push-down automata.
4) Syntax Analysis: (1) Top-down syntax analysis: Repeated use of different production to deduce to seek to match the input symbol string. (2) Bottom-up syntax analysis: the input symbol string looking for different production to the statute until the beginning of the grammar symbol. Note: The input symbol described here refers to the word that is recognized by lexical analysis.
2. Push-down automata:
1) Push-down automata model
2) The form definition of the push-down automata: note: A. The PDA defined by this is definitely an indeterminate PDA. This will bring uncertainty to the parsing of the grammar. When we construct the PDA m algorithm, we need to make some restrictions on the PDA. B.PDA uses "| |" to indicate that the PDA has done one step. C. The input string can be accepted by the PDA, only if the input string is read, the lower push stack is empty, or the input string is read, the controller reaches some final state. D. Sometimes, the push-down automata also configures the output bands to record all the generation numbers of the derivation or statute process. E. For a form like a->ω, there is § (Q, empty string, A) = (q,ω), which is called derivation.