From 32c32bc48c8fd7cffca301b8919fb26726f6467e Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Sat, 24 Dec 2011 01:08:21 -0700 Subject: Ast nearly done, builder coming along. --- src/astnode.h | 35 +++++++++++++++++++++-------------- 1 file changed, 21 insertions(+), 14 deletions(-) (limited to 'src/astnode.h') diff --git a/src/astnode.h b/src/astnode.h index 780e07e..9584788 100644 --- a/src/astnode.h +++ b/src/astnode.h @@ -6,31 +6,38 @@ class AstNode { public: - AstNode(); - virtual ~AstNode(); - enum Type { - tValue = 0x01000000, + tLeaf = 0x01000000, tVarName = 0x01000001, tLiteral = 0x01000002, tFuncName = 0x01000003, + tNot = 0x01000004, + tComp = 0x01000005, + tCompGt = 0x01000006, + tCompLt = 0x01000007, + tCompGtEq = 0x01000008, + tCompLtEq = 0x01000009, + tStore = 0x0100000A, + tAnd = 0x0100000B, + tOr = 0x0100000C, + tBranch = 0x02000000, tScope = 0x02000001, tIf = 0x02000002, - tElse = 0x02000003, - tNot = 0x00000004, - tComp = 0x02000005, - tCompGt = 0x02000006, - tCompLt = 0x02000007, - tCompGtEq = 0x02000008, - tCompLtEq = 0x02000009, - tStore = 0x0200000A, - tAnd = 0x0200000B, - tOr = 0x0200000C, + tForEach = 0x02000003, + tWhile = 0x02000004, + + tTypeMask = 0x03000000, }; + + AstNode( Type eType ); + virtual ~AstNode(); + + Type getType() const { return eType; } private: + Type eType; }; #endif -- cgit v1.2.3