mtc2dot.cpp
Go to the documentation of this file.
1 /** gen2dot.cpp Utility to convert gen files to dot files */
2 
3 /* FAU Discrete Event Systems Library (libfaudes)
4 
5  Copyright (C) 2006 Bernd Opitz
6  Exclusive copyright is granted to Klaus Schmidt
7 
8  This library is free software; you can redistribute it and/or
9  modify it under the terms of the GNU Lesser General Public
10  License as published by the Free Software Foundation; either
11  version 2.1 of the License, or (at your option) any later version.
12 
13  This library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Lesser General Public License for more details.
17 
18  You should have received a copy of the GNU Lesser General Public
19  License along with this library; if not, write to the Free Software
20  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
21 
22 
23 #include "libfaudes.h"
24 #include <iostream>
25 
26 using namespace faudes;
27 
28 int main(int argc, char *argv[]) {
29  if (argc != 2) {
30  std::cerr << "usage: mtc_gen2dot <generator>" << std::endl;
31  exit(1);
32  }
33 
34  // read gen file
35  MtcSystem g(argv[1]);
36 
37  // fix output file name
38  std::string basename = argv[1];
39  if (basename.rfind(".gen") < basename.size()) {
40  basename.resize(basename.rfind(".gen"));
41  }
42  std::string dotfilename = basename+".dot";
43 
44  // write dot file
45  g.DotWrite(dotfilename);
46 
47  return 0;
48 }
Allows to create colored marking generators (CMGs) as the common five tupel consisting of alphabet,...
Definition: mtc_generator.h:53
virtual void DotWrite(const std::string &rFileName) const
Writes generator to dot input format.
Includes all libFAUDES headers, incl plugings
int main(int argc, char *argv[])
Definition: mtc2dot.cpp:28
libFAUDES resides within the namespace faudes.

libFAUDES 2.32b --- 2024.03.01 --- c++ api documentaion by doxygen