codefrags.h

来自「用于词法分析的词法分析器」· C头文件 代码 · 共 59 行

H
59
字号
/*  $Id: CodeFrags.h,v 1.2 1996/07/27 07:26:28 matt Exp $  Code frags handler class.  (c) Matt Phillips 1996.  */#ifndef _CODE_FRAGS#define _CODE_FRAGS#include <istream.h>#include <std/string.h>// code frags example:////  *//  cpp//  > a c++ code frag//  > a c++ code frag//  ada//  > an ada code frag//  *//  c//  > a c code fragclass CodeFrags{public:  // an object reading from <i> looking for fragments of language <l>.  CodeFrags (istream &i, const string &l) :    input (i), lang (l) {atFrag = 0;}  // jump to next code fragment (if any).  int nextFrag ();    // true if the previous nextFrag () found a code fragment.  int hasFrag () const {return atFrag;}    // output a fragment found by nextFrag () to <output>.  does nothing  // if no fragment was found.  void outputFrag (ostream &output);  // true if the code frags file has been fully processed.  int eof () const {return input.eof ();}protected:  istream &input;  const string lang;  string line;  int atFrag;  void nextSection ();};#endif

⌨️ 快捷键说明

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