资源简介
该设计为编译原理实验课内容,使用Flex+Bison设计MiniPascal编译器,支持if-else、while、for、变量任何位置定义以及变量初始化。随压缩包附实验报告及测例。

代码片段和文件信息
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
* $Header: /home/daffy/u0/vern/flex/RCS/flex.sklv 2.91 96/09/10 16:58:48 vern Exp $
*/
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
#include
/* cfront 1.2 defines “c_plusplus“ instead of “__cplusplus“ */
#ifdef c_plusplus
#ifndef __cplusplus
#define __cplusplus
#endif
#endif
#ifdef __cplusplus
#include
#include
/* Use prototypes in function declarations. */
#define YY_USE_PROTOS
/* The “const“ storage-class-modifier is valid. */
#define YY_USE_CONST
#else /* ! __cplusplus */
#if __STDC__
#define YY_USE_PROTOS
#define YY_USE_CONST
#endif /* __STDC__ */
#endif /* ! __cplusplus */
#ifdef __TURBOC__
#pragma warn -rch
#pragma warn -use
#include
#include
#define YY_USE_CONST
#define YY_USE_PROTOS
#endif
#ifdef YY_USE_CONST
#define yyconst const
#else
#define yyconst
#endif
#ifdef YY_USE_PROTOS
#define YY_PROTO(proto) proto
#else
#define YY_PROTO(proto) ()
#endif
/* Returned upon end-of-file. */
#define YY_NULL 0
/* Promotes a possibly negative possibly signed char to an unsigned
* integer for use as an array index. If the signed char is negative
* we want to instead treat it as an 8-bit unsigned char hence the
* double cast.
*/
#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
/* Enter a start condition. This macro really ought to take a parameter
* but we do it the disgusting crufty way forced on us by the ()-less
* definition of BEGIN.
*/
#define BEGIN yy_start = 1 + 2 *
/* Translate the current start state into a value that can be later handed
* to BEGIN to return to the state. The YYSTATE alias is for lex
* compatibility.
*/
#define YY_START ((yy_start - 1) / 2)
#define YYSTATE YY_START
/* Action number for EOF rule of a given start state. */
#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
/* Special action meaning “start processing a new file“. */
#define YY_NEW_FILE yyrestart( yyin )
#define YY_END_OF_BUFFER_CHAR 0
/* Size of default input buffer. */
#define YY_BUF_SIZE 16384
typedef struct yy_buffer_state *YY_BUFFER_STATE;
extern int yyleng;
extern FILE *yyin *yyout;
#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2
/* The funky do-while in the following #define is used to turn the definition
* int a single C statement (which needs a semi-colon terminator). This
* avoids problems with code like:
*
* if ( condition_holds )
* yyless( 5 );
* else
* do_something_else();
*
* Prior to using the do-while the compiler would get upset at the
* “else“ because it interpreted the “if“ statement as being all
* done when it reached the ‘;‘ after the yyless() call.
*/
/* Return all but the first ‘n‘ matched characters back to the input stream. */
#defin
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 49343 2019-05-30 15:27 编译原理实验-MiniPascal\lex.yy.c
文件 67318 2019-05-30 15:31 编译原理实验-MiniPascal\Mini.exe
文件 68775 2019-05-30 15:35 编译原理实验-MiniPascal\WXTBison.tab.c
文件 3155 2019-05-02 23:15 编译原理实验-MiniPascal\WXTBison.tab.h
文件 10934 2019-05-30 15:29 编译原理实验-MiniPascal\WXTBison.y
文件 2881 2019-05-30 15:21 编译原理实验-MiniPascal\WXTLex.l
文件 51 2019-05-17 14:28 编译原理实验-MiniPascal\测例\Mini1.txt
文件 86 2019-05-27 20:44 编译原理实验-MiniPascal\测例\Mini10.txt
文件 76 2019-05-17 14:27 编译原理实验-MiniPascal\测例\Mini2.txt
文件 83 2019-05-17 14:36 编译原理实验-MiniPascal\测例\Mini3.txt
文件 98 2019-05-17 14:39 编译原理实验-MiniPascal\测例\Mini4.txt
文件 122 2019-05-17 22:32 编译原理实验-MiniPascal\测例\Mini5.txt
文件 154 2019-05-17 22:38 编译原理实验-MiniPascal\测例\Mini6.txt
文件 161 2019-05-30 15:31 编译原理实验-MiniPascal\测例\Mini7.txt
文件 102 2019-05-28 21:50 编译原理实验-MiniPascal\测例\Mini8.txt
文件 94 2019-05-18 20:09 编译原理实验-MiniPascal\测例\Mini9.txt
文件 655863 2019-07-02 21:41 编译原理实验-MiniPascal\编译原理实验报告.docx
目录 0 2019-05-30 15:34 编译原理实验-MiniPascal\测例
目录 0 2019-07-02 21:41 编译原理实验-MiniPascal
----------- --------- ---------- ----- ----
859296 19
- 上一篇:研究生复试简历模板
- 下一篇:最全Linux常用命令大全.docx
相关资源
- 易语言编译原理 易语言循环首尾配对
- 微软masm汇编编译器
- 编译原理实验工具及参考源码(lex&
- 类pascal语言编译器(编译原理实验)
- 编译原理课程设计:词法语法编译器
- 中科院 编译原理 习题及解答
- 编译原理四元式和逆波兰式
- 汇编语言编译器masm5.0
- 《编译原理》清华大学版中的pl0扩充
- PL/0功能扩充break功能
- 编译原理LR(0)语法分析
- 编译原理中间代码生成程序
- 编译原理:LR分析程序
- C编译器源代码(超级牛b).rar
- 编译原理实验:词法分析,语法分析
- 吉林大学编译原理课件
- 编译原理龙书答案
- 编译原理 第三章课后习题答案
- 易语言变量和数组的编译原理
- 编译原理语法分析器、词法分析器
- 山东大学编译原理PL/0语言 compiler实验
- FOR循环语句的翻译程序设计简单优先
- NFA的确定化NFA->DFA完整可运行代码
- pl/0编译器 语法分析
- 哈工大威海编译原理实验报告和源代
- 哈工大威海-编译原理实验报告和源码
- 编译原理课设c编译器
- 赋值语句翻译四元式
- 河北工业大学编译原理实验代码及实
- 完整C-编译器源代码
评论
共有 条评论