Overview
Comment: | More codes and testing in class codes parser |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
02b262b608ef322c50bc4731d727209f |
User & Date: | user on 2018-04-27 20:25:35 |
Other Links: | manifest | tags |
Context
2018-05-05
| ||
23:58 | Implement preprocessor, and add some more opcode names, and a few bug fixed check-in: 79caf678be user: user tags: trunk | |
2018-04-27
| ||
20:25 | More codes and testing in class codes parser check-in: 02b262b608 user: user tags: trunk | |
2018-04-22
| ||
00:44 | Further progress on writing the lexer check-in: c36edda367 user: user tags: trunk | |
Changes
Modified class.c from [c6330b030d] to [c8671ac4ba].
︙ | |||
12 13 14 15 16 17 18 | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 | - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + | #include <stdio.h> #include <stdlib.h> #include <string.h> #include "sqlite3.h" #include "smallxrm.h" #include "heromesh.h" |
︙ | |||
160 161 162 163 164 165 166 167 168 169 | 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 | + + + + + + + + + + + + + + + + + + - + - - - + | } if(u==0x4000) ParseError("Too many message names; cannot add #%s",tokenstr); if(u==undef_message) ++undef_message; messages[u]=strdup(tokenstr); if(!messages[u]) fatal("Allocation failed\n"); return u; } static Uint16 look_hash(Hash*tbl,int size,Uint16 minv,Uint16 maxv,Uint16 newv,const char*err) { int h,i,m; for(h=i=0;tokenstr[i];i++) h=(13*h+tokenstr[i])%size; m=h; for(;;) { if(tbl[h].id>=minv && tbl[h].id<=maxv && !strcmp(tokenstr,tbl[h].txt)) return tbl[h].id; if(!tbl[h].id) { if(newv>maxv) ParseError("Too many %s\n",err); tbl[h].txt=strdup(tokenstr); if(!tbl[h].txt) ParseError("Out of string space in hash table\n"); tbl[h].id=newv; return 0; } h=(h+1)%size; if(h==m) ParseError("Hash table full\n"); } } #define ReturnToken(x,y) do{ tokent=x; tokenv=y; return; }while(0) static void nxttok(void) { |
︙ | |||
258 259 260 261 262 263 264 | 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 | - + - + - + + + + + + + + + + + + + + + + + - + + + + + + + + + + | // Just ignore sounds for now if(fl) ParseError("Invalid use of , and = in token\n"); tokent=TF_NAME; tokenv=0x0400; break; case '%': if(fl&TF_COMMA) ParseError("Invalid use of , in token\n"); |
Modified heromesh.h from [927413f183] to [0030d49afe].
︙ | |||
29 30 31 32 33 34 35 36 37 38 39 40 41 42 | 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | + | extern const char*const heromesh_key_names[256]; extern sqlite3*userdb; extern xrm_db*resourcedb; extern const char*basefilename; extern xrm_quark optionquery[16]; extern Uint32 generation_number; extern char main_options[128]; void set_cursor(int id); // == picture == extern SDL_Surface*screen; extern Uint16 picture_size; |
︙ |
Modified instruc from [fbb7f15d4d] to [97418ba69b].
︙ | |||
155 156 157 158 159 160 161 | 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | - + + | ,=Busy ,=Invisible ,=KeyCleared ,=UserSignal ,=VisualOnly ,=Stealthy ,=Moved |
︙ |
Modified instruc.h from [be3608b2e3] to [2460412a09].
︙ | |||
227 228 229 230 231 232 233 | 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 | - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - - - + + + + - + - - - + + + - + - + - - + + - + - - + + - + - + + - + - - + - - - + + + - + - - + + - + - - + + - - - - + + + + + - - - + + + - + - - - + + + - + - + - + - - + + - + | #define OP_STEALTHY_C 34910 #define OP_STEALTHY_E 36958 #define OP_STEALTHY_EC 39006 #define OP_MOVED 32863 #define OP_MOVED_C 34911 #define OP_MOVED_E 36959 #define OP_MOVED_EC 39007 |
︙ | |||
593 594 595 596 597 598 599 | 595 596 597 598 599 600 601 602 603 | - + | {"rsh",8486938}, {"swap",8421378}, {"then",8683527}, {"tuck",8421380}, {"until",8683531}, {"while",8683532}, }; |
Modified main.c from [752b28ab5b] to [03fb7ee697].
︙ | |||
33 34 35 36 37 38 39 40 41 42 43 44 45 46 | 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | + - | ; sqlite3*userdb; xrm_db*resourcedb; const char*basefilename; xrm_quark optionquery[16]; Uint32 generation_number; char main_options[128]; static const char*globalclassname; static SDL_Cursor*cursor[77]; static FILE*levelfp; static FILE*solutionfp; static FILE*hamarc_fp; static long hamarc_pos; |
︙ | |||
283 284 285 286 287 288 289 290 291 292 | 283 284 285 286 287 288 289 290 291 292 293 | + | load_key_bindings(); init_screen(); load_pictures(); if(main_options['T']) { test_mode(); return 0; } load_classes(); return 0; } |
Modified mbtofhm.c from [d589d1523d] to [12639d272e].
︙ | |||
414 415 416 417 418 419 420 | 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 | - + | #define PushFlowControl() do{ flowblock[flowptr]=ofs+2+(op[1]<<1)+(op[2]<<9); if(++flowptr==64) fatal("Too many nested flow controls\n"); len+=2; ind+=2; }while(0) static void class_codes(FILE*fp,const unsigned char*op,int ofs,const unsigned char*lbl,int nlbl,const unsigned char*subs,int nsubs,unsigned char*vars) { static const char*const stdvars[256]={ [0]="Class","Temperature","Shape", [4]="Xloc","Yloc","Dir","Image","Inertia","Misc1","Misc2","Misc3","Misc4","Misc5","Misc6","Misc7", [16]="Arrived","Departed","Arrivals","Departures", |
︙ |