00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00024 #ifndef SHBLOCK_HPP
00025 #define SHBLOCK_HPP
00026
00027 #include <vector>
00028 #include <iosfwd>
00029 #include "ShDllExport.hpp"
00030 #include "ShRefCount.hpp"
00031 #include "ShStatement.hpp"
00032
00033 namespace SH {
00034
00038 class
00039 SH_DLLEXPORT ShBlock : public ShRefCountable {
00040 public:
00041 virtual ~ShBlock();
00042
00044 virtual void print(std::ostream& out, int indent) const = 0;
00045 };
00046
00047 typedef ShPointer<ShBlock> ShBlockPtr;
00048 typedef ShPointer<const ShBlock> ShBlockCPtr;
00049
00052 class
00053 SH_DLLEXPORT ShBlockList : public ShRefCountable {
00054 public:
00055 ShBlockList(bool isArgument = false);
00056
00058 bool isArgument();
00059
00061 void addStatement(const ShStatement& statement);
00063 void addBlock(const ShBlockPtr& statement);
00064
00066 ShBlockPtr ShBlockList::getFront() const;
00067
00069 ShBlockPtr ShBlockList::removeFront();
00070
00072 bool empty() const;
00073
00075 friend SH_DLLEXPORT std::ostream& operator<<(std::ostream& out, const ShBlockList& blockList);
00076
00078 std::ostream& print(std::ostream& out, int indentation) const;
00079
00080 private:
00081 bool m_isArgument;
00082 std::vector<ShBlockPtr> m_blocks;
00083 };
00084
00085 typedef ShPointer<ShBlockList> ShBlockListPtr;
00086 typedef ShPointer<const ShBlockList> ShBlockListCPtr;
00087
00088 }
00089
00090 #endif