/******************************************************************************* * Node.h C Node Object * T.Barnaby, BEAM Ltd, 20/2/02 ******************************************************************************* */ #ifndef NODE_HH #define NODE_HH #include #include /* * Node class: Main storage node */ class Node { public: enum NodeType { TNONE, TLIST, TIDENT, TTYPE, TFUNC, TFUNCPARAM, TINTERFACE, TBIDIRECTIONAL, TMODULE, TSTRUCT, TSTRUCTITEM, TSTRUCTITEM_ARRAYFIXED, TTYPELIST, TTYPEARRAY, TTYPEDICT, TDIR, TTYPEDOMAIN, TCOMMENT, TENUM, TAPIVERSION, TAPICMD, TDERIVED }; Node(NodeType type, BString name); virtual ~Node(); NodeType nodeType(); BString name(); BList& nodes(); Node* node(int n); Node* append(Node* n); Node* appendList(Node* n); static BString nodeTypeName(NodeType t); // Test interface BString str(); BString asStr(); private: NodeType onodeType; BString oname; BList onodes; }; class NodeOp1 : public Node { public: NodeOp1(NodeType nodeType, BString name, Node* arg1); }; class NodeOp2 : public Node { public: NodeOp2(NodeType nodeType, BString name, Node* arg1, Node* arg2); }; class NodeOp3 : public Node { public: NodeOp3(NodeType nodeType, BString name, Node* arg1, Node* arg2, Node* arg3); }; class NodeOp4 : public Node { public: NodeOp4(NodeType nodeType, BString name, Node* arg1, Node* arg2, Node* arg3, Node* arg4); }; #endif