Fix stream operator on rules and items

This commit is contained in:
Max Brunsfeld 2013-11-12 08:17:19 -08:00
parent 11e3980319
commit 6bbaba3ef8
4 changed files with 49 additions and 13 deletions

View file

@ -9,16 +9,20 @@ namespace tree_sitter {
namespace lr {
class Item {
public:
Item(const std::string &rule_name, rules::rule_ptr rule, int consumed_sym_count);
Item(const std::string &rule_name, const rules::rule_ptr rule, int consumed_sym_count);
TransitionMap<Item> transitions() const;
private:
std::string rule_name;
rules::rule_ptr rule;
int consumed_sym_count;
std::vector<rules::rule_ptr> next_symbols() const;
bool operator==(const Item &other) const;
const std::string rule_name;
const rules::rule_ptr rule;
const int consumed_sym_count;
};
typedef std::shared_ptr<Item> item_ptr;
std::ostream& operator<<(std::ostream &stream, const Item &item);
}
}
#endif
#endif