搜索资源列表
字符串表达式解析器
- 此程序实现的是一个运算器,是在一个程序的基础上进行改进的,计算器中需要的运算以及操作对象: IF,AND,OR,<,<=,>,>=,<>,=,== 数字0-9,(,),+,-,*,/, SIN,COS,TAN,POW,EXP,ABS,SQRT,INT,LN,LOG,MIN,MAX.-this program is a computing device that is in a process of improvement based on the
S语言词法分析程序
- 一、 实验内容 S语言的编译程序的词法分析部分实现 从左到右扫描每行S语言源程序的符号,拼成单词,换成内部表示(token) 二、 实验要求 要求实现编译器的以下功能: 组织源程序的输入 按规则拼写单词,并转换成二元形式 删除空格及无用符号(如回车符,字符常数的引号符等) 发现并定位错误 建立单词表、符号表、常数表等文件 三、 实现方法 数据结构 1、
pa
- #include \"define.h\" #include <stdio.h> #include <string.h> #include <ctype.h> #include <malloc.h> FILE *fp /*////////////////////////////////////////////////////////////////////////////// This is a pretreat
BAS-INT
- 本程序是用C语言编写的一个类BASIC语言解释器,可以让使用BASIC语言编写的程序编译并的出运算结果-this program is written in C, a category of the BASIC language interpreter, allow the use of the BASIC language compiler and procedures from the Operational results
compiler([1].netstl)
- (1) 给定一段符合Pascal子集语法的语言,能成功转换成C语言; (2) 一个简单的说明文档; (3) 2007.7.14之前上传到ftp:// C07:C07@10.11.3.71/upload,用学号建立自己的目录; (4) (可额外加分5分)若有出错处理功能,请在说明文档中写明可以处理哪几项错误。 注意事项: (1) 两人一组 (2) 可以使用词法、语法自动生成工具,windows下有Flex,Bison,Linux下有Lex,Yacc,Java的有Jlex,J
ucw-src129
- UC Library Extensions UnderC comes with a pocket implementation of the standard C++ libraries, which is a reasonably faithful subset. This documentation describes those UnderC functions and classes which are not part of the C++ standard. UC
cmm
- 简单C编译器生成的目标代码是8086的汇编代码(16位),可以在一般的PC上被像MASM之类的汇编编译程序编译,生成可执行文件后,在DOS或Windows控制台下运行。 实现的语言定义如下: 语言类似于tiny语言,不支持过程调用,也就是只有一个main函数,无其他函数和全局变量 基本语句:注释语句(/*…*/),输入语句(int input(void) ),输出语句(void output(int) ),赋值语句。这里的输入输出语句实际上类似于函数调用,可以看作是本语言内部的函数
wordanalysis
- 、该个词法分析器要求至少能够识别以下几类单词: a. 关键字:else if int return void while共6个,所有的关键字都是保留字,并且必须是小写; b. 标识符:识别与C语言词法规定相一致的标识符,通过下列正则表达式定义:ID = letter (letter | digit)*; c. 常数:NUM=(+ | - |ε)digit digit*(.digit digit* |ε)(e(+ | - |ε) digit digit* |ε),letter = a|
cifa
- 词法分析器的功能是输入源程序,输出单词符号。词法分析器的单词符号常常表示成以下的二元式(单词种别码,单词符号的属性值)。 识别保留字:if、int、for、while、do、return、break、continue; 单词种别码为1。 其他的都识别为标识符;单词种别码为2。 常数为无符号整形数;单词种别码为3。 运算符包括:+、-、*、/、=、>、<、>=、<=、!= ; 单词种别码为4。 分隔符包括:,、 、{、}、(、)、【、】; 单词
analyse
- 词法分析器 对输入一个函数,并对其分析main() { int a,b a = 10 b = a + 20 }
ag
- 词法分析程序,可对以下的C源程序进行分析:main() {int a[12] ,sum for(i=1 i<=12 i++) {for(j=1 j<=12 j++)scanf(\"%d\",&a[i][j]) } for(i=12 i>=1 i--){ for(j=12 j>=1 j--){ if(i==j&&i+j==13)sum+=a[i][j] } } printf(\"%c\",sum) }-lexical analysis procedures, right b
词法分析程序
- /*** *****词法分析程序*** *****/ # include<iostream.h> # include<fstream.h> # include<math.h> int cc=0 -/*** ***** lexical analysis procedure *** *****/ # includelt; Iostream.hgt; # Includelt; Fstream.hgt; # Includelt; Math.hgt; Int cc =
cifafenxiqi
- /*** *****词法分析程序*** *****/ # include<iostream.h> # include<fstream.h> # include<math.h> int cc=0 -/*** ***** lexical analysis procedure *** *****/ # includelt; Iostream.hgt; # Includelt; Fstream.hgt; # Includelt; Math.hgt; Int cc =
预测分析法
- #include #include #include #define MAX 30 int table[5][6]; char stack[30]; int top=0; char buffer[MAX]; int buf=0; void start()//初始化预测分析表
pl/0
- /*PL/0编译系统C版本头文件pl0.h*/ /* typedef enum { false, true } bool; */ #define norw 13 /*关键字个数*/ #define txmax 100 /*名字表容量*/ #define nmax 14 /*number的最大位数*/ #define al 10
DFA
- 编译原理实验 DFA识别语言的java实现,为DFA.java文件中的DFA类实现成员函数boolean recognizeString(int move[][], int accept_state[], String word).-Compile the DFA recognizes the language of principle experiment java implementation for DFA.java file DFA class implements member fun
b
- /*** *****词法分析程序*** *****/ # include<iostream.h> # include<fstream.h> # include<math.h> int cc=0 -/******** lexical analysis procedure********/# includelt; Iostream.hgt;# Includelt; Fstream.hgt;# Includelt; Math.hgt; Int cc = 0
c
- /*** *****词法分析程序*** *****/ # include<iostream.h> # include<fstream.h> # include<math.h> int cc=0 -/******** lexical analysis procedure********/# includelt; Iostream.hgt;# Includelt; Fstream.hgt;# Includelt; Math.hgt; Int cc = 0
cde
- /*** *****词法分析程序*** *****/ # include<iostream.h> # include<fstream.h> # include<math.h> int cc=0 -/******** lexical analysis procedure********/# includelt; Iostream.hgt;# Includelt; Fstream.hgt;# Includelt; Math.hgt; Int cc = 0
cdef
- /*** *****词法分析程序*** *****/ # include<iostream.h> # include<fstream.h> # include<math.h> int cc=0 -/******** lexical analysis procedure********/# includelt; Iostream.hgt;# Includelt; Fstream.hgt;# Includelt; Math.hgt; Int cc = 0