Description: 这是一个判断是否是算符优先分析方法的语法分析器,可以作为一个参考-This is an analysis to determine whether the method is operator precedence parser can be used as a reference Platform: |
Size: 3072 |
Author:贾 |
Hits:
Description: 一个算符优先分析器,首先构造优先关系表,然后根据算符优先分析算法编写程序。
-An operator precedence parser, the first priority relational table structure, and then write a program operator precedence parsing algorithm. Platform: |
Size: 46080 |
Author:卜丽娜 |
Hits:
Description: 编译原理课程设计—基于算符优先分析方法的表达式语法分析器
学习了张素琴的《编译原理》(第二版),根据书中的算法,写了个语法分析器。
有完整的代码+文档。-Principles of curriculum design compiler- based analysis of the expression operator precedence parser learn Zhang Suqin the " compiler theory" (second edition), according to the book of the algorithm, wrote a parser. A complete code+ documentation. Platform: |
Size: 231424 |
Author:liweihua |
Hits:
Description: 算符优先分析器设计
给定定义算术表达式的算符优先文法如下:
G[E]:
(1)E->E+T
(2)E->E-T
(3) E->T
(4)T->T*F
(5)T->T/F
(6)T->F
(7)F->P^F
(8)F->P
(9)P->(E)
(10)P->i
编程实现此文法的算法优先分析器,并设输入的文法的句子为:
(i*(i+i)-i )/i^i^i
给出输出结果
-Design of operator precedence parser
Given the definition of operator precedence grammar arithmetic expressions are as follows:
G [E]:
(1) E-> E+ T
(2) E-> E-T
(3) E-> T
(4) T-> T* F
(5) T-> T/F
(6) T-> F
(7) F-> P ^ F
(8) F-> P
(9) P-> (E)
(10) P-> i
Programming algorithm for precedence parser article law, and set the input of the grammar of the sentence is:
(i* (i+ i)-i)/i ^ i ^ i
Given output Platform: |
Size: 198656 |
Author:浮云 |
Hits:
Description: 编译原理实验指导书
实验一 词法分析程序(扫描器)的设计
实验二 递归下降语法分析程序设计
实验三 LL(1)语法分析器设计
实验四 算符优先分析器设计
实验五 LR分析器设计
实验六 语法制导翻译程序设计-Compile term Principle Experiment Experimental Analysis of Instruction Program (scanner) is designed to test two recursive descent parser design experiments three LL (1) parser operator precedence parser design experiments design experiment four five six LR parser design experiments Syntax Translation Program Platform: |
Size: 46080 |
Author:浮云 |
Hits:
Description: 语法分析器,算符优先实现,完成FIRSTVT, LASTVT的构建,算符优先表的实现和规约过程的输出-Parsers, operator precedence to achieve completion of FIRSTVT Construction of LASTVT, the operator precedence table and the Statute of the output of the process Platform: |
Size: 1024000 |
Author:侯超俊 |
Hits:
Description: 这是一个简单的算符优先的语法分析程序。从文件输入文法规则以后,能够判断文法规则是否为算符优先的,并构造算符优先关系表,然后由用户输入一段合法的句子,然后对这个句子进行规约。-This is a simple operator precedence parser. From file input grammar rules, grammar rules can determine whether the operator precedence, and construct the operator precedence table for a legal sentence, and then entered by the user, then this sentence Statute. Platform: |
Size: 4096 |
Author:sqc |
Hits:
Description: 算符优先分析是基于文法满足算符优先文法的基础上施加的一种自底向上的一种语法分析方法。通过对给定的文法构造算符优先分析表和实现某个符号串的分析,掌握算符优先分析法的基本思想和实现过程。-Operator priority analysis is based on operator precedence grammar grammar satisfy imposed on the basis of a bottom-up approach a grammatical analysis. Through a given operator precedence grammar structure analysis and implementation of a symbol string table analysis, analysis of operator precedence grasp the basic ideas and implementation process. Platform: |
Size: 2616320 |
Author:葛骁倩 |
Hits:
Description: 算符优先分析器,可根据输入的产生式,构造算符优先分析器-Operator precedence parser, according to the input of production, construction operator precedence parser Platform: |
Size: 633856 |
Author:jue |
Hits:
Description: C++编写的赋值语句的算符优先语法分析程序,以文件形式输入赋值语句,以文件形式输出归约过程。程序中自动构造算符优先表。-Operator precedence parser written in C++ assignment statement, in document form input assignment, output reduction process in document form. The program automatically constructed operator precedence table. Platform: |
Size: 4096 |
Author:王雅 |
Hits:
Description: 1、给出文法如下:
G[E]
E->T|E+T
T->F|T*F
F->i(E)
可以构造算符优先表如下:
+ * ( ) i
+
*
(
)
i
2、计算机中表示上述优先关系,优先关系的机内存放方式有两种1)直接存放,2)为优先关系建立优先函数,这里由学生自己选择一种方式;
3、给出算符优先分析算法如下:
k:=1 S[k]:=‘#’
REPEAT
把下一个输入符号读进a中;
IF S[k]∈VT THEN j:=k ELSE j:=k-1
WHILE S[j] a DO
BEGIN
REPEAT
Q:=S[j]
IF S[j-1]∈VT THEN j:=j-1 ELSE j:=j-2
UNTIL S[j] Q
把S[j+1]…S[k]归约为某个N;
k:=j+1
S[k]:=N
END OF WHILE
IF S[j] a OR S[j] a THEN
BEGIN
k:=k+1 S[k]:=a
END
ELSE ERROR
UNTIL a=‘#’
4、根据给出算法,利用适当的数据结构实现算符优先分析程序;-1 gives grammar as follows: E [E] E-> T | E+ T T-> F | T* F F-> i (E)
Operator priority table can be constructed as follows:+* () i
+
*
(
)
i
2, the computer indicated above priority, preferential relations machine memory put in two ways 1) Direct storage, 2) as a priority relationship building priority function, here by the students themselves choose a way
3, gives the operator precedence analysis algorithm is as follows:
k: = 1 S [k]: = #
REPEAT read the next input symbol into a medium IF S [k] ∈VT THEN j: = k ELSE j: = k-1 WHILE S [j] a DO BEGIN REPEAT Q: = S [j] IF S [j-1] ∈VT THEN j: = j-1 ELSE j: = j-2 UNTIL S [j] Q to S [j+ 1] ... S [k] is about a normalization N k: = j+1 S [k]: = N END OF WHILE
IF S [j] a OR S [j] a THEN BEGIN k: = k+ 1 S [k]: = a END ELSE ERROR UNTIL a = #
4, according to the given algorithm, using the appropriate data structure to achieve operator priority analysis program Platform: |
Size: 2048 |
Author:忆昔 |
Hits: