CBMC
janalyzer_parse_options.h
Go to the documentation of this file.
1 /*******************************************************************\
2 
3 Module: JANALYZER Command Line Option Processing
4 
5 Author: Daniel Kroening, kroening@kroening.com
6 
7 \*******************************************************************/
8 
99 
100 #ifndef CPROVER_JANALYZER_JANALYZER_PARSE_OPTIONS_H
101 #define CPROVER_JANALYZER_JANALYZER_PARSE_OPTIONS_H
102 
103 #include <util/parse_options.h>
104 #include <util/timestamper.h>
105 
106 #include <langapi/language.h>
107 
110 
112 
114 class ai_baset;
115 class goto_functiont;
117 class optionst;
118 
119 // clang-format off
120 #define JANALYZER_OPTIONS \
121  OPT_FUNCTIONS \
122  "(classpath):(cp):" \
123  OPT_JAVA_JAR \
124  "(main-class):" \
125  OPT_JAVA_GOTO_BINARY \
126  "(16)(32)(64)(LP64)(ILP64)(LLP64)(ILP32)(LP32)" \
127  "(little-endian)(big-endian)" \
128  OPT_SHOW_GOTO_FUNCTIONS \
129  OPT_SHOW_PROPERTIES \
130  "(no-assertions)(no-assumptions)" \
131  "(show-symbol-table)(show-parse-tree)" \
132  "(property):" \
133  "(verbosity):(version)" \
134  "(arch):" \
135  "(taint):(show-taint)" \
136  "(show-local-may-alias)" \
137  "(json):(xml):" \
138  "(text):(dot):" \
139  OPT_TIMESTAMP \
140  "(unreachable-instructions)(unreachable-functions)" \
141  "(reachable-functions)" \
142  "(intervals)(show-intervals)" \
143  "(non-null)(show-non-null)" \
144  "(constants)" \
145  "(dependence-graph)" \
146  "(show)(verify)(simplify):" \
147  "(location-sensitive)(concurrent)" \
148  "(no-simplify-slicing)" \
149  JAVA_BYTECODE_LANGUAGE_OPTIONS
150 // clang-format on
151 
153 {
154 public:
155  int doit() override;
156  void help() override;
157 
158  janalyzer_parse_optionst(int argc, const char **argv);
159 
160  bool process_goto_functions(goto_modelt &goto_model, const optionst &options);
161 
163  goto_model_functiont &function,
164  const abstract_goto_modelt &model,
165  const optionst &options);
166 
167  bool can_generate_function_body(const irep_idt &name);
168 
170  const irep_idt &function_name,
171  symbol_table_baset &symbol_table,
172  goto_functiont &function,
173  bool body_available);
174 
175 protected:
176  std::unique_ptr<class_hierarchyt> class_hierarchy;
177 
178  void register_languages() override;
179 
180  void get_command_line_options(optionst &options);
181 
182  virtual int
183  perform_analysis(goto_modelt &goto_model, const optionst &options);
184 
186  goto_modelt &goto_model,
187  const optionst &,
188  const namespacet &ns);
189 };
190 
191 #endif // CPROVER_JANALYZER_JANALYZER_PARSE_OPTIONS_H
Abstract interface to eager or lazy GOTO models.
This is the basic interface of the abstract interpreter with default implementations of the core func...
Definition: ai.h:117
dstringt has one field, an unsigned integer no which is an index into a static table of strings.
Definition: dstring.h:38
A goto function, consisting of function body (see body) and parameter identifiers (see parameter_iden...
Definition: goto_function.h:24
Interface providing access to a single function in a GOTO model, plus its associated symbol table.
Definition: goto_model.h:190
janalyzer_parse_optionst(int argc, const char **argv)
void help() override
display command line help
bool can_generate_function_body(const irep_idt &name)
ai_baset * build_analyzer(goto_modelt &goto_model, const optionst &, const namespacet &ns)
For the task, build the appropriate kind of analyzer Ideally this should be a pure function of option...
std::unique_ptr< class_hierarchyt > class_hierarchy
bool generate_function_body(const irep_idt &function_name, symbol_table_baset &symbol_table, goto_functiont &function, bool body_available)
void get_command_line_options(optionst &options)
virtual int perform_analysis(goto_modelt &goto_model, const optionst &options)
Depending on the command line mode, run one of the analysis tasks.
int doit() override
invoke main modules
bool process_goto_functions(goto_modelt &goto_model, const optionst &options)
void process_goto_function(goto_model_functiont &function, const abstract_goto_modelt &model, const optionst &options)
A namespacet is essentially one or two symbol tables bound together, to allow for symbol lookups in t...
Definition: namespace.h:94
The symbol table base class interface.
Abstract interface to support a programming language.
Show the goto functions.
Show the properties.
Emit timestamps.