Changeset 92 in dev for BasicCompiler_Common/Enum.cpp
- Timestamp:
- Apr 8, 2007, 2:07:31 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
BasicCompiler_Common/Enum.cpp
r88 r92 147 147 parent=ppobj_EnumParent[i]; 148 148 149 sprintf(buffer+length,"Class %s\n",parent->TypeName);149 sprintf(buffer+length,"Class Enum %s\n",parent->TypeName); 150 150 length+=lstrlen(buffer+length); 151 151 lstrcpy(buffer+length,"\tInherits EnumBase\n"); 152 152 length+=lstrlen(buffer+length); 153 sprintf(buffer+length,"\tSub %s(value As Long,lpszName As LPSTR)\n",parent->TypeName); 154 length+=lstrlen(buffer+length); 155 lstrcpy(buffer+length,"\t\tEnumBase(value,lpszName)\n"); 156 length+=lstrlen(buffer+length); 157 lstrcpy(buffer+length,"\tEnd Sub\n"); 158 length+=lstrlen(buffer+length); 153 159 lstrcpy(buffer+length,"Public\n"); 154 160 length+=lstrlen(buffer+length); … … 156 162 length+=lstrlen(buffer+length); 157 163 if(parent->iEnumMemberNum){ 158 sprintf(buffer+length,"\t\tEnumBase(%d)\n", 159 parent->ppobj_EnumMember[0]->m_value); 160 length+=lstrlen(buffer+length); 161 } 162 lstrcpy(buffer+length,"\tEnd Sub\n"); 163 length+=lstrlen(buffer+length); 164 sprintf(buffer+length,"\tSub %s(ByRef e As %s)\n",parent->TypeName,parent->TypeName); 165 length+=lstrlen(buffer+length); 166 lstrcpy(buffer+length,"\t\tEnumBase(e.m_Value)\n"); 167 length+=lstrlen(buffer+length); 168 lstrcpy(buffer+length,"\tEnd Sub\n"); 169 length+=lstrlen(buffer+length); 170 sprintf(buffer+length,"\tSub %s(value As Long)\n",parent->TypeName); 171 length+=lstrlen(buffer+length); 172 lstrcpy(buffer+length,"\t\tEnumBase(value)\n"); 173 length+=lstrlen(buffer+length); 164 sprintf(buffer+length,"\t\tEnumBase(%d,\"%s\")\n", 165 parent->ppobj_EnumMember[0]->m_value, 166 parent->ppobj_EnumMember[0]->m_name); 167 length+=lstrlen(buffer+length); 168 } 174 169 lstrcpy(buffer+length,"\tEnd Sub\n"); 175 170 length+=lstrlen(buffer+length); … … 183 178 member=parent->ppobj_EnumMember[i2]; 184 179 185 sprintf(buffer+length,"\tStatic %s As %s(%d )\n",180 sprintf(buffer+length,"\tStatic %s As %s(%d,\"%s\")\n", 186 181 member->m_name, 187 182 parent->TypeName, 188 member->m_value); 189 length+=lstrlen(buffer+length); 190 } 191 183 member->m_value, 184 member->m_name); 185 length+=lstrlen(buffer+length); 186 } 187 188 /* 192 189 sprintf(buffer+length,"\tOverride Function ToString() As String\n",parent->TypeName); 193 190 length+=lstrlen(buffer+length); 194 lstrcpy(buffer+length,"\t\tSelect Case m_Value\n");191 lstrcpy(buffer+length,"\t\tSelect Case value\n"); 195 192 length+=lstrlen(buffer+length); 196 193 for(i2=0;i2<parent->iEnumMemberNum;i2++){ … … 208 205 length+=lstrlen(buffer+length); 209 206 207 210 208 sprintf(buffer+length,"\tSub Operator= (ByRef value As %s)\n",parent->TypeName); 211 209 length+=lstrlen(buffer+length); … … 215 213 length+=lstrlen(buffer+length); 216 214 217 /*sprintf(buffer+length,"\tSub Operator= (ByRef value As String)\n",parent->TypeName);215 sprintf(buffer+length,"\tSub Operator= (ByRef value As String)\n",parent->TypeName); 218 216 length+=lstrlen(buffer+length); 219 217 lstrcpy(buffer+length,"\t\tSelect Case value\n"); … … 231 229 length+=lstrlen(buffer+length); 232 230 lstrcpy(buffer+length,"\tEnd Sub\n"); 231 length+=lstrlen(buffer+length); 232 233 sprintf(buffer+length,"\tSub Operator= (value As Long)\n",parent->TypeName); 234 length+=lstrlen(buffer+length); 235 lstrcpy(buffer+length,"\t\tm_Value=value\n"); 236 length+=lstrlen(buffer+length); 237 lstrcpy(buffer+length,"\tEnd Sub\n"); 233 238 length+=lstrlen(buffer+length);*/ 234 235 sprintf(buffer+length,"\tSub Operator= (value As Long)\n",parent->TypeName);236 length+=lstrlen(buffer+length);237 lstrcpy(buffer+length,"\t\tm_Value=value\n");238 length+=lstrlen(buffer+length);239 lstrcpy(buffer+length,"\tEnd Sub\n");240 length+=lstrlen(buffer+length);241 242 sprintf(buffer+length,"\tFunction Operator== (ByRef e As %s) As Boolean\n",parent->TypeName);243 length+=lstrlen(buffer+length);244 lstrcpy(buffer+length,"\t\tReturn ( e.m_Value = m_Value )\n");245 length+=lstrlen(buffer+length);246 lstrcpy(buffer+length,"\tEnd Function\n");247 length+=lstrlen(buffer+length);248 239 249 240 lstrcpy(buffer+length,"End Class\n"); … … 258 249 } 259 250 251 // ログを生成 252 Smoothie::Logger::PutFile( "enum_generated.log", buffer ); 253 260 254 return buffer; 261 255 }
Note:
See TracChangeset
for help on using the changeset viewer.