Organize source into compiler and runtime dirs

This commit is contained in:
Max Brunsfeld 2013-12-15 23:57:30 -08:00
parent e480cf538d
commit 9618efd12a
46 changed files with 169 additions and 38 deletions

View file

@ -1,21 +0,0 @@
#include "spec_helper.h"
#include "test_grammars/arithmetic.h"
#include "parse_table_builder.h"
#include "parse_table.h"
#include "c_code.h"
#include <fstream>
using namespace std;
using namespace tree_sitter::lr;
using namespace tree_sitter;
Describe(code_generation) {
string test_parser_dir = src_dir() + "/spec/test_parsers";
It(works_for_the_arithmetic_grammar) {
Grammar grammar = test_grammars::arithmetic();
ParseTable table = ParseTableBuilder::build_table(grammar);
std::ofstream parser_file(test_parser_dir + "/arithmetic.c");
parser_file << code_gen::c_code(grammar, table);
}
};