Separate table building operations from Item, ItemSet value objects
This commit is contained in:
parent
92cec5758f
commit
8881214f0d
18 changed files with 218 additions and 166 deletions
|
|
@ -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<rules::Rule, Item>({
|
||||
{ char1, make_shared<Item>("my-rule", char2, 3) }
|
||||
})));
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
END_TEST
|
||||
35
src/compiler/build_tables/close_item_set.cpp
Normal file
35
src/compiler/build_tables/close_item_set.cpp
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
#include "close_item_set.h"
|
||||
#include "./next_symbols.h"
|
||||
#include "grammar.h"
|
||||
#include "item.h"
|
||||
#include <vector>
|
||||
|
||||
using std::vector;
|
||||
|
||||
namespace tree_sitter {
|
||||
namespace build_tables {
|
||||
static bool vector_contains(vector<Item> items, build_tables::Item item) {
|
||||
return (std::find(items.begin(), items.end(), item) != items.end());
|
||||
}
|
||||
|
||||
static void add_item(vector<Item> &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<Item> closure_in_grammar(const Item &item, const Grammar &grammar) {
|
||||
vector<Item> 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));
|
||||
}
|
||||
}
|
||||
}
|
||||
14
src/compiler/build_tables/close_item_set.h
Normal file
14
src/compiler/build_tables/close_item_set.h
Normal file
|
|
@ -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
|
||||
|
|
@ -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<rules::Rule, Item> Item::transitions() const {
|
||||
return rule_transitions(rule).map<Item>([&](rules::rule_ptr to_rule) -> item_ptr {
|
||||
int next_sym_count = (consumed_sym_count == -1) ? -1 : (consumed_sym_count + 1);
|
||||
return make_shared<Item>(rule_name, to_rule, next_sym_count);
|
||||
});
|
||||
};
|
||||
|
||||
vector<rules::Symbol> Item::next_symbols() const {
|
||||
vector<rules::Symbol> result;
|
||||
for (auto pair : rule_transitions(rule)) {
|
||||
auto sym = dynamic_pointer_cast<const rules::Symbol>(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;
|
||||
|
|
|
|||
|
|
@ -3,15 +3,13 @@
|
|||
|
||||
#include <string>
|
||||
#include "rule.h"
|
||||
#include "symbol.h"
|
||||
#include "transition_map.h"
|
||||
#include <set>
|
||||
|
||||
namespace tree_sitter {
|
||||
class Grammar;
|
||||
|
||||
namespace build_tables {
|
||||
class Item;
|
||||
typedef std::shared_ptr<const Item> 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<rules::Rule, Item> transitions() const;
|
||||
std::vector<rules::Symbol> 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<const Item> item_ptr;
|
||||
std::ostream& operator<<(std::ostream &stream, const Item &item);
|
||||
|
||||
std::ostream& operator<<(std::ostream &stream, const Item &item);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<Item> &items) : contents(items) {}
|
||||
ItemSet::ItemSet(const initializer_list<Item> &items) : contents(items) {}
|
||||
|
||||
static bool vector_contains(vector<Item> items, build_tables::Item item) {
|
||||
return (std::find(items.begin(), items.end(), item) != items.end());
|
||||
}
|
||||
|
||||
static void add_item(vector<Item> &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<Item> closure_in_grammar(const Item &item, const Grammar &grammar) {
|
||||
vector<Item> result;
|
||||
add_item(result, item, grammar);
|
||||
return result;
|
||||
}
|
||||
|
||||
ItemSet::ItemSet(const Item &item, const Grammar &grammar) : contents(closure_in_grammar(item, grammar)) {}
|
||||
|
||||
template<typename RuleClass>
|
||||
transition_map<RuleClass, ItemSet> transitions(const ItemSet *item_set, const Grammar &grammar) {
|
||||
transition_map<RuleClass, ItemSet> result;
|
||||
for (Item item : *item_set) {
|
||||
for (auto transition : item.transitions()) {
|
||||
auto rule = dynamic_pointer_cast<const RuleClass>(transition.first);
|
||||
if (rule.get()) result.add(rule, make_shared<ItemSet>(*transition.second, grammar));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
transition_map<rules::Character, ItemSet> ItemSet::char_transitions(const Grammar &grammar) const {
|
||||
return transitions<rules::Character>(this, grammar);
|
||||
}
|
||||
|
||||
transition_map<rules::Symbol, ItemSet> ItemSet::sym_transitions(const Grammar &grammar) const {
|
||||
return transitions<rules::Symbol>(this, grammar);
|
||||
}
|
||||
|
||||
set<rules::Symbol> ItemSet::next_terminal_symbols(const Grammar &grammar) const {
|
||||
set<rules::Symbol> 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("#<item_set ");
|
||||
for (Item item : item_set)
|
||||
|
|
|
|||
|
|
@ -2,35 +2,27 @@
|
|||
#define __TreeSitter__item_set__
|
||||
|
||||
#include "item.h"
|
||||
#include "grammar.h"
|
||||
#include "rule.h"
|
||||
#include <vector>
|
||||
#include <set>
|
||||
|
||||
namespace tree_sitter {
|
||||
namespace build_tables {
|
||||
class ItemSet;
|
||||
typedef std::shared_ptr<const ItemSet> item_set_ptr;
|
||||
|
||||
class ItemSet {
|
||||
const std::vector<Item> contents;
|
||||
public:
|
||||
ItemSet(const std::vector<Item> &items);
|
||||
ItemSet(const std::initializer_list<Item> &items);
|
||||
ItemSet(const Item &item, const Grammar &grammar);
|
||||
bool operator==(const ItemSet &other) const;
|
||||
|
||||
typedef Item value_type;
|
||||
typedef std::vector<Item>::const_iterator const_iterator;
|
||||
const_iterator begin() const;
|
||||
const_iterator end() const;
|
||||
size_t size() const;
|
||||
|
||||
transition_map<rules::Character, ItemSet> char_transitions(const Grammar &grammar) const;
|
||||
transition_map<rules::Symbol, ItemSet> sym_transitions(const Grammar &grammar) const;
|
||||
|
||||
std::set<rules::Symbol> next_terminal_symbols(const Grammar &grammar) const;
|
||||
bool operator==(const ItemSet &other) const;
|
||||
};
|
||||
|
||||
typedef std::shared_ptr<const ItemSet> item_set_ptr;
|
||||
std::ostream& operator<<(std::ostream &stream, const ItemSet &item_set);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
37
src/compiler/build_tables/item_set_transitions.cpp
Normal file
37
src/compiler/build_tables/item_set_transitions.cpp
Normal file
|
|
@ -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<rules::Rule, Item> item_transitions(const Item &item) {
|
||||
return rule_transitions(item.rule).map<Item>([&](rules::rule_ptr to_rule) {
|
||||
return make_shared<Item>(item.rule_name, to_rule, item.next_sym_count());
|
||||
});
|
||||
};
|
||||
|
||||
template<typename RuleClass>
|
||||
transition_map<RuleClass, ItemSet> transitions(const ItemSet &item_set, const Grammar &grammar) {
|
||||
transition_map<RuleClass, ItemSet> result;
|
||||
for (Item item : item_set) {
|
||||
for (auto transition : item_transitions(item)) {
|
||||
auto rule = dynamic_pointer_cast<const RuleClass>(transition.first);
|
||||
auto new_item_set = make_shared<ItemSet>(close_item_set(ItemSet({ *transition.second }), grammar));
|
||||
if (rule.get()) result.add(rule, new_item_set);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
transition_map<rules::Character, ItemSet> char_transitions(const ItemSet &item_set, const Grammar &grammar) {
|
||||
return transitions<rules::Character>(item_set, grammar);
|
||||
}
|
||||
|
||||
transition_map<rules::Symbol, ItemSet> sym_transitions(const ItemSet &item_set, const Grammar &grammar) {
|
||||
return transitions<rules::Symbol>(item_set, grammar);
|
||||
}
|
||||
}
|
||||
}
|
||||
16
src/compiler/build_tables/item_set_transitions.h
Normal file
16
src/compiler/build_tables/item_set_transitions.h
Normal file
|
|
@ -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<rules::Character, ItemSet> char_transitions(const ItemSet &item_set, const Grammar &grammar);
|
||||
transition_map<rules::Symbol, ItemSet> sym_transitions(const ItemSet &item_set, const Grammar &grammar);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
41
src/compiler/build_tables/next_symbols.cpp
Normal file
41
src/compiler/build_tables/next_symbols.cpp
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
#include "next_symbols.h"
|
||||
#include "rule_transitions.h"
|
||||
#include "grammar.h"
|
||||
#include <vector>
|
||||
|
||||
using std::set;
|
||||
using std::vector;
|
||||
using std::dynamic_pointer_cast;
|
||||
|
||||
namespace tree_sitter {
|
||||
class Grammar;
|
||||
|
||||
namespace build_tables {
|
||||
template<bool isNonTerminal>
|
||||
set<rules::Symbol> next_symbols(const Item &item, const Grammar &grammar) {
|
||||
set<rules::Symbol> result;
|
||||
for (auto pair : rule_transitions(item.rule)) {
|
||||
auto symbol = dynamic_pointer_cast<const rules::Symbol>(pair.first);
|
||||
if (symbol && (grammar.has_definition(*symbol) == isNonTerminal))
|
||||
result.insert(*symbol);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
set<rules::Symbol> next_terminals(const Item &item, const Grammar &grammar) {
|
||||
return next_symbols<false>(item, grammar);
|
||||
}
|
||||
|
||||
set<rules::Symbol> next_non_terminals(const Item &item, const Grammar &grammar) {
|
||||
return next_symbols<true>(item, grammar);
|
||||
}
|
||||
|
||||
set<rules::Symbol> next_terminals(const ItemSet &item_set, const Grammar &grammar) {
|
||||
set<rules::Symbol> result;
|
||||
for (Item item : item_set)
|
||||
for (rules::Symbol symbol : next_terminals(item, grammar))
|
||||
result.insert(symbol);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
17
src/compiler/build_tables/next_symbols.h
Normal file
17
src/compiler/build_tables/next_symbols.h
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
#ifndef __tree_sitter__first_terminal__
|
||||
#define __tree_sitter__first_terminal__
|
||||
|
||||
#include "item_set.h"
|
||||
#include "symbol.h"
|
||||
#include <set>
|
||||
|
||||
namespace tree_sitter {
|
||||
class Grammar;
|
||||
|
||||
namespace build_tables {
|
||||
std::set<rules::Symbol> next_terminals(const ItemSet &item_set, const Grammar &grammar);
|
||||
std::set<rules::Symbol> next_terminals(const Item &item, const Grammar &grammar);
|
||||
std::set<rules::Symbol> next_non_terminals(const Item &item, const Grammar &grammar);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
|
@ -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<const ItemSet, size_t> parse_state_indices;
|
||||
std::unordered_map<const ItemSet, size_t> lex_state_indices;
|
||||
unordered_map<const ItemSet, size_t> parse_state_indices;
|
||||
unordered_map<const ItemSet, size_t> 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<Item> 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<ParseTable, LexTable> 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<ParseTable, LexTable>(parse_table, lex_table);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -20,8 +20,6 @@ namespace tree_sitter {
|
|||
|
||||
const CharMatch value;
|
||||
};
|
||||
|
||||
typedef std::shared_ptr<const Character> char_ptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,11 +10,11 @@ namespace tree_sitter {
|
|||
return make_shared<Blank>();
|
||||
}
|
||||
|
||||
char_ptr character(char value) {
|
||||
rule_ptr character(char value) {
|
||||
return make_shared<Character>(value);
|
||||
}
|
||||
|
||||
char_ptr character(CharClass value) {
|
||||
rule_ptr character(CharClass value) {
|
||||
return make_shared<Character>(value);
|
||||
}
|
||||
|
||||
|
|
@ -46,7 +46,7 @@ namespace tree_sitter {
|
|||
return make_shared<String>(value);
|
||||
}
|
||||
|
||||
sym_ptr sym(const string &name) {
|
||||
rule_ptr sym(const string &name) {
|
||||
return make_shared<Symbol>(name);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<rule_ptr> &rules);
|
||||
rule_ptr pattern(const std::string &value);
|
||||
rule_ptr repeat(const rule_ptr content);
|
||||
rule_ptr seq(const std::initializer_list<rule_ptr> &rules);
|
||||
rule_ptr str(const std::string &value);
|
||||
sym_ptr sym(const std::string &name);
|
||||
rule_ptr sym(const std::string &name);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -18,8 +18,6 @@ namespace tree_sitter {
|
|||
|
||||
const std::string name;
|
||||
};
|
||||
|
||||
typedef std::shared_ptr<const Symbol> sym_ptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 = "<group>"; };
|
||||
12EDCFAD18820181005A7A07 /* compile.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = compile.h; sourceTree = "<group>"; };
|
||||
12EDCFB5188205BA005A7A07 /* item_spec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = item_spec.cpp; sourceTree = "<group>"; };
|
||||
12EDCFB6188205BA005A7A07 /* rule_transitions_spec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = rule_transitions_spec.cpp; sourceTree = "<group>"; };
|
||||
12EDCFB7188205BA005A7A07 /* perform_spec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = perform_spec.cpp; sourceTree = "<group>"; };
|
||||
12EDCFBE18820880005A7A07 /* close_item_set.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = close_item_set.cpp; sourceTree = "<group>"; };
|
||||
12EDCFBF18820880005A7A07 /* close_item_set.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = close_item_set.h; sourceTree = "<group>"; };
|
||||
12EDCFC118820A70005A7A07 /* item_set_transitions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = item_set_transitions.cpp; sourceTree = "<group>"; };
|
||||
12EDCFC218820A70005A7A07 /* item_set_transitions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = item_set_transitions.h; sourceTree = "<group>"; };
|
||||
12EDCFC41882153D005A7A07 /* next_symbols.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = next_symbols.cpp; sourceTree = "<group>"; };
|
||||
12EDCFC51882153D005A7A07 /* next_symbols.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = next_symbols.h; sourceTree = "<group>"; };
|
||||
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 = "<group>";
|
||||
};
|
||||
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 */,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue