Changeset 23
- Timestamp:
- Jun 27, 2012, 11:46:20 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/AS8051toC/UMainForm.pas
r22 r23 173 173 Expect('fi'); 174 174 Emit('#endif '); 175 end else Error('Unknown token "' + GetNext + '"');175 end; // else Error('Unknown token "' + GetNext + '"'); 176 176 end 177 177 else if ParseComment then … … 181 181 else if IsIdentificator(GetNext) then begin 182 182 Variable := ReadNext; 183 if GetNext = '%' then begin 184 Expect('%'); 185 Variable := Variable + '##' + ReadNext; 186 end; 183 187 if GetNext = ':' then begin 184 188 Expect(':'); … … 232 236 Expect('then'); 233 237 Expect('('); 234 end else Error('Unknown macro: ' + ReadNext); 238 end else 239 if GetNext = 'set' then begin 240 Expect('set'); 241 Emit('#define '); 242 Expect('('); 243 Emit(ReadNext + ' '); 244 Expect(','); 245 ParseDbExpression; 246 Expect(')'); 247 Emit(';'); 248 end else 249 if GetNext = '*' then begin 250 Expect('*'); 251 if GetNext = 'define' then begin 252 Expect('define'); 253 Emit('#define '); 254 Expect('('); 255 Emit(ReadNext); 256 Expect('('); 257 Emit('(' + ReadNext); 258 while GetNext = ',' do begin 259 Expect(','); 260 Emit(', ' + ReadNext); 261 end; 262 Expect(')'); 263 Emit(')'); 264 Expect(')'); 265 if GetNext = 'local' then begin 266 Expect('local'); 267 ReadNext; 268 end; 269 Expect('('); 270 end; 271 end;// else Error('Unknown macro: ' + ReadNext); 235 272 end else Result := False; 236 273 end; … … 259 296 MacroName := ReadNext; 260 297 Emit(MacroName); 298 if GetNext = '(' then begin 299 Expect('('); 300 Emit('('); 301 if ParseMacroUsage then 302 else Emit(ReadNext); 303 while GetNext = ',' do begin 304 Expect(','); 305 Emit(','); 306 if ParseMacroUsage then 307 else Emit(ReadNext); 308 end; 309 Emit(')'); 310 Expect(')'); 311 end; 261 312 end else Result := False; 262 313 end; … … 325 376 end; 326 377 end else 378 if GetNext = 'dw' then begin 379 Result := True; 380 Expect('dw'); 381 Emit('char '); 382 ParseDbExpression; 383 while GetNext = ',' do begin 384 Expect(','); 385 Emit(','); 386 ParseDbExpression; 387 end; 388 end else 327 389 if GetNext = 'ds' then begin 328 390 Result := True; … … 386 448 Expect('le'); 387 449 Emit('<= '); 450 end else 451 if GetNext = 'or' then begin 452 Expect('or'); 453 Emit('|| '); 454 end else 455 if GetNext = 'and' then begin 456 Expect('and'); 457 Emit('&& '); 388 458 end else 389 459 Error('Unknown operand "' + ReadNext + '"'); … … 435 505 Emit('/'); 436 506 ParseDbExpression; 507 end else 508 if GetNext = 'or' then begin 509 Expect('or'); 510 Emit('|| '); 511 ParseDbExpression; 512 end else 513 if GetNext = 'and' then begin 514 Expect('and'); 515 Emit('&& '); 516 ParseDbExpression; 437 517 end; 438 518 end;
Note:
See TracChangeset
for help on using the changeset viewer.