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 /src/ast/ast.cpp | |
parent | 89771222961d699f5ca6f586033b5fb915ced431 (diff) | |
download | mrust-04dd6b05f945c944c13431baa509ec628ac26f41.tar.gz |
Move source files to src/ folder
Diffstat (limited to 'src/ast/ast.cpp')
-rw-r--r-- | src/ast/ast.cpp | 138 |
1 files changed, 138 insertions, 0 deletions
diff --git a/src/ast/ast.cpp b/src/ast/ast.cpp new file mode 100644 index 00000000..a39bc0d4 --- /dev/null +++ b/src/ast/ast.cpp @@ -0,0 +1,138 @@ +/*
+ */
+#include "ast.hpp"
+#include "../types.hpp"
+#include <iostream>
+#include "../parse/parseerror.hpp"
+
+namespace AST {
+
+Path::Path()
+{
+}
+Path::Path(Path::TagAbsolute)
+{
+}
+
+
+PathNode::PathNode(::std::string name, ::std::vector<TypeRef> args):
+ m_name(name),
+ m_params(args)
+{
+}
+const ::std::string& PathNode::name() const
+{
+ return m_name;
+}
+const ::std::vector<TypeRef>& PathNode::args() const
+{
+ return m_params;
+}
+
+Pattern::Pattern(TagMaybeBind, ::std::string name)
+{
+}
+Pattern::Pattern(TagValue, ExprNode node)
+{
+}
+Pattern::Pattern(TagEnumVariant, Path path, ::std::vector<Pattern> sub_patterns)
+{
+}
+
+
+Function::Function(::std::string name, TypeParams params, Class fcn_class, TypeRef ret_type, ::std::vector<StructItem> args, Expr code)
+{
+}
+
+Impl::Impl(TypeRef impl_type, TypeRef trait_type)
+{
+}
+void Impl::add_function(bool is_public, Function fcn)
+{
+}
+
+void Crate::iterate_functions(Crate::fcn_visitor_t* visitor)
+{
+}
+
+void Module::add_constant(bool is_public, ::std::string name, TypeRef type, Expr val)
+{
+ ::std::cout << "add_constant()" << ::std::endl;
+}
+void Module::add_global(bool is_public, bool is_mut, ::std::string name, TypeRef type, Expr val)
+{
+ ::std::cout << "add_global()" << ::std::endl;
+}
+void Module::add_struct(bool is_public, ::std::string name, TypeParams params, ::std::vector<StructItem> items)
+{
+}
+void Module::add_function(bool is_public, Function func)
+{
+}
+void Module::add_impl(Impl impl)
+{
+}
+
+void Expr::visit_nodes(const NodeVisitor& v)
+{
+ throw ParseError::Todo("Expr::visit_nodes");
+}
+
+ExprNode::ExprNode()
+{
+
+}
+ExprNode::ExprNode(TagBlock, ::std::vector<ExprNode> nodes)
+{
+}
+ExprNode::ExprNode(TagLetBinding, Pattern pat, ExprNode value)
+{
+}
+ExprNode::ExprNode(TagReturn, ExprNode val)
+{
+}
+ExprNode::ExprNode(TagCast, ExprNode value, TypeRef dst_type)
+{
+}
+ExprNode::ExprNode(TagInteger, uint64_t value, enum eCoreType datatype)
+{
+}
+ExprNode::ExprNode(TagStructLiteral, Path path, ExprNode base_value, ::std::vector< ::std::pair< ::std::string,ExprNode> > values )
+{
+}
+ExprNode::ExprNode(TagCallPath, Path path, ::std::vector<ExprNode> args)
+{
+}
+ExprNode::ExprNode(TagCallObject, ExprNode val, ::std::vector<ExprNode> args)
+{
+}
+ExprNode::ExprNode(TagMatch, ExprNode val, ::std::vector< ::std::pair<Pattern,ExprNode> > arms)
+{
+}
+ExprNode::ExprNode(TagIf, ExprNode cond, ExprNode true_code, ExprNode false_code)
+{
+}
+ExprNode::ExprNode(TagNamedValue, Path path)
+{
+}
+ExprNode::ExprNode(TagField, ::std::string name)
+{
+}
+ExprNode::ExprNode(TagBinOp, BinOpType type, ExprNode left, ExprNode right)
+{
+}
+
+TypeParam::TypeParam(bool is_lifetime, ::std::string name)
+{
+
+}
+void TypeParam::addLifetimeBound(::std::string name)
+{
+
+}
+void TypeParam::addTypeBound(TypeRef type)
+{
+
+}
+
+}
|