InfixRvalue (lines 364-634)
Back to List
Browsing infix.h
0364 Array InfixRV_rvals --> 32;
0365 Array InfixRV_lvals --> 32;
0366 Array InfixRV_op --> 32;
0367 Array InfixRV_lop --> 32;
0368 Array InfixRV_rop --> 32;
0369 Array InfixRV_types --> 32;
0370 Array InfixRV_commas --> 32;
0371
0372 [ InfixRvalue acc w i n flag base expecting_term max maxi lop rop lvalside
0373 a b sysfun_f;
0374
0375 if (InfixCheckLineSpaced()) return GPR_REPARSE;
0376
0377 ! w = wn; for (i=0: i<10: i++) { wn = w; InfixRvalueTerm(); print i, "^"; }
0378 ! wn = w;
0379
0380 expecting_term = true; base = 0;
0381 do
0382 { w = NextWordStopped();
0383 if (expecting_term)
0384 { switch(w)
0385 { '-//':
0386 InfixRV_rvals-->n = 'unary-'; InfixRV_types-->n = base + 8;
0387 '[//':
0388 InfixRV_rvals-->n = w; InfixRV_types-->n = base + 6;
0389 '[[':
0390 InfixRV_rvals-->n = w; InfixRV_types-->n = base + 2;
0391 '++':
0392 InfixRV_rvals-->n = 'pre++'; InfixRV_types-->n = base + 9;
0393 '--':
0394 InfixRV_rvals-->n = 'pre--'; InfixRV_types-->n = base + 9;
0395 '(//':
0396 InfixRV_rvals-->n = w; InfixRV_types-->n = -3; base=base+100;
0397 ')//':
0398 InfixRV_rvals-->n = w; InfixRV_types-->n = -3; base=base-100;
0399 if (base < 0) { wn--; flag = true; }
0400 -1: flag = true;
0401 default:
0402 wn--;
0403 if (InfixRValueTerm() == 1)
0404 { InfixRV_rvals-->n = parsed_number;
0405 InfixRV_lvals-->n = infix_parsed_lvalue;
0406 InfixRV_types-->n = -1;
0407 expecting_term = false;
0408 }
0409 else flag = true;
0410 }
0411 }
0412 else
0413 { expecting_term = true;
0414 switch(w)
0415 { ',//':
0416 InfixRV_rvals-->n = w; InfixRV_types-->n = base;
0417 '=//':
0418 InfixRV_rvals-->n = w; InfixRV_types-->n = base + 1;
0419 '&&', '||':
0420 InfixRV_rvals-->n = w; InfixRV_types-->n = base + 2;
0421 '==', '[=', '>//', '>=', '/', '<=', 'has', 'hasnt',
0422 'in', 'notin', 'ofclass', 'provides':
0423 InfixRV_rvals-->n = w; InfixRV_types-->n = base + 3;
0424 'or':
0425 InfixRV_rvals-->n = w; InfixRV_types-->n = base + 4;
0426 '+//', '-//':
0427 InfixRV_rvals-->n = w; InfixRV_types-->n = base + 5;
0428 '*//', '@{2f}//', '%//', '&//', '|//':
0429 InfixRV_rvals-->n = w; InfixRV_types-->n = base + 6;
0430 '->', '-->':
0431 InfixRV_rvals-->n = w; InfixRV_types-->n = base + 7;
0432 ']&', ']#':
0433 InfixRV_rvals-->n = w; InfixRV_types-->n = base + 10;
0434 './/':
0435 InfixRV_rvals-->n = w; InfixRV_types-->n = base + 12;
0436 '::':
0437 InfixRV_rvals-->n = w; InfixRV_types-->n = base + 13;
0438 '(//':
0439 InfixRV_rvals-->n = '(rcall';
0440 InfixRV_types-->n = base + 11; base = base + 100;
0441 ')//':
0442 InfixRV_rvals-->n = w; InfixRV_types-->n = -3;
0443 base = base - 100;
0444 if (base < 0) { wn--; flag = true; }
0445 expecting_term = false;
0446 '++':
0447 InfixRV_rvals-->n = 'post++'; InfixRV_types-->n = base + 9;
0448 expecting_term = false;
0449 '--':
0450 InfixRV_rvals-->n = 'post--'; InfixRV_types-->n = base + 9;
0451 expecting_term = false;
0452 default:
0453 flag = true;
0454 }
0455 }
0456 n++;
0457 } until (flag || n==32);
0458 if (base > 0) return -1;
0459 n--; if (n == 0) return -1;
0460 wn--;
0461
0462 for (i=0: i<n: i++)
0463 { acc = 0; if (InfixRV_types-->i ~= -3) acc = InfixRV_rvals-->i;
0464 InfixRV_op-->i = acc;
0465 }
0466
0467 for (::)
0468 {
0469 ! for (i=0: i
Last updated 27 February 2004.
This site is no longer supported; information may be out of date.
Maintained as a historical archive by the Interactive Fiction Technology Foundation.
Copyright 1993-2018 IFTF, CC-BY-SA unless otherwise noted.
This page was originally managed by Graham Nelson (graham@gnelson.demon.co.uk) assisted by C Knight.