Shinichiro Hamaji | 776ca30 | 2015-06-06 03:52:48 +0900 | [diff] [blame^] | 1 | #ifndef RULE_H_ |
| 2 | #define RULE_H_ |
| 3 | |
| 4 | #include <vector> |
| 5 | |
| 6 | #include "loc.h" |
| 7 | #include "log.h" |
| 8 | #include "string_piece.h" |
| 9 | |
| 10 | using namespace std; |
| 11 | |
| 12 | class Value; |
| 13 | |
| 14 | class Rule { |
| 15 | public: |
| 16 | Rule(); |
| 17 | void Parse(StringPiece line); |
| 18 | |
| 19 | string DebugString() const; |
| 20 | |
| 21 | vector<StringPiece> outputs; |
| 22 | vector<StringPiece> inputs; |
| 23 | vector<StringPiece> order_only_inputs; |
| 24 | vector<string> output_patterns; |
| 25 | bool is_double_colon; |
| 26 | bool is_suffix_rule; |
| 27 | vector<Value*> cmds; |
| 28 | Loc loc; |
| 29 | int cmd_lineno; |
| 30 | |
| 31 | private: |
| 32 | void Error(const string& msg) { |
| 33 | ERROR("%s:%d: %s", loc.filename, loc.lineno, msg.c_str()); |
| 34 | } |
| 35 | }; |
| 36 | |
| 37 | #endif // RULE_H_ |