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