Location:
Search - context-free
Search list
Description: 编译原理的词法分析,上下文无关文法的编译器-compiler tenets of lexical analysis, context-free grammar compiler
Platform: |
Size: 82965 |
Author: 王亭 |
Hits:
Description: 上下文无关文法(Context-Free Grammar, CFG)是一个4元组G=(V, T, S, P),其中,V和T是不相交的有限集,S∈V,P是一组有限的产生式规则集,形如A→α,其中A∈V,且α∈(V∪T)*。V的元素称为非终结符,T的元素称为终结符,S是一个特殊的非终结符,称为文法开始符。
设G=(V, T, S, P)是一个CFG,则G产生的语言是所有可由G产生的字符串组成的集合,即L(G)={x∈T* | Sx}。一个语言L是上下文无关语言(Context-Free Language, CFL),当且仅当存在一个CFG G,使得L=L(G)。 *⇒
例如,设文法G:S→AB
A→aA|a
B→bB|b
则L(G)={a^nb^m | n,m>=1}
其中非终结符都是大写字母,开始符都是S,终结符都是小写字母。
Platform: |
Size: 308790 |
Author: wu |
Hits:
Description: 语法分析器lex和词法分析器yacc的C++语言实现
1.Lex
(1)Lex输入文件的解析
(2)正规表达式的解析
(3)一个正规表达式到NFA的转换算法实现
(4)多个NFA的合并
(5)NFA的确定化和最小化算法实现
(6)返回状态与返回内容的对应
2.Yacc
(1)Yacc输入文件的解析
(2)上下文无关文法到对应LR(1)文法的下推自动机的构造
(3)LR(1)文法的下推自动机到相应分析表的构造
(4)LR(1)总控程序的构造(查表程序)
(5)符号表的构建与相应管理程序
(6)语义动作程序的加入
环境:Visual Studio.NET 2003-Parser lex and yacc lexical analyzer C language 1.Lex (1) Lex lose into the analytical document (2) Analysis of the formal expression (3) a formal expression of the NFA conversion algorithm (4 ) more than the combined NFA (5) NFA and the determination of the smallest algorithm (6) to return to state and the return of the contents 2.Yacc counterparts (1) Yacc the analytical input file (2) context-free grammar to the corresponding LR (1) grammar pushdown automata Construction (3) LR (1) grammar pushdown automata corresponding to the tectonic analysis table (4) L R (1) General procedures for the control structure (look-up table) (5) Construction of the symbol table with the corresponding management procedures (6) semantic action procedures to the environment : Visual Studio 2003
Platform: |
Size: 41490 |
Author: 尤冉 |
Hits:
Description: 每种程序设计语言都有描述程序语法结构的规则。例如,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) Description. 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
Platform: |
Size: 134421 |
Author: 李爱春 |
Hits:
Description: 给定一个上下文无关文法的n条产生式规则,编程判断该文法对应的语言是否为空。若为空,则输出yes,否则输出no。-given a context-free grammar n production rules, the judgment of the programming language grammar counterparts whether empty. If empty, the output yes, or no output.
Platform: |
Size: 1366 |
Author: lxq |
Hits:
Description: SVMcfg: Learns a weighted context free grammar from examples. Training examples (e.g. for natural language parsing) specify the sentence along with the correct parse tree. The goal is to predict the parse tree of new sentences.
Platform: |
Size: 327597 |
Author: 王强 |
Hits:
Description: 实现自动机,用于计算理论和编译原理的学习,关于上下文无关文法和正则表达式-automatic machine used in the calculation of compiler theory and principles of learning, on the context-free grammar, and is a regular expression
Platform: |
Size: 8208 |
Author: huwu |
Hits:
Description: 实现自动机,用于计算理论和编译原理的学习,关于上下文无关文法和正则表达式-automatic machine used in the calculation of compiler theory and principles of learning, on the context-free grammar, and is a regular expression
Platform: |
Size: 231424 |
Author: huwu |
Hits:
Description: 编译原理的词法分析,上下文无关文法的编译器-compiler tenets of lexical analysis, context-free grammar compiler
Platform: |
Size: 82944 |
Author: |
Hits:
Description: Draak is a multi-language, macro compiler, meaning all syntax and code generation is defined in a single file. Draak is a single binary that is able to compile any context free language (like C, Pascal, Java) for any platform with only 1 file.
Draak Compiler是一个多语言,宏编译器,可以在一个单独的文件中定义所有的语法和代码生成。Draak 是一个单独的二进制文件,可以在任意平台上只使用一个文件来编译任何上下文无关的语言(类似 C, Pascal, Java)。 -Draak is a multi-language, macro compiler, meaning all syntax and code generation is defin ed in a single file. Draak is a single binary that is able to compile any context free language (li ke C, Pascal, Java) for any platform with only a file. Draak Co. mpiler is more than one language, Acer compiler, in a separate document definition all the grammar and code generation. Draak is a single binary file. at any platform can only use one file to compile any context-free languages (like C, Pascal, Java).
Platform: |
Size: 644096 |
Author: 远超 |
Hits:
Description: 上下文无关文法(Context-Free Grammar, CFG)是一个4元组G=(V, T, S, P),其中,V和T是不相交的有限集,S∈V,P是一组有限的产生式规则集,形如A→α,其中A∈V,且α∈(V∪T)*。V的元素称为非终结符,T的元素称为终结符,S是一个特殊的非终结符,称为文法开始符。
设G=(V, T, S, P)是一个CFG,则G产生的语言是所有可由G产生的字符串组成的集合,即L(G)={x∈T* | Sx}。一个语言L是上下文无关语言(Context-Free Language, CFL),当且仅当存在一个CFG G,使得L=L(G)。 *⇒
例如,设文法G:S→AB
A→aA|a
B→bB|b
则L(G)={a^nb^m | n,m>=1}
其中非终结符都是大写字母,开始符都是S,终结符都是小写字母。
-err
Platform: |
Size: 308224 |
Author: wu |
Hits:
Description: 语法分析器lex和词法分析器yacc的C++语言实现
1.Lex
(1)Lex输入文件的解析
(2)正规表达式的解析
(3)一个正规表达式到NFA的转换算法实现
(4)多个NFA的合并
(5)NFA的确定化和最小化算法实现
(6)返回状态与返回内容的对应
2.Yacc
(1)Yacc输入文件的解析
(2)上下文无关文法到对应LR(1)文法的下推自动机的构造
(3)LR(1)文法的下推自动机到相应分析表的构造
(4)LR(1)总控程序的构造(查表程序)
(5)符号表的构建与相应管理程序
(6)语义动作程序的加入
环境:Visual Studio.NET 2003-Parser lex and yacc lexical analyzer C language 1.Lex (1) Lex lose into the analytical document (2) Analysis of the formal expression (3) a formal expression of the NFA conversion algorithm (4 ) more than the combined NFA (5) NFA and the determination of the smallest algorithm (6) to return to state and the return of the contents 2.Yacc counterparts (1) Yacc the analytical input file (2) context-free grammar to the corresponding LR (1) grammar pushdown automata Construction (3) LR (1) grammar pushdown automata corresponding to the tectonic analysis table (4) L R (1) General procedures for the control structure (look-up table) (5) Construction of the symbol table with the corresponding management procedures (6) semantic action procedures to the environment : Visual Studio 2003
Platform: |
Size: 40960 |
Author: 尤冉 |
Hits:
Description: 每种程序设计语言都有描述程序语法结构的规则。例如,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) Description. 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
Platform: |
Size: 134144 |
Author: 李爱春 |
Hits:
Description: 给定一个上下文无关文法的n条产生式规则,编程判断该文法对应的语言是否为空。若为空,则输出yes,否则输出no。-given a context-free grammar n production rules, the judgment of the programming language grammar counterparts whether empty. If empty, the output yes, or no output.
Platform: |
Size: 1024 |
Author: lxq |
Hits:
Description: SVMcfg: Learns a weighted context free grammar from examples. Training examples (e.g. for natural language parsing) specify the sentence along with the correct parse tree. The goal is to predict the parse tree of new sentences.
Platform: |
Size: 327680 |
Author: 王强 |
Hits:
Description: 编写为某一任意上下文无关文法构造的LL(1)语法分析程序,并对任给的一个输入串进行语法分析检查。
程序要求为该文法构造预测分析表,并按照预测分析算法对输入串进行语法分析,判别程序是否符合已
知的语法规则,-To prepare for a arbitrarily constructed context-free grammar LL (1) grammar analysis program, and any given input strings for a grammar analysis of inspection. Procedural requirements for the grammar structure prediction analysis table, and in accordance with the analysis of prediction algorithms for parsing input strings, determine whether the procedures in line with the known rules of grammar,
Platform: |
Size: 197632 |
Author: 傅波 |
Hits:
Description: 编写为某一任意上下文无关文法构造的LL(1)语法分析程序,并对任给的一个输入串进行语法分析检查。
程序要求为该文法构造预测分析表,并按照预测分析算法对输入串进行语法分析-To prepare for a arbitrarily constructed context-free grammar LL (1) syntax analysis program, and to a term of office for parsing input strings to check. Procedural requirements for the grammar structure prediction analysis table, and in accordance with the analysis of prediction algorithms for parsing input strings
Platform: |
Size: 10240 |
Author: 傅波 |
Hits:
Description: CFG上下文无关文法的化简程序,注释详细,本人原来的作业-Context-free grammar CFG simplification of procedures, detailed notes, I am the original operation
Platform: |
Size: 666624 |
Author: liu hao |
Hits:
Description: Generates mock philosophy based on a context-free grammar-Kant Generator for Python
Platform: |
Size: 16384 |
Author: H.P |
Hits:
Description: CSharp version of Parser and Lexer Lex and Yacc.
The most unique Unix language toolset descendants.
C and C++ probably got invented on those two
and so is Ms-dos probably.
They treat Context-free grammars easily
Platform: |
Size: 3052544 |
Author: mike |
Hits: