diff options
author | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | 2015-06-19 14:25:17 +0900 |
---|---|---|
committer | Shinichiro Hamaji <shinichiro.hamaji@gmail.com> | 2015-06-22 15:46:23 +0900 |
commit | 9b16bda965b29b6ba5ce3178abf8e4655e5af044 (patch) | |
tree | 7f61396a6d8acb6fe01764b69b307e02a04ed539 /rule.h | |
parent | 9d959c38e872b453396bb20a4bff40d62f933fac (diff) | |
download | kati-9b16bda965b29b6ba5ce3178abf8e4655e5af044.tar.gz |
[C++] Parse all kinds of rules
Diffstat (limited to 'rule.h')
-rw-r--r-- | rule.h | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -3,25 +3,26 @@ #include <vector> +#include "ast.h" #include "loc.h" #include "log.h" #include "string_piece.h" using namespace std; +class Evaluator; 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; + vector<StringPiece> output_patterns; bool is_double_colon; bool is_suffix_rule; vector<Value*> cmds; @@ -34,4 +35,14 @@ class Rule { } }; +struct RuleVar { + vector<StringPiece> outputs; + StringPiece lhs; + StringPiece rhs; + AssignOp op; +}; + +// If |rule| is not NULL, rule_var is filled. +void ParseRule(Loc& loc, StringPiece line, Rule** rule, RuleVar* rule_var); + #endif // RULE_H_ |