]> git.tdb.fi Git - builder.git/blob - source/analyzer.h
Add command line options (not all of them work yet)
[builder.git] / source / analyzer.h
1 #ifndef ANALYZER_H_
2 #define ANALYZER_H_
3
4 #include <list>
5 #include <string>
6 #include <vector>
7
8 class Builder;
9 class Target;
10
11 class Analyzer
12 {
13 public:
14         enum Mode
15         {
16                 DEPS,
17                 ALLDEPS,
18                 REBUILD,
19                 RDEPS
20         };
21
22         Analyzer(Builder &);
23         void set_mode(Mode m)          { mode=m; }
24         void set_max_depth(unsigned m) { max_depth=m; }
25         void set_full_paths(bool f)    { full_paths=f; }
26         void analyze();
27 private:
28         typedef std::vector<std::string> TableRow;
29         typedef std::list<TableRow> Table;
30
31         Builder  &builder;
32         Mode     mode;
33         Table    table;
34         unsigned max_depth;
35         bool     full_paths;
36
37         void build_depend_table(Target &, unsigned);
38         void print_table() const;
39
40         static bool target_order(Target *, Target *);
41 };
42
43 #endif