Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

ShToken.hpp

00001 // Sh: A GPU metaprogramming language.
00002 //
00003 // Copyright 2003-2005 Serious Hack Inc.
00004 // 
00005 // This library is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU Lesser General Public
00007 // License as published by the Free Software Foundation; either
00008 // version 2.1 of the License, or (at your option) any later version.
00009 //
00010 // This library is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 // Lesser General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU Lesser General Public
00016 // License along with this library; if not, write to the Free Software
00017 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
00018 // MA  02110-1301, USA
00020 #ifndef SHTOKEN_HPP
00021 #define SHTOKEN_HPP
00022 
00023 #include <vector>
00024 #include "ShDllExport.hpp"
00025 #include "ShRefCount.hpp"
00026 #include "ShBlock.hpp"
00027 
00028 namespace SH {
00029 
00030 struct ShTokenArgument;
00031   
00036 enum ShTokenType {
00037   SH_TOKEN_IF,
00038   SH_TOKEN_ELSE,
00039   SH_TOKEN_ENDIF,
00040   SH_TOKEN_WHILE,
00041   SH_TOKEN_ENDWHILE,
00042   SH_TOKEN_DO,
00043   SH_TOKEN_UNTIL,
00044   SH_TOKEN_FOR,
00045   SH_TOKEN_ENDFOR,
00046   SH_TOKEN_BREAK,
00047   SH_TOKEN_CONTINUE,
00048   SH_TOKEN_STARTSEC,
00049   SH_TOKEN_ENDSEC,
00050   SH_TOKEN_STARTSWITCH,
00051   SH_TOKEN_ENDSWITCH,
00052   SH_TOKEN_CASE
00053 };
00054 
00060 class 
00061 SH_DLLEXPORT ShToken : public ShBlock {
00062 public:
00063   ShToken(ShTokenType type);
00064   ~ShToken();
00065 
00067   ShTokenType type();
00068   
00069   void print(std::ostream& out, int indent) const;
00070 
00072   std::vector<ShTokenArgument> arguments;
00073   
00074 private:
00075   ShTokenType m_type;
00076 };
00077 
00078 typedef ShPointer<ShToken> ShTokenPtr;
00079 typedef ShPointer<const ShToken> ShTokenCPtr;
00080 
00081 
00082 }
00083 
00084 #endif

Generated on Thu Jul 28 17:33:06 2005 for Sh by  doxygen 1.4.3-20050530