diff options
author | John Hodge (sonata) <tpg@mutabah.net> | 2014-12-23 12:06:25 +0800 |
---|---|---|
committer | John Hodge (sonata) <tpg@mutabah.net> | 2014-12-23 12:06:25 +0800 |
commit | 04dd6b05f945c944c13431baa509ec628ac26f41 (patch) | |
tree | 5a3d67f4f875481057118a3c553abf5ae998a548 /convert/render.cpp | |
parent | 89771222961d699f5ca6f586033b5fb915ced431 (diff) | |
download | mrust-04dd6b05f945c944c13431baa509ec628ac26f41.tar.gz |
Move source files to src/ folder
Diffstat (limited to 'convert/render.cpp')
-rw-r--r-- | convert/render.cpp | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/convert/render.cpp b/convert/render.cpp deleted file mode 100644 index 6de8dc57..00000000 --- a/convert/render.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/*
- */
-#include "../ast/ast.hpp"
-
-void Render_Type(::std::ostream& os, const TypeRef& type, const char *name)
-{
- /*
- swicth(type.class())
- {
- case TYPECLASS_STRUCT:
- os << "struct " << type.struct().mangled_name() << " " << name;
- break;
- }
- */
-}
-
-void Render_CStruct(::std::ostream& os, const AST::CStruct& str)
-{
- os << "struct " << str.name() << "{\n";
- FOREACH(::std::vector<std::pair<std::string,TypeRef> >, f, str.fields())
- {
- os << "\t";
- Render_Type(os, f->second(), f->first().c_str());
- os << ";\n";
- }
- os << "}\n"
-}
-
-void Render_Crate(::std::ostream& os, const AST::Flat& crate)
-{
- // First off, print forward declarations of all structs + enums
- FOREACH(::std::vector<AST::CStruct>, s, crate.structs())
- os << "struct " << s->mangled_name() << ";\n";
-
- FOREACH(::std::vector<AST::Function>, fcn, crate.functions())
- {
- Render_Type(os, fcn->rettype(), nullptr);
- os << " " << fcn->name() << "(";
- bool is_first = true;
- FOREACH(::std::vector<std::pair<std::string,TypeRef> >, f, fcn.args())
- {
- if( !is_first )
- os << ", ";
- is_first = false;
- Render_Type(os, f->second(), f->first().c_str());
- }
- os << ")\n{\n";
- // Dump expression AST
- os << "}\n";
- }
-}
-
|