diff --git a/spec/compiler/grammar/prepare_grammar_spec.cpp b/spec/compiler/grammar/prepare_grammar_spec.cpp index 9a7e345b..8613b9d7 100644 --- a/spec/compiler/grammar/prepare_grammar_spec.cpp +++ b/spec/compiler/grammar/prepare_grammar_spec.cpp @@ -21,11 +21,11 @@ describe("preparing a grammar", []() { AssertThat(result.first, Equals(Grammar({ { "rule1", seq({ - token("1"), + sym("1"), seq({ sym("rule2"), sym("rule3") }), - token("1") }) } + sym("1") }) } }))); AssertThat(result.second, Equals(Grammar("", { diff --git a/spec/compiler/lr/table_builder_spec.cpp b/spec/compiler/lr/table_builder_spec.cpp index fc093764..10a8c9a2 100644 --- a/spec/compiler/lr/table_builder_spec.cpp +++ b/spec/compiler/lr/table_builder_spec.cpp @@ -14,19 +14,19 @@ describe("building parse and lex tables", []() { { "expression", choice({ seq({ sym("term"), - token("plus-token"), + sym("plus-token"), sym("term") }), sym("term") }) }, { "term", choice({ sym("variable"), sym("number"), seq({ - token("left-paren-token"), + sym("left-paren-token"), sym("expression"), - token("right-paren-token") + sym("right-paren-token") }) }) }, - { "variable", token("variable-token") }, - { "number", token("number-token") } + { "variable", sym("variable-token") }, + { "number", sym("number-token") } }); Grammar lex_grammar({ @@ -64,8 +64,8 @@ describe("building parse and lex tables", []() { AssertThat(lex_state(0).actions, Equals(unordered_map({ { CharMatchSpecific('('), lex_actions({ LexAction::Advance(1) }) }, - { CharMatchClass(CharClassWord), lex_actions({ LexAction::Advance(2) }) }, - { CharMatchClass(CharClassDigit), lex_actions({ LexAction::Advance(3) }) }, + { CharMatchClass(CharClassDigit), lex_actions({ LexAction::Advance(2) }) }, + { CharMatchClass(CharClassWord), lex_actions({ LexAction::Advance(3) }) }, }))); }); diff --git a/spec/fixtures/parsers/arithmetic.c b/spec/fixtures/parsers/arithmetic.c index 1b634782..fca3d303 100644 --- a/spec/fixtures/parsers/arithmetic.c +++ b/spec/fixtures/parsers/arithmetic.c @@ -20,19 +20,19 @@ static void ts_lex(TSParser *parser) { START_LEXER(); switch (LEX_STATE()) { case 0: - if (isalnum(LOOKAHEAD_CHAR())) - ADVANCE(2); if (isdigit(LOOKAHEAD_CHAR())) ADVANCE(3); if (LOOKAHEAD_CHAR() == '(') + ADVANCE(2); + if (isalnum(LOOKAHEAD_CHAR())) ADVANCE(1); LEX_ERROR(); case 1: - ACCEPT_TOKEN(ts_symbol_2); - case 2: if (isalnum(LOOKAHEAD_CHAR())) - ADVANCE(2); + ADVANCE(1); ACCEPT_TOKEN(ts_symbol_1); + case 2: + ACCEPT_TOKEN(ts_symbol_2); case 3: if (isdigit(LOOKAHEAD_CHAR())) ADVANCE(3); diff --git a/src/compiler/grammar/extract_tokens.cpp b/src/compiler/grammar/extract_tokens.cpp index 7f13bb81..f5c39ae6 100644 --- a/src/compiler/grammar/extract_tokens.cpp +++ b/src/compiler/grammar/extract_tokens.cpp @@ -19,7 +19,7 @@ namespace tree_sitter { return value; } else { string token_name = add_token(rule); - return rules::token(token_name); + return rules::sym(token_name); } } diff --git a/src/compiler/grammar/grammar.cpp b/src/compiler/grammar/grammar.cpp index c74ca50a..de3afa59 100644 --- a/src/compiler/grammar/grammar.cpp +++ b/src/compiler/grammar/grammar.cpp @@ -38,6 +38,10 @@ namespace tree_sitter { return true; } + bool Grammar::has_definition(const rules::Symbol &symbol) const { + return rules.find(symbol.name) != rules.end(); + } + std::ostream& operator<<(std::ostream &stream, const Grammar &grammar) { stream << string("# rule_names() const; bool operator==(const Grammar &other) const; + bool has_definition(const rules::Symbol &symbol) const; const std::unordered_map rules; }; diff --git a/src/compiler/lr/item.cpp b/src/compiler/lr/item.cpp index 11823ae3..e8b4a13f 100644 --- a/src/compiler/lr/item.cpp +++ b/src/compiler/lr/item.cpp @@ -28,10 +28,10 @@ namespace tree_sitter { }); }; - vector Item::next_symbols() const { - vector result; + vector Item::next_symbols() const { + vector result; for (auto pair : lr::transitions(rule)) { - auto sym = dynamic_pointer_cast(pair.first); + auto sym = dynamic_pointer_cast(pair.first); if (sym) result.push_back(*sym); } return result; @@ -40,24 +40,24 @@ namespace tree_sitter { bool Item::operator==(const Item &other) const { bool rule_names_eq = other.rule_name == rule_name; bool rules_eq = (*other.rule == *rule); - return rule_names_eq && rules_eq; + bool consumed_sym_counts_eq = (other.consumed_sym_count == consumed_sym_count); + return rule_names_eq && rules_eq && consumed_sym_counts_eq; } bool Item::is_done() const { - for (auto pair : transitions()) { - if (*pair.first == rules::Blank()) return true; - } + for (auto pair : transitions()) + if (*pair.first == rules::Blank()) + return true; return false; } std::ostream& operator<<(ostream &stream, const Item &item) { - stream << + return stream << string("#"); - return stream; } } } diff --git a/src/compiler/lr/item.h b/src/compiler/lr/item.h index 6a8d6ffb..34e463c6 100644 --- a/src/compiler/lr/item.h +++ b/src/compiler/lr/item.h @@ -3,7 +3,7 @@ #include #include "rule.h" -#include "non_terminal.h" +#include "symbol.h" #include "transition_map.h" namespace tree_sitter { @@ -20,7 +20,7 @@ namespace tree_sitter { static Item at_beginning_of_token(const std::string &rule_name, const Grammar &grammar); transition_map transitions() const; - std::vector next_symbols() const; + std::vector next_symbols() const; bool operator==(const Item &other) const; bool is_done() const; diff --git a/src/compiler/lr/item_set.cpp b/src/compiler/lr/item_set.cpp index 22129a46..9dcce663 100644 --- a/src/compiler/lr/item_set.cpp +++ b/src/compiler/lr/item_set.cpp @@ -1,10 +1,12 @@ #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 lr { @@ -18,9 +20,11 @@ namespace tree_sitter { static void add_item(vector &vector, const Item &item, const Grammar &grammar) { if (!vector_contains(vector, item)) { vector.push_back(item); - for (rules::NonTerminal rule : item.next_symbols()) { - Item next_item = Item::at_beginning_of_rule(rule.name, grammar); - add_item(vector, next_item, grammar); + 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); + } } } } @@ -33,17 +37,35 @@ namespace tree_sitter { ItemSet::ItemSet(const Item &item, const Grammar &grammar) : contents(closure_in_grammar(item, grammar)) {} - transition_map ItemSet::all_transitions(const Grammar &grammar) const { - transition_map result; - for (auto item : *this) { - auto item_transitions = item.transitions(); - for (auto pair : item_transitions) { - result.add(pair.first, std::make_shared(*pair.second, 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::lr::ItemSet &other) const { return contents == other.contents; } @@ -66,12 +88,9 @@ namespace tree_sitter { ostream& operator<<(ostream &stream, const ItemSet &item_set) { stream << string("#"); - return stream; + for (Item item : item_set) + stream << item << string(" "); + return stream << string(">"); } } } diff --git a/src/compiler/lr/item_set.h b/src/compiler/lr/item_set.h index df6eae7f..a2397e32 100644 --- a/src/compiler/lr/item_set.h +++ b/src/compiler/lr/item_set.h @@ -3,6 +3,7 @@ #include "item.h" #include "grammar.h" +#include namespace tree_sitter { namespace lr { @@ -22,26 +23,10 @@ namespace tree_sitter { const_iterator end() const; size_t size() const; - transition_map all_transitions(const Grammar &grammar) const; - - template - transition_map transitions(const Grammar &grammar) const { - transition_map result; - for (auto transition : all_transitions(grammar)) { - auto rule = std::dynamic_pointer_cast(transition.first); - if (rule.get()) result.add(rule, transition.second); - } - return result; - } - - template - std::vector next_inputs(const Grammar &grammar) const { - std::vector result; - for (auto pair : transitions(grammar)) - result.push_back(*pair.first); - return result; - } + 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; }; diff --git a/src/compiler/lr/table_builder.cpp b/src/compiler/lr/table_builder.cpp index 121a4176..caf5cf60 100644 --- a/src/compiler/lr/table_builder.cpp +++ b/src/compiler/lr/table_builder.cpp @@ -32,7 +32,9 @@ namespace tree_sitter { } void add_shift_actions(const ItemSet &item_set, size_t state_index) { - for (auto transition : item_set.transitions(grammar)) { + auto x = item_set.sym_transitions(grammar); + for (auto transition : x) { + rules::Symbol symbol = *transition.first; ItemSet item_set = *transition.second; size_t new_state_index = add_parse_state(item_set); @@ -41,7 +43,7 @@ namespace tree_sitter { } void add_advance_actions(const ItemSet &item_set, size_t state_index) { - for (auto transition : item_set.transitions(grammar)) { + for (auto transition : item_set.char_transitions(grammar)) { rules::Character rule = *transition.first; ItemSet item_set = *transition.second; size_t new_state_index = add_lex_state(item_set); @@ -82,8 +84,8 @@ namespace tree_sitter { ItemSet lex_item_set_for_parse_item_set(const ItemSet &parse_item_set) { vector items; - for (rules::Token token : parse_item_set.next_inputs(grammar)) - items.push_back(Item::at_beginning_of_token(token.name, lex_grammar)); + for (rules::Symbol symbol : parse_item_set.next_terminal_symbols(grammar)) + items.push_back(Item::at_beginning_of_token(symbol.name, lex_grammar)); return ItemSet(items); } diff --git a/src/compiler/lr/transitions.cpp b/src/compiler/lr/transitions.cpp index 1b98465b..bde7c352 100644 --- a/src/compiler/lr/transitions.cpp +++ b/src/compiler/lr/transitions.cpp @@ -21,10 +21,6 @@ namespace tree_sitter { value = transition_map({{ rule->copy(), blank() }}); } - void visit(const Token *rule) { - value = transition_map({{ rule->copy(), blank() }}); - } - void visit(const Choice *rule) { value = transitions(rule->left); value.merge(transitions(rule->right), [&](rule_ptr left, rule_ptr right) -> rule_ptr { diff --git a/src/compiler/rules/non_terminal.cpp b/src/compiler/rules/non_terminal.cpp deleted file mode 100644 index 2d107b66..00000000 --- a/src/compiler/rules/non_terminal.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include "rules.h" -#include "transition_map.h" - -using std::string; -using std::hash; - -namespace tree_sitter { - namespace rules { - NonTerminal::NonTerminal(const std::string &name) : Symbol(name) {}; - - bool NonTerminal::operator==(const Rule &rule) const { - const NonTerminal *other = dynamic_cast(&rule); - return other && (other->name == name); - } - - rule_ptr NonTerminal::copy() const { - return std::make_shared(*this); - } - - string NonTerminal::to_string() const { - return string("#"; - } - - void NonTerminal::accept(Visitor &visitor) const { - visitor.visit(this); - } - } -} \ No newline at end of file diff --git a/src/compiler/rules/non_terminal.h b/src/compiler/rules/non_terminal.h deleted file mode 100644 index 77a548f7..00000000 --- a/src/compiler/rules/non_terminal.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef __tree_sitter__non_terminal__ -#define __tree_sitter__non_terminal__ - -#include "symbol.h" - -namespace tree_sitter { - namespace rules { - class NonTerminal : public Symbol { - public: - NonTerminal(const std::string &name); - - bool operator==(const Rule& other) const; - rule_ptr copy() const; - std::string to_string() const; - void accept(Visitor &visitor) const; - }; - } -} - -#endif diff --git a/src/compiler/rules/rules.cpp b/src/compiler/rules/rules.cpp index 6920df83..f43caa79 100644 --- a/src/compiler/rules/rules.cpp +++ b/src/compiler/rules/rules.cpp @@ -47,11 +47,7 @@ namespace tree_sitter { } sym_ptr sym(const string &name) { - return make_shared(name); - } - - rule_ptr token(const std::string &name) { - return make_shared(name); + return make_shared(name); } } } diff --git a/src/compiler/rules/rules.h b/src/compiler/rules/rules.h index 6c4aa6fa..41e4611d 100644 --- a/src/compiler/rules/rules.h +++ b/src/compiler/rules/rules.h @@ -4,14 +4,12 @@ #include "rule.h" #include "blank.h" #include "symbol.h" -#include "token.h" #include "choice.h" #include "seq.h" #include "string.h" #include "pattern.h" #include "character.h" #include "repeat.h" -#include "non_terminal.h" #include "visitor.h" namespace tree_sitter { @@ -26,7 +24,6 @@ namespace tree_sitter { rule_ptr seq(const std::initializer_list &rules); rule_ptr str(const std::string &value); sym_ptr sym(const std::string &name); - rule_ptr token(const std::string &name); } } diff --git a/src/compiler/rules/symbol.cpp b/src/compiler/rules/symbol.cpp index 99ff25d1..25d505e0 100644 --- a/src/compiler/rules/symbol.cpp +++ b/src/compiler/rules/symbol.cpp @@ -25,6 +25,10 @@ namespace tree_sitter { return string("#"; } + bool Symbol::operator<(const Symbol &other) const { + return name < other.name; + } + void Symbol::accept(Visitor &visitor) const { visitor.visit(this); } diff --git a/src/compiler/rules/symbol.h b/src/compiler/rules/symbol.h index d287e0ff..6a0ffe0b 100644 --- a/src/compiler/rules/symbol.h +++ b/src/compiler/rules/symbol.h @@ -14,6 +14,7 @@ namespace tree_sitter { rule_ptr copy() const; std::string to_string() const; void accept(Visitor &visitor) const; + bool operator<(const Symbol &other) const; const std::string name; }; @@ -22,4 +23,10 @@ namespace tree_sitter { } } +namespace std { + template<> + struct hash : hash {}; +} + + #endif \ No newline at end of file diff --git a/src/compiler/rules/token.cpp b/src/compiler/rules/token.cpp deleted file mode 100644 index 9c279784..00000000 --- a/src/compiler/rules/token.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include "rules.h" -#include "transition_map.h" - -using std::string; -using std::hash; - -namespace tree_sitter { - namespace rules { - Token::Token(const std::string &name) : Symbol(name) {}; - - bool Token::operator==(const Rule &rule) const { - const Token *other = dynamic_cast(&rule); - return other && (other->name == name); - } - - rule_ptr Token::copy() const { - return std::make_shared(*this); - } - - string Token::to_string() const { - return string("#"; - } - - void Token::accept(Visitor &visitor) const { - visitor.visit(this); - } - } -} \ No newline at end of file diff --git a/src/compiler/rules/token.h b/src/compiler/rules/token.h deleted file mode 100644 index 96d9b5a3..00000000 --- a/src/compiler/rules/token.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef __tree_sitter__token__ -#define __tree_sitter__token__ - -#include "symbol.h" - -namespace tree_sitter { - namespace rules { - class Token : public Symbol { - public: - Token(const std::string &name); - - bool operator==(const Rule& other) const; - rule_ptr copy() const; - std::string to_string() const; - void accept(Visitor &visitor) const; - }; - } -} - -#endif diff --git a/src/compiler/rules/visitor.cpp b/src/compiler/rules/visitor.cpp index dd786212..ec2d04bb 100644 --- a/src/compiler/rules/visitor.cpp +++ b/src/compiler/rules/visitor.cpp @@ -11,6 +11,5 @@ namespace tree_sitter { void Visitor::visit(const Seq *rule) { default_visit(rule); } void Visitor::visit(const String *rule) { default_visit(rule); } void Visitor::visit(const Pattern *rule) { default_visit(rule); } - void Visitor::visit(const Token *rule) { default_visit(rule); } } } \ No newline at end of file diff --git a/src/compiler/rules/visitor.h b/src/compiler/rules/visitor.h index 63455231..ae95aac3 100644 --- a/src/compiler/rules/visitor.h +++ b/src/compiler/rules/visitor.h @@ -16,7 +16,6 @@ namespace tree_sitter { virtual void visit(const Seq *rule); virtual void visit(const String *rule); virtual void visit(const Pattern *rule); - virtual void visit(const Token *rule); }; } } diff --git a/tree_sitter.xcodeproj/project.pbxproj b/tree_sitter.xcodeproj/project.pbxproj index 12d995c7..19aec9cf 100644 --- a/tree_sitter.xcodeproj/project.pbxproj +++ b/tree_sitter.xcodeproj/project.pbxproj @@ -16,14 +16,10 @@ 1213061B182C84DF00FCF928 /* item.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 12130619182C84DF00FCF928 /* item.cpp */; }; 12130622182C85D300FCF928 /* item_set.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 12130620182C85D300FCF928 /* item_set.cpp */; }; 1214930E181E200B008E9BDA /* main.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 121492E9181E200B008E9BDA /* main.cpp */; }; - 121D8B2E187763F3003CF44B /* non_terminal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 121D8B2C187763F3003CF44B /* non_terminal.cpp */; }; - 121D8B2F1877AD1C003CF44B /* non_terminal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 121D8B2C187763F3003CF44B /* non_terminal.cpp */; }; 1225CC6418765693000D4723 /* prepare_grammar_spec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1225CC6318765693000D4723 /* prepare_grammar_spec.cpp */; }; 1225CC6718765737000D4723 /* prepare_grammar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1225CC6518765737000D4723 /* prepare_grammar.cpp */; }; 1225CC6A187661C7000D4723 /* extract_tokens.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1225CC68187661C7000D4723 /* extract_tokens.cpp */; }; 1225CC6D18766969000D4723 /* search_for_symbols.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1225CC6B18766969000D4723 /* search_for_symbols.cpp */; }; - 1225CC701876AFFF000D4723 /* token.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1225CC6E1876AFFF000D4723 /* token.cpp */; }; - 1225CC711876B103000D4723 /* token.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1225CC6E1876AFFF000D4723 /* token.cpp */; }; 1251209B1830145300C9B56A /* rule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1251209A1830145300C9B56A /* rule.cpp */; }; 125120A018307DEC00C9B56A /* parse_table.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1251209E18307DEC00C9B56A /* parse_table.cpp */; }; 125120A4183083BD00C9B56A /* arithmetic.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 125120A3183083BD00C9B56A /* arithmetic.cpp */; }; @@ -113,8 +109,6 @@ 12130621182C85D300FCF928 /* item_set.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = item_set.h; sourceTree = ""; }; 121492E9181E200B008E9BDA /* main.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = main.cpp; path = spec/main.cpp; sourceTree = SOURCE_ROOT; }; 121492EA181E200B008E9BDA /* rules_spec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = rules_spec.cpp; path = spec/compiler/rules/rules_spec.cpp; sourceTree = SOURCE_ROOT; }; - 121D8B2C187763F3003CF44B /* non_terminal.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = non_terminal.cpp; sourceTree = ""; }; - 121D8B2D187763F3003CF44B /* non_terminal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = non_terminal.h; sourceTree = ""; }; 1225CC6318765693000D4723 /* prepare_grammar_spec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = prepare_grammar_spec.cpp; sourceTree = ""; }; 1225CC6518765737000D4723 /* prepare_grammar.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = prepare_grammar.cpp; sourceTree = ""; }; 1225CC6618765737000D4723 /* prepare_grammar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = prepare_grammar.h; sourceTree = ""; }; @@ -122,8 +116,6 @@ 1225CC69187661C7000D4723 /* extract_tokens.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = extract_tokens.h; sourceTree = ""; }; 1225CC6B18766969000D4723 /* search_for_symbols.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = search_for_symbols.cpp; sourceTree = ""; }; 1225CC6C18766969000D4723 /* search_for_symbols.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = search_for_symbols.h; sourceTree = ""; }; - 1225CC6E1876AFFF000D4723 /* token.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = token.cpp; sourceTree = ""; }; - 1225CC6F1876AFFF000D4723 /* token.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = token.h; sourceTree = ""; }; 12512092182F307C00C9B56A /* table_builder_spec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = table_builder_spec.cpp; path = spec/compiler/lr/table_builder_spec.cpp; sourceTree = SOURCE_ROOT; }; 1251209A1830145300C9B56A /* rule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rule.cpp; sourceTree = ""; }; 1251209E18307DEC00C9B56A /* parse_table.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = parse_table.cpp; sourceTree = ""; }; @@ -208,12 +200,8 @@ 12130616182C3D2900FCF928 /* string.h */, 12130609182C389100FCF928 /* symbol.cpp */, 1213060A182C389100FCF928 /* symbol.h */, - 1225CC6E1876AFFF000D4723 /* token.cpp */, - 1225CC6F1876AFFF000D4723 /* token.h */, 12FD40E618639B910041A84E /* visitor.cpp */, 12FD40E41862B3530041A84E /* visitor.h */, - 121D8B2C187763F3003CF44B /* non_terminal.cpp */, - 121D8B2D187763F3003CF44B /* non_terminal.h */, ); path = rules; sourceTree = ""; @@ -487,7 +475,6 @@ files = ( 12FD40D7185FEEDB0041A84E /* item_spec.cpp in Sources */, 12130614182C3A1700FCF928 /* seq.cpp in Sources */, - 121D8B2E187763F3003CF44B /* non_terminal.cpp in Sources */, 1225CC6A187661C7000D4723 /* extract_tokens.cpp in Sources */, 129D242C183EB1EB00FE9F71 /* table_builder.cpp in Sources */, 125120A4183083BD00C9B56A /* arithmetic.cpp in Sources */, @@ -499,7 +486,6 @@ 1213060E182C398300FCF928 /* choice.cpp in Sources */, 12F9A64E182DD5FD00FAF50C /* spec_helper.cpp in Sources */, 12FD40F7186A16020041A84E /* lex_table.cpp in Sources */, - 1225CC701876AFFF000D4723 /* token.cpp in Sources */, 12FD40E918641FB70041A84E /* rules.cpp in Sources */, 12FD4061185E68470041A84E /* c_code.cpp in Sources */, 12FD40D8185FEEDF0041A84E /* rules_spec.cpp in Sources */, @@ -530,13 +516,11 @@ 12FD40B3185EEB5E0041A84E /* seq.cpp in Sources */, 12FD40B4185EEB5E0041A84E /* table_builder.cpp in Sources */, 12FD40B6185EEB5E0041A84E /* arithmetic.cpp in Sources */, - 121D8B2F1877AD1C003CF44B /* non_terminal.cpp in Sources */, 12FD40DD185FF12C0041A84E /* parser.c in Sources */, 12FD40B8185EEB5E0041A84E /* item.cpp in Sources */, 12FD40B9185EEB5E0041A84E /* string.cpp in Sources */, 12FD40EF186641510041A84E /* transitions.cpp in Sources */, 12FD40BB185EEB5E0041A84E /* blank.cpp in Sources */, - 1225CC711876B103000D4723 /* token.cpp in Sources */, 12FD40F4186641C00041A84E /* char_match.cpp in Sources */, 12FD40BD185EEB5E0041A84E /* choice.cpp in Sources */, 12FD40DF1860064C0041A84E /* tree.c in Sources */,