资源简介
很多人都知道lex&yacc,特别是计算机科班毕业的。因为在unix上自带的bshell就有这些功能。
cygwin里面也有这些。
可是,这种基本的功能,在win32平台下,微软似乎忘了。
有个外国人写了个软件Parser Generator (bum-bee).
他把unix的这些功能,做了个软件放到win32平台上。
我的这个例子不是讲这些理论,而是想对那些初学者讲解,如何把这种第三方工具集成到vc中,如何设置vc ide来编译这些文件。
有兴趣的人,可以给我写信。
haoyujie@sohu.com
但我很忙,可能很久也不去一回,所以可能很久才能回。

代码片段和文件信息
/****************************************************************************
* U N R E G I S T E R E D C O P Y
*
* You are on day 61 of your 30 day trial period.
*
* This file was produced by an UNREGISTERED COPY of Parser Generator. It is
* for evaluation purposes only. If you continue to use Parser Generator 30
* days after installation then you are required to purchase a license. For
* more information see the online help or go to the Bumble-Bee Software
* homepage at:
*
* http://www.bumblebeesoftware.com
*
* This notice must remain present in the file. It cannot be removed.
****************************************************************************/
/****************************************************************************
* lexer.cpp
* C++ source file generated from lexer.l.
*
* Date: 12/20/04
* Time: 18:00:10
*
* ALex Version: 2.06
****************************************************************************/
#include
// namespaces
#ifdef YYSTDCPPLIB
using namespace std;
#endif
#ifdef YYNAMESPACE
using namespace yl;
#endif
#line 1 “.\\lexer.l“
/****************************************************************************
lexer.l
Lexical analyser for a simple calculator. The lexical analyser is
implemented using a C++ class. This is specified by selecting the -Tcpp
option in ALex (the “C++“ selection from the Target Language combo box in
the ALex Options dialog box).
****************************************************************************/
#include
#include
#include
#include
#include
//#include
#include “parser.h“
#include “utils.h“
#line 60 “lexer.cpp“
// repeated because of possible precompiled header
#include
// namespaces
#ifdef YYSTDCPPLIB
using namespace std;
#endif
#ifdef YYNAMESPACE
using namespace yl;
#endif
#include “.\lexer.h“
/////////////////////////////////////////////////////////////////////////////
// constructor
YYLEXERNAME::YYLEXERNAME()
{
yytables();
#line 49 “.\\lexer.l“
// do nothing
#line 84 “lexer.cpp“
}
/////////////////////////////////////////////////////////////////////////////
// destructor
YYLEXERNAME::~YYLEXERNAME()
{
}
#ifndef YYTEXT_SIZE
#define YYTEXT_SIZE 100
#endif
#ifndef YYUNPUT_SIZE
#define YYUNPUT_SIZE YYTEXT_SIZE
#endif
#ifndef YYTEXT_MAX
#define YYTEXT_MAX 0
#endif
#ifndef YYUNPUT_MAX
#define YYUNPUT_MAX YYTEXT_MAX
#endif
/****************************************************************************
* N O T E
*
* If the compiler generates a YYLEXERNAME error then you have not declared
* the name of the lexical analyser. The easiest way to do this is to use a
* name declaration. This is placed in the declarations section of your Lex
* source file and is introduced with the %name keyword. For instance the
* following name declaration declares the lexer my
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 13371 2004-12-20 18:00 calculate_strcmp\lexer.cpp
文件 2098 2004-12-20 18:00 calculate_strcmp\lexer.h
文件 2841 2004-12-20 18:00 calculate_strcmp\lexer.l
文件 9174 2004-12-20 18:00 calculate_strcmp\lexer.v
文件 252 2007-11-15 15:10 calculate_strcmp\mssccprj.scc
文件 21826 2004-12-20 18:49 calculate_strcmp\parser.cpp
文件 2857 2004-12-20 18:49 calculate_strcmp\parser.h
文件 9330 2004-12-20 18:49 calculate_strcmp\parser.v
文件 3488 2004-12-20 18:49 calculate_strcmp\parser.y
文件 1363 2004-12-10 20:01 calculate_strcmp\Readme.txt
文件 1922 2004-11-20 16:12 calculate_strcmp\symbol.cpp
文件 5032 2004-12-20 17:00 calculate_strcmp\symbol.dsp
文件 537 2004-12-10 19:44 calculate_strcmp\symbol.dsw
文件 1056 1998-09-07 18:58 calculate_strcmp\Symbol.h
文件 24 2004-12-20 18:00 calculate_strcmp\test.txt
文件 736 2004-12-20 17:47 calculate_strcmp\Utils.cpp
文件 582 2004-12-20 17:00 calculate_strcmp\Utils.h
..A.SH. 470 2007-11-15 15:10 calculate_strcmp\vssver2.scc
目录 0 2008-08-09 07:15 calculate_strcmp
----------- --------- ---------- ----- ----
76959 19
- 上一篇:高频电子线路历年期末考题
- 下一篇:压缩一个目录下的指定类型文件的rar脚本
相关资源
- 电脑卡西欧计算器 fx-991CN X Emulator19中
- 编译原理实验工具及参考源码(lex&
- 卡西欧工程计算器模拟器Casio FX
- 怎样在flex的datagrid中运用checkbox
- PIC 单片机定时器初值计算器
- 湍流k-e经验值计算器
- CListCtrlExDemo.rar
- PIC单片机延时计算器
- MVC模式实现的计算器
- powerbuilder 计算器小程序
- 简单计算器的实现(数据结构)
- 简单计算器的实现(数据结构 修正版
- 基于51单片机的计算器(C51编写,有
- labview计算器实例.vi88218
- Indentification of Interface Blocker to the LA
- dive into design patterns(Alexander Shvets)
- network science Albert-László Barabási
- EGM2008重力模型计算器
- IBM Flex System –超越刀片
- IBM Flex System产品介绍
- IBM Flex System企业级机箱
- E展区:联想VPLEX双活数据中心解决方
- 基于AT89S52单片机简易计算器的设计
- Enol functionalized N-heterocyclic carbene lan
- Catalytic Asymmetric Mannich Reaction of Glyci
- 中兴电视盒ADB密码计算器
- 实验1.zip arduino跑马灯led灯实验,串口
- 复分析可视化方法 英文版(Visual C
- 汇率计算器
- Lexmark 教客户如何通过减少打印量来节
评论
共有 条评论