00001 00002 // Common Text Transformation Library 00003 // Copyright (C) 1997-2006 by Igor Kholodov. 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 00017 // Free Software Foundation, Inc., 00018 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00019 // 00020 // mailto:cttl@users.sourceforge.net 00021 // http://sourceforge.net/projects/cttl/ 00023 00033 // xst_instruction_traits.h 00034 00035 #ifndef _XST_INSTRUCTION_TRAITS_H_INCLUDED_ 00036 #define _XST_INSTRUCTION_TRAITS_H_INCLUDED_ 00037 00038 namespace cttl_impl { 00039 00041 static const int pop_data_ = 1; 00042 00043 00045 static const int push_data_ = 2; 00046 00048 static const int push_value_ = 3; 00049 00051 static const int push_top_ = 4; 00052 00054 static const int push_size_ = 5; 00055 00056 00058 static const int move_value_ = 6; 00059 00061 static const int move_top_ = 7; 00062 00064 static const int move_size_ = 8; 00065 00066 00068 static const int add_value_ = 9; 00069 00071 static const int add_top_ = 10; 00072 00074 static const int add_size_ = 11; 00075 00076 00078 static const int sub_value_ = 12; 00079 00081 static const int sub_top_ = 13; 00082 00084 static const int sub_size_ = 14; 00085 00086 00088 static const int neg_top_ = 15; 00089 00090 00092 static const int mul_value_ = 16; 00093 00095 static const int mul_top_ = 17; 00096 00098 static const int mul_size_ = 18; 00099 00100 00102 static const int div_value_ = 19; 00103 00105 static const int div_top_ = 20; 00106 00108 static const int div_size_ = 21; 00109 00110 00111 00119 template< int OpcodeT > 00120 struct xst_instruction_traits { 00121 00122 enum { length_ = 2 }; 00123 00124 }; // struct xst_instruction_traits 00125 00130 template<> 00131 struct xst_instruction_traits< pop_data_ > { 00132 00133 enum { length_ = 1 }; 00134 00135 }; // struct xst_instruction_traits 00136 00141 template<> 00142 struct xst_instruction_traits< push_data_ > { 00143 00144 enum { length_ = 1 }; 00145 00146 }; // struct xst_instruction_traits 00147 00152 template<> 00153 struct xst_instruction_traits< neg_top_ > { 00154 00155 enum { length_ = 1 }; 00156 00157 }; // struct xst_instruction_traits 00158 00159 } // namespace cttl_impl 00160 00161 00162 #endif //_XST_INSTRUCTION_TRAITS_H_INCLUDED_
1.3.9.1