文件名称:yufafenxikejianzongshu
介绍说明--下载内容均来自于网络,请自行研究使用
每种程序设计语言都有描述程序语法结构的规则。例如,Pascal程序由程序块(又叫分程序)构成,程序块由语句组成,语句由表达式组成,表达式由记号组成等等。这些规则可以用上下文无关文法或BNF范式(Backus-Naur Form)描述。
编译器常用的文法分析方法有自上而下和自下而上两种。正如它们的名字所示,自上而下分析器建立分析树是从根结点到叶结点,而自下而上分析器恰好反过来。它们的共同点是从左向右地扫描输入,每次一个符号。
最有效的自上而下和自下而上的分析法都只能处理上下文无关文法的子类。这些子类足以描述程序设计语言的大多数语法结构,其中LL文法的分析器通常用手工实现,而LR文法的分析器通常利用自动工具构造。
本章致力于编译器采用的典型语法分析方法。我们首先提出有关上下文无关文法的基本概念,然后介绍适合于手工实现的预测分析技术,最后给出自动工具用的LR分析算法。由于程序员准备的代码经常会出现一些语法错误,因此我们还扩展所介绍的分析方法,使之能从常见的错误中恢复过来。
3.1 上下文无关文法 .....
3.4 自下而上分析
3.6 二义文法的应用-each programming language has described procedures grammatical structure of rules. For example, Pascal procedures block (also known as sub-procedures), with procedures block composed by the statement, statement by the composition of expression, etc. from the component mark. These rules can be used context-free grammar or paradigm BNF (Backus - Naur Form) Descr iption. Compiler grammar analysis of the commonly used methods are both top-down and bottom-up. As their name implies, top-down analysis of the establishment of analyzers from the root node of the tree to the leaf nodes, and the bottom-up analyzer exactly the contrary. The common denominator is to scan from left to right input, each a symbol. The most effective top-down and bottom-up analysis can only deal with
编译器常用的文法分析方法有自上而下和自下而上两种。正如它们的名字所示,自上而下分析器建立分析树是从根结点到叶结点,而自下而上分析器恰好反过来。它们的共同点是从左向右地扫描输入,每次一个符号。
最有效的自上而下和自下而上的分析法都只能处理上下文无关文法的子类。这些子类足以描述程序设计语言的大多数语法结构,其中LL文法的分析器通常用手工实现,而LR文法的分析器通常利用自动工具构造。
本章致力于编译器采用的典型语法分析方法。我们首先提出有关上下文无关文法的基本概念,然后介绍适合于手工实现的预测分析技术,最后给出自动工具用的LR分析算法。由于程序员准备的代码经常会出现一些语法错误,因此我们还扩展所介绍的分析方法,使之能从常见的错误中恢复过来。
3.1 上下文无关文法 .....
3.4 自下而上分析
3.6 二义文法的应用-each programming language has described procedures grammatical structure of rules. For example, Pascal procedures block (also known as sub-procedures), with procedures block composed by the statement, statement by the composition of expression, etc. from the component mark. These rules can be used context-free grammar or paradigm BNF (Backus - Naur Form) Descr iption. Compiler grammar analysis of the commonly used methods are both top-down and bottom-up. As their name implies, top-down analysis of the establishment of analyzers from the root node of the tree to the leaf nodes, and the bottom-up analyzer exactly the contrary. The common denominator is to scan from left to right input, each a symbol. The most effective top-down and bottom-up analysis can only deal with
(系统自动生成,下载前可以参看下载内容)
下载文件列表
压缩包 : 27796712yufafenxikejianzongshu.rar 列表 yufafenxikejianzongshu.doc