ROSE  0.11.145.0
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 */
__when_T< graphviz_t > graphviz
Used by the -rose:ast:graphviz:XXX options.
Shows a full report of all defects on the standard output.
Configure the AST checker module.
Definition: cmdline.h:41
Mode mode
only a single mode, defaults to tree mode
Definition: cmdline.h:32
Configure the AST visualization module.
Definition: cmdline.h:23
the Abstract Syntax Tree, only contains nodes that directly correspond to code
Calls ROSE_ABORT (after save/log if any)
Main namespace for the ROSE library.
T backend
Configuration to run before the backend.
Definition: cmdline.h:19
A simple template to facilitate configuration of modules that can be run after the frontend or before...
Definition: cmdline.h:17
std::string save
Filepath (without extension) where to save both the AST and a JSON dump of the defects.
Definition: cmdline.h:66
Mode
Many different modes are available.
Definition: cmdline.h:43
__when_T< checker_t > checker
Used by the -rose:ast:checker:XXX options.
checks the edges of the AST for invalid pointers/nodes
checks each of the decalration subgraphs (1st-nondef / defn)
the whole graph contains the AST and all other nodes, such as types and symbols
std::string log
Filepath to write out the log (equivalent to report)
Definition: cmdline.h:65
std::string out
name of the output file
Definition: cmdline.h:33
Effect
One can select the effect if any defect is detected.
Definition: cmdline.h:54
T frontend
Configuration to run after the frontend.
Definition: cmdline.h:18
This class represents a source project, with a list of SgFile objects and global information about th...
Shows a summary on the standard output.
Mode
Two visualization modes.
Definition: cmdline.h:25