diff options
author | John Hodge (bugs) <tpg@mutabah.net> | 2014-12-08 18:48:42 +0800 |
---|---|---|
committer | John Hodge (bugs) <tpg@mutabah.net> | 2014-12-08 18:48:42 +0800 |
commit | 605c764a79ed00630967780ee7d434fbaa8aa284 (patch) | |
tree | 310997762a1bfc7461700194bc7d827fab156a82 /ast/ast.hpp | |
parent | 0bfd3352489411a1e1d6b98397979ad91e2a52b1 (diff) | |
download | mrust-605c764a79ed00630967780ee7d434fbaa8aa284.tar.gz |
Further progress, parsing if blocks and some binary operations, blocked on decimal lexing
Diffstat (limited to 'ast/ast.hpp')
-rw-r--r-- | ast/ast.hpp | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/ast/ast.hpp b/ast/ast.hpp index 2c8b06c0..f05747ac 100644 --- a/ast/ast.hpp +++ b/ast/ast.hpp @@ -72,9 +72,15 @@ public: struct TagLetBinding {};
ExprNode(TagLetBinding, Pattern pat, ExprNode value);
+ struct TagReturn {};
+ ExprNode(TagReturn, ExprNode val);
+
struct TagAssign {};
ExprNode(TagAssign, ExprNode slot, ExprNode value) {}
+ struct TagCast {};
+ ExprNode(TagCast, ExprNode value, TypeRef dst_type);
+
struct TagInteger {};
ExprNode(TagInteger, uint64_t value, enum eCoreType datatype);
@@ -84,11 +90,34 @@ public: struct TagCallPath {};
ExprNode(TagCallPath, Path path, ::std::vector<ExprNode> args);
+ struct TagCallObject {};
+ ExprNode(TagCallObject, ExprNode val, ::std::vector<ExprNode> args);
+
struct TagMatch {};
ExprNode(TagMatch, ExprNode val, ::std::vector< ::std::pair<Pattern,ExprNode> > arms);
+ struct TagIf {};
+ ExprNode(TagIf, ExprNode cond, ExprNode true_code, ExprNode false_code);
+
struct TagNamedValue {};
ExprNode(TagNamedValue, Path path);
+
+ struct TagField {};
+ ExprNode(TagField, ::std::string name);
+
+ enum BinOpType {
+ BINOP_CMPEQU,
+ BINOP_CMPNEQU,
+
+ BINOP_BITAND,
+ BINOP_BITOR,
+ BINOP_BITXOR,
+
+ BINOP_SHL,
+ BINOP_SHR,
+ };
+ struct TagBinOp {};
+ ExprNode(TagBinOp, BinOpType type, ExprNode left, ExprNode right);
};
class Expr
|