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

📄 codefrags.cpp

📁 用于词法分析的词法分析器
💻 CPP
字号:
/*  $Id: CodeFrags.cpp,v 1.4 1997/02/02 01:31:02 matt Exp $  Code frags handler class.  (c) Matt Phillips 1996.  */#include <ctype.h>#include "CodeFrags.h"static const string sectionSep ("*");int CodeFrags::nextFrag (){  nextSection ();    atFrag = 0;			// pessimistic!  // look for language  while (!input.eof () && line.length () != 0 && line != lang)  {    if (line == sectionSep)      return 0;    getline (input, line);  }  atFrag = !input.eof ();  getline (input, line);  return atFrag;}void CodeFrags::nextSection (){  while (line != sectionSep && !input.eof ())  {    getline (input, line);  };  getline (input, line);}void CodeFrags::outputFrag (ostream &output){  if (hasFrag)  {    while (line [0] == '>' && !input.eof ())    {      if (line.length () > 1)	output << line.substr (1, line.length () - 1) << endl;      else	output << endl;      getline (input, line);     }  }  atFrag = 0;}

⌨️ 快捷键说明

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