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

📄 dotout.cpp

📁 一个类似STL的自动机的源代码库
💻 CPP
字号:
#include <astl.h>
#include <stream.h>
#include <dot.h>
#include <iostream>
#include <string>

using namespace std;

#if defined(__GNUG__) && (__GNUG__ < 3)
#define CHAR_TRAITS string_char_traits
#else
#define CHAR_TRAITS char_traits
#endif

void usage(const string& exe)
{
  cerr << "Usage: " << exe << " [-s]" << endl;
  cerr << "      output a representation of the DFA read from stdin"
       << " suitable for dot" << endl; 
  cerr << "      -s\texpect string as the DFA alphabet" << endl;
  exit(1);
}

int main(int argc, const char** argv)
{
  if (argc > 2) usage(argv[0]);
  DFA_dot out(cout);
  if (argc == 2)
    if (string(argv[1]) == "-s") { // string mode ?
      clone_cursor<CHAR_TRAITS<string> > c(cin);
      dot(out, c);
    }
    else usage(argv[0]);
  else {  // normal, character mode
    clone_cursor<plain> c(cin);
    dot(out, c);
  }
  return 0;
}

⌨️ 快捷键说明

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