From 8881214f0dc81418bff4ab6c48865fb4597d76e9 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Sat, 11 Jan 2014 16:48:40 -0800 Subject: [PATCH] Separate table building operations from Item, ItemSet value objects --- spec/compiler/build_tables/item_spec.cpp | 33 ---------- src/compiler/build_tables/close_item_set.cpp | 35 +++++++++++ src/compiler/build_tables/close_item_set.h | 14 +++++ src/compiler/build_tables/item.cpp | 29 +++------ src/compiler/build_tables/item.h | 11 +--- src/compiler/build_tables/item_set.cpp | 62 ------------------- src/compiler/build_tables/item_set.h | 14 +---- .../build_tables/item_set_transitions.cpp | 37 +++++++++++ .../build_tables/item_set_transitions.h | 16 +++++ src/compiler/build_tables/next_symbols.cpp | 41 ++++++++++++ src/compiler/build_tables/next_symbols.h | 17 +++++ src/compiler/build_tables/perform.cpp | 18 +++--- src/compiler/build_tables/perform.h | 4 +- src/compiler/rules/character.h | 2 - src/compiler/rules/rules.cpp | 6 +- src/compiler/rules/rules.h | 8 +-- src/compiler/rules/symbol.h | 2 - tree_sitter.xcodeproj/project.pbxproj | 35 +++++++---- 18 files changed, 218 insertions(+), 166 deletions(-) delete mode 100644 spec/compiler/build_tables/item_spec.cpp create mode 100644 src/compiler/build_tables/close_item_set.cpp create mode 100644 src/compiler/build_tables/close_item_set.h create mode 100644 src/compiler/build_tables/item_set_transitions.cpp create mode 100644 src/compiler/build_tables/item_set_transitions.h create mode 100644 src/compiler/build_tables/next_symbols.cpp create mode 100644 src/compiler/build_tables/next_symbols.h diff --git a/spec/compiler/build_tables/item_spec.cpp b/spec/compiler/build_tables/item_spec.cpp deleted file mode 100644 index 9029efab..00000000 --- a/spec/compiler/build_tables/item_spec.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include "spec_helper.h" -#include "item.h" -#include "../../fixtures/grammars/arithmetic.h" - -using namespace tree_sitter::build_tables; - -START_TEST - -describe("items", []() { - describe("construction", [&]() { - it("finds the item at the start of a rule", [&]() { - Grammar grammar = test_grammars::arithmetic(); - Item item = Item::at_beginning_of_rule("expression", grammar); - AssertThat(item, Equals(Item("expression", grammar.rule("expression"), 0))); - }); - }); - - describe("transitions", [&]() { - it("computes the possible advancements", [&]() { - auto char1 = rules::character('a'); - auto char2 = rules::character('b'); - Item item = Item("my-rule", rules::seq({ char1, char2 }), 2); - - AssertThat( - item.transitions(), - Equals(transition_map({ - { char1, make_shared("my-rule", char2, 3) } - }))); - }); - }); -}); - -END_TEST \ No newline at end of file diff --git a/src/compiler/build_tables/close_item_set.cpp b/src/compiler/build_tables/close_item_set.cpp new file mode 100644 index 00000000..70fd31fe --- /dev/null +++ b/src/compiler/build_tables/close_item_set.cpp @@ -0,0 +1,35 @@ +#include "close_item_set.h" +#include "./next_symbols.h" +#include "grammar.h" +#include "item.h" +#include + +using std::vector; + +namespace tree_sitter { + namespace build_tables { + static bool vector_contains(vector items, build_tables::Item item) { + return (std::find(items.begin(), items.end(), item) != items.end()); + } + + static void add_item(vector &vector, const Item &item, const Grammar &grammar) { + if (!vector_contains(vector, item)) { + vector.push_back(item); + for (rules::Symbol rule : next_non_terminals(item, grammar)) { + Item next_item = Item::at_beginning_of_rule(rule.name, grammar); + add_item(vector, next_item, grammar); + } + } + } + + static vector closure_in_grammar(const Item &item, const Grammar &grammar) { + vector result; + add_item(result, item, grammar); + return result; + } + + ItemSet close_item_set(const ItemSet &item_set, const Grammar &grammar) { + return ItemSet(closure_in_grammar(*item_set.begin(), grammar)); + } + } +} \ No newline at end of file diff --git a/src/compiler/build_tables/close_item_set.h b/src/compiler/build_tables/close_item_set.h new file mode 100644 index 00000000..352d33d1 --- /dev/null +++ b/src/compiler/build_tables/close_item_set.h @@ -0,0 +1,14 @@ +#ifndef __tree_sitter__close_item_set__ +#define __tree_sitter__close_item_set__ + +#include "item_set.h" + +namespace tree_sitter { + class Grammar; + + namespace build_tables { + ItemSet close_item_set(const ItemSet &item_set, const Grammar &grammar); + } +} + +#endif diff --git a/src/compiler/build_tables/item.cpp b/src/compiler/build_tables/item.cpp index 12218d81..8ce8013f 100644 --- a/src/compiler/build_tables/item.cpp +++ b/src/compiler/build_tables/item.cpp @@ -3,13 +3,12 @@ #include "rule_transitions.h" using std::string; -using std::vector; -using std::dynamic_pointer_cast; -using std::make_shared; using std::ostream; namespace tree_sitter { namespace build_tables { + const int NO_SYMBOLS = -1; + Item::Item(const string &rule_name, const rules::rule_ptr rule, int consumed_sym_count) : rule_name(rule_name), rule(rule), @@ -20,25 +19,13 @@ namespace tree_sitter { } Item Item::at_beginning_of_token(const string &rule_name, const Grammar &grammar) { - return Item(rule_name, grammar.rule(rule_name), -1); + return Item(rule_name, grammar.rule(rule_name), NO_SYMBOLS); + } + + int Item::next_sym_count() const { + return (consumed_sym_count == NO_SYMBOLS) ? NO_SYMBOLS : (consumed_sym_count + 1); } - transition_map Item::transitions() const { - return rule_transitions(rule).map([&](rules::rule_ptr to_rule) -> item_ptr { - int next_sym_count = (consumed_sym_count == -1) ? -1 : (consumed_sym_count + 1); - return make_shared(rule_name, to_rule, next_sym_count); - }); - }; - - vector Item::next_symbols() const { - vector result; - for (auto pair : rule_transitions(rule)) { - auto sym = dynamic_pointer_cast(pair.first); - if (sym) result.push_back(*sym); - } - return result; - } - bool Item::operator==(const Item &other) const { bool rule_names_eq = other.rule_name == rule_name; bool rules_eq = (*other.rule == *rule); @@ -47,7 +34,7 @@ namespace tree_sitter { } bool Item::is_done() const { - for (auto pair : transitions()) + for (auto pair : rule_transitions(rule)) if (*pair.first == rules::Blank()) return true; return false; diff --git a/src/compiler/build_tables/item.h b/src/compiler/build_tables/item.h index 8d65ed86..8a300850 100644 --- a/src/compiler/build_tables/item.h +++ b/src/compiler/build_tables/item.h @@ -3,15 +3,13 @@ #include #include "rule.h" -#include "symbol.h" -#include "transition_map.h" +#include namespace tree_sitter { class Grammar; namespace build_tables { class Item; - typedef std::shared_ptr item_ptr; class Item { public: @@ -19,19 +17,16 @@ namespace tree_sitter { static Item at_beginning_of_rule(const std::string &rule_name, const Grammar &grammar); static Item at_beginning_of_token(const std::string &rule_name, const Grammar &grammar); - transition_map transitions() const; - std::vector next_symbols() const; bool operator==(const Item &other) const; bool is_done() const; + int next_sym_count() const; const std::string rule_name; const rules::rule_ptr rule; const int consumed_sym_count; }; -// typedef std::shared_ptr item_ptr; - std::ostream& operator<<(std::ostream &stream, const Item &item); - + std::ostream& operator<<(std::ostream &stream, const Item &item); } } diff --git a/src/compiler/build_tables/item_set.cpp b/src/compiler/build_tables/item_set.cpp index c950fe34..91db6ceb 100644 --- a/src/compiler/build_tables/item_set.cpp +++ b/src/compiler/build_tables/item_set.cpp @@ -1,77 +1,17 @@ #include "item_set.h" using std::vector; -using std::set; -using std::initializer_list; -using std::dynamic_pointer_cast; using std::ostream; using std::string; -using std::make_shared; namespace tree_sitter { namespace build_tables { ItemSet::ItemSet(const vector &items) : contents(items) {} - ItemSet::ItemSet(const initializer_list &items) : contents(items) {} - - static bool vector_contains(vector items, build_tables::Item item) { - return (std::find(items.begin(), items.end(), item) != items.end()); - } - static void add_item(vector &vector, const Item &item, const Grammar &grammar) { - if (!vector_contains(vector, item)) { - vector.push_back(item); - for (rules::Symbol rule : item.next_symbols()) { - if (grammar.has_definition(rule)) { - Item next_item = Item::at_beginning_of_rule(rule.name, grammar); - add_item(vector, next_item, grammar); - } - } - } - } - - static vector closure_in_grammar(const Item &item, const Grammar &grammar) { - vector result; - add_item(result, item, grammar); - return result; - } - - ItemSet::ItemSet(const Item &item, const Grammar &grammar) : contents(closure_in_grammar(item, grammar)) {} - - template - transition_map transitions(const ItemSet *item_set, const Grammar &grammar) { - transition_map result; - for (Item item : *item_set) { - for (auto transition : item.transitions()) { - auto rule = dynamic_pointer_cast(transition.first); - if (rule.get()) result.add(rule, make_shared(*transition.second, grammar)); - } - } - return result; - } - - transition_map ItemSet::char_transitions(const Grammar &grammar) const { - return transitions(this, grammar); - } - - transition_map ItemSet::sym_transitions(const Grammar &grammar) const { - return transitions(this, grammar); - } - - set ItemSet::next_terminal_symbols(const Grammar &grammar) const { - set result; - for (Item item : *this) - for (rules::Symbol symbol : item.next_symbols()) - if (!grammar.has_definition(symbol)) - result.insert(symbol); - return result; - } - bool ItemSet::operator==(const tree_sitter::build_tables::ItemSet &other) const { return contents == other.contents; } -#pragma mark - container - ItemSet::const_iterator ItemSet::begin() const { return contents.begin(); } @@ -84,8 +24,6 @@ namespace tree_sitter { return contents.size(); } -#pragma mark - printing - ostream& operator<<(ostream &stream, const ItemSet &item_set) { stream << string("# #include namespace tree_sitter { namespace build_tables { class ItemSet; - typedef std::shared_ptr item_set_ptr; class ItemSet { const std::vector contents; public: ItemSet(const std::vector &items); - ItemSet(const std::initializer_list &items); - ItemSet(const Item &item, const Grammar &grammar); + bool operator==(const ItemSet &other) const; typedef Item value_type; typedef std::vector::const_iterator const_iterator; const_iterator begin() const; const_iterator end() const; size_t size() const; - - transition_map char_transitions(const Grammar &grammar) const; - transition_map sym_transitions(const Grammar &grammar) const; - - std::set next_terminal_symbols(const Grammar &grammar) const; - bool operator==(const ItemSet &other) const; }; - typedef std::shared_ptr item_set_ptr; std::ostream& operator<<(std::ostream &stream, const ItemSet &item_set); } } diff --git a/src/compiler/build_tables/item_set_transitions.cpp b/src/compiler/build_tables/item_set_transitions.cpp new file mode 100644 index 00000000..a0a39131 --- /dev/null +++ b/src/compiler/build_tables/item_set_transitions.cpp @@ -0,0 +1,37 @@ +#include "item_set_transitions.h" +#include "close_item_set.h" +#include "rule_transitions.h" + +using std::dynamic_pointer_cast; +using std::make_shared; + +namespace tree_sitter { + namespace build_tables { + transition_map item_transitions(const Item &item) { + return rule_transitions(item.rule).map([&](rules::rule_ptr to_rule) { + return make_shared(item.rule_name, to_rule, item.next_sym_count()); + }); + }; + + template + transition_map transitions(const ItemSet &item_set, const Grammar &grammar) { + transition_map result; + for (Item item : item_set) { + for (auto transition : item_transitions(item)) { + auto rule = dynamic_pointer_cast(transition.first); + auto new_item_set = make_shared(close_item_set(ItemSet({ *transition.second }), grammar)); + if (rule.get()) result.add(rule, new_item_set); + } + } + return result; + } + + transition_map char_transitions(const ItemSet &item_set, const Grammar &grammar) { + return transitions(item_set, grammar); + } + + transition_map sym_transitions(const ItemSet &item_set, const Grammar &grammar) { + return transitions(item_set, grammar); + } + } +} \ No newline at end of file diff --git a/src/compiler/build_tables/item_set_transitions.h b/src/compiler/build_tables/item_set_transitions.h new file mode 100644 index 00000000..f9fcbadc --- /dev/null +++ b/src/compiler/build_tables/item_set_transitions.h @@ -0,0 +1,16 @@ +#ifndef __tree_sitter__item_set_transitions__ +#define __tree_sitter__item_set_transitions__ + +#include "character.h" +#include "symbol.h" +#include "transition_map.h" +#include "item_set.h" + +namespace tree_sitter { + namespace build_tables { + transition_map char_transitions(const ItemSet &item_set, const Grammar &grammar); + transition_map sym_transitions(const ItemSet &item_set, const Grammar &grammar); + } +} + +#endif diff --git a/src/compiler/build_tables/next_symbols.cpp b/src/compiler/build_tables/next_symbols.cpp new file mode 100644 index 00000000..f7969d90 --- /dev/null +++ b/src/compiler/build_tables/next_symbols.cpp @@ -0,0 +1,41 @@ +#include "next_symbols.h" +#include "rule_transitions.h" +#include "grammar.h" +#include + +using std::set; +using std::vector; +using std::dynamic_pointer_cast; + +namespace tree_sitter { + class Grammar; + + namespace build_tables { + template + set next_symbols(const Item &item, const Grammar &grammar) { + set result; + for (auto pair : rule_transitions(item.rule)) { + auto symbol = dynamic_pointer_cast(pair.first); + if (symbol && (grammar.has_definition(*symbol) == isNonTerminal)) + result.insert(*symbol); + } + return result; + } + + set next_terminals(const Item &item, const Grammar &grammar) { + return next_symbols(item, grammar); + } + + set next_non_terminals(const Item &item, const Grammar &grammar) { + return next_symbols(item, grammar); + } + + set next_terminals(const ItemSet &item_set, const Grammar &grammar) { + set result; + for (Item item : item_set) + for (rules::Symbol symbol : next_terminals(item, grammar)) + result.insert(symbol); + return result; + } + } +} \ No newline at end of file diff --git a/src/compiler/build_tables/next_symbols.h b/src/compiler/build_tables/next_symbols.h new file mode 100644 index 00000000..719954e1 --- /dev/null +++ b/src/compiler/build_tables/next_symbols.h @@ -0,0 +1,17 @@ +#ifndef __tree_sitter__first_terminal__ +#define __tree_sitter__first_terminal__ + +#include "item_set.h" +#include "symbol.h" +#include + +namespace tree_sitter { + class Grammar; + + namespace build_tables { + std::set next_terminals(const ItemSet &item_set, const Grammar &grammar); + std::set next_terminals(const Item &item, const Grammar &grammar); + std::set next_non_terminals(const Item &item, const Grammar &grammar); + } +} +#endif diff --git a/src/compiler/build_tables/perform.cpp b/src/compiler/build_tables/perform.cpp index 959a640e..541b8c8c 100644 --- a/src/compiler/build_tables/perform.cpp +++ b/src/compiler/build_tables/perform.cpp @@ -1,10 +1,14 @@ #include "./perform.h" -#include "./item_set.h" +#include "item_set.h" +#include "close_item_set.h" +#include "next_symbols.h" +#include "item_set_transitions.h" #include "rules.h" #include "grammar.h" using std::pair; using std::vector; +using std::unordered_map; namespace tree_sitter { namespace build_tables { @@ -13,8 +17,8 @@ namespace tree_sitter { class TableBuilder { const Grammar grammar; const Grammar lex_grammar; - std::unordered_map parse_state_indices; - std::unordered_map lex_state_indices; + unordered_map parse_state_indices; + unordered_map lex_state_indices; ParseTable parse_table; LexTable lex_table; @@ -29,7 +33,7 @@ namespace tree_sitter { } void add_shift_actions(const ItemSet &item_set, size_t state_index) { - auto x = item_set.sym_transitions(grammar); + auto x = sym_transitions(item_set, grammar); for (auto transition : x) { rules::Symbol symbol = *transition.first; ItemSet item_set = *transition.second; @@ -39,7 +43,7 @@ namespace tree_sitter { } void add_advance_actions(const ItemSet &item_set, size_t state_index) { - for (auto transition : item_set.char_transitions(grammar)) { + for (auto transition : char_transitions(item_set, grammar)) { rules::Character rule = *transition.first; ItemSet item_set = *transition.second; size_t new_state_index = add_lex_state(item_set); @@ -80,7 +84,7 @@ namespace tree_sitter { ItemSet lex_item_set_for_parse_item_set(const ItemSet &parse_item_set) { vector items; - for (rules::Symbol symbol : parse_item_set.next_terminal_symbols(grammar)) + for (rules::Symbol symbol : next_terminals(parse_item_set, grammar)) items.push_back(Item::at_beginning_of_token(symbol.name, lex_grammar)); return ItemSet(items); } @@ -107,7 +111,7 @@ namespace tree_sitter { pair build() { auto item = Item(ParseTable::START, rules::sym(grammar.start_rule_name), 0); - auto item_set = ItemSet(item, grammar); + auto item_set = close_item_set(ItemSet({ item }), grammar); add_parse_state(item_set); return pair(parse_table, lex_table); } diff --git a/src/compiler/build_tables/perform.h b/src/compiler/build_tables/perform.h index 33257507..1fcc8094 100644 --- a/src/compiler/build_tables/perform.h +++ b/src/compiler/build_tables/perform.h @@ -1,5 +1,5 @@ -#ifndef __TreeSitter__parse_table_builder__ -#define __TreeSitter__parse_table_builder__ +#ifndef __TreeSitter__build_tables__ +#define __TreeSitter__build_tables__ #include "parse_table.h" #include "lex_table.h" diff --git a/src/compiler/rules/character.h b/src/compiler/rules/character.h index deb8fc4f..9df5583c 100644 --- a/src/compiler/rules/character.h +++ b/src/compiler/rules/character.h @@ -20,8 +20,6 @@ namespace tree_sitter { const CharMatch value; }; - - typedef std::shared_ptr char_ptr; } } diff --git a/src/compiler/rules/rules.cpp b/src/compiler/rules/rules.cpp index f43caa79..a1f95433 100644 --- a/src/compiler/rules/rules.cpp +++ b/src/compiler/rules/rules.cpp @@ -10,11 +10,11 @@ namespace tree_sitter { return make_shared(); } - char_ptr character(char value) { + rule_ptr character(char value) { return make_shared(value); } - char_ptr character(CharClass value) { + rule_ptr character(CharClass value) { return make_shared(value); } @@ -46,7 +46,7 @@ namespace tree_sitter { return make_shared(value); } - sym_ptr sym(const string &name) { + rule_ptr sym(const string &name) { return make_shared(name); } } diff --git a/src/compiler/rules/rules.h b/src/compiler/rules/rules.h index 41e4611d..46732977 100644 --- a/src/compiler/rules/rules.h +++ b/src/compiler/rules/rules.h @@ -15,15 +15,15 @@ namespace tree_sitter { namespace rules { rule_ptr blank(); - char_ptr character(char value); - char_ptr character(char min, char max); - char_ptr character(CharClass value); + rule_ptr character(char value); + rule_ptr character(char min, char max); + rule_ptr character(CharClass value); rule_ptr choice(const std::initializer_list &rules); rule_ptr pattern(const std::string &value); rule_ptr repeat(const rule_ptr content); rule_ptr seq(const std::initializer_list &rules); rule_ptr str(const std::string &value); - sym_ptr sym(const std::string &name); + rule_ptr sym(const std::string &name); } } diff --git a/src/compiler/rules/symbol.h b/src/compiler/rules/symbol.h index 6a0ffe0b..fe2584f4 100644 --- a/src/compiler/rules/symbol.h +++ b/src/compiler/rules/symbol.h @@ -18,8 +18,6 @@ namespace tree_sitter { const std::string name; }; - - typedef std::shared_ptr sym_ptr; } } diff --git a/tree_sitter.xcodeproj/project.pbxproj b/tree_sitter.xcodeproj/project.pbxproj index 24e1d043..02306262 100644 --- a/tree_sitter.xcodeproj/project.pbxproj +++ b/tree_sitter.xcodeproj/project.pbxproj @@ -34,9 +34,11 @@ 12EDCFB21882039A005A7A07 /* perform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 12EDCFA418820137005A7A07 /* perform.cpp */; }; 12EDCFB31882039A005A7A07 /* rule_transitions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 12EDCFA618820137005A7A07 /* rule_transitions.cpp */; }; 12EDCFB418820519005A7A07 /* compile.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 12EDCFAC18820181005A7A07 /* compile.cpp */; }; - 12EDCFBB188205BF005A7A07 /* item_spec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 12EDCFB5188205BA005A7A07 /* item_spec.cpp */; }; 12EDCFBC188205BF005A7A07 /* rule_transitions_spec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 12EDCFB6188205BA005A7A07 /* rule_transitions_spec.cpp */; }; 12EDCFBD188205BF005A7A07 /* perform_spec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 12EDCFB7188205BA005A7A07 /* perform_spec.cpp */; }; + 12EDCFC018820880005A7A07 /* close_item_set.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 12EDCFBE18820880005A7A07 /* close_item_set.cpp */; }; + 12EDCFC318820A70005A7A07 /* item_set_transitions.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 12EDCFC118820A70005A7A07 /* item_set_transitions.cpp */; }; + 12EDCFC61882153D005A7A07 /* next_symbols.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 12EDCFC41882153D005A7A07 /* next_symbols.cpp */; }; 12F9A64E182DD5FD00FAF50C /* spec_helper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 12F9A64C182DD5FD00FAF50C /* spec_helper.cpp */; }; 12F9A651182DD6BC00FAF50C /* grammar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 12F9A64F182DD6BC00FAF50C /* grammar.cpp */; }; 12FD4061185E68470041A84E /* c_code.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 12FD405F185E68470041A84E /* c_code.cpp */; }; @@ -143,9 +145,14 @@ 12EDCFA718820137005A7A07 /* rule_transitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = rule_transitions.h; path = src/compiler/build_tables/rule_transitions.h; sourceTree = SOURCE_ROOT; }; 12EDCFAC18820181005A7A07 /* compile.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = compile.cpp; sourceTree = ""; }; 12EDCFAD18820181005A7A07 /* compile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = compile.h; sourceTree = ""; }; - 12EDCFB5188205BA005A7A07 /* item_spec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = item_spec.cpp; sourceTree = ""; }; 12EDCFB6188205BA005A7A07 /* rule_transitions_spec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rule_transitions_spec.cpp; sourceTree = ""; }; 12EDCFB7188205BA005A7A07 /* perform_spec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = perform_spec.cpp; sourceTree = ""; }; + 12EDCFBE18820880005A7A07 /* close_item_set.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = close_item_set.cpp; sourceTree = ""; }; + 12EDCFBF18820880005A7A07 /* close_item_set.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = close_item_set.h; sourceTree = ""; }; + 12EDCFC118820A70005A7A07 /* item_set_transitions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = item_set_transitions.cpp; sourceTree = ""; }; + 12EDCFC218820A70005A7A07 /* item_set_transitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = item_set_transitions.h; sourceTree = ""; }; + 12EDCFC41882153D005A7A07 /* next_symbols.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = next_symbols.cpp; sourceTree = ""; }; + 12EDCFC51882153D005A7A07 /* next_symbols.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = next_symbols.h; sourceTree = ""; }; 12F9A64C182DD5FD00FAF50C /* spec_helper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = spec_helper.cpp; path = spec/compiler/spec_helper.cpp; sourceTree = SOURCE_ROOT; }; 12F9A64D182DD5FD00FAF50C /* spec_helper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = spec_helper.h; path = spec/compiler/spec_helper.h; sourceTree = SOURCE_ROOT; }; 12F9A64F182DD6BC00FAF50C /* grammar.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = grammar.cpp; path = src/compiler/grammar.cpp; sourceTree = SOURCE_ROOT; }; @@ -219,24 +226,28 @@ 12130618182C84B700FCF928 /* build_tables */ = { isa = PBXGroup; children = ( - 12C344421822F27700B07BE3 /* transition_map.h */, - 12EDCFA018820137005A7A07 /* item_set.cpp */, - 12EDCFA118820137005A7A07 /* item_set.h */, + 12EDCFBE18820880005A7A07 /* close_item_set.cpp */, + 12EDCFBF18820880005A7A07 /* close_item_set.h */, 12EDCFA218820137005A7A07 /* item.cpp */, 12EDCFA318820137005A7A07 /* item.h */, + 12EDCFA018820137005A7A07 /* item_set.cpp */, + 12EDCFA118820137005A7A07 /* item_set.h */, + 12EDCFC118820A70005A7A07 /* item_set_transitions.cpp */, + 12EDCFC218820A70005A7A07 /* item_set_transitions.h */, + 12EDCFC41882153D005A7A07 /* next_symbols.cpp */, + 12EDCFC51882153D005A7A07 /* next_symbols.h */, 12EDCFA418820137005A7A07 /* perform.cpp */, 12EDCFA518820137005A7A07 /* perform.h */, 12EDCFA618820137005A7A07 /* rule_transitions.cpp */, 12EDCFA718820137005A7A07 /* rule_transitions.h */, + 12C344421822F27700B07BE3 /* transition_map.h */, ); - name = build_tables; - path = lr; + path = build_tables; sourceTree = ""; }; 1213061C182C854F00FCF928 /* build_tables */ = { isa = PBXGroup; children = ( - 12EDCFB5188205BA005A7A07 /* item_spec.cpp */, 12EDCFB6188205BA005A7A07 /* rule_transitions_spec.cpp */, 12EDCFB7188205BA005A7A07 /* perform_spec.cpp */, ); @@ -368,9 +379,9 @@ 12FD40AE185EE6610041A84E /* compiler */ = { isa = PBXGroup; children = ( - 1225CC6318765693000D4723 /* prepare_grammar_spec.cpp */, - 12FD4063185E75290041A84E /* compile_fixtures.cpp */, 1213061C182C854F00FCF928 /* build_tables */, + 12FD4063185E75290041A84E /* compile_fixtures.cpp */, + 1225CC6318765693000D4723 /* prepare_grammar_spec.cpp */, 12D1369F18357066005F3369 /* rules */, 12F9A64C182DD5FD00FAF50C /* spec_helper.cpp */, 12F9A64D182DD5FD00FAF50C /* spec_helper.h */, @@ -480,7 +491,9 @@ 12EDCFB31882039A005A7A07 /* rule_transitions.cpp in Sources */, 12FD40D9185FEEDF0041A84E /* pattern_spec.cpp in Sources */, 12130617182C3D2900FCF928 /* string.cpp in Sources */, + 12EDCFC018820880005A7A07 /* close_item_set.cpp in Sources */, 12EDCFBD188205BF005A7A07 /* perform_spec.cpp in Sources */, + 12EDCFC61882153D005A7A07 /* next_symbols.cpp in Sources */, 12130611182C3A1100FCF928 /* blank.cpp in Sources */, 1213060E182C398300FCF928 /* choice.cpp in Sources */, 12F9A64E182DD5FD00FAF50C /* spec_helper.cpp in Sources */, @@ -490,6 +503,7 @@ 12EDCF981881FCD5005A7A07 /* extract_tokens.cpp in Sources */, 12FD4061185E68470041A84E /* c_code.cpp in Sources */, 12FD40D8185FEEDF0041A84E /* rules_spec.cpp in Sources */, + 12EDCFC318820A70005A7A07 /* item_set_transitions.cpp in Sources */, 12FD4064185E75290041A84E /* compile_fixtures.cpp in Sources */, 12EDCFAF18820387005A7A07 /* parse_table.cpp in Sources */, 1214930E181E200B008E9BDA /* main.cpp in Sources */, @@ -499,7 +513,6 @@ 12EDCF9A1881FCD9005A7A07 /* search_for_symbols.cpp in Sources */, 12FD40F3186641C00041A84E /* char_match.cpp in Sources */, 12EDCFB21882039A005A7A07 /* perform.cpp in Sources */, - 12EDCFBB188205BF005A7A07 /* item_spec.cpp in Sources */, 12FD40E718639B910041A84E /* visitor.cpp in Sources */, 12EDCF991881FCD9005A7A07 /* perform.cpp in Sources */, 12EDCFBC188205BF005A7A07 /* rule_transitions_spec.cpp in Sources */,