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

📄 build.cpp

📁 一个类似STL的自动机的源代码库
💻 CPP
字号:
#include <astl.h>#include <dfa.h>#include <build.h>#include <stream.h>#include <cursor.h>#include <ccopy.h>#include <tools.h>#include <iostream>using namespace std;template <typename DFA>void run(DFA& dfa, bool verbose, bool state_mark){  dfa.initial(build(dfa, cin));  if (verbose)     cerr << "DFA built has " << dfa.state_count() << " states and "	 << dfa.trans_count() << " transitions" << endl;  DFA_stream out(cout);  if (state_mark)    clone(out, dfirst_markc(dfa));  else    clone(out, dfirstc(dfa));}int main(int argc, char** argv){  config c(argc, argv, 1, "all");  if (c.representation == "matrix") {    DFA_matrix<> dfa;    run(dfa, c.verbose_mode, c.state_mark);  }  if (c.representation == "map") {    DFA_map<> dfa;    run(dfa, c.verbose_mode, c.state_mark);  }  if (c.representation == "bin") {    DFA_bin<> dfa;    run(dfa, c.verbose_mode, c.state_mark);  }  if (c.representation == "mtf") {    DFA_mtf<> dfa;    run(dfa, c.verbose_mode, c.state_mark);  }  if (c.representation == "tr") {    DFA_tr<> dfa;    run(dfa, c.verbose_mode, c.state_mark);  }  return 0;}  

⌨️ 快捷键说明

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