⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 elexcompiler.h

📁 用于词法分析的词法分析器
💻 H
字号:
/*  $Id: ElexCompiler.h,v 1.6 1997/05/18 10:58:07 matt Exp $  Elex compiler class.  (c) 1996 Matt Phillips.  */#ifndef _ELEXCOMP_H#define _ELEXCOMP_H#include <std/string.h>#include <compiler/ErrorMessage.h>#include <util/checks.h>#include <regexp/RegexpCompiler.h>#include "ElexScanner.h"#include "ElexScannerDef.h"class ElexCompiler{public:     // constructor  ElexCompiler (BufferedInputStream &i, ostream &co = cout);  int nErrors () const {return errors.nErrors ();}  int nWarnings () const {return errors.nWarnings ();}     ErrorMessageList &getErrors () {return errors;}  ElexScannerDef &getScannerDef () {return scannerDef;}protected:  ostream &codeOut;  ErrorMessageList errors;  ElexScanner scanner;  ElexScannerDef scannerDef;  RegexpCompiler::Symbols symbols;  // errors  void error (const char *msg);  void warning (const char *msg);  // parser subs  void parseSymbols ();  void parseDefines ();  void parseDeclarations ();  Fsm *parseRegexp ();  void parseCodeFrags ();  void outputCodeFrag ();  void parseProduction ();  void parseRegexProduction (const string &prodName);  void parseProductions ();  void parseScannerDef ();  // error handling  int mustbe (int sym);  void mustbeError (int sym);  int have (int sym);};#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -