home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 September / Simtel20_Sept92.cdr / msdos / pascal / qparser.arc / SKELDTBL.PAS < prev    next >
Pascal/Delphi Source File  |  1985-08-27  |  2KB  |  46 lines

  1.     { SKELDTBL:  Contains the procedure to read debugging tables. }
  2.     { Copyright (C) 1984 by QCAD Systems Inc., All Rights Reserved. }
  3.  
  4.     {..................}
  5.     procedure READ_DEBUGGING_TABLES;
  6.       { This procedure takes up where read_table_files leaves off.
  7.         The rest of the tables are purely for debugging purposes
  8.         (specifically, to provide parser stack dump capability),
  9.         and may be omitted without affecting the parsing. }
  10.       var PX, TX:  int;  { token, token character array indices }
  11.           INDEX:  int;  { for loops }
  12.  
  13.       {. . . . . . . . .}
  14.       procedure READ_TOKEN(PX:  int);
  15.         { read the px-th token table entry. }
  16.         var TOK_NAME:  string80;
  17.             I:  byte;
  18.       begin
  19.         tokx[px] := tx;
  20.         read_string(tok_name);
  21.         tok_name := concat(tok_name, ' ');
  22.         tok_name[length(tok_name)]:=chr(0);
  23.         for i := 1 to length(tok_name) do begin
  24.           tokchar[tx] := tok_name[i];
  25.           tx := tx+1
  26.         end
  27.       end;
  28.  
  29.     begin { read_debugging_tables }
  30.       for index := 1 to lookstate do
  31.         insym[index] := next_value;
  32.       verify(-1);
  33.       for index := 1 to reducelen do
  34.         prodx[index] := next_value;
  35.       verify(-1);
  36.       for index := 1 to prodtoks do
  37.         prods[index] := next_value;
  38.       verify(-1);
  39.       tx := 1;
  40.       for px := 1 to all_toks do
  41.         read_token(px)
  42.       { omit the last verify, because it's gonna do another read }
  43.     end { read_debugging_tables };
  44.  
  45.  
  46.