Overview
Comment: | Further progress on writing the lexer |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
c36edda36791645735354fb2c607cf16 |
User & Date: | user on 2018-04-22 00:44:59 |
Other Links: | manifest | tags |
Context
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 | |
2018-04-20
| ||
05:04 | Add class.c and add more instruction names check-in: 06c8b2a469 user: user tags: trunk | |
Changes
Modified class.c from [a8af44a33c] to [c6330b030d].
︙ | |||
20 21 22 23 24 25 26 | 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 | - + | #define TF_EQUAL 0x0002 #define TF_ABNORMAL 0x0004 #define TF_COMPAT 0x0008 #define TF_DIR 0x0010 #define TF_DROP 0x0020 #define TF_NAME 0x0080 #define TF_KEY 0x0100 |
︙ | |||
107 108 109 110 111 112 113 114 115 116 117 118 119 120 | 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 | + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + | } static int name_compar(const void*a,const void*b) { const Op_Names*x=a; const Op_Names*y=b; return strcmp(x->txt,y->txt); } static Class*initialize_class(int n,int f,const char*name) { Class*cl; if(classes[n]) fatal("Duplicate class number %d\n",n); cl=classes[n]=malloc(sizeof(Class)); if(!cl) fatal("Allocation failed\n"); cl->name=strdup(name); if(!cl->name) fatal("Allocation failed\n"); cl->edithelp=cl->gamehelp=0; cl->codes=cl->messages=cl->images=0; cl->height=cl->weight=cl->climb=cl->density=cl->volume=cl->strength=cl->arrivals=cl->departures=0; cl->temperature=cl->misc4=cl->misc5=cl->misc6=cl->misc7=0; cl->uservars=cl->hard[0]=cl->hard[1]=cl->hard[2]=cl->hard[3]=0; cl->oflags=cl->sharp[0]=cl->sharp[1]=cl->sharp[2]=cl->sharp[3]=0; cl->shape=cl->shovable=cl->collisionLayers=cl->nimages=0; cl->cflags=f; if(undef_class<=n) undef_class=n+1; } static int look_class_name(void) { int i; int u=undef_class; for(i=1;i<undef_class;i++) { if(classes[i]) { if(!strcmp(classes[i]->name,tokenstr)) { if(classes[i]->cflags&CF_NOCLASS2) classes[i]->cflags|=CF_NOCLASS1; return i; } } else { u=i; } } if(u==0x4000) ParseError("Too many class names; cannot add $%s\n",tokenstr); initialize_class(u,CF_NOCLASS1,tokenstr); return u; } static int look_message_name(void) { int i; int u=undef_message; for(i=0;i<undef_message;i++) { if(messages[i]) { if(!strcmp(messages[i],tokenstr)) return i; } else { u=i; } } 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; } #define ReturnToken(x,y) do{ tokent=x; tokenv=y; return; }while(0) static void nxttok(void) { int c,i; int fl=0; int n=0; int pr=0; |
︙ | |||
131 132 133 134 135 136 137 | 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 | - + + | while(c!=EOF && c!='\n') c=fgetc(classfp); ++linenum; goto again; } if(c=='(') ReturnToken(TF_OPEN,0); if(c==')') ReturnToken(TF_CLOSE,0); if(c=='"') { |
︙ | |||
167 168 169 170 171 172 173 | 221 222 223 224 225 226 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 | - + - + + + - + + + - + - + + + + + - + + + - + + + + + + + + - + + + + + | switch(pr) { case 0: if(chkind[c=*tokenstr]==2) { char*e; if(c=='-' || c=='+') n=1; else n=0; if(n && !tokenstr[1]) goto norm; tokent=TF_INT; |
Modified heromesh.h from [f8e6ccfb6c] to [927413f183].
︙ | |||
74 75 76 77 78 79 80 | 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 | - + - + | Uint16*messages; // use 0xFFFF if no such message block; not present if CF_GROUP Uint16*images; // high bit is set if available to editor; not present if CF_GROUP Sint32 height,weight,climb,density,volume,strength,arrivals,departures; Sint32 temperature,misc4,misc5,misc6,misc7; Uint16 uservars,oflags; Uint16 sharp[4]; Uint16 hard[4]; |
︙ |
Modified instruc from [be5d10fd00] to [fbb7f15d4d].
︙ | |||
177 178 179 180 181 182 183 | 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 212 213 214 215 216 217 218 219 220 221 222 223 224 225 | - + - - - + + + - + - + - + - - + + - + + - + | -DefaultImage -Help -EditorHelp -SUBS ; Main operations Animate |
︙ |
Modified instruc.h from [8595c2a4b6] to [be3608b2e3].
︙ | |||
306 307 308 309 310 311 312 | 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 | + - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + | #define OP_OBJCLASSAT 32909 #define OP_OBJBELOW 32910 #define OP_OBJBELOW_C 34958 #define OP_OBJDIR 32911 #define OP_OBJDIR_C 34959 #define OP_POPUP 32912 #define OP_POPUPARGS 32913 #define OP_QUEUETURN 32914 |
︙ | |||
471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 | 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 | + - - - + + + - + - + - + - - + + - + | {"ObjClassAt",8421517}, {"ObjDir",8487055}, {"PLAYERMOVING",8389133}, {"POSTINIT",8389138}, {"POUR",8389377}, {"POWER",8389386}, {"PopUp",8421520}, {"QueueTurn",8421522}, {"Quiz",8683627}, {"R",9437198}, {"RATCHET1",8389418}, {"RATCHET2",8389412}, {"RATTLE",8389403}, {"RB",9437197}, {"RF",9437199}, {"S",9437190}, {"SE",9437191}, {"SMALL_POP",8389389}, {"SPLASH",8389376}, {"STEAM",8389424}, {"STOP",8388608}, {"SUBS",8683632}, {"SUNK",8389131}, {"SW",9437189}, {"Self",8421474}, |
︙ | |||
591 592 593 594 595 596 597 | 593 594 595 596 597 598 599 600 601 | - + | {"rsh",8486938}, {"swap",8421378}, {"then",8683527}, {"tuck",8421380}, {"until",8683531}, {"while",8683532}, }; |
Modified quarks from [c0379a86e6] to [28bc2772ba].
︙ | |||
204 205 206 207 208 209 210 211 | 204 205 206 207 208 209 210 211 212 | + | sqlMemStatus sqlSmallAllocations sqlCoveringIndexScan sqlPowerSafe ! Miscellaneous level tracePrefix |