From 9618efd12a02dcd934b58b0a15850bf1222c5451 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Sun, 15 Dec 2013 23:57:30 -0800 Subject: [PATCH] Organize source into compiler and runtime dirs --- TreeSitter.xcodeproj/project.pbxproj | 104 ++++++++++++------ .../xcshareddata/xcschemes/specs.xcscheme | 93 ++++++++++++++++ .../generate_parsers.cpp} | 3 +- spec/{ => compiler}/lr/item_set_spec.cpp | 1 - spec/{ => compiler}/lr/item_spec.cpp | 2 +- .../lr/parse_table_builder_spec.cpp | 1 - spec/{ => compiler}/rules/pattern_spec.cpp | 0 spec/{ => compiler}/rules/rules_spec.cpp | 0 .../grammars}/arithmetic.cpp | 0 .../grammars}/arithmetic.h | 0 .../parsers}/arithmetic.c | 0 spec/spec_helper.h | 3 + src/{ => compiler}/code_gen/c_code.cpp | 0 src/{ => compiler}/code_gen/c_code.h | 0 src/{ => compiler}/grammar.cpp | 0 src/{ => compiler}/grammar.h | 0 src/{ => compiler}/lr/item.cpp | 0 src/{ => compiler}/lr/item.h | 0 src/{ => compiler}/lr/item_set.cpp | 0 src/{ => compiler}/lr/item_set.h | 0 src/{ => compiler}/lr/parse_table.cpp | 0 src/{ => compiler}/lr/parse_table.h | 0 src/{ => compiler}/lr/parse_table_builder.cpp | 0 src/{ => compiler}/lr/parse_table_builder.h | 0 src/{ => compiler}/rules/blank.cpp | 0 src/{ => compiler}/rules/blank.h | 0 src/{ => compiler}/rules/char.cpp | 0 src/{ => compiler}/rules/char.h | 0 src/{ => compiler}/rules/char_class.cpp | 0 src/{ => compiler}/rules/char_class.h | 0 src/{ => compiler}/rules/choice.cpp | 0 src/{ => compiler}/rules/choice.h | 0 src/{ => compiler}/rules/pattern.cpp | 0 src/{ => compiler}/rules/pattern.h | 0 src/{ => compiler}/rules/repeat.cpp | 0 src/{ => compiler}/rules/repeat.h | 0 src/{ => compiler}/rules/rule.cpp | 0 src/{ => compiler}/rules/rule.h | 0 src/{ => compiler/rules}/rules.h | 0 src/{ => compiler}/rules/seq.cpp | 0 src/{ => compiler}/rules/seq.h | 0 src/{ => compiler}/rules/string.cpp | 0 src/{ => compiler}/rules/string.h | 0 src/{ => compiler}/rules/symbol.cpp | 0 src/{ => compiler}/rules/symbol.h | 0 src/{ => compiler}/transition_map.h | 0 46 files changed, 169 insertions(+), 38 deletions(-) create mode 100644 TreeSitter.xcodeproj/xcshareddata/xcschemes/specs.xcscheme rename spec/{code_gen_spec.cpp => compiler/generate_parsers.cpp} (84%) rename spec/{ => compiler}/lr/item_set_spec.cpp (98%) rename spec/{ => compiler}/lr/item_spec.cpp (89%) rename spec/{ => compiler}/lr/parse_table_builder_spec.cpp (97%) rename spec/{ => compiler}/rules/pattern_spec.cpp (100%) rename spec/{ => compiler}/rules/rules_spec.cpp (100%) rename spec/{test_grammars => fixtures/grammars}/arithmetic.cpp (100%) rename spec/{test_grammars => fixtures/grammars}/arithmetic.h (100%) rename spec/{test_parsers => fixtures/parsers}/arithmetic.c (100%) rename src/{ => compiler}/code_gen/c_code.cpp (100%) rename src/{ => compiler}/code_gen/c_code.h (100%) rename src/{ => compiler}/grammar.cpp (100%) rename src/{ => compiler}/grammar.h (100%) rename src/{ => compiler}/lr/item.cpp (100%) rename src/{ => compiler}/lr/item.h (100%) rename src/{ => compiler}/lr/item_set.cpp (100%) rename src/{ => compiler}/lr/item_set.h (100%) rename src/{ => compiler}/lr/parse_table.cpp (100%) rename src/{ => compiler}/lr/parse_table.h (100%) rename src/{ => compiler}/lr/parse_table_builder.cpp (100%) rename src/{ => compiler}/lr/parse_table_builder.h (100%) rename src/{ => compiler}/rules/blank.cpp (100%) rename src/{ => compiler}/rules/blank.h (100%) rename src/{ => compiler}/rules/char.cpp (100%) rename src/{ => compiler}/rules/char.h (100%) rename src/{ => compiler}/rules/char_class.cpp (100%) rename src/{ => compiler}/rules/char_class.h (100%) rename src/{ => compiler}/rules/choice.cpp (100%) rename src/{ => compiler}/rules/choice.h (100%) rename src/{ => compiler}/rules/pattern.cpp (100%) rename src/{ => compiler}/rules/pattern.h (100%) rename src/{ => compiler}/rules/repeat.cpp (100%) rename src/{ => compiler}/rules/repeat.h (100%) rename src/{ => compiler}/rules/rule.cpp (100%) rename src/{ => compiler}/rules/rule.h (100%) rename src/{ => compiler/rules}/rules.h (100%) rename src/{ => compiler}/rules/seq.cpp (100%) rename src/{ => compiler}/rules/seq.h (100%) rename src/{ => compiler}/rules/string.cpp (100%) rename src/{ => compiler}/rules/string.h (100%) rename src/{ => compiler}/rules/symbol.cpp (100%) rename src/{ => compiler}/rules/symbol.h (100%) rename src/{ => compiler}/transition_map.h (100%) diff --git a/TreeSitter.xcodeproj/project.pbxproj b/TreeSitter.xcodeproj/project.pbxproj index 4f172dda..2bd7c233 100644 --- a/TreeSitter.xcodeproj/project.pbxproj +++ b/TreeSitter.xcodeproj/project.pbxproj @@ -30,7 +30,7 @@ 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 */; }; - 12FD4064185E75290041A84E /* code_gen_spec.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 12FD4063185E75290041A84E /* code_gen_spec.cpp */; }; + 12FD4064185E75290041A84E /* generate_parsers.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 12FD4063185E75290041A84E /* generate_parsers.cpp */; }; 27A343CA69E17E0F9EBEDF1C /* pattern.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 27A340F3EEB184C040521323 /* pattern.cpp */; }; /* End PBXBuildFile section */ @@ -62,37 +62,37 @@ 12130616182C3D2900FCF928 /* string.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = string.h; sourceTree = ""; }; 12130619182C84DF00FCF928 /* item.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = item.cpp; sourceTree = ""; }; 1213061A182C84DF00FCF928 /* item.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = item.h; sourceTree = ""; }; - 1213061D182C857100FCF928 /* item_set_spec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = item_set_spec.cpp; path = spec/lr/item_set_spec.cpp; sourceTree = SOURCE_ROOT; }; + 1213061D182C857100FCF928 /* item_set_spec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = item_set_spec.cpp; path = spec/compiler/lr/item_set_spec.cpp; sourceTree = SOURCE_ROOT; }; 12130620182C85D300FCF928 /* item_set.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = item_set.cpp; sourceTree = ""; }; 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/rules/rules_spec.cpp; sourceTree = SOURCE_ROOT; }; - 12512092182F307C00C9B56A /* parse_table_builder_spec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = parse_table_builder_spec.cpp; path = spec/lr/parse_table_builder_spec.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; }; + 12512092182F307C00C9B56A /* parse_table_builder_spec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = parse_table_builder_spec.cpp; path = spec/compiler/lr/parse_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 = ""; }; 1251209F18307DEC00C9B56A /* parse_table.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = parse_table.h; sourceTree = ""; }; - 125120A218307FFD00C9B56A /* arithmetic.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = arithmetic.h; path = spec/test_grammars/arithmetic.h; sourceTree = SOURCE_ROOT; }; - 125120A3183083BD00C9B56A /* arithmetic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = arithmetic.cpp; path = spec/test_grammars/arithmetic.cpp; sourceTree = SOURCE_ROOT; }; + 125120A218307FFD00C9B56A /* arithmetic.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = arithmetic.h; path = spec/fixtures/grammars/arithmetic.h; sourceTree = SOURCE_ROOT; }; + 125120A3183083BD00C9B56A /* arithmetic.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = arithmetic.cpp; path = spec/fixtures/grammars/arithmetic.cpp; sourceTree = SOURCE_ROOT; }; 129D242A183EB1EB00FE9F71 /* parse_table_builder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = parse_table_builder.cpp; sourceTree = ""; }; 129D242B183EB1EB00FE9F71 /* parse_table_builder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = parse_table_builder.h; sourceTree = ""; }; 12C344421822F27700B07BE3 /* transition_map.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = transition_map.h; sourceTree = ""; }; - 12D1369C18328C5A005F3369 /* item_spec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = item_spec.cpp; path = spec/lr/item_spec.cpp; sourceTree = SOURCE_ROOT; }; + 12D1369C18328C5A005F3369 /* item_spec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = item_spec.cpp; path = spec/compiler/lr/item_spec.cpp; sourceTree = SOURCE_ROOT; }; 12D1369E18342088005F3369 /* todo.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = todo.md; sourceTree = ""; }; - 12D136A0183570F5005F3369 /* pattern_spec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = pattern_spec.cpp; path = spec/rules/pattern_spec.cpp; sourceTree = SOURCE_ROOT; }; + 12D136A0183570F5005F3369 /* pattern_spec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = pattern_spec.cpp; path = spec/compiler/rules/pattern_spec.cpp; sourceTree = SOURCE_ROOT; }; 12D136A2183678A2005F3369 /* repeat.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = repeat.cpp; sourceTree = ""; }; 12D136A3183678A2005F3369 /* repeat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = repeat.h; sourceTree = ""; }; 12E71794181D02A80051A649 /* specs */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = specs; sourceTree = BUILT_PRODUCTS_DIR; }; - 12E71852181D081C0051A649 /* rules.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rules.h; sourceTree = ""; }; + 12E71852181D081C0051A649 /* rules.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = rules.h; path = src/compiler/rules/rules.h; sourceTree = SOURCE_ROOT; }; 12F8BE8C183C79B2006CCF99 /* char_class.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = char_class.cpp; sourceTree = ""; }; 12F8BE8D183C79B2006CCF99 /* char_class.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = char_class.h; sourceTree = ""; }; 12F9A64C182DD5FD00FAF50C /* spec_helper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = spec_helper.cpp; path = spec/spec_helper.cpp; sourceTree = SOURCE_ROOT; }; 12F9A64D182DD5FD00FAF50C /* spec_helper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = spec_helper.h; path = spec/spec_helper.h; sourceTree = SOURCE_ROOT; }; 12F9A64F182DD6BC00FAF50C /* grammar.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = grammar.cpp; sourceTree = ""; }; 12F9A650182DD6BC00FAF50C /* grammar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = grammar.h; sourceTree = ""; }; - 12FD405F185E68470041A84E /* c_code.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = c_code.cpp; path = src/code_gen/c_code.cpp; sourceTree = SOURCE_ROOT; }; - 12FD4060185E68470041A84E /* c_code.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = c_code.h; path = src/code_gen/c_code.h; sourceTree = SOURCE_ROOT; }; - 12FD4063185E75290041A84E /* code_gen_spec.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = code_gen_spec.cpp; path = spec/code_gen_spec.cpp; sourceTree = SOURCE_ROOT; }; - 12FD4065185E7C2F0041A84E /* arithmetic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = arithmetic.c; path = spec/test_parsers/arithmetic.c; sourceTree = SOURCE_ROOT; }; + 12FD405F185E68470041A84E /* c_code.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = c_code.cpp; path = src/compiler/code_gen/c_code.cpp; sourceTree = SOURCE_ROOT; }; + 12FD4060185E68470041A84E /* c_code.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = c_code.h; path = src/compiler/code_gen/c_code.h; sourceTree = SOURCE_ROOT; }; + 12FD4063185E75290041A84E /* generate_parsers.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = generate_parsers.cpp; path = spec/compiler/generate_parsers.cpp; sourceTree = SOURCE_ROOT; }; + 12FD4065185E7C2F0041A84E /* arithmetic.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = arithmetic.c; path = spec/fixtures/parsers/arithmetic.c; sourceTree = SOURCE_ROOT; }; 27A340F3EEB184C040521323 /* pattern.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = pattern.cpp; sourceTree = ""; }; 27A3438C4FA59A3882E8493B /* pattern.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = pattern.h; sourceTree = ""; }; /* End PBXFileReference section */ @@ -111,6 +111,7 @@ 12130602182C344400FCF928 /* rules */ = { isa = PBXGroup; children = ( + 12E71852181D081C0051A649 /* rules.h */, 1213060F182C3A1100FCF928 /* blank.cpp */, 12130610182C3A1100FCF928 /* blank.h */, 12130603182C348F00FCF928 /* char.cpp */, @@ -161,14 +162,13 @@ path = spec/lr; sourceTree = ""; }; - 125120A118307FCA00C9B56A /* test_grammars */ = { + 125120A118307FCA00C9B56A /* grammars */ = { isa = PBXGroup; children = ( 125120A218307FFD00C9B56A /* arithmetic.h */, 125120A3183083BD00C9B56A /* arithmetic.cpp */, ); - name = test_grammars; - path = spec/test_grammars; + path = grammars; sourceTree = ""; }; 12D1369F18357066005F3369 /* rules */ = { @@ -178,7 +178,7 @@ 12D136A0183570F5005F3369 /* pattern_spec.cpp */, ); name = rules; - path = spec/rules; + path = compiler/rules; sourceTree = ""; }; 12E716F9181D010E0051A649 = { @@ -194,13 +194,8 @@ 12E71701181D01890051A649 /* src */ = { isa = PBXGroup; children = ( - 12FD4067185E8AF40041A84E /* code_gen */, - 12F9A64F182DD6BC00FAF50C /* grammar.cpp */, - 12F9A650182DD6BC00FAF50C /* grammar.h */, - 12130618182C84B700FCF928 /* lr */, - 12130602182C344400FCF928 /* rules */, - 12E71852181D081C0051A649 /* rules.h */, - 12C344421822F27700B07BE3 /* transition_map.h */, + 12FD40AD185EE5440041A84E /* runtime */, + 12FD40AC185EE4C00041A84E /* compiler */, ); path = src; sourceTree = ""; @@ -216,25 +211,22 @@ 12E71796181D02A80051A649 /* spec */ = { isa = PBXGroup; children = ( - 12FD4063185E75290041A84E /* code_gen_spec.cpp */, - 1213061C182C854F00FCF928 /* lr */, + 12FD40AE185EE6610041A84E /* compiler */, + 12FD40AF185EE81D0041A84E /* fixtures */, 121492E9181E200B008E9BDA /* main.cpp */, - 12D1369F18357066005F3369 /* rules */, + 12FD40B0185EE97E0041A84E /* runtime */, 12F9A64C182DD5FD00FAF50C /* spec_helper.cpp */, 12F9A64D182DD5FD00FAF50C /* spec_helper.h */, - 125120A118307FCA00C9B56A /* test_grammars */, - 12FD4062185E74DF0041A84E /* test_parsers */, ); path = spec; sourceTree = ""; }; - 12FD4062185E74DF0041A84E /* test_parsers */ = { + 12FD4062185E74DF0041A84E /* parsers */ = { isa = PBXGroup; children = ( 12FD4065185E7C2F0041A84E /* arithmetic.c */, ); - name = test_parsers; - path = spec/test_parsers; + path = parsers; sourceTree = ""; }; 12FD4067185E8AF40041A84E /* code_gen */ = { @@ -246,6 +238,52 @@ path = code_gen; sourceTree = ""; }; + 12FD40AC185EE4C00041A84E /* compiler */ = { + isa = PBXGroup; + children = ( + 12FD4067185E8AF40041A84E /* code_gen */, + 12F9A64F182DD6BC00FAF50C /* grammar.cpp */, + 12F9A650182DD6BC00FAF50C /* grammar.h */, + 12130618182C84B700FCF928 /* lr */, + 12130602182C344400FCF928 /* rules */, + 12C344421822F27700B07BE3 /* transition_map.h */, + ); + path = compiler; + sourceTree = ""; + }; + 12FD40AD185EE5440041A84E /* runtime */ = { + isa = PBXGroup; + children = ( + ); + path = runtime; + sourceTree = ""; + }; + 12FD40AE185EE6610041A84E /* compiler */ = { + isa = PBXGroup; + children = ( + 12D1369F18357066005F3369 /* rules */, + 1213061C182C854F00FCF928 /* lr */, + 12FD4063185E75290041A84E /* generate_parsers.cpp */, + ); + name = compiler; + sourceTree = ""; + }; + 12FD40AF185EE81D0041A84E /* fixtures */ = { + isa = PBXGroup; + children = ( + 125120A118307FCA00C9B56A /* grammars */, + 12FD4062185E74DF0041A84E /* parsers */, + ); + path = fixtures; + sourceTree = ""; + }; + 12FD40B0185EE97E0041A84E /* runtime */ = { + isa = PBXGroup; + children = ( + ); + name = runtime; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXNativeTarget section */ @@ -310,7 +348,7 @@ 12F9A64E182DD5FD00FAF50C /* spec_helper.cpp in Sources */, 12FD4061185E68470041A84E /* c_code.cpp in Sources */, 125120A018307DEC00C9B56A /* parse_table.cpp in Sources */, - 12FD4064185E75290041A84E /* code_gen_spec.cpp in Sources */, + 12FD4064185E75290041A84E /* generate_parsers.cpp in Sources */, 1214930E181E200B008E9BDA /* main.cpp in Sources */, 12F9A651182DD6BC00FAF50C /* grammar.cpp in Sources */, 12512093182F307C00C9B56A /* parse_table_builder_spec.cpp in Sources */, diff --git a/TreeSitter.xcodeproj/xcshareddata/xcschemes/specs.xcscheme b/TreeSitter.xcodeproj/xcshareddata/xcschemes/specs.xcscheme new file mode 100644 index 00000000..6da991f2 --- /dev/null +++ b/TreeSitter.xcodeproj/xcshareddata/xcschemes/specs.xcscheme @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/spec/code_gen_spec.cpp b/spec/compiler/generate_parsers.cpp similarity index 84% rename from spec/code_gen_spec.cpp rename to spec/compiler/generate_parsers.cpp index 1eb6edcc..787c4d67 100644 --- a/spec/code_gen_spec.cpp +++ b/spec/compiler/generate_parsers.cpp @@ -1,5 +1,4 @@ #include "spec_helper.h" -#include "test_grammars/arithmetic.h" #include "parse_table_builder.h" #include "parse_table.h" #include "c_code.h" @@ -10,7 +9,7 @@ using namespace tree_sitter::lr; using namespace tree_sitter; Describe(code_generation) { - string test_parser_dir = src_dir() + "/spec/test_parsers"; + string test_parser_dir = src_dir() + "/spec/fixtures/parsers"; It(works_for_the_arithmetic_grammar) { Grammar grammar = test_grammars::arithmetic(); diff --git a/spec/lr/item_set_spec.cpp b/spec/compiler/lr/item_set_spec.cpp similarity index 98% rename from spec/lr/item_set_spec.cpp rename to spec/compiler/lr/item_set_spec.cpp index dcd39e56..bfe468c3 100644 --- a/spec/lr/item_set_spec.cpp +++ b/spec/compiler/lr/item_set_spec.cpp @@ -1,5 +1,4 @@ #include "spec_helper.h" -#include "../test_grammars/arithmetic.h" #include using namespace tree_sitter::lr; diff --git a/spec/lr/item_spec.cpp b/spec/compiler/lr/item_spec.cpp similarity index 89% rename from spec/lr/item_spec.cpp rename to spec/compiler/lr/item_spec.cpp index c74b72e3..4eada616 100644 --- a/spec/lr/item_spec.cpp +++ b/spec/compiler/lr/item_spec.cpp @@ -1,5 +1,5 @@ #include "spec_helper.h" -#include "../test_grammars/arithmetic.h" +#include "../../fixtures/grammars/arithmetic.h" using namespace tree_sitter::lr; diff --git a/spec/lr/parse_table_builder_spec.cpp b/spec/compiler/lr/parse_table_builder_spec.cpp similarity index 97% rename from spec/lr/parse_table_builder_spec.cpp rename to spec/compiler/lr/parse_table_builder_spec.cpp index 44e1362e..1b470797 100644 --- a/spec/lr/parse_table_builder_spec.cpp +++ b/spec/compiler/lr/parse_table_builder_spec.cpp @@ -1,5 +1,4 @@ #include "spec_helper.h" -#include "../test_grammars/arithmetic.h" #include "parse_table_builder.h" #include "parse_table.h" diff --git a/spec/rules/pattern_spec.cpp b/spec/compiler/rules/pattern_spec.cpp similarity index 100% rename from spec/rules/pattern_spec.cpp rename to spec/compiler/rules/pattern_spec.cpp diff --git a/spec/rules/rules_spec.cpp b/spec/compiler/rules/rules_spec.cpp similarity index 100% rename from spec/rules/rules_spec.cpp rename to spec/compiler/rules/rules_spec.cpp diff --git a/spec/test_grammars/arithmetic.cpp b/spec/fixtures/grammars/arithmetic.cpp similarity index 100% rename from spec/test_grammars/arithmetic.cpp rename to spec/fixtures/grammars/arithmetic.cpp diff --git a/spec/test_grammars/arithmetic.h b/spec/fixtures/grammars/arithmetic.h similarity index 100% rename from spec/test_grammars/arithmetic.h rename to spec/fixtures/grammars/arithmetic.h diff --git a/spec/test_parsers/arithmetic.c b/spec/fixtures/parsers/arithmetic.c similarity index 100% rename from spec/test_parsers/arithmetic.c rename to spec/fixtures/parsers/arithmetic.c diff --git a/spec/spec_helper.h b/spec/spec_helper.h index 6bf6fc9c..9c912179 100644 --- a/spec/spec_helper.h +++ b/spec/spec_helper.h @@ -11,6 +11,9 @@ #include "parse_table.h" #include "parse_table_builder.h" +#include "fixtures/grammars/arithmetic.h" + + using namespace tree_sitter; using namespace std; using namespace igloo; diff --git a/src/code_gen/c_code.cpp b/src/compiler/code_gen/c_code.cpp similarity index 100% rename from src/code_gen/c_code.cpp rename to src/compiler/code_gen/c_code.cpp diff --git a/src/code_gen/c_code.h b/src/compiler/code_gen/c_code.h similarity index 100% rename from src/code_gen/c_code.h rename to src/compiler/code_gen/c_code.h diff --git a/src/grammar.cpp b/src/compiler/grammar.cpp similarity index 100% rename from src/grammar.cpp rename to src/compiler/grammar.cpp diff --git a/src/grammar.h b/src/compiler/grammar.h similarity index 100% rename from src/grammar.h rename to src/compiler/grammar.h diff --git a/src/lr/item.cpp b/src/compiler/lr/item.cpp similarity index 100% rename from src/lr/item.cpp rename to src/compiler/lr/item.cpp diff --git a/src/lr/item.h b/src/compiler/lr/item.h similarity index 100% rename from src/lr/item.h rename to src/compiler/lr/item.h diff --git a/src/lr/item_set.cpp b/src/compiler/lr/item_set.cpp similarity index 100% rename from src/lr/item_set.cpp rename to src/compiler/lr/item_set.cpp diff --git a/src/lr/item_set.h b/src/compiler/lr/item_set.h similarity index 100% rename from src/lr/item_set.h rename to src/compiler/lr/item_set.h diff --git a/src/lr/parse_table.cpp b/src/compiler/lr/parse_table.cpp similarity index 100% rename from src/lr/parse_table.cpp rename to src/compiler/lr/parse_table.cpp diff --git a/src/lr/parse_table.h b/src/compiler/lr/parse_table.h similarity index 100% rename from src/lr/parse_table.h rename to src/compiler/lr/parse_table.h diff --git a/src/lr/parse_table_builder.cpp b/src/compiler/lr/parse_table_builder.cpp similarity index 100% rename from src/lr/parse_table_builder.cpp rename to src/compiler/lr/parse_table_builder.cpp diff --git a/src/lr/parse_table_builder.h b/src/compiler/lr/parse_table_builder.h similarity index 100% rename from src/lr/parse_table_builder.h rename to src/compiler/lr/parse_table_builder.h diff --git a/src/rules/blank.cpp b/src/compiler/rules/blank.cpp similarity index 100% rename from src/rules/blank.cpp rename to src/compiler/rules/blank.cpp diff --git a/src/rules/blank.h b/src/compiler/rules/blank.h similarity index 100% rename from src/rules/blank.h rename to src/compiler/rules/blank.h diff --git a/src/rules/char.cpp b/src/compiler/rules/char.cpp similarity index 100% rename from src/rules/char.cpp rename to src/compiler/rules/char.cpp diff --git a/src/rules/char.h b/src/compiler/rules/char.h similarity index 100% rename from src/rules/char.h rename to src/compiler/rules/char.h diff --git a/src/rules/char_class.cpp b/src/compiler/rules/char_class.cpp similarity index 100% rename from src/rules/char_class.cpp rename to src/compiler/rules/char_class.cpp diff --git a/src/rules/char_class.h b/src/compiler/rules/char_class.h similarity index 100% rename from src/rules/char_class.h rename to src/compiler/rules/char_class.h diff --git a/src/rules/choice.cpp b/src/compiler/rules/choice.cpp similarity index 100% rename from src/rules/choice.cpp rename to src/compiler/rules/choice.cpp diff --git a/src/rules/choice.h b/src/compiler/rules/choice.h similarity index 100% rename from src/rules/choice.h rename to src/compiler/rules/choice.h diff --git a/src/rules/pattern.cpp b/src/compiler/rules/pattern.cpp similarity index 100% rename from src/rules/pattern.cpp rename to src/compiler/rules/pattern.cpp diff --git a/src/rules/pattern.h b/src/compiler/rules/pattern.h similarity index 100% rename from src/rules/pattern.h rename to src/compiler/rules/pattern.h diff --git a/src/rules/repeat.cpp b/src/compiler/rules/repeat.cpp similarity index 100% rename from src/rules/repeat.cpp rename to src/compiler/rules/repeat.cpp diff --git a/src/rules/repeat.h b/src/compiler/rules/repeat.h similarity index 100% rename from src/rules/repeat.h rename to src/compiler/rules/repeat.h diff --git a/src/rules/rule.cpp b/src/compiler/rules/rule.cpp similarity index 100% rename from src/rules/rule.cpp rename to src/compiler/rules/rule.cpp diff --git a/src/rules/rule.h b/src/compiler/rules/rule.h similarity index 100% rename from src/rules/rule.h rename to src/compiler/rules/rule.h diff --git a/src/rules.h b/src/compiler/rules/rules.h similarity index 100% rename from src/rules.h rename to src/compiler/rules/rules.h diff --git a/src/rules/seq.cpp b/src/compiler/rules/seq.cpp similarity index 100% rename from src/rules/seq.cpp rename to src/compiler/rules/seq.cpp diff --git a/src/rules/seq.h b/src/compiler/rules/seq.h similarity index 100% rename from src/rules/seq.h rename to src/compiler/rules/seq.h diff --git a/src/rules/string.cpp b/src/compiler/rules/string.cpp similarity index 100% rename from src/rules/string.cpp rename to src/compiler/rules/string.cpp diff --git a/src/rules/string.h b/src/compiler/rules/string.h similarity index 100% rename from src/rules/string.h rename to src/compiler/rules/string.h diff --git a/src/rules/symbol.cpp b/src/compiler/rules/symbol.cpp similarity index 100% rename from src/rules/symbol.cpp rename to src/compiler/rules/symbol.cpp diff --git a/src/rules/symbol.h b/src/compiler/rules/symbol.h similarity index 100% rename from src/rules/symbol.h rename to src/compiler/rules/symbol.h diff --git a/src/transition_map.h b/src/compiler/transition_map.h similarity index 100% rename from src/transition_map.h rename to src/compiler/transition_map.h