2015-12-01 16:19:44 -05:00
|
|
|
import symbol:*
|
|
|
|
|
import tree:*
|
|
|
|
|
import vector:*
|
|
|
|
|
import stack:*
|
|
|
|
|
import map:*
|
|
|
|
|
import util:*
|
|
|
|
|
import string:*
|
|
|
|
|
import mem:*
|
|
|
|
|
import io:*
|
2015-12-05 07:13:32 -05:00
|
|
|
import importer:*
|
|
|
|
|
import ast_node:*
|
|
|
|
|
|
|
|
|
|
/*Importer * importer;*/
|
|
|
|
|
/*NodeTree<ASTData>* builtin_trans_unit; // the top scope for language level stuff*/
|
|
|
|
|
/*std::map<std::string, std::vector<NodeTree<ASTData>*>> languageLevelReservedWords;*/
|
|
|
|
|
/*std::map<std::string, std::vector<NodeTree<ASTData>*>> languageLevelOperators;*/
|
|
|
|
|
/*std::map<NodeTree<ASTData>*, NodeTree<ASTData>*> this_map; // used to map implicit "this" variables to their type*/
|
|
|
|
|
/*NodeTree<ASTData>* topScope; //maintained for templates that need to add themselves to the top scope no matter where they are instantiated*/
|
|
|
|
|
/*int lambdaID = 0;*/
|
2015-12-01 16:19:44 -05:00
|
|
|
obj ast_transformation (Object) {
|
|
|
|
|
fun construct(): *ast_transformation {
|
|
|
|
|
return this
|
|
|
|
|
}
|
|
|
|
|
fun copy_construct(old: *ast_transformation) {
|
|
|
|
|
}
|
|
|
|
|
fun operator=(old: ref ast_transformation) {
|
|
|
|
|
destruct()
|
|
|
|
|
copy_construct(&old)
|
|
|
|
|
}
|
|
|
|
|
fun destruct() {
|
|
|
|
|
}
|
|
|
|
|
|
2015-12-05 07:13:32 -05:00
|
|
|
fun first_pass(file_name: string, parse_tree: *tree<symbol>, importer: *importer): *ast_node {
|
|
|
|
|
var translation_unit = ast_translation_unit_ptr()
|
|
|
|
|
importer->register(file_name, parse_tree, translation_unit)
|
|
|
|
|
return translation_unit
|
2015-12-01 16:19:44 -05:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|