home *** CD-ROM | disk | FTP | other *** search
/ Atari FTP / ATARI_FTP_0693.zip / ATARI_FTP_0693 / Tex / Tex29 / StTeXsrc.zoo / src / tokenstack.h < prev   
Text File  |  1988-03-13  |  3KB  |  114 lines

  1.  
  2. /*
  3.  * @(#)tokenstack.h 2.6 EPA
  4.  *
  5.  * Copyright 1987,1988 Pat J Monardo
  6.  *
  7.  * Redistribution of this file is permitted through
  8.  * the specifications in the file COPYING.
  9.  *
  10.  * 
  11.  */
  12.  
  13. typedef struct
  14. {
  15.     qword   state_field;
  16.     qword   index_field;
  17.     hword   start_field;
  18.     hword   loc_field;
  19.     hword   limit_field;
  20.     hword   name_field;
  21. }
  22.     input;
  23.  
  24. global  input   cur_input;
  25. global  input   input_stack[];
  26. global  ptr     input_ptr;
  27. global  ptr     max_in_stack;
  28.  
  29. #define state           cur_input.state_field
  30. #define index           cur_input.index_field
  31. #define start           cur_input.start_field
  32. #define loc             cur_input.loc_field
  33. #define limit           cur_input.limit_field
  34. #define name            cur_input.name_field
  35.  
  36. #define MID_LINE        1
  37. #define SKIP_BLANKS     (2 + MAX_CHAR_CODE)
  38. #define NEW_LINE        (3 + MAX_CHAR_CODE + MAX_CHAR_CODE)
  39.  
  40. #define terminal_input  (name == 0)
  41.  
  42. global  alpha_file  input_file[];
  43.  
  44. global  ptr     in_open;
  45. global  val     line;
  46. global  val     line_stack[];
  47.  
  48. #define cur_file    input_file[index]
  49.  
  50. #define TOKEN_LIST          0
  51. #define param_start         limit
  52. #define token_type          index
  53.  
  54. #define PARAMETER           0
  55. #define U_TEMPLATE          1
  56. #define V_TEMPLATE          2
  57. #define BACKED_UP           3
  58. #define INSERTED            4
  59. #define MACRO               5
  60. #define OUTPUT_TEXT         6
  61. #define EVERY_PAR_TEXT      7
  62. #define EVERY_MATH_TEXT     8
  63. #define EVERY_DISPLAY_TEXT  9
  64. #define EVERY_HBOX_TEXT     10
  65. #define EVERY_VBOX_TEXT     11
  66. #define EVERY_JOB_TEXT      12
  67. #define EVERY_CR_TEXT       13
  68. #define MARK_TEXT           14
  69. #define WRITE_TEXT          15
  70.  
  71. global  ptr     param_ptr;
  72. global  ptr     param_stack[];
  73. global  ptr     max_param_stack;
  74.  
  75. int     runaway();
  76. int     show_context();
  77.  
  78. global  val     align_state;
  79. global  ptr     base_ptr;
  80. global  ptr     def_ref;
  81. global  ptr     warning_index;
  82. global  int     scanner_status;
  83.  
  84. #define SKIPPING        1
  85. #define DEFINING        2
  86. #define MATCHING        3
  87. #define ALIGNING        4
  88. #define ABSORBING       5
  89.  
  90. #define set_trick_count() \
  91.     {first_count = tally; \
  92.     trick_count = tally + 1 + ERROR_LINE - HALF_ERROR_LINE; \
  93.     if (trick_count < ERROR_LINE) \
  94.         trick_count = ERROR_LINE;}
  95.  
  96. #define magic_c()   set_trick_count()
  97.  
  98. int     push_input();
  99. int     pop_input();
  100.  
  101. int     begin_token_list();
  102. int     end_token_list();
  103.  
  104. #define back_list(L)    begin_token_list(L, BACKED_UP)
  105. #define ins_list(L)     begin_token_list(L, INSERTED)
  106.  
  107. int     back_input();
  108. int     back_error();
  109.  
  110. int     begin_file_reading();
  111. int     end_file_reading();
  112.  
  113. int     clear_for_error_prompt();
  114.