ROSE  0.11.96.11
cmdline.h
1 
2 #ifndef ROSE_AST_CMDLINE_H
3 #define ROSE_AST_CMDLINE_H
4 
5 #include <string>
6 #include <vector>
7 
8 class SgProject;
9 
10 namespace Rose { namespace AST {
11 
13 namespace cmdline {
14 
16  template <typename T>
17  struct __when_T {
19  T backend;
20  };
21 
23  struct graphviz_t {
25  enum class Mode {
26  tree,
27  graph,
28  unknown
29  };
30 
31  bool on{false};
33  std::string out;
34 
35  void exec(SgProject * project) const;
36  static Mode __mode(std::string const &);
37  };
39 
41  struct checker_t {
43  enum class Mode {
44  all,
45  integrity,
50  consistency,
51  unknown
52  };
54  enum class Effect {
55  none,
56  summary,
57  report,
58  fail,
59  unknown
60  };
61 
62  bool on{false};
63  std::vector<Mode> modes{Mode::integrity}; // !< User can run multiple checkers of their choice
64  Effect effect{Effect::none};
65  std::string log;
66  std::string save;
67 
68  void exec(SgProject * project) const;
69  static Mode __mode(std::string const &);
70  static Effect __effect(std::string const &);
71  };
73 
74 } } }
75 #endif /* ROSE_AST_CMDLINE_H */
Rose::AST::cmdline::checker_t::Effect::summary
@ summary
Shows a summary on the standard output.
Rose::AST::cmdline::checker_t::Effect::report
@ report
Shows a full report of all defects on the standard output.
Rose::AST::cmdline::__when_T::backend
T backend
Configuration to run before the backend.
Definition: cmdline.h:19
Rose::AST::cmdline::checker
__when_T< checker_t > checker
Used by the -rose:ast:checker:XXX options.
Rose::AST::cmdline::checker_t::Effect::fail
@ fail
Calls ROSE_ABORT (after save/log if any)
Rose::AST::cmdline::__when_T
A simple template to facilitate configuration of modules that can be run after the frontend or before...
Definition: cmdline.h:17
Rose::AST::cmdline::checker_t::Effect::none
@ none
NOP.
Rose::AST::cmdline::graphviz
__when_T< graphviz_t > graphviz
Used by the -rose:ast:graphviz:XXX options.
Rose::AST::cmdline::checker_t::Mode::integrity_types
@ integrity_types
checks the types subgraph
Rose::AST::cmdline::checker_t
Configure the AST checker module.
Definition: cmdline.h:41
Rose::AST::cmdline::__when_T::frontend
T frontend
Configuration to run after the frontend.
Definition: cmdline.h:18
Rose::AST::cmdline::checker_t::log
std::string log
Filepath to write out the log (equivalent to report)
Definition: cmdline.h:65
Rose::AST::cmdline::checker_t::Mode::integrity
@ integrity
run all integrity checkers
Rose::AST::cmdline::checker_t::save
std::string save
Filepath (without extension) where to save both the AST and a JSON dump of the defects.
Definition: cmdline.h:66
Rose::AST::cmdline::checker_t::Mode::integrity_declarations
@ integrity_declarations
checks each of the decalration subgraphs (1st-nondef / defn)
Rose::AST::cmdline::graphviz_t::Mode::tree
@ tree
the Abstract Syntax Tree, only contains nodes that directly correspond to code
Rose::AST::cmdline::checker_t::Effect
Effect
One can select the effect if any defect is detected.
Definition: cmdline.h:54
Rose::AST::cmdline::graphviz_t::Mode::graph
@ graph
the whole graph contains the AST and all other nodes, such as types and symbols
Rose::AST::cmdline::graphviz_t::out
std::string out
name of the output file
Definition: cmdline.h:33
Rose::AST::cmdline::checker_t::Mode::consistency
@ consistency
run all consistency checkers
Rose::AST::cmdline::checker_t::Mode::integrity_symbols
@ integrity_symbols
checks the symbols subgraph
Rose::AST::cmdline::graphviz_t::mode
Mode mode
only a single mode, defaults to tree mode
Definition: cmdline.h:32
Rose::AST::cmdline::checker_t::Mode::all
@ all
run all checkers
Rose::AST::cmdline::checker_t::Mode
Mode
Many different modes are available.
Definition: cmdline.h:43
Rose
Main namespace for the ROSE library.
Definition: BinaryTutorial.dox:3
Rose::AST::cmdline::checker_t::Mode::integrity_edges
@ integrity_edges
checks the edges of the AST for invalid pointers/nodes
SgProject
This class represents a source project, with a list of SgFile objects and global information about th...
Definition: Cxx_Grammar.h:24060
Rose::AST::cmdline::graphviz_t::Mode
Mode
Two visualization modes.
Definition: cmdline.h:25
Rose::AST::cmdline::graphviz_t
Configure the AST visualization module.
Definition: cmdline.h:23