aboutsummaryrefslogtreecommitdiff
path: root/rule.h
diff options
context:
space:
mode:
authorShinichiro Hamaji <shinichiro.hamaji@gmail.com>2015-06-06 03:52:48 +0900
committerShinichiro Hamaji <shinichiro.hamaji@gmail.com>2015-06-18 11:25:42 +0900
commit776ca3085c44e6570813270df75278849c37d400 (patch)
tree6dc3f2d468cfd860347f2f9d519f49c2a38d4c64 /rule.h
parenta3caa8166baeb348f817eb1b4fa2e81672b3d77f (diff)
downloadkati-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.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/rule.h b/rule.h
new file mode 100644
index 0000000..071ad48
--- /dev/null
+++ b/rule.h
@@ -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_