summaryrefslogtreecommitdiff
path: root/ast/ast.hpp
diff options
context:
space:
mode:
authorJohn Hodge (bugs) <tpg@mutabah.net>2014-11-23 21:18:03 +0800
committerJohn Hodge (bugs) <tpg@mutabah.net>2014-11-23 21:18:03 +0800
commitd2fae3b040b20c91afff472de5154977677d06c3 (patch)
treef601d728a11f36b1a06ad6dd264210846c0a6702 /ast/ast.hpp
parent7ad1a8b4b40784e0a10bd453c75dd0dcf123d5f1 (diff)
downloadmrust-d2fae3b040b20c91afff472de5154977677d06c3.tar.gz
Lexer "complete", parsing up to structure definitions.
Diffstat (limited to 'ast/ast.hpp')
-rw-r--r--ast/ast.hpp36
1 files changed, 35 insertions, 1 deletions
diff --git a/ast/ast.hpp b/ast/ast.hpp
index f637e742..f84f322f 100644
--- a/ast/ast.hpp
+++ b/ast/ast.hpp
@@ -1,6 +1,12 @@
#ifndef AST_HPP_INCLUDED
#define AST_HPP_INCLUDED
+#include <string>
+#include <vector>
+#include "../coretypes.hpp"
+
+class TypeRef;
+
namespace AST {
class Path
@@ -9,10 +15,38 @@ public:
void append(::std::string str) {}
};
+class ExprNode
+{
+public:
+ struct TagAssign {};
+ ExprNode(TagAssign, ExprNode slot, ExprNode value) {}
+ struct TagInteger {};
+
+ ExprNode(TagInteger, uint64_t value, enum eCoreType datatype);
+};
+
+class Expr
+{
+public:
+ Expr(ExprNode node) {}
+};
+
+class TypeParam
+{
+public:
+ TypeParam(bool is_lifetime, ::std::string name);
+ void addLifetimeBound(::std::string name);
+ void addTypeBound(TypeRef type);
+};
+
+typedef ::std::vector<TypeParam> TypeParams;
+
class Module
{
public:
- void add_alias(Path path) {}
+ 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);
};
}