diff options
-rw-r--r-- | llvm.cpp | 14 | ||||
-rw-r--r-- | tuplr.cpp | 8 | ||||
-rw-r--r-- | tuplr.hpp | 10 | ||||
-rw-r--r-- | typing.cpp | 2 |
4 files changed, 11 insertions, 23 deletions
@@ -45,11 +45,6 @@ struct CEngine { IRBuilder<> builder; }; - -/*************************************************************************** - * Typing * - ***************************************************************************/ - const Type* lltype(AType* t) { @@ -72,13 +67,6 @@ lltype(AType* t) return NULL; // not reached } - -/*************************************************************************** - * Code Generation * - ***************************************************************************/ - -// Compile-Time Environment - CEngine::CEngine() : module(new Module("tuplr")) , engine(ExecutionEngine::create(module)) @@ -185,7 +173,7 @@ compileFunction(CEnv& cenv, const std::string& name, const Type* retT, const AST /*************************************************************************** - * AST Code Generation * + * Code Generation * ***************************************************************************/ void @@ -33,7 +33,7 @@ std::ostream& out = std::cout; /*************************************************************************** - * S-Expression Lexer :: text -> S-Expressions (SExp) * + * Lexer * ***************************************************************************/ inline int @@ -157,7 +157,7 @@ initLang(PEnv& penv, TEnv& tenv) int print_usage(char* name, bool error) { - std::ostream& os = error ? std::cerr : std::cout; + ostream& os = error ? cerr : cout; os << "Usage: " << name << " [OPTION]... [FILE]..." << endl; os << "Evaluate and/or compile Tuplr code" << endl; os << endl; @@ -206,7 +206,7 @@ main(int argc, char** argv) if (is.good()) { ret = ret | eval(*cenv, *f, is); } else { - std::cerr << argv[0] << ": " << *f << ": " << strerror(errno) << endl; + cerr << argv[0] << ": " << *f << ": " << strerror(errno) << endl; ++ret; } is.close(); @@ -217,7 +217,7 @@ main(int argc, char** argv) a = args.find("-o"); if (a != args.end()) { - std::ofstream os(a->second.c_str()); + ofstream os(a->second.c_str()); if (os.good()) { cenv->write(os); } else { @@ -68,7 +68,7 @@ struct Exp { /*************************************************************************** - * S-Expression Lexer :: text -> S-Expressions (SExp) * + * Lexer: Text (istream) -> S-Expressions (SExp) (Prefix S for Syntactic) * ***************************************************************************/ typedef Exp<string> SExp; ///< Textual S-Expression @@ -77,7 +77,7 @@ SExp readExpression(Cursor& cur, std::istream& in); /*************************************************************************** - * Backend * + * Backend (Prefix C for Compiled) * ***************************************************************************/ typedef void* CValue; ///< Compiled value (opaque) @@ -86,7 +86,7 @@ struct CEngine; ///< Backend data (opaque) /*************************************************************************** - * Abstract Syntax Tree * + * Abstract Syntax Tree (Prefix A for Abstract) * ***************************************************************************/ struct TEnv; ///< Type-Time Environment @@ -306,7 +306,7 @@ struct ASTCdrCall : public ASTCall { /*************************************************************************** - * Parser - S-Expressions (SExp) -> AST Nodes (AST) * + * Parser: S-Expressions (SExp) -> AST Nodes (AST) (Prefix P for Parsing) * ***************************************************************************/ /// Parse Time Environment (symbol table) @@ -420,7 +420,7 @@ struct Env : public list< map<K,V> > { /*************************************************************************** - * Typing * + * Typing (Prefix T for Type) * ***************************************************************************/ struct TSubst : public map<AType*, AType*> { @@ -18,7 +18,7 @@ #include "tuplr.hpp" /*************************************************************************** - * AST Type Contraints * + * AST Type Constraints * ***************************************************************************/ void |