00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00020 #ifndef SHBLOCK_HPP
00021 #define SHBLOCK_HPP
00022
00023 #include <vector>
00024 #include <iosfwd>
00025 #include "ShDllExport.hpp"
00026 #include "ShRefCount.hpp"
00027 #include "ShStatement.hpp"
00028
00029 namespace SH {
00030
00034 class
00035 SH_DLLEXPORT ShBlock : public ShRefCountable {
00036 public:
00037 virtual ~ShBlock();
00038
00040 virtual void print(std::ostream& out, int indent) const = 0;
00041 };
00042
00043 typedef ShPointer<ShBlock> ShBlockPtr;
00044 typedef ShPointer<const ShBlock> ShBlockCPtr;
00045
00048 class
00049 SH_DLLEXPORT ShBlockList : public ShRefCountable {
00050 public:
00051 ShBlockList(bool isArgument = false);
00052
00054 bool isArgument();
00055
00057 void addStatement(const ShStatement& statement);
00059 void addBlock(const ShBlockPtr& statement);
00060
00062 ShBlockPtr getFront() const;
00063
00065 ShBlockPtr removeFront();
00066
00068 bool empty() const;
00069
00071 friend SH_DLLEXPORT std::ostream& operator<<(std::ostream& out, const ShBlockList& blockList);
00072
00074 std::ostream& print(std::ostream& out, int indentation) const;
00075
00076 private:
00077 bool m_isArgument;
00078 std::vector<ShBlockPtr> m_blocks;
00079 };
00080
00081 typedef ShPointer<ShBlockList> ShBlockListPtr;
00082 typedef ShPointer<const ShBlockList> ShBlockListCPtr;
00083
00084 }
00085
00086 #endif