00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00024 #ifndef SHTOKENIZER_HPP
00025 #define SHTOKENIZER_HPP
00026
00027 #include <stack>
00028 #include <queue>
00029 #include <vector>
00030 #include <iosfwd>
00031 #include "ShDllExport.hpp"
00032 #include "ShRefCount.hpp"
00033 #include "ShVariable.hpp"
00034 #include "ShBlock.hpp"
00035 #include "ShException.hpp"
00036 #include "ShToken.hpp"
00037
00038 namespace SH {
00039
00045 struct
00046 SH_DLLEXPORT ShTokenArgument {
00047 ShTokenArgument(const ShVariable& result, const ShBlockListPtr& blockList)
00048 : result(result), blockList(blockList)
00049 {
00050 }
00051
00052 ShVariable result;
00053 ShBlockListPtr blockList;
00054 };
00055
00060 class
00061 SH_DLLEXPORT ShTokenizerException : public ShException {
00062 public:
00063 ShTokenizerException(const std::string& error);
00064 };
00065
00075 class
00076 SH_DLLEXPORT ShTokenizer {
00077 public:
00078 ShTokenizer();
00079
00085
00086
00087 bool pushArgQueue();
00089 bool pushArg();
00091 bool processArg(const ShVariable& result);
00093
00095
00096
00097 ShTokenArgument getArgument();
00099 void popArgQueue();
00101
00103 ShBlockListPtr blockList();
00104
00105 private:
00106 std::stack<ShBlockListPtr> m_listStack;
00107 std::stack< std::queue<ShTokenArgument> > m_argQueueStack;
00108 };
00109
00110 }
00111
00112 #endif