#ifndef AST_NODE_H #define AST_NODE_H #include class AstNode { friend Bu::Formatter &operator<<( Bu::Formatter &f, const AstNode &n ); public: enum Type { tLeaf = 0x01000000, tNot = 0x01000001, tComp = 0x01000002, tCompGt = 0x01000003, tCompLt = 0x01000004, tCompGtEq = 0x01000005, tCompLtEq = 0x01000006, tStore = 0x01000007, tAnd = 0x01000008, tOr = 0x01000009, tLeafLiteral = 0x02000000, tVarName = 0x02000001, tLiteral = 0x02000002, tFuncName = 0x02000003, tBranch = 0x04000000, tScope = 0x04000001, tIf = 0x04000002, tForEach = 0x04000003, tWhile = 0x04000004, tTypeMask = 0x07000000, }; AstNode( Type eType ); virtual ~AstNode(); Type getType() const { return eType; } private: Type eType; }; Bu::Formatter &operator<<( Bu::Formatter &f, AstNode::Type t ); Bu::Formatter &operator<<( Bu::Formatter &f, const AstNode &n ); #endif