X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fanalyzer.h;h=7dd4c1345d8e3b5d09f25835da88ce996be48bb7;hb=242c55b17e6608b29a77ca17a5b677e202a3ca90;hp=b4ffd8b65d0aabc7b2beb04273e896e7c583ba0a;hpb=77461a8c0e2b5686b04cf15f3a9333b215813992;p=builder.git diff --git a/source/analyzer.h b/source/analyzer.h index b4ffd8b..7dd4c13 100644 --- a/source/analyzer.h +++ b/source/analyzer.h @@ -1,7 +1,7 @@ /* $Id$ This file is part of builder -Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions +Copyright © 2006-2007, 2009 Mikko Rasa, Mikkosoft Productions Distributed under the LGPL */ @@ -23,28 +23,42 @@ class Analyzer public: enum Mode { - DEPS, /// Skip over "trivial" targets such as Install and Compile - ALLDEPS, /// Print out absolutely every target - REBUILD, /// Print targets that are going to be rebuilt - RDEPS /// Print targets that depend on the given targets (NYI) + DEPS, //< Skip over "trivial" targets such as Install and Compile + ALLDEPS, //< Print out absolutely every target + REBUILD, //< Print targets that are going to be rebuilt + RDEPS //< Print targets that depend on the given targets (NYI) }; - Analyzer(Builder &); - void set_mode(Mode m) { mode=m; } - void set_max_depth(unsigned m) { max_depth=m; } - void set_full_paths(bool f) { full_paths=f; } - void analyze(); private: typedef std::vector TableRow; typedef std::list Table; - Builder &builder; - Mode mode; - Table table; + Builder &builder; + Mode mode; + Table table; unsigned max_depth; - bool full_paths; + bool full_paths; +public: + Analyzer(Builder &); + void set_mode(Mode m) { mode=m; } + void set_max_depth(unsigned m) { max_depth=m; } + void set_full_paths(bool f) { full_paths=f; } + + /** + Performs the analysis and prints out the resulting dependency tree. + */ + void analyze(); + +private: + /** + Adds rows to the table for the given target and its dependencies. + */ void build_depend_table(Target &, unsigned); + + /** + Prints out the table that resulted from the analysis. + */ void print_table() const; static bool target_order(Target *, Target *);