资源简介
用Yacc编写一个语法分析程序,使之与词法分析器结合,能够根据语言的上下文无关文法,识别输入的单词序列是否文法的句子。

代码片段和文件信息
/* A lexical scanner generated by flex */
/* Scanner skeleton version:
* $Header: /home/daffy/u0/vern/flex/RCS/flex.sklv 2.85 95/04/24 10:48:47 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
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2016-01-08 19:49 实验4\
目录 0 2015-11-29 10:05 实验4\Debug\
文件 213071 2015-11-29 10:05 实验4\Debug\expr.exe
文件 254496 2015-11-29 10:05 实验4\Debug\expr.ilk
文件 157340 2015-11-29 10:05 实验4\Debug\expr.pch
文件 508928 2015-11-29 10:05 实验4\Debug\expr.pdb
文件 41984 2015-11-29 10:05 实验4\Debug\vc60.idb
文件 53248 2015-11-29 10:05 实验4\Debug\vc60.pdb
文件 44803 2015-11-29 10:05 实验4\Debug\y.tab.obj
文件 4259 2015-11-29 10:04 实验4\expr.dsp
文件 516 2015-11-29 10:04 实验4\expr.dsw
文件 1435 2015-11-29 10:04 实验4\expr.l
文件 58368 2015-11-29 10:04 实验4\expr.ncb
文件 48640 2015-11-29 10:04 实验4\expr.opt
文件 880 2015-11-29 10:04 实验4\expr.plg
文件 73 2015-11-29 10:04 实验4\expr.txt
文件 2153 2015-11-29 10:04 实验4\expr.y
文件 181294 2015-11-29 10:04 实验4\flex.exe
文件 40467 2015-11-29 10:04 实验4\lex.yy.c
文件 14420 2015-11-29 10:04 实验4\y.tab.c
文件 114688 2015-11-29 10:04 实验4\YACC.EXE
文件 38400 2015-11-29 10:04 实验4\实验4 用YACC实现语法分析器.doc
文件 216027 2015-11-29 10:04 实验4\实验4.docx
- 上一篇:数据分析课程设计
- 下一篇:CY7C68013A逻辑分析仪电路
相关资源
- 编译原理语法分析器、词法分析器
- 词法语法分析器
- 编译原理语法分析器课程设计
- 杭电编译原理语法分析器
- LR0语法分析器
- 编译原理语法分析器课程设计完美版
- LR1语法分析器
- C Minus 语法分析器及课程设计报告
- 词法分析器+语法分析器+中间代码生成
- 自顶向下语法分析器的设计与实现
- 编译原理 词法语法分析器
- LR0语法分析器WINDOW.rar
- 语法分析器 Cminus
- c语法分析器
- 编译课程设计报告 语法分析器.doc
- 语法分析器(含完整源码)
- 实验三 学习用递归下降算法和YACC工具
- LR语法分析器
- 编译原理——语法分析器
- 编译原理语法分析器实验报告.doc版
- 在语法分析器的基础上构造的三地址
- 北方工业大学语法分析器 (1)完整实
- 自顶向下语法分析器。。。。。。。
- 编译原理词法分析器语法分析器实验
- 语法分析器
- 语法分析器_编译原理_带报告
- 实验三 LL1语法分析器设计
- PL0词法语法分析器225358
- 编译原理中VC实现语法分析器
- 语法分析器 算符优先 编译原理实验
评论
共有 条评论