00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00020 #ifndef SHTOKENIZER_HPP
00021 #define SHTOKENIZER_HPP
00022
00023 #include <stack>
00024 #include <queue>
00025 #include <vector>
00026 #include <iosfwd>
00027 #include "ShDllExport.hpp"
00028 #include "ShRefCount.hpp"
00029 #include "ShVariable.hpp"
00030 #include "ShBlock.hpp"
00031 #include "ShException.hpp"
00032 #include "ShToken.hpp"
00033
00034 namespace SH {
00035
00041 struct
00042 SH_DLLEXPORT ShTokenArgument {
00043 ShTokenArgument(const ShVariable& result, const ShBlockListPtr& blockList)
00044 : result(result), blockList(blockList)
00045 {
00046 }
00047
00048 ShVariable result;
00049 ShBlockListPtr blockList;
00050 };
00051
00056 class
00057 SH_DLLEXPORT ShTokenizerException : public ShException {
00058 public:
00059 ShTokenizerException(const std::string& error);
00060 };
00061
00071 class
00072 SH_DLLEXPORT ShTokenizer {
00073 public:
00074 ShTokenizer();
00075
00081
00082
00083 bool pushArgQueue();
00085 bool pushArg();
00087 bool processArg(const ShVariable& result);
00089
00091
00092
00093 ShTokenArgument getArgument();
00095 void popArgQueue();
00097
00099 ShBlockListPtr blockList();
00100
00101 private:
00102 std::stack<ShBlockListPtr> m_listStack;
00103 std::stack< std::queue<ShTokenArgument> > m_argQueueStack;
00104 };
00105
00106 }
00107
00108 #endif