Added generator-dependent compilation and simple passthrough that allows us to have non-cheated emitted, printing c-code for the first time! (no typechecking or anything yet, but we'll get there). It's also still rough.

This commit is contained in:
Nathan Braswell
2013-12-22 01:34:59 -06:00
parent 6ad406e42d
commit 935cc6f968
9 changed files with 55 additions and 33 deletions

View File

@@ -24,7 +24,9 @@ std::string ASTData::toString() {
}
ValueType ASTData::strToType(std::string type) {
if (type == "bool")
if (type == "void")
return void_type;
else if (type == "bool")
return boolean;
else if (type == "int")
return integer;
@@ -41,22 +43,18 @@ std::string ASTData::ValueTypeToString(ValueType type) {
switch (type) {
case none:
return "none";
break;
case void_type:
return "void";
case boolean:
return "bool";
break;
case integer:
return "int";
break;
case floating:
return "float";
break;
case double_percision:
return "double";
break;
case char_string:
return "string";
break;
default:
return "unknown_ValueType";
}
@@ -96,6 +94,10 @@ std::string ASTData::ASTTypeToString(ASTType type) {
return "assignment_statement";
case declaration_statement:
return "declaration_statement";
case if_comp:
return "if_comp";
case simple_passthrough:
return "simple_passthrough";
case function_call:
return "function_call";
case value: