亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? cppcodegenerator.cpp

?? 用于詞法分析的詞法分析器
?? CPP
字號:
/*  $Id: CppCodeGenerator.cpp,v 1.15 1997/02/22 09:00:23 matt Exp $  C++ code generator class.  (c) Matt Phillips 1996.  */#include "CppCodeGenerator.h"CppCodeGenerator::CppCodeGenerator (const FooObject &s,				    istream &cf, ostream &h,				    ostream &b) :  scandef (s), codefrags (cf, "cpp"), header (h), body (b), errors (0),  errorProduction ("ElexState::DefaultErrorProduction"){  doHeader ();  doBody ();}// output chr as 'c' is ASCII or as a number if not.void CppCodeGenerator::doOutputChar (unsigned char chr){  if (chr < 32 || chr > 127)    body << (unsigned)chr;  else if (chr == '\\')    body << "'\\\\'";  else    body << '\'' << (char)chr << '\'';}void CppCodeGenerator::doHeader (){  // includes  header << "#include <cppscan/ElexScanner.h>\n\n";  // do header includes  codefrags.nextFrag ();  if (codefrags.hasFrag ())  {    codefrags.outputFrag (header);    header << endl;  }  // class  header << "class " << scandef.getAttrString ("name") << " : public ";  // base class  if (scandef.hasAttr ("base"))    header << scandef.getAttrString ("base") << endl;  else    header << "ElexScanner\n";  header << "{\npublic:\n\n";  doTokenSymbols ();  doProdSymbols ();  // constructor  header << "  " << scandef.getAttrString ("name") <<    " (XInputStream &i);\n\n";  header << "  virtual int invokeProduction (int prod);\n\n";  doProdDecls ();  header << "};\n";}// do the enum declarations for productionsvoid CppCodeGenerator::doProdSymbols (){  const FooObject::Objects &productions =    scandef.getAttrs ("productions");  if (productions.nItems () > 0)  {    header << "  enum {";    for (FooObject::Objects::Iterator p (productions); p; )    {      header << "Prod" << p.ref ().getAttr ();      p++;      if (p) header << ", ";    }    header << "};\n\n";  }}// do the enum declarations for token symbolsvoid CppCodeGenerator::doTokenSymbols (){  const FooObject::Objects &tokens = scandef.getAttrs ("tokens");  if (tokens.nItems () > 0)  {    header << "  enum {";    for (FooObject::Objects::Iterator i (tokens); i; )    {      header << i.ref ().getAttr ();      i++;      if (i)	header << ", ";    }    header << "};\n\n";  }}// do the production member function declarationsvoid CppCodeGenerator::doProdDecls (){  const FooObject::Objects &productions =    scandef.getAttrs ("productions");  for (FooObject::Objects::Iterator p (productions); p; p++)  {    header << "  int prod" << p.ref ().getAttr () << " ();\n";  }}void CppCodeGenerator::doBody (){  const string &scannerName = scandef.getAttrString ("name");  body << "static ElexState states [];\n\n";  body << "//////////////////// Edges ////////////////////\n\n";  doEdgeLists ();  body << "//////////////////// States ////////////////////\n\n";  doStates ();  body << "\n////////////////// Productions /////////////////\n\n";  body << "typedef int (" << scannerName << "::*ProdFunc) ();\n\n";  doProdFuncsTable (scannerName);  body << "int " << scannerName << "::invokeProduction (int prod)\n";  body << "{\n  return (this->*(funcs [prod])) ();\n}\n\n";  doProdBodies (scannerName);  body << "////////////////// Constructor /////////////////\n\n";  body << "static ElexScannerData scannerData = {states, " << errorProduction << "};\n\n";  body << scannerName << "::" << scannerName <<    " (XInputStream &i) :\n";  body << "  ElexScanner (scannerData, i) {}\n\n";}// do the edge list definitions for all statesvoid CppCodeGenerator::doEdgeLists (){  const FooObject::Objects &states = scandef.getAttrs ("states");  for (FooObject::Objects::Iterator s (states); s; s++)  {    const string &stateNo = s.ref ().getAttrString ("state");    const FooObject::Objects &edges = s.ref ().getAttrs ("edges");        // output any edges for this state    if (edges.nItems () > 0)    {      body << "static ElexEdge state" << stateNo << "_edgelist [] =\n{\n";            doEdgeList (edges, stateNo);            body << "};\n";            body << "static ElexEdges state" << stateNo <<	"_edges = {state" << stateNo << "_edgelist, " <<	edges.nItems () << "};\n\n";    }  }}// do <edges> for state <stateNo>void CppCodeGenerator::doEdgeList (const FooObject::Objects &edges,				   const string &stateNo){  for (FooObject::Objects::Iterator e (edges); e; )  {    const FooObject &edge = e.ref ();    const string &range = edge.getAttrString ("range");        body << "  {";    doOutputChar (range [0]);    body << ", ";        // if range is of form 'l-u', then output upper, otherwise    // output the lower again    doOutputChar (range.length () > 1 ? range [2] : range [0]);    body << ", states + " << edge.getAttrString ("target") << "}";        e++;    if (e)      body << ",\n";    else      body << endl;  }}// do the states tablevoid CppCodeGenerator::doStates (){  body << "static ElexState states [] =\n{\n";    const string &scannerName = scandef.getAttrString ("name");  const FooObject::Objects &states = scandef.getAttrs ("states");  for (FooObject::Objects::Iterator s (states); s; )  {    const FooObject &state = s.ref ();    const string &stateNo = state.getAttrString ("state");    const string &prodName = state.getAttrString ("production");    const FooObject::Objects &edges = state.getAttrs ("edges");    if (state.hasAttr ("edges"))      body << "  {&state" << stateNo << "_edges, ";    else      body << "  {0, ";    if (prodName.length () > 0)      body << scannerName << "::Prod" << prodName;    else      body << "ElexState::NoProduction";    body << "}";    s++;    if (s)      body << ",\n";    else      body << endl;  }  body << "};\n";}// do the production member functions table: maps production number to// member function.  also looks for the error production, and sets// errorProduction if found.void CppCodeGenerator::doProdFuncsTable (const string &scannerName){  const FooObject::Objects &productions =    scandef.getAttrs ("productions");  body << "static ProdFunc funcs [] =\n{\n";  int first = 1;  for (FooObject::Objects::Iterator p (productions); p; )  {    const string &prodName = p.ref ().getAttr ();    body << "  " << scannerName << "::prod" << prodName;    if (prodName == "error")      errorProduction = scannerName + "::Prod" + prodName;    p++;    if (p)      body << ",\n";    else      body << endl;  }    body << "};\n\n";}// inserts the production bodies from the code fragsvoid CppCodeGenerator::doProdBodies (const string &scannerName){  const FooObject::Objects &productions =    scandef.getAttrs ("productions");  for (FooObject::Objects::Iterator p (productions); p; p++)  {    body << "int " << scannerName << "::prod" << p.ref ().getAttr () <<      " ()\n{\n";    codefrags.nextFrag ();    if (codefrags.hasFrag ())      codefrags.outputFrag (body);    else    {      cerr << "warning: no code for production " <<	p.ref ().getAttr () << endl;      body << "// *** Missing code fragment\n";    }    body << "}\n\n";  }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产日韩高清在线| 日本网站在线观看一区二区三区 | 99国产精品国产精品毛片| 成人国产精品免费网站| 欧美视频中文一区二区三区在线观看| 欧美日韩在线三级| 久久婷婷久久一区二区三区| 久久久久9999亚洲精品| 亚洲精品久久久久久国产精华液| 日韩精品电影在线| 成人精品高清在线| 欧美一二三四在线| 成人免费一区二区三区在线观看| 一区二区三区国产精品| 精品一区二区久久| 欧美少妇bbb| 亚洲国产精品成人综合| 五月天一区二区| 波多野结衣亚洲一区| 欧美性一二三区| 国产精品视频麻豆| 久久99深爱久久99精品| 色婷婷久久综合| 中文字幕成人在线观看| 美日韩黄色大片| gogo大胆日本视频一区| 欧美日韩国产精品成人| 日韩一区中文字幕| 国产精品99久久久久久似苏梦涵| 91精品在线麻豆| 欧美精品一区二区三区蜜桃视频 | 日韩一级大片在线| 香蕉影视欧美成人| 91麻豆swag| 国产日韩高清在线| 国产剧情av麻豆香蕉精品| 一本一道波多野结衣一区二区| www欧美成人18+| 日韩在线观看一区二区| 欧美性色aⅴ视频一区日韩精品| 国产精品家庭影院| 精品在线免费视频| 在线综合亚洲欧美在线视频| 亚洲小少妇裸体bbw| 一本色道**综合亚洲精品蜜桃冫| 国产欧美一二三区| 激情丁香综合五月| 欧美zozozo| 青青草国产精品97视觉盛宴| 欧美性大战久久久久久久蜜臀| 国产精品第五页| 粉嫩久久99精品久久久久久夜| 久久久久亚洲综合| 极品美女销魂一区二区三区| 欧美v日韩v国产v| 黄页网站大全一区二区| 日韩情涩欧美日韩视频| 久久狠狠亚洲综合| 在线综合视频播放| 久久av资源网| 久久久久久久久伊人| 粉嫩一区二区三区性色av| 国产精品美女久久久久久久久 | 日韩欧美一级精品久久| 免费人成网站在线观看欧美高清| 日韩一区二区视频在线观看| 久久综合综合久久综合| 久久久久久久综合狠狠综合| 成人免费观看视频| 亚洲一区二区视频在线| 欧美乱熟臀69xxxxxx| 蜜臀va亚洲va欧美va天堂| 欧美成人艳星乳罩| 风流少妇一区二区| 洋洋成人永久网站入口| 欧美精品乱人伦久久久久久| 国内精品嫩模私拍在线| 国产视频一区在线播放| 色国产精品一区在线观看| 日韩av中文字幕一区二区三区| 久久一留热品黄| 成人深夜视频在线观看| 一区二区视频在线| 亚洲精品在线网站| caoporn国产精品| 午夜伊人狠狠久久| 国产日产欧美精品一区二区三区| av一区二区不卡| 亚洲一区在线免费观看| 精品国产污污免费网站入口 | 三级精品在线观看| 久久只精品国产| 色婷婷亚洲综合| 国产一区二区三区免费播放 | 久久 天天综合| 亚洲精品乱码久久久久久久久 | 精品国产免费一区二区三区香蕉| 成人av集中营| 韩国中文字幕2020精品| 亚洲一区中文在线| 中文字幕精品在线不卡| 337p亚洲精品色噜噜噜| 不卡的av电影| 国产一区91精品张津瑜| 美女视频黄免费的久久| 日本免费在线视频不卡一不卡二| 亚洲国产精品视频| 亚洲网友自拍偷拍| 亚洲第一福利视频在线| 一区二区三区精品视频| 亚洲一级片在线观看| 亚洲在线中文字幕| 亚洲成人综合视频| 视频一区在线播放| 蜜臀av一区二区在线免费观看| 青草av.久久免费一区| 热久久久久久久| 精品一区二区三区在线视频| 韩国视频一区二区| 国产成人三级在线观看| 懂色av一区二区三区蜜臀| 成人免费视频一区二区| 99久久精品国产一区二区三区| 99精品国产一区二区三区不卡| 99久久99久久综合| 欧美日韩亚洲综合一区| 欧美电影在线免费观看| 日韩欧美在线观看一区二区三区| 日韩情涩欧美日韩视频| 欧美国产综合一区二区| 一区二区三区国产豹纹内裤在线| 一区二区三区.www| 美女脱光内衣内裤视频久久网站| 激情文学综合插| 国产大陆精品国产| 在线亚洲欧美专区二区| 欧美日韩高清一区二区不卡| 精品成人一区二区三区四区| 中文字幕高清一区| 欧美mv和日韩mv国产网站| 国产欧美日韩麻豆91| 亚洲永久精品大片| 日韩和欧美的一区| 成人性生交大片免费看中文网站| 日本丶国产丶欧美色综合| 91精品国产入口在线| 中文一区二区完整视频在线观看| 樱桃国产成人精品视频| 黑人精品欧美一区二区蜜桃| 91日韩精品一区| 日韩午夜精品电影| 日韩美女精品在线| 麻豆精品一区二区av白丝在线| 懂色av一区二区三区免费观看 | 91在线免费视频观看| 欧美日韩国产成人在线91| 国产人成一区二区三区影院| 亚洲综合小说图片| 国产精品影视网| 欧美日韩一区二区不卡| 欧美激情中文字幕| 免费人成在线不卡| 91福利资源站| 欧美激情一区二区三区不卡| 日韩电影在线一区二区| 91美女片黄在线观看| 久久日韩粉嫩一区二区三区| 亚洲成精国产精品女| 成人永久免费视频| 日韩欧美国产系列| 一区二区三区日韩精品视频| 国产精品1区2区3区在线观看| 欧美精品丝袜久久久中文字幕| 欧美激情在线看| 激情文学综合插| 欧美一区二区三区色| 亚洲电影视频在线| 一本久久综合亚洲鲁鲁五月天| 亚洲精品一区二区三区99| 日韩精品一卡二卡三卡四卡无卡| 91亚洲精品久久久蜜桃| 国产欧美视频一区二区| 久久丁香综合五月国产三级网站| 欧美日韩精品一区二区三区四区 | 国产日韩一级二级三级| 蜜桃视频一区二区三区| 欧美日韩国产乱码电影| 亚洲自拍偷拍综合| 在线观看视频一区二区欧美日韩| 中文字幕日韩av资源站| 成人av片在线观看| 中文字幕中文在线不卡住| 处破女av一区二区| 国产精品美女久久久久久| 国产精品综合av一区二区国产馆| 欧美一区二区三区男人的天堂| 视频一区在线播放| 91麻豆精品国产综合久久久久久| 亚洲高清视频在线| 欧美日韩国产小视频|