cprover
Toggle main menu visibility
Loading...
Searching...
No Matches
crangler_parse_options.cpp
Go to the documentation of this file.
1
/*******************************************************************\
2
3
Module: CRANGLER Command Line Option Processing
4
5
Author: Daniel Kroening, dkr@amazon.com
6
7
\*******************************************************************/
8
11
12
#include "
crangler_parse_options.h
"
13
14
#include <
util/cout_message.h
>
15
#include <
util/exit_codes.h
>
16
#include <
util/help_formatter.h
>
17
#include <
util/version.h
>
18
19
#include <
json/json_parser.h
>
20
21
#include "
c_wrangler.h
"
22
23
#include <iostream>
24
25
int
crangler_parse_optionst::doit
()
26
{
27
if
(
cmdline
.args.empty())
28
{
29
std::cerr <<
"please give a configuration file\n"
;
30
return
CPROVER_EXIT_INCORRECT_TASK
;
31
}
32
33
for
(
const
auto
&file_name :
cmdline
.args)
34
process_crangler_json
(file_name);
35
36
return
0;
37
}
38
39
void
crangler_parse_optionst::process_crangler_json
(
40
const
std::string &file_name)
41
{
42
console_message_handlert
message_handler;
43
jsont
configuration;
44
45
if
(
parse_json
(file_name, message_handler, configuration))
46
return
;
47
48
c_wrangler
(configuration);
49
}
50
51
void
crangler_parse_optionst::help
()
52
{
53
std::cout <<
'\n'
<<
banner_string
(
"CRANGLER"
,
CBMC_VERSION
) <<
'\n'
;
54
55
std::cout <<
help_formatter
(
56
"\n"
57
"Usage: \tPurpose:\n"
58
"\n"
59
" {bcrangler} [{y-?}] [{y-h}] [{y--help}] \t show this help\n"
60
" {bcrangler} {ufile.json} ... \t configuration file names\n"
61
"\n"
);
62
}
c_wrangler
void c_wrangler(const jsont &config)
Definition
c_wrangler.cpp:596
c_wrangler.h
C Wrangler.
console_message_handlert
Definition
cout_message.h:30
crangler_parse_optionst::process_crangler_json
void process_crangler_json(const std::string &file_name)
Definition
crangler_parse_options.cpp:39
crangler_parse_optionst::help
void help() override
Definition
crangler_parse_options.cpp:51
crangler_parse_optionst::doit
int doit() override
Definition
crangler_parse_options.cpp:25
jsont
Definition
json.h:27
parse_options_baset::cmdline
cmdlinet cmdline
Definition
parse_options.h:28
cout_message.h
crangler_parse_options.h
CRANGLER Command Line Option Processing.
exit_codes.h
Document and give macros for the exit codes of CPROVER binaries.
CPROVER_EXIT_INCORRECT_TASK
#define CPROVER_EXIT_INCORRECT_TASK
The command line is correctly structured but cannot be carried out due to missing files,...
Definition
exit_codes.h:49
help_formatter.h
Help Formatter.
help_formatter
static help_formattert help_formatter(const std::string &s)
Definition
help_formatter.h:40
parse_json
bool parse_json(std::istream &in, const std::string &filename, message_handlert &message_handler, jsont &dest)
Definition
json_parser.cpp:27
json_parser.h
banner_string
std::string banner_string(const std::string &front_end, const std::string &version)
Definition
parse_options.cpp:171
version.h
CBMC_VERSION
const char * CBMC_VERSION
crangler
crangler_parse_options.cpp
Generated by
1.17.0