-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsnow.cpp
More file actions
executable file
·84 lines (73 loc) · 3 KB
/
snow.cpp
File metadata and controls
executable file
·84 lines (73 loc) · 3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#include <PNet.h>
#include <PNetIO.h>
#include <LineParser.h>
#include <iostream>
using namespace std;
void usage() {
cerr << "This tool computes static subclasses for GreatSpn. Input is a CAMI model file. Options :" << endl;
cerr<< " -m path : specifies the path to cami model " <<endl;
cerr<< " -p path : specifies the path to properties file" <<endl;
cerr<< " -d directory : specifies the directory in which to generate .def .net files (default \"./FK_MNGR\")" <<endl;
cerr<< " -f filter: specifies the transitions to parse in the properties file \n";
cerr<< " filter is a list of comma separated atomic property names" << endl;
cerr<< " -show : exports Cami model for viewing (non standalone mode)" <<endl;
cerr<< " -nodynamic : force to use only static subclasses in expression of initial marking (default is to use compute and use dynamic subclasses)"<<endl;
cerr<< " -v : verbose mode outputs debug model before and after for control" <<endl;
cerr<< " --help,-h : display this (very helpful) helping help text"<<endl;
cerr<< "Problems ? Comments ? contact Yann.Thierry-Mieg@lip6.fr " <<endl;
}
int main (int argc,char * argv[]) {
string pathcamiff;
string pathltlff;
string pathtobsff;
bool doshow= false;
bool doverbose= false;
bool doDynamicSS=true;
string dirgspn="./";
for (int i=1;i < argc; i++) {
if ( ! strcmp(argv[i],"-m") ) {
if (++i > argc)
{ cerr << "give argument value please after " << argv[i-1]<<endl; usage() ;FkExit(kFk_EndOnError);}
pathcamiff = argv[i];
dirgspn="./";
} else if (! strcmp(argv[i],"-p") ) {
if (++i > argc)
{ cerr << "give argument value please after " << argv[i-1]<<endl; usage() ; FkExit(kFk_EndOnError);}
pathtobsff = argv[i];
} else if (! strcmp(argv[i],"-f") ) {
if (++i > argc)
{ cerr << "give argument value please after " << argv[i-1]<<endl; usage() ; FkExit(kFk_EndOnError);}
char delim[2] ;
strcpy(delim,",");
set<string> s;
char * name;
name = strtok(argv[i],delim);
s.insert(name);
while ( (name = strtok(NULL,delim)) )
s.insert(name);
SetTobsFilter(s);
} else if (! strcmp(argv[i],"-show") ) {
doshow= true;
} else if (! strcmp(argv[i],"-nodynamic") ) {
doDynamicSS=false;
} else if (! strcmp(argv[i],"-v") ) {
doverbose= true;
} else if (! strcmp(argv[i],"--help") || ! strcmp(argv[i],"-h") ) {
usage(); exit(0);
} else if (! strcmp(argv[i],"-d") ) {
if (++i > argc)
{ cerr << "give argument value please after " << argv[i-1]<<endl; usage() ; FkExit(kFk_EndOnError);}
dirgspn = argv[i];
} else {
cerr << "Error : incorrect Argument : "<<argv[i] <<endl ; usage(); exit(0);
}
}
PNet * PN = parseCAMI (pathcamiff);
LoadCAMIAestetic(PN);
if (pathtobsff != "")
ParseTobs (pathtobsff,PN);
if (doverbose) cout << *PN;
PN->GenerateStaticSub (doDynamicSS) ;
if (doverbose) cout << *PN;
PN->ExportToGSPN(dirgspn);
}