tan
0.0.1
|
Compile a list of C++ and/or tan source files, and perform linking. More...
#include <driver.h>
Public Member Functions | |
CompilerDriver (TanCompilation config) | |
void | run (const vector< str > &files) |
Compile CXX or TAN source files and link their output object files. More... | |
vector< Program * > | parse (const vector< str > &files) |
Parse the corresponding source file, and build AST. More... | |
void | link (const vector< str > &input_paths) |
void | register_package (const str &name, Package *package) |
Register a Package that has been spotted from source files, with top-level context stored inside. More... | |
Package * | get_package (const str &name) |
Get a pointer to a Package. Semantic analysis is not guaranteed to be fully performed on it. More... | |
vector< Package * > | stage1_analysis (vector< Program * > ps) |
Get a set of partially analyzed packages that can be used for cross-package dependency analysis. Note that some composite types need a full analysis for the dependent packages to work during codegen. More... | |
Static Public Member Functions | |
static CompilerDriver * | instance () |
static vector< str > | resolve_package_import (const str &callee_path, const str &import_name) |
Get a list of possible files that corresponds to an import. Check PACKAGES.md. More... | |
Static Public Attributes | |
static vector< str > | import_dirs {} |
Import search directories FIXME: static variable? More... | |
Compile a list of C++ and/or tan source files, and perform linking.
Package * CompilerDriver::get_package | ( | const str & | name | ) |
Get a pointer to a Package. Semantic analysis is not guaranteed to be fully performed on it.
Definition at line 183 of file driver.cpp.
vector< Program * > CompilerDriver::parse | ( | const vector< str > & | files | ) |
Parse the corresponding source file, and build AST.
Definition at line 313 of file driver.cpp.
References tanlang::Intrinsic::GetIntrinsicFunctionDeclarations().
void CompilerDriver::register_package | ( | const str & | name, |
Package * | package | ||
) |
Register a Package that has been spotted from source files, with top-level context stored inside.
Definition at line 191 of file driver.cpp.
|
static |
Get a list of possible files that corresponds to an import. Check PACKAGES.md.
callee_path | The path to the file which the import statement is in |
import_name | The filename specified by the import statement |
Definition at line 342 of file driver.cpp.
References import_dirs.
void CompilerDriver::run | ( | const vector< str > & | files | ) |
Compile CXX or TAN source files and link their output object files.
The object files are named as "<name of the source file>.o" and they are located at current working directory. If current build is release, all exceptions are captured and e.what()
is printed out to stderr. If current build is debug, all exceptions are not captured, making debugging easier.
files | The path to source files, can be relative or absolute path. They will be distinguished by their file extensions. |
config | Compilation configuration, |
Definition at line 146 of file driver.cpp.
Get a set of partially analyzed packages that can be used for cross-package dependency analysis. Note that some composite types need a full analysis for the dependent packages to work during codegen.
Package dependencies are analyzed recursively but there's no guarantee that all of them are found.
Definition at line 193 of file driver.cpp.
|
inlinestatic |
Import search directories FIXME: static variable?
Definition at line 34 of file driver.h.
Referenced by resolve_package_import().