Commit 86584418 authored by Alexandre Duret-Lutz's avatar Alexandre Duret-Lutz

bin: use enums instead of #define for option codes

* src/bin/autfilt.cc, src/bin/common_aoutput.cc,
src/bin/common_finput.cc, src/bin/common_output.cc,
src/bin/common_post.cc, src/bin/common_setup.cc,
src/bin/common_trans.cc, src/bin/dstar2tgba.cc, src/bin/genltl.cc,
src/bin/ltl2tgba.cc, src/bin/ltl2tgta.cc, src/bin/ltlcross.cc,
src/bin/ltlfilt.cc, src/bin/ltlgrind.cc, src/bin/randaut.cc,
src/bin/randltl.cc: Here.
parent a530498f
......@@ -60,31 +60,33 @@ Exit status:\n\
1 if no automata were output (no match)\n\
2 if any error has been reported";
#define OPT_TGBA 1
#define OPT_RANDOMIZE 2
#define OPT_SEED 3
#define OPT_PRODUCT 4
#define OPT_MERGE 5
#define OPT_ARE_ISOMORPHIC 6
#define OPT_IS_COMPLETE 7
#define OPT_IS_DETERMINISTIC 8
#define OPT_STATES 9
#define OPT_COUNT 10
#define OPT_EDGES 11
#define OPT_ACC_SETS 12
#define OPT_DESTUT 13
#define OPT_INSTUT 14
#define OPT_IS_EMPTY 15
#define OPT_INTERSECT 16
#define OPT_MASK_ACC 17
#define OPT_SBACC 18
#define OPT_STRIPACC 19
#define OPT_KEEP_STATES 20
#define OPT_DNF_ACC 21
#define OPT_REM_FIN 22
#define OPT_CLEAN_ACC 23
#define OPT_COMPLEMENT_ACC 24
// Keep this list sorted
enum {
OPT_ACC_SETS = 256,
OPT_ARE_ISOMORPHIC,
OPT_CLEAN_ACC,
OPT_COMPLEMENT_ACC,
OPT_COUNT,
OPT_DESTUT,
OPT_DNF_ACC,
OPT_EDGES,
OPT_INSTUT,
OPT_INTERSECT,
OPT_IS_COMPLETE,
OPT_IS_DETERMINISTIC,
OPT_IS_EMPTY,
OPT_KEEP_STATES,
OPT_MASK_ACC,
OPT_MERGE,
OPT_PRODUCT,
OPT_RANDOMIZE,
OPT_REM_FIN,
OPT_SBACC,
OPT_SEED,
OPT_STATES,
OPT_STRIPACC,
OPT_TGBA,
};
static const argp_option options[] =
{
......
......@@ -40,10 +40,12 @@ const char* opt_name = nullptr;
static const char* opt_output = nullptr;
static const char* stats = "";
#define OPT_DOT 1
#define OPT_LBTT 2
#define OPT_STATS 3
#define OPT_NAME 4
enum {
OPT_DOT = 1,
OPT_LBTT,
OPT_NAME,
OPT_STATS,
};
static const argp_option options[] =
{
......
// -*- coding: utf-8 -*-
// Copyright (C) 2012, 2013, 2014 Laboratoire de Recherche et
// Copyright (C) 2012, 2013, 2014, 2015 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
......@@ -24,8 +24,10 @@
#include <fstream>
#include <cstring>
#define OPT_LBT 1
#define OPT_LENIENT 2
enum {
OPT_LBT = 1,
OPT_LENIENT,
};
jobs_t jobs;
bool lbt_input = false;
......
......@@ -28,11 +28,13 @@
#include "common_cout.hh"
#include "error.h"
#define OPT_SPOT 1
#define OPT_WRING 2
#define OPT_LATEX 3
#define OPT_FORMAT 4
#define OPT_CSV 5
enum {
OPT_CSV = 1,
OPT_FORMAT,
OPT_LATEX,
OPT_SPOT,
OPT_WRING,
};
output_format_t output_format = spot_output;
bool full_parenth = false;
......
// -*- coding: utf-8 -*-
// Copyright (C) 2012, 2013, 2014 Laboratoire de Recherche et
// Copyright (C) 2012, 2013, 2014, 2015 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
......@@ -26,10 +26,12 @@ spot::postprocessor::output_pref pref = spot::postprocessor::Small;
spot::postprocessor::output_pref comp = spot::postprocessor::Any;
spot::postprocessor::optimization_level level = spot::postprocessor::High;
#define OPT_SMALL 1
#define OPT_LOW 2
#define OPT_MEDIUM 3
#define OPT_HIGH 4
enum {
OPT_HIGH = 1,
OPT_LOW,
OPT_MEDIUM,
OPT_SMALL,
};
static const argp_option options[] =
{
......
......@@ -57,9 +57,12 @@ setup(char** argv)
// I mean, come on, why not also add -* to Darwinise more shell users?
// We disable this option as well as -V (because --version don't need
// a short version).
#define OPT_VERSION 1
#define OPT_HELP 2
#define OPT_USAGE 3
enum {
OPT_HELP = 1,
OPT_USAGE,
OPT_VERSION,
};
static const argp_option options[] =
{
{ "version", OPT_VERSION, 0, 0, "print program version", -1 },
......
......@@ -383,7 +383,9 @@ exec_with_timeout(const char* cmd)
}
#endif // ENABLE_TIMEOUT
#define OPT_LIST 1
enum {
OPT_LIST = 1,
};
static const argp_option options[] =
{
/**************************************************/
......
......@@ -50,11 +50,13 @@ Transition-based Generalized Büchi Automata in GraphViz's format by default.\n\
If multiple files are supplied (one automaton per file), several automata\n\
will be output.";
#define OPT_TGBA 1
#define OPT_DOT 2
#define OPT_LBTT 3
#define OPT_STATS 4
#define OPT_NAME 5
enum {
OPT_DOT = 1,
OPT_LBTT,
OPT_NAME,
OPT_STATS,
OPT_TGBA,
};
static const argp_option options[] =
{
......
// -*- coding: utf-8 -*-
// Copyright (C) 2012, 2013 Laboratoire de Recherche et Développement
// Copyright (C) 2012, 2013, 2015 Laboratoire de Recherche et Développement
// de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
......@@ -96,27 +96,29 @@ using namespace spot::ltl;
const char argp_program_doc[] ="\
Generate temporal logic formulas from predefined scalable patterns.";
#define OPT_AND_F 1
#define OPT_AND_FG 2
#define OPT_AND_GF 3
#define OPT_CCJ_ALPHA 4
#define OPT_CCJ_BETA 5
#define OPT_CCJ_BETA_PRIME 6
#define OPT_GH_Q 7
#define OPT_GH_R 8
#define OPT_GO_THETA 9
#define OPT_OR_FG 10
#define OPT_OR_G 11
#define OPT_OR_GF 12
#define OPT_R_LEFT 13
#define OPT_R_RIGHT 14
#define OPT_RV_COUNTER 15
#define OPT_RV_COUNTER_CARRY 16
#define OPT_RV_COUNTER_CARRY_LINEAR 17
#define OPT_RV_COUNTER_LINEAR 18
#define OPT_U_LEFT 19
#define OPT_U_RIGHT 20
#define LAST_CLASS 20
enum {
OPT_AND_F = 1,
OPT_AND_FG,
OPT_AND_GF,
OPT_CCJ_ALPHA,
OPT_CCJ_BETA,
OPT_CCJ_BETA_PRIME,
OPT_GH_Q,
OPT_GH_R,
OPT_GO_THETA,
OPT_OR_FG,
OPT_OR_G,
OPT_OR_GF,
OPT_R_LEFT,
OPT_R_RIGHT,
OPT_RV_COUNTER,
OPT_RV_COUNTER_CARRY,
OPT_RV_COUNTER_CARRY_LINEAR,
OPT_RV_COUNTER_LINEAR,
OPT_U_LEFT,
OPT_U_RIGHT,
LAST_CLASS,
};
const char* const class_name[LAST_CLASS] =
{
......
......@@ -46,7 +46,10 @@ the smallest Transition-based Generalized Büchi Automata, \
in GraphViz's format.\n\
If multiple formulas are supplied, several automata will be output.";
#define OPT_TGBA 1
enum {
OPT_TGBA = 1,
};
static const argp_option options[] =
{
......
// -*- coding: utf-8 -*-
// Copyright (C) 2012, 2013, 2014 Laboratoire de Recherche et
// Copyright (C) 2012, 2013, 2014, 2015 Laboratoire de Recherche et
// Développement de l'Epita (LRDE).
//
// This file is part of Spot, a model checking library.
......@@ -52,12 +52,14 @@ the smallest Transition-based Generalized Büchi Automata, \
in GraphViz's format. The input formula is assumed to be \
stuttering-insensitive.";
#define OPT_TGTA 1
#define OPT_TA 2
#define OPT_GTA 3
#define OPT_SPLV 4
#define OPT_SPNO 5
#define OPT_INIT 6
enum {
OPT_GTA = 1,
OPT_INIT,
OPT_SPLV,
OPT_SPNO,
OPT_TA,
OPT_TGTA,
};
static const argp_option options[] =
{
......
......@@ -76,23 +76,24 @@ Exit status:\n\
2 ltlcross aborted on error\n\
";
#define OPT_STATES 1
#define OPT_DENSITY 2
#define OPT_JSON 3
#define OPT_CSV 4
#define OPT_DUPS 5
#define OPT_NOCHECKS 6
#define OPT_STOP_ERR 7
#define OPT_SEED 8
#define OPT_PRODUCTS 9
#define OPT_COLOR 10
#define OPT_NOCOMP 11
#define OPT_OMIT 12
#define OPT_BOGUS 13
#define OPT_VERBOSE 14
#define OPT_GRIND 15
#define OPT_IGNORE_EXEC_FAIL 16
enum {
OPT_BOGUS = 256,
OPT_COLOR,
OPT_CSV,
OPT_DENSITY,
OPT_DUPS,
OPT_GRIND,
OPT_IGNORE_EXEC_FAIL,
OPT_JSON,
OPT_NOCHECKS,
OPT_NOCOMP,
OPT_OMIT,
OPT_PRODUCTS,
OPT_SEED,
OPT_STATES,
OPT_STOP_ERR,
OPT_VERBOSE,
};
static const argp_option options[] =
{
......
......@@ -55,38 +55,40 @@ Exit status:\n\
1 if no formulas were output (no match)\n\
2 if any error has been reported";
#define OPT_SKIP_ERRORS 1
#define OPT_DROP_ERRORS 2
#define OPT_NNF 3
#define OPT_LTL 4
#define OPT_SYNTACTIC_SI 5
#define OPT_BOOLEAN 6
#define OPT_EVENTUAL 7
#define OPT_UNIVERSAL 8
#define OPT_SYNTACTIC_SAFETY 9
#define OPT_SYNTACTIC_GUARANTEE 10
#define OPT_SYNTACTIC_OBLIGATION 11
#define OPT_SYNTACTIC_RECURRENCE 12
#define OPT_SYNTACTIC_PERSISTENCE 13
#define OPT_SAFETY 14
#define OPT_GUARANTEE 15
#define OPT_OBLIGATION 16
#define OPT_SIZE_MIN 17
#define OPT_SIZE_MAX 18
#define OPT_BSIZE_MIN 19
#define OPT_BSIZE_MAX 20
#define OPT_IMPLIED_BY 21
#define OPT_IMPLY 22
#define OPT_EQUIVALENT_TO 23
#define OPT_RELABEL 24
#define OPT_RELABEL_BOOL 25
#define OPT_REMOVE_WM 26
#define OPT_BOOLEAN_TO_ISOP 27
#define OPT_REMOVE_X 28
#define OPT_STUTTER_INSENSITIVE 29
#define OPT_AP_N 30
#define OPT_IGNORE_ERRORS 31
#define OPT_NEGATE 256
enum {
OPT_AP_N = 1,
OPT_BOOLEAN,
OPT_BOOLEAN_TO_ISOP,
OPT_BSIZE_MAX,
OPT_BSIZE_MIN,
OPT_DROP_ERRORS,
OPT_EQUIVALENT_TO,
OPT_EVENTUAL,
OPT_GUARANTEE,
OPT_IGNORE_ERRORS,
OPT_IMPLIED_BY,
OPT_IMPLY,
OPT_LTL,
OPT_NEGATE,
OPT_NNF,
OPT_OBLIGATION,
OPT_RELABEL,
OPT_RELABEL_BOOL,
OPT_REMOVE_WM,
OPT_REMOVE_X,
OPT_SAFETY,
OPT_SIZE_MAX,
OPT_SIZE_MIN,
OPT_SKIP_ERRORS,
OPT_STUTTER_INSENSITIVE,
OPT_SYNTACTIC_GUARANTEE,
OPT_SYNTACTIC_OBLIGATION,
OPT_SYNTACTIC_PERSISTENCE,
OPT_SYNTACTIC_RECURRENCE,
OPT_SYNTACTIC_SAFETY,
OPT_SYNTACTIC_SI,
OPT_UNIVERSAL,
};
static const argp_option options[] =
{
......
......@@ -33,14 +33,16 @@
#include "ltlvisit/length.hh"
#include "ltlvisit/mutation.hh"
#define OPT_AP2CONST 1
#define OPT_SIMPLIFY_BOUNDS 2
#define OPT_REMOVE_MULTOP_OPERANDS 3
#define OPT_REMOVE_OPS 4
#define OPT_SPLIT_OPS 5
#define OPT_REWRITE_OPS 6
#define OPT_REMOVE_ONE_AP 7
#define OPT_SORT 8
enum {
OPT_AP2CONST = 1,
OPT_SIMPLIFY_BOUNDS,
OPT_REMOVE_MULTOP_OPERANDS,
OPT_REMOVE_OPS,
OPT_SPLIT_OPS,
OPT_REWRITE_OPS,
OPT_REMOVE_ONE_AP,
OPT_SORT,
};
static unsigned mutation_nb = 1;
static unsigned max_output = -1U;
......
......@@ -61,8 +61,10 @@ states, 1 to 3 acceptance sets, and three atomic propositions:\n\
% randaut -n 3 --hoa -S5..10 -A1..3 3\n\
";
#define OPT_SEED 1
#define OPT_STATE_ACC 2
enum {
OPT_SEED = 1,
OPT_STATE_ACC,
};
static const argp_option options[] =
{
......
......@@ -63,15 +63,17 @@ of X to occur by 10.\n\
% randltl --ltl-priorities='xor=0, implies=0, equiv=0, X=10' -n10 a b c\n\
";
#define OPT_DUMP_PRIORITIES 1
#define OPT_LTL_PRIORITIES 2
#define OPT_SERE_PRIORITIES 3
#define OPT_PSL_PRIORITIES 4
#define OPT_BOOLEAN_PRIORITIES 5
#define OPT_SEED 6
#define OPT_TREE_SIZE 7
#define OPT_WF 8
#define OPT_DUPS 9
enum {
OPT_BOOLEAN_PRIORITIES = 1,
OPT_DUMP_PRIORITIES,
OPT_DUPS,
OPT_LTL_PRIORITIES,
OPT_PSL_PRIORITIES,
OPT_SEED,
OPT_SERE_PRIORITIES,
OPT_TREE_SIZE,
OPT_WF,
};
static const argp_option options[] =
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment