summaryrefslogtreecommitdiff
path: root/ast
diff options
context:
space:
mode:
Diffstat (limited to 'ast')
-rw-r--r--ast/ast.cpp13
-rw-r--r--ast/ast.hpp11
2 files changed, 23 insertions, 1 deletions
diff --git a/ast/ast.cpp b/ast/ast.cpp
index 5c9c566e..4bba2b61 100644
--- a/ast/ast.cpp
+++ b/ast/ast.cpp
@@ -15,7 +15,20 @@ void Module::add_global(bool is_public, bool is_mut, ::std::string name, TypeRef
{
::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, ::std::string name, TypeParams params, TypeRef ret_type, ::std::vector<StructItem> args, Expr code)
+{
+}
+ExprNode::ExprNode()
+{
+
+}
+ExprNode::ExprNode(TagBlock, ::std::vector<ExprNode> nodes)
+{
+}
ExprNode::ExprNode(TagInteger, uint64_t value, enum eCoreType datatype)
{
diff --git a/ast/ast.hpp b/ast/ast.hpp
index f84f322f..c3bc549b 100644
--- a/ast/ast.hpp
+++ b/ast/ast.hpp
@@ -18,16 +18,22 @@ public:
class ExprNode
{
public:
+ ExprNode();
+
+ struct TagBlock {};
+ ExprNode(TagBlock, ::std::vector<ExprNode> nodes);
+
struct TagAssign {};
ExprNode(TagAssign, ExprNode slot, ExprNode value) {}
- struct TagInteger {};
+ struct TagInteger {};
ExprNode(TagInteger, uint64_t value, enum eCoreType datatype);
};
class Expr
{
public:
+ Expr() {}
Expr(ExprNode node) {}
};
@@ -40,6 +46,7 @@ public:
};
typedef ::std::vector<TypeParam> TypeParams;
+typedef ::std::pair< ::std::string, TypeRef> StructItem;
class Module
{
@@ -47,6 +54,8 @@ public:
void add_alias(bool is_public, Path path) {}
void add_constant(bool is_public, ::std::string name, TypeRef type, Expr val);
void add_global(bool is_public, bool is_mut, ::std::string name, TypeRef type, Expr val);
+ void add_struct(bool is_public, ::std::string name, TypeParams params, ::std::vector<StructItem> items);
+ void add_function(bool is_public, ::std::string name, TypeParams params, TypeRef ret_type, ::std::vector<StructItem> args, Expr code);
};
}