Start work on building parse tables

This commit is contained in:
Max Brunsfeld 2013-12-15 14:41:51 -08:00
parent 99c216f78a
commit 928f4f9deb
19 changed files with 419 additions and 29 deletions

View file

@ -1,5 +1,7 @@
#include "grammar.h"
using namespace std;
namespace tree_sitter {
Grammar::Grammar(const rule_map_init_list &rules) :
rules(rules),
@ -11,4 +13,13 @@ namespace tree_sitter {
rules::rule_ptr(nullptr) :
iter->second;
}
vector<string> Grammar::rule_names() const {
vector<string> result;
for (auto pair : rules) {
result.push_back(pair.first);
}
return result;
}
}