~verifydtapn-contributers/verifydtapn/trunk

« back to all changes in this revision

Viewing changes to src/Core/ArgsParser.cpp

  • Committer: Jiri Srba
  • Date: 2017-09-18 13:43:37 UTC
  • mfrom: (334.1.8 verifydtapn)
  • Revision ID: srba.jiri@gmail.com-20170918134337-fi97wtwg1i1689kt
merged in branch lp:~verifydtapn-contributers/verifydtapn/win-compile 
allowing to cross compile to windows (min mac version is 10.9)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
#include <sstream>
4
4
#include "boost/algorithm/string.hpp"
5
5
#include "boost/lexical_cast.hpp"
6
 
#include "boost/make_shared.hpp"
7
6
#include <iomanip>
8
7
#include "boost/tokenizer.hpp"
9
8
 
135
134
    //       Each line in the description is assumed to fit within the remaining width
136
135
    //       of the console, so keep descriptions short, or implement manual word-wrapping :).
137
136
    parsers.push_back(
138
 
            boost::make_shared<SwitchWithArg > ("k", KBOUND_OPTION,
 
137
            new SwitchWithArg ("k", KBOUND_OPTION,
139
138
            "Max tokens to use during exploration.", 0));
140
139
    parsers.push_back(
141
 
            boost::make_shared<SwitchWithArg > ("o", SEARCH_OPTION,
 
140
            new SwitchWithArg ("o", SEARCH_OPTION,
142
141
            "Specify the desired search strategy.\n - 0: Breadth-First Search\n - 1: Depth-First Search\n - 2: Random Search\n - 3: Heuristic Search\n - 4: Default",
143
142
            4));
144
143
    parsers.push_back(
145
 
            boost::make_shared<SwitchWithArg > ("m", VERIFICATION_OPTION,
 
144
            new SwitchWithArg ("m", VERIFICATION_OPTION,
146
145
            "Specify the desired verification method.\n - 0: Default (discrete)\n - 1: Time Darts",
147
146
            0));
148
147
    parsers.push_back(
149
 
            boost::make_shared<SwitchWithArg > ("p", MEMORY_OPTIMIZATION_OPTION,
 
148
            new SwitchWithArg ("p", MEMORY_OPTIMIZATION_OPTION,
150
149
            "Specify the desired memory optimization.\n - 0: None \n - 1: PTrie",
151
150
            0)); 
152
151
    parsers.push_back(
153
 
            boost::make_shared<SwitchWithArg > ("t", TRACE_OPTION,
 
152
            new SwitchWithArg ("t", TRACE_OPTION,
154
153
            "Specify the desired trace option.\n - 0: none\n - 1: some\n - 2: fastest",
155
154
            0));
156
155
    parsers.push_back(
157
 
            boost::make_shared<Switch > ("d", KEEP_DEAD,
 
156
            new Switch ("d", KEEP_DEAD,
158
157
            "Do not discard dead tokens\n(used for boundedness checking)"));
159
158
    parsers.push_back(
160
 
            boost::make_shared<Switch > ("g", MAX_CONSTANT_OPTION,
 
159
            new Switch ("g", MAX_CONSTANT_OPTION,
161
160
            "Use global maximum constant for \nextrapolation (as opposed to local \nconstants)."));
162
161
    parsers.push_back(
163
 
            boost::make_shared<Switch > ("s", LEGACY,
 
162
            new Switch ("s", LEGACY,
164
163
            "Legacy option (no effect)."));
165
164
 
166
165
    parsers.push_back(
167
 
            boost::make_shared<Switch > ("x", XML_TRACE_OPTION,
 
166
            new Switch ("x", XML_TRACE_OPTION,
168
167
            "Output trace in xml format for TAPAAL."));
169
168
 
170
169
    parsers.push_back(
171
 
            boost::make_shared<Switch >("c", GCD,
 
170
            new Switch("c", GCD,
172
171
            "Enable lowering the guards by the greatest common divisor"));
173
172
    
174
173
    parsers.push_back(
175
 
            boost::make_shared<SwitchWithArg > ("w", WORKFLOW,
 
174
            new SwitchWithArg ("w", WORKFLOW,
176
175
            "Workflow mode.\n - 0: Disabled\n - 1: Soundness (and min)\n - 2: Strong Soundness (and max)",
177
176
            0));
178
177
    parsers.push_back(
179
 
            boost::make_shared<SwitchWithArg > ("b", STRONG_WORKFLOW_BOUND,
 
178
            new SwitchWithArg ("b", STRONG_WORKFLOW_BOUND,
180
179
            "Maximum delay bound for strong workflow analysis",
181
180
            0));
182
181
    parsers.push_back(
183
 
            boost::make_shared<Switch> ("n", CALCULATE_CMAX,
 
182
            new Switch ("n", CALCULATE_CMAX,
184
183
            "Calculate the place bounds"));
185
184
 
186
185
    };
194
193
                        << "Displays this help message." << std::endl;
195
194
        std::cout << std::setw(WIDTH) << std::left << "-v [ --version ]"
196
195
                        << "Displays version information." << std::endl;
197
 
        for (parser_vec::const_iterator arg = parsers.begin(); arg != parsers.end();
198
 
                        arg++) {
199
 
                std::cout << **arg;
 
196
        for (auto& p : parsers) {
 
197
                std::cout << *p;
200
198
        }
201
199
}
202
200
;