文章目录 Context-Free GrammarsCFG FormalismBNF NotationLeftmost and Rightmost DerivationsLeftmost DerivationsRightmost Derivations Parse TreesYield of a Parse TreeGeneralization of Parse TreesTrees, leftmost, and rightmost derivations correspondAmbiguous GrammarLL(1) GrammarsInherent Ambiguity Normal Forms for CFG’ sEliminating Useless SymbolsEliminate Variables That Derive NothingEliminate unreachable symbols Eliminate ε-Productions**Epsilon Productions****Nullable Symbols** Eliminate Unit Productions**Unit Productions** Cleaning Up a GrammarChomsky Normal Form Pushdown AutomataPDA FormalismActions of the PDAExample: DFAActions of the Example PDAGraphical PresentationInstantaneous DescriptionsThe "Goes-To" Relation Language of a PDAEquivalence of Language DefinitionsDeterministic PDA' sNPDA v.s. DPDADPDA and Ambiguity Equivalence of PDA, CFGConverting a CFG to a PDAFrom a PDA to a CFG**Intuition****Variables of G****Productions of G** The Pumping Lemma for CFL'sStatement of the CFL Pumping LemmaUsing the Pumping Lemma Properties of Context-Free LanguagesDecision Properties of Context-Free LanguagesTesting EmptinessTesting Membership**Algorithm CYK** Testing Infiniteness Closure Properties of CFL'sClosure of CFL's Under UnionClosure of CFL's Under ConcatenationClosure of CFL's Under StarClosure of CFL's Under ReversalClosure of CFL's Under HomomorphismNonclosure Under IntersectionNonclosure Under DifferenceIntersection with a Regular Language