Inform - Support - Source

Back to List

Inventory
Complete

Backward
Forward

Plain
Coloured
Gaudy

This code
in plain text

Browsing infix.h

InfixExamineP (lines 772-902)

0772  [ InfixExamineP brief x a b w flag lines;
0773      switch (infix_term_type) {
0774        INFIXTT_NUMBER:
0775          if (brief) "; == ", noun;
0776          print "; The number ", noun, " == $", (InfixHex) noun;
0777          if (noun >= 32 && noun < 127) print " == '", (char) noun, "'";
0778          new_line;
0779        INFIXTT_NAMEDOBJECT:
0780          print "~", (name) noun, "~ (", noun, ")^"; if (brief) return;
0781          <<Showobj noun>>;
0782        INFIXTT_CONSTANT:
0783          if (brief) "; == ", noun;
0784          switch (infix_data1 & 15) {
0785              nothing:
0786                  print "; Constant ", (InfixPrintConstant) infix_parsed_lvalue,
0787                  " == ", noun, "^";
0788              Object: <<Showobj noun>>;
0789              Class:
0790                  print "Class ", (name) noun, "^";
0791                  objectloop (a ofclass noun) {
0792                      if (flag) print ", "; else print "Contains: ";
0793                      print (name) a, " (", a, ")"; flag=true;
0794                  }
0795                  if (flag == false) "No object is of this class";
0796          }
0797          new_line;
0798        INFIXTT_ATTRIBUTE:
0799          if (brief) "; == ", noun;
0800          if (noun >= 48 || noun < 0) "; No such attribute";
0801          print "; Attribute ", (InfixPrintAttribute) noun,
0802              " (numbered ", noun, ")^";
0803          objectloop (x has noun) {
0804              if (flag) print ", ";
0805              else print "Each of these ~has ", (InfixPrintAttribute) noun, "~: ";
0806              print (name) x, " (", x, ")"; flag = true;
0807          }
0808          if (flag == false) "No object ~has ", (InfixPrintAttribute) noun, "~";
0809          new_line;
0810        INFIXTT_PROPERTY:
0811          if (brief) "; == ", noun;
0812          print "; Property ", (property) noun, " (numbered ", noun, ")^";
0813          objectloop (x provides noun) {
0814              if (flag) print ", "; else print "Provided by: ";
0815              print (name) x, " (", x, ")"; flag = true;
0816          }
0817          if (flag == false) "Which is not provided by any object";
0818          new_line;
0819        INFIXTT_DWORD:
0820          if (brief) "; == ", noun;
0821          if (noun == 0) "; This word is not in the dictionary";
0822          a = noun->#dict_par1;
0823          print "; Dictionary word '", (address) noun;
0824          if (a & 4) print "//p";
0825          print "' (address ", noun, ")";
0826          if (a) {
0827              print ": ";
0828              if (a & 2)   print "meta ";
0829              if (a & 1)   print "verb   ";
0830              if (a & 8)   print "preposition   ";
0831              if (a & 4)   print "pluralising ";
0832              if (a & 128) print "noun ";
0833          }
0834          new_line;
0835          if (a & 1) <<Showverb noun>>;
0836        INFIXTT_ROUTINE:
0837          if (brief) "; == ", noun;
0838          print "; Routine ", (InfixPrintRoutine) infix_parsed_lvalue, " (number ",
0839            infix_parsed_lvalue, ", packed address ", noun, ")^";
0840        INFIXTT_GLOBAL:
0841          if (brief) "; == ", noun;
0842          print "; Global ", (InfixPrintGlobal) infix_parsed_lvalue, " == ", noun, "^";
0843        INFIXTT_ARRAY:
0844          if (brief) "; == ", noun;
0845          print "; Array ", (InfixPrintArray) infix_parsed_lvalue, " ";
0846          infix_data1 = infix_data1 % 16;
0847          switch (infix_data1) {
0848            0:    print "->"; a=0;
0849            1:    print "-->"; a=0;
0850            2:    print "string"; a=1;
0851            3:    print "table"; a=1;
0852            4:    print "buffer"; a=WORDSIZE;
0853          }
0854          print " ", infix_data2 + 1 - a, "^; == "; b = infix_data2;
0855          for (w=b : w>=a : w--)
0856              if (infix_data1 == 0 or 2 or 4) { if (noun->w) break; }
0857              else { if (noun-->w) break; }
0858          if (b-w < 5) w=b;
0859          for (: x<=w : x++) {
0860              if (infix_data1 == 0 or 2 or 4) print noun->x, " ";
0861              else print noun-->x, " ";
0862              if (x+1 == a) print ": ";
0863              }
0864          if (w < b) print "(then ", b-w, " zero entries)";
0865          new_line;
0866        INFIXTT_ACTION:
0867          if (brief) "; == ", noun;
0868          if (noun >= #lowest_fake_action_number && noun <= #highest_fake_action_number)
0869             "; Fake action ", (InfixPrintFakeAction) noun,
0870              " (numbered ", noun, ")^Is not generated by any grammar";
0871          print "; Action ", (InfixPrintAction) noun,
0872              " (numbered ", noun, ")^";
0873          w = HDR_DICTIONARY-->0;
0874          for (b=0 : b<(HDR_DICTIONARY-->0 + 5)-->0 : b++) {
0875              w = HDR_DICTIONARY-->0 + 7 + b*9;
0876              if ((w->#dict_par1) & 1) {
0877                  a = (HDR_STATICMEMORY-->0)-->($ff-(w->#dict_par2));
0878                  lines = a->0; a++;
0879                  for (: lines>0 : lines--) {
0880                      a = UnpackGrammarLine(a);
0881                      if (action_to_be == noun) {
0882                          print "'", (address) w, "' "; DebugGrammarLine();
0883                          new_line;
0884                          flag = true;
0885                      }
0886                  }
0887              }
0888          }
0889          if (flag == 0) "Is not generated by any grammar";
0890        INFIXTT_SYSFUN:
0891          if (brief) "; == ", noun;
0892          "; System function ~", (address) infix_parsed_lvalue, "~ has
0893          not been overridden by any routine and so has its standard definition.";
0894        INFIXTT_STATICSTRING:
0895          if (brief) "; == ", noun;
0896          if (metaclass(noun) ~= String) "; ", noun, " is not a string.";
0897          print "~", (string) noun, "~^";
0898        INFIXTT_LOGICAL:
0899          if (noun == true) "; true"; if (noun == false) "; false";
0900          "; ", noun;
0901      }
0902  ]; ! end of InfixExamineP


Last updated 27 February 2004. The librarian in charge of this page is Graham Nelson (graham@gnelson.demon.co.uk) assisted by C Knight. Please email any comments, suggestions or corrections to cedenqs@inform-fiction.org.