blob: 071ad4898100cb12453087c74d34e7325df6429e [file] [log] [blame]
Shinichiro Hamaji776ca302015-06-06 03:52:48 +09001#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
10using namespace std;
11
12class Value;
13
14class 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_