資源簡介
C++語言的語法分析器,代碼借助yacc和lex,實現了語法書的生成及展示

代碼片段和文件信息
/****************************************************************************
*?????????????????????U?N?R?E?G?I?S?T?E?R?E?D???C?O?P?Y
*?
*?You?are?on?day?108?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.
****************************************************************************/
/****************************************************************************
*?mylexer.cpp
*?C++?source?file?generated?from?mylexer.l.
*?
*?Date:?12/29/17
*?Time:?16:26:59
*?
*?ALex?Version:?2.07
****************************************************************************/
#include?
//?namespaces
#ifdef?YYSTDCPPLIB
using?namespace?std;
#endif
#ifdef?YYNAMESPACE
using?namespace?yl;
#endif
#line?1?“.\\mylexer.l“
/****************************************************************************
mylexer.l
ParserWizard?generated?Lex?file.
Date:?2015年11月24日
****************************************************************************/
#include
#include
#include
#include?
using?namespace?std;
#include?“tree.h“
#include?“myparser.h“
#include?“sign_table.h“
extern?symbol_list?symtbl;
extern?YYSTYPE?yylval;
int?address=0;
Node?node;
int?lineno=1;
#line?66?“mylexer.cpp“
//?repeated?because?of?possible?precompiled?header
#include?
//?namespaces
#ifdef?YYSTDCPPLIB
using?namespace?std;
#endif
#ifdef?YYNAMESPACE
using?namespace?yl;
#endif
#include?“.\mylexer.h“
/////////////////////////////////////////////////////////////////////////////
//?constructor
YYLEXERNAME::YYLEXERNAME()
{
yytables();
}
/////////////////////////////////////////////////////////////////////////////
//?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?mylexer:
*?
*?%name?mylexer
*?
*?For?more?information?see?help.
****************************************************************************
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-12-02?14:45??編譯原理語法樹\
?????目錄???????????0??2017-12-29?16:34??編譯原理語法樹\test++\
?????文件?????????749??2017-12-29?16:00??編譯原理語法樹\test++\Globals.h
?????文件???????12956??2017-12-29?16:26??編譯原理語法樹\test++\mylexer.cpp
?????文件????????1696??2017-12-29?16:26??編譯原理語法樹\test++\mylexer.h
?????文件????????2440??2017-12-29?16:26??編譯原理語法樹\test++\mylexer.l
?????文件???????12063??2017-12-29?16:26??編譯原理語法樹\test++\mylexer.v
?????文件???????39560??2017-12-29?16:29??編譯原理語法樹\test++\myparser.cpp
?????文件????????2772??2017-12-29?16:29??編譯原理語法樹\test++\myparser.h
?????文件???????26071??2017-12-29?16:29??編譯原理語法樹\test++\myparser.v
?????文件????????8640??2017-12-29?16:29??編譯原理語法樹\test++\myparser.y
?????文件????????1379??2017-12-04?20:07??編譯原理語法樹\test++\sign_table.cpp
?????文件?????????477??2017-12-04?20:08??編譯原理語法樹\test++\sign_table.h
?????文件?????????751??2016-11-16?10:36??編譯原理語法樹\test++\test++.pgp
?????文件?????????268??2017-12-29?16:34??編譯原理語法樹\test++\test++.pgw
?????文件???????23706??2017-12-09?13:08??編譯原理語法樹\test++\test++.zip
?????文件?????????185??2003-12-10?21:04??編譯原理語法樹\test++\tmp.c
?????文件????????4414??2017-12-29?16:22??編譯原理語法樹\test++\tree.cpp
?????文件????????1617??2017-12-28?22:57??編譯原理語法樹\test++\tree.h
- 上一篇:機房收費管理系統課程設計C語言
- 下一篇:文件管理系統C++
評論
共有 條評論