文件名称:compiler2
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:897byte
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
语法分析(一)
在实验一的基础上,对符号表中的单词采用自顶向下的分析方法进行语法分析,对不符合给定的文法的字符串,给出错误信息。
内容:给定描述语法的文法为:
E→E+T|E-T|T
T→T*F|T/F|F
F→i
注:i为实验一中分析得到的整型数值型数据,+、-、*和/为实验一文法二所描述的算符。
使用的数据结构:
1.定义一个结构体,利用该结构体定义一个数组stable,用来存放字符串中字符的属性(类型class和值value)。(与实验一同用)
2.定义一个整型数组eft,大小与stable数组相同,记录对应单词是否是错误。
3.定义一个三维字符数组:用来存放分析表。-Parsing (a) on the basis of experiment, using the word in the symbol table parsing top-down analysis methods that do not meet the string of a given grammar, given the error message. : Grammar describes the syntax given: E → E+T | ET | the TT → T* F | T/F, | the FF → i Note: i is an integer numeric data analysis experiment,+,-,* and/experiment grammar described by the two operators. The data structures used: 1. Define a structure, the structure is defined an array of stable, used to store the characters in the string attributes (type, class and value value). (Together with the experimental use) 2. Define an integer array eft, the size of the stable array of the same record the corresponding word is wrong. 3. Define a three-dimensional array of characters: used to store the analysis table.
在实验一的基础上,对符号表中的单词采用自顶向下的分析方法进行语法分析,对不符合给定的文法的字符串,给出错误信息。
内容:给定描述语法的文法为:
E→E+T|E-T|T
T→T*F|T/F|F
F→i
注:i为实验一中分析得到的整型数值型数据,+、-、*和/为实验一文法二所描述的算符。
使用的数据结构:
1.定义一个结构体,利用该结构体定义一个数组stable,用来存放字符串中字符的属性(类型class和值value)。(与实验一同用)
2.定义一个整型数组eft,大小与stable数组相同,记录对应单词是否是错误。
3.定义一个三维字符数组:用来存放分析表。-Parsing (a) on the basis of experiment, using the word in the symbol table parsing top-down analysis methods that do not meet the string of a given grammar, given the error message. : Grammar describes the syntax given: E → E+T | ET | the TT → T* F | T/F, | the FF → i Note: i is an integer numeric data analysis experiment,+,-,* and/experiment grammar described by the two operators. The data structures used: 1. Define a structure, the structure is defined an array of stable, used to store the characters in the string attributes (type, class and value value). (Together with the experimental use) 2. Define an integer array eft, the size of the stable array of the same record the corresponding word is wrong. 3. Define a three-dimensional array of characters: used to store the analysis table.
(系统自动生成,下载前可以参看下载内容)
下载文件列表
compiler2.c
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.