diff options
author | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | 2015-06-06 03:52:48 +0900 |
---|---|---|
committer | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | 2015-06-18 11:25:42 +0900 |
commit | 776ca3085c44e6570813270df75278849c37d400 (patch) | |
tree | 6dc3f2d468cfd860347f2f9d519f49c2a38d4c64 /rule.h | |
parent | a3caa8166baeb348f817eb1b4fa2e81672b3d77f (diff) | |
download | kati-776ca3085c44e6570813270df75278849c37d400.tar.gz |
[C++] The first commit for C++ version
16 tests out of 169 are passing.
Diffstat (limited to 'rule.h')
-rw-r--r-- | rule.h | 37 |
1 files changed, 37 insertions, 0 deletions
@@ -0,0 +1,37 @@ +#ifndef RULE_H_ +#define RULE_H_ + +#include <vector> + +#include "loc.h" +#include "log.h" +#include "string_piece.h" + +using namespace std; + +class Value; + +class Rule { + public: + Rule(); + void Parse(StringPiece line); + + string DebugString() const; + + vector<StringPiece> outputs; + vector<StringPiece> inputs; + vector<StringPiece> order_only_inputs; + vector<string> output_patterns; + bool is_double_colon; + bool is_suffix_rule; + vector<Value*> cmds; + Loc loc; + int cmd_lineno; + + private: + void Error(const string& msg) { + ERROR("%s:%d: %s", loc.filename, loc.lineno, msg.c_str()); + } +}; + +#endif // RULE_H_ |