OSDN Git Service

touaTeX + Y&Y TeX.
[putex/putex.git] / src / texsourc / tex2.c
1 #ifdef _WINDOWS
2   #define NOCOMM
3   #define NOSOUND
4   #define NODRIVERS
5   #define STRICT
6   #pragma warning(disable:4115) // kill rpcasync.h complaint
7   #include <windows.h>
8   #define MYLIBAPI __declspec(dllexport)
9 #endif
10
11 #include "texwin.h"
12
13 #pragma warning(disable:4996)
14 #pragma warning(disable:4131) // old style declarator
15 #pragma warning(disable:4135) // conversion between different integral types 
16 #pragma warning(disable:4127) // conditional expression is constant
17
18 #include <setjmp.h>
19
20 #define EXTERN extern
21
22 #include "texd.h"
23
24 #pragma warning(disable:4244)       /* 96/Jan/10 */
25
26 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
27
28 /* following bit used to be end of tex1.c */
29
30 #ifdef STAT
31 void restore_trace_(halfword p, str_number s)
32
33   begin_diagnostic(); 
34   print_char(123);  /* { */
35   print(s); 
36   print_char(32); /*   */
37   show_eqtb(p); 
38   print_char(125);  /* } */
39   end_diagnostic(false); 
40
41 #endif /* STAT */
42 void unsave (void) 
43 {/* 30 */  
44   halfword p; 
45   quarterword l; 
46   halfword t; 
47   if(cur_level > 1)
48   {
49     decr(cur_level); 
50     while(true){
51       decr(save_ptr); 
52       if(save_stack[save_ptr].hh.b0 == 3)
53       goto lab30; 
54       p = save_stack[save_ptr].hh.v.RH; 
55       if(save_stack[save_ptr].hh.b0 == 2)
56       {
57   t = cur_tok; 
58   cur_tok = p; 
59   back_input (); 
60   cur_tok = t; 
61       } 
62       else {
63     
64   if(save_stack[save_ptr].hh.b0 == 0)
65   {
66     l = save_stack[save_ptr].hh.b1; 
67     decr(save_ptr); 
68   } 
69   else save_stack[save_ptr]= eqtb[(hash_size + 781)]; 
70                     /* undefine_control_sequence */
71   if(p < (hash_size + 3163))
72   if(eqtb[p].hh.b1 == 1)
73   {
74     eq_destroy(save_stack[save_ptr]); 
75   ;
76 #ifdef STAT
77     if(eqtb[(hash_size + 3200)].cint > 0)
78     restore_trace(p, 541); /* retaining */
79 #endif /* STAT */
80   } 
81   else {
82       
83     eq_destroy(eqtb[p]); 
84     eqtb[p]= save_stack[save_ptr]; 
85   ;
86 #ifdef STAT
87     if(eqtb[(hash_size + 3200)].cint > 0)
88     restore_trace(p, 542); /* restoring */
89 #endif /* STAT */
90   } 
91   else if(xeq_level[p]!= 1)
92   {
93     eqtb[p]= save_stack[save_ptr]; 
94     xeq_level[p]= l;     /* l may be used without having been ... */
95   ;
96 #ifdef STAT
97     if(eqtb[(hash_size + 3200)].cint > 0)
98     restore_trace(p, 542); /* restoring */
99 #endif /* STAT */
100   } 
101   else {
102       
103   ;
104 #ifdef STAT
105     if(eqtb[(hash_size + 3200)].cint > 0)
106     restore_trace(p, 541); /* retaining */
107 #endif /* STAT */
108   } 
109       } 
110     } 
111     lab30: cur_group = save_stack[save_ptr].hh.b1; 
112     cur_boundary = save_stack[save_ptr].hh.v.RH; 
113   } 
114   else {
115     confusion(540); /* cur_level */
116     return;       // abort_flag set
117   }
118
119 /* This is where the old tex2.c used to start */
120 void prepare_mag (void) 
121 {
122   if((mag_set > 0)&&(eqtb[(hash_size + 3180)].cint != mag_set)) 
123   {
124     {
125       if(interaction == 3)
126    ; 
127       print_nl(266);  /* ! */
128       print(544);   /* Incompatible magnification(*/
129     } 
130     print_int(eqtb[(hash_size + 3180)].cint); 
131     print(545);     /*)*/
132     print_nl(546);    /*  the previous value will be retained */
133     {
134       help_ptr = 2; 
135       help_line[1]= 547; /* I can handle only one magnification ratio per job. */
136       help_line[0]= 548; /* So I've reverted to the magnification you used earlier on this run. */
137
138     } 
139     int_error(mag_set); 
140     geq_word_define((hash_size + 3180), mag_set); 
141   } 
142   if((eqtb[(hash_size + 3180)].cint <= 0)||
143     (eqtb[(hash_size + 3180)].cint > 32768L)) 
144   {
145     {
146       if(interaction == 3)
147    ; 
148       print_nl(262);    /* ! */
149       print(549);   /* Illegal magnification has been changed to 1000 */
150     } 
151     {
152       help_ptr = 1; 
153       help_line[0]= 550; /* The magnification ratio must be between 1 and 32768. */
154     } 
155     int_error(eqtb[(hash_size + 3180)].cint); 
156     geq_word_define((hash_size + 3180), 1000); 
157   } 
158   mag_set = eqtb[(hash_size + 3180)].cint; 
159
160 void token_show_ (halfword p)  
161 {
162 /* begin if p<>null then show_token_list(link(p),null,10000000); l.6289 */
163   if(p != 0)
164   show_token_list(mem[p].hh.v.RH, 0, 10000000L); 
165
166 void print_meaning (void) 
167 {
168   print_cmd_chr(cur_cmd, cur_chr); 
169   if(cur_cmd >= 111)
170   {
171     print_char(58); /* : */
172     print_ln (); 
173     token_show(cur_chr); 
174   } 
175   else if(cur_cmd == 110)
176   {
177     print_char(58); /* : */
178     print_ln (); 
179     token_show(cur_mark[cur_chr]); 
180   } 
181
182 void show_cur_cmd_chr (void) 
183
184   begin_diagnostic (); 
185   print_nl(123);    /* { */
186   if(mode != shown_mode)
187   {
188     print_mode(mode); 
189     print(565); /* :  */
190     shown_mode = mode; 
191   } 
192   print_cmd_chr(cur_cmd, cur_chr); 
193   print_char(125);  /* } */
194   end_diagnostic(false); 
195
196 void show_context (void) 
197 {/* 30 */ 
198   char old_setting; 
199   integer nn; 
200   bool bottomline; 
201   integer i; 
202   integer j; 
203   integer l; 
204   integer m; 
205   integer n; 
206   integer p; 
207   integer q; 
208   base_ptr = input_ptr; 
209   input_stack[base_ptr] = cur_input; 
210   nn = -1; 
211   bottomline = false; 
212   while(true){
213     cur_input = input_stack[base_ptr]; 
214     if((cur_input.state_field != 0)) 
215     if((cur_input.name_field > 17)||(base_ptr == 0)) 
216     bottomline = true; 
217     if((base_ptr == input_ptr)|| bottomline ||
218     (nn < eqtb[(hash_size + 3217)].cint)) 
219     {
220 /* begin if (base_ptr=input_ptr) or (state<>token_list) or
221    (token_type<>backed_up) or (loc<>null) then
222     {we omit backed-up token lists that have already been read} l.6761 */
223       if((base_ptr == input_ptr)||(cur_input.state_field != 0)||(
224       cur_input.index_field != 3)||(cur_input.loc_field != 0)) 
225       {
226   tally = 0; 
227   old_setting = selector;  
228   if(cur_input.state_field != 0)
229   {
230     if(cur_input.name_field <= 17)
231     if((cur_input.name_field == 0)) 
232       if(base_ptr == 0)print_nl(571);   /* <*> */
233       else print_nl(572); /* <insert>  */
234     else {
235       print_nl(573);    /* <read  */
236       if(cur_input.name_field == 17)
237       print_char(42);   /* * */
238       else print_int(cur_input.name_field - 1); 
239       print_char(62);   /* > */
240     } 
241     else {
242 /*      print_nl(574); */
243 /*      print_int(line); */
244 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
245       if (c_style_flag) {         /* 94/Mar/21 */
246         print_ln();         /* new line */
247         /* show current input file name - ignore if from terminal */
248         if (cur_input.name_field > 17)  /* redundant ? */
249           print(cur_input.name_field);
250         print_char(40);       /*(*/
251         print_int(line);      /* line number */
252         print_char(41);       /*)*/
253         print_char(32);       /*   */
254         print_char(58);       /* : */
255       }
256       else {
257         print_nl(574);        /* l. ? 573 ????? 98/Dec/8 check ! */
258         print_int(line);      /* line number */
259       }
260 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
261     } 
262     print_char(32);   /*   */
263     {
264       l = tally; 
265       tally = 0; 
266       selector = 20; 
267       trick_count = 1000000L; 
268     } 
269     if(buffer[cur_input.limit_field]== eqtb[(hash_size + 3211)].cint)
270     j = cur_input.limit_field; 
271     else j = cur_input.limit_field + 1; 
272     if(j > 0)
273     {
274       register integer for_end; 
275       i = cur_input.start_field; 
276       for_end = j - 1; 
277       if(i <= for_end) do 
278       {
279         if(i == cur_input.loc_field)
280         {
281           first_count = tally; 
282           trick_count = tally + 1 + error_line - half_error_line; 
283           if(trick_count < error_line)
284             trick_count = error_line; 
285         } 
286         print(buffer[i]); 
287       } 
288       while(i++ < for_end);
289     } 
290   } 
291   else {
292       
293     switch(cur_input.index_field)
294     {case 0 : 
295       print_nl(575); /* <argument>  */  
296     break; 
297     case 1 : 
298     case 2 : 
299       print_nl(576); /* <template>  */
300       break; 
301     case 3 : 
302       if(cur_input.loc_field == 0)
303       print_nl(577);  /* <recently read>  */
304       else print_nl(578); /* <to be read again>  */
305       break; 
306     case 4 : 
307       print_nl(579); /* <inserted text>  */
308       break; 
309     case 5 : 
310       {
311         print_ln (); 
312         print_cs(cur_input.name_field); 
313       } 
314       break; 
315     case 6 : 
316       print_nl(580); /* <output>  */
317       break; 
318     case 7 : 
319       print_nl(581); /* <everypar>  */
320       break; 
321     case 8 : 
322       print_nl(582); /* <everymath>  */
323       break; 
324     case 9 : 
325       print_nl(583); /* <everydisplay>  */
326       break; 
327     case 10 : 
328       print_nl(584); /* <everyhbox>  */
329       break; 
330     case 11 : 
331       print_nl(585); /* <everyvbox>  */
332       break; 
333     case 12 : 
334       print_nl(586); /* <everyjob>  */
335       break; 
336     case 13 : 
337       print_nl(587); /* <everycr>  */
338       break; 
339     case 14 : 
340       print_nl(588); /* <mark>  */
341       break; 
342     case 15 : 
343       print_nl(589); /* <write>  */
344       break; 
345       default: 
346       print_nl(63);  /* ? */
347       break; 
348     } 
349     {
350       l = tally; 
351       tally = 0; 
352       selector = 20; 
353       trick_count = 1000000L; 
354     } 
355     if(cur_input.index_field < 5)
356     show_token_list(cur_input.start_field, cur_input.loc_field, 100000L 
357   ); 
358     else show_token_list(mem[cur_input.start_field].hh.v.RH, 
359     cur_input.loc_field, 100000L); 
360   } 
361   selector = old_setting; 
362   if(trick_count == 1000000L)
363   {
364     first_count = tally; 
365     trick_count = tally + 1 + error_line - half_error_line; 
366     if(trick_count < error_line)
367       trick_count = error_line; 
368   } 
369   if(tally < trick_count)
370     m = tally - first_count; 
371   else m = trick_count - first_count; 
372   if(l + first_count <= half_error_line){
373     p = 0; 
374     n = l + first_count; 
375   } 
376   else {
377     print(275);       /* ... */
378     p = l + first_count - half_error_line + 3; 
379     n = half_error_line; 
380   } 
381   {
382     register integer for_end; 
383     q = p; 
384     for_end = first_count - 1; 
385     if(q  <= for_end) do 
386       print_char(trick_buf[q % error_line]); 
387     while(q++ < for_end);
388   } 
389   print_ln (); 
390   {
391     register integer for_end; 
392     q = 1; 
393     for_end = n; 
394     if(q <= for_end) 
395       do print_char(32);    /*   */
396     while(q++ < for_end);
397   } 
398   if(m + n <= error_line)
399   p = first_count + m; 
400   else p = first_count +(error_line - n - 3); 
401   {
402     register integer for_end; 
403     q = first_count; 
404     for_end = p - 1; 
405     if(q  <= for_end) do 
406       print_char(trick_buf[q % error_line]); 
407     while(q++ < for_end);
408   } 
409   if(m + n > error_line)
410     print(275);       /* ... */
411   incr(nn); 
412       } 
413     } 
414     else if(nn == eqtb[(hash_size + 3217)].cint)
415     {
416       print_nl(275);      /* ... */
417       incr(nn); 
418     } 
419     if(bottomline)
420     goto lab30; 
421     decr(base_ptr); 
422   } 
423   lab30: cur_input = input_stack[input_ptr]; 
424 }
425 #pragma optimize("g", off)          /* 98/Dec/10 experiment */
426 void begin_token_list_ (halfword p, quarterword t)
427 {
428   {
429     if(input_ptr > max_in_stack)
430     {
431       max_in_stack = input_ptr; 
432 #ifdef ALLOCATEINPUTSTACK
433     if(input_ptr == current_stack_size)
434       input_stack = realloc_input_stack (increment_stack_size);
435     if(input_ptr == current_stack_size){    /* check again after allocation */
436       overflow(590, current_stack_size);
437       return;     // abort_flag set
438     }
439 #else
440     if(input_ptr == stack_size) { /* input stack - not dynamic */
441       overflow(590, stack_size);
442       return;     // abort_flag set
443     }
444 #endif
445     } 
446     input_stack[input_ptr]= cur_input; 
447     incr(input_ptr); 
448   } 
449   cur_input.state_field = 0; 
450   cur_input.start_field = p; 
451   cur_input.index_field = t; 
452   if(t >= 5)
453   {
454     incr(mem[p].hh.v.LH); 
455     if(t == 5)
456     cur_input.limit_field = param_ptr; 
457     else {
458   
459       cur_input.loc_field = mem[p].hh.v.RH; 
460       if(eqtb[(hash_size + 3193)].cint > 1)
461       {
462   begin_diagnostic (); 
463   print_nl(335);   /* */
464   switch(t)
465   {case 14 : 
466     print_esc(348); /* mark */
467     break; 
468   case 15 : 
469     print_esc(591); /* write */
470     break; 
471     default: 
472     print_cmd_chr(72, t + (hash_size + 1307));  /* H */
473     break; 
474   } 
475   print(553); /* -> */
476   token_show(p); 
477   end_diagnostic(false); 
478       } 
479     } 
480   } 
481   else cur_input.loc_field = p; 
482
483 #pragma optimize("", on)          /* 98/Dec/10 experiment */
484 void end_token_list (void) 
485
486   if(cur_input.index_field >= 3)
487   {
488     if(cur_input.index_field <= 4)
489     flush_list(cur_input.start_field); 
490     else {
491       delete_token_ref(cur_input.start_field); 
492       if(cur_input.index_field == 5)
493       while(param_ptr > cur_input.limit_field){
494       decr(param_ptr); 
495       flush_list(param_stack[param_ptr]); 
496       } 
497     } 
498   } 
499   else if(cur_input.index_field == 1)
500   if(align_state > 500000L)align_state = 0; 
501   else {
502     fatal_error(592); /* (interwoven alignment preambles are not allowed) */
503     return;     // abort_flag set
504   }
505   {
506     decr(input_ptr); 
507     cur_input = input_stack[input_ptr]; 
508   } 
509   {
510     if(interrupt != 0){
511     pause_for_instructions ();
512   }
513   } 
514 }
515 void back_input (void) 
516
517   halfword p; 
518   while((cur_input.state_field == 0)&&(cur_input.loc_field == 0)) {
519     end_token_list ();
520   }
521   p = get_avail (); 
522   mem[p].hh.v.LH = cur_tok; 
523   if(cur_tok < 768)
524     if(cur_tok < 512)
525       decr(align_state); 
526     else incr(align_state); 
527   {
528     if(input_ptr > max_in_stack)
529     {
530       max_in_stack = input_ptr; 
531 #ifdef ALLOCATEINPUTSTACK
532       if(input_ptr == current_stack_size)
533         input_stack = realloc_input_stack (increment_stack_size);
534       if(input_ptr == current_stack_size){  /* check again after allocation */
535         overflow(590, current_stack_size);
536         return;     // abort_flag set
537       }
538 #else
539       if(input_ptr == stack_size) { /* stack size - not dynamic */
540         overflow(590, stack_size);
541         return;     // abort_flag set
542       }
543 #endif
544     } 
545     input_stack[input_ptr]= cur_input; 
546     incr(input_ptr); 
547   } 
548   cur_input.state_field = 0; 
549   cur_input.start_field = p; 
550   cur_input.index_field = 3; 
551   cur_input.loc_field = p; 
552
553 void back_error (void) 
554
555   OK_to_interrupt = false; 
556   back_input (); 
557   OK_to_interrupt = true; 
558   error (); 
559
560 void ins_error (void) 
561
562     OK_to_interrupt = false; 
563   back_input (); 
564   cur_input.index_field = 4; 
565   OK_to_interrupt = true; 
566   error (); 
567
568 void begin_file_reading (void) 
569
570     if(in_open == max_in_open){
571       overflow(593, max_in_open); /* text input levels - NOT DYNAMIC */
572     return;     // abort_flag set
573   }
574 #ifdef ALLOCATEBUFFER
575     if(first == current_buf_size)
576     buffer = realloc_buffer (increment_buf_size);
577   if(first == current_buf_size) {   /* check again after allocation */
578     overflow(256, current_buf_size);
579     return;     // abort_flag set
580   }
581 #else
582   if(first == buf_size){
583     overflow(256, buf_size);  /* buffer size - not dynamic */
584     return;     // abort_flag set
585   }
586 #endif
587
588   incr(in_open); 
589   if (in_open > high_in_open)     /* 1999 Jan 17 */
590     high_in_open = in_open;
591   {
592     if(input_ptr > max_in_stack)
593     {
594       max_in_stack = input_ptr; 
595 #ifdef ALLOCATEINPUTSTACK
596     if(input_ptr == current_stack_size)
597       input_stack = realloc_input_stack (increment_stack_size);
598     if(input_ptr == current_stack_size){
599       overflow(590, current_stack_size);  /* check again after allocation */
600       return;     // abort_flag set
601     }
602 #else
603     if(input_ptr == stack_size){
604       overflow(590, stack_size);    /* input stack - not dynamic */
605       return;     // abort_flag set
606     }
607 #endif
608     } 
609     input_stack[input_ptr]= cur_input; 
610     incr(input_ptr); 
611   } 
612   cur_input.index_field = in_open; 
613   line_stack[cur_input.index_field]= line; 
614   cur_input.start_field = first; 
615   cur_input.state_field = 1; 
616   cur_input.name_field = 0; 
617
618 void end_file_reading (void) 
619
620   first = cur_input.start_field; 
621   line = line_stack[cur_input.index_field]; 
622   if(cur_input.name_field > 17)
623     (void) a_close(input_file[cur_input.index_field]); 
624   {
625     decr(input_ptr); 
626     cur_input = input_stack[input_ptr]; 
627   } 
628   decr(in_open); 
629
630 /* called only form tex0.c */
631 void clear_for_error_prompt (void) 
632 {
633   while((cur_input.state_field != 0)&&
634      (cur_input.name_field == 0)&&
635      (input_ptr > 0)&&
636      (cur_input.loc_field > cur_input.limit_field)) 
637   end_file_reading (); 
638   print_ln (); 
639
640 void check_outer_validity (void) 
641
642   halfword p; 
643   halfword q; 
644   if(scanner_status != 0)
645   {
646     deletions_allowed = false; 
647     if(cur_cs != 0)
648     {
649       if((cur_input.state_field == 0)||(cur_input.name_field < 1)||
650       (cur_input.name_field > 17)) 
651       {
652 /*     begin p:=get_avail; info(p):=cs_token_flag+cur_cs; */
653   p = get_avail (); 
654   mem[p].hh.v.LH = 4095 + cur_cs; 
655   begin_token_list(p, 3); 
656       } 
657       cur_cmd = 10; 
658       cur_chr = 32; 
659     } 
660     if(scanner_status > 1)
661     {
662       runaway (); 
663       if(cur_cs == 0)
664       {
665   if(interaction == 3)
666   ; 
667   print_nl(262);  /* ! */
668   print(601);   /* File ended */
669       } 
670       else {
671     
672   cur_cs = 0; 
673   {
674     if(interaction == 3)
675   ; 
676     print_nl(262); /* ! */
677     print(602); /* Forbidden control sequence found */
678   } 
679       } 
680       print(603); /*  while scanning  */
681       p = get_avail (); 
682       switch(scanner_status)
683       {case 2 : 
684   {
685     print(567); /* definition */
686     mem[p].hh.v.LH = 637; 
687   } 
688   break; 
689       case 3 : 
690   {
691     print(609); /* use */
692     mem[p].hh.v.LH = par_token; 
693     long_state = 113; 
694   } 
695   break; 
696       case 4 : 
697   {
698     print(569); /* preamble */
699     mem[p].hh.v.LH = 637; 
700     q = p; 
701     p = get_avail (); 
702     mem[p].hh.v.RH = q; 
703 /*    mem[p].hh.v.LH = (hash_size + 4610);  */
704 /*    mem[p].hh.v.LH = (hash_size + 4095 + 515);  */
705     mem[p].hh.v.LH = (hash_size + hash_extra + 4095 + 515); /*96/Jan/10*/
706     align_state = -1000000L; 
707   } 
708   break; 
709       case 5 : 
710   {
711     print(570); /* text */
712     mem[p].hh.v.LH = 637; 
713   } 
714   break; 
715       } 
716       begin_token_list(p, 4); 
717       print(604); /*  of  */
718       sprint_cs(warning_index); 
719       {
720   help_ptr = 4; 
721   help_line[3]= 605; /* I suspect you have forgotten a `}', causing me */
722   help_line[2]= 606; /* to read past where you wanted me to stop. */
723   help_line[1]= 607; /* I'll try to recover; but if the error is serious, */
724   help_line[0]= 608; /* you'd better type `E' or `X' now and fix your file. */
725       } 
726       error (); 
727     } 
728     else {
729   
730       {
731   if(interaction == 3)
732   ; 
733   print_nl(262);  /* ! */
734   print(595);   /* Incomplete  */
735       } 
736       print_cmd_chr(105, cur_if); /* i */
737       print(596); /*; all text was ignored after line  */
738       print_int(skip_line); 
739       {
740   help_ptr = 3; 
741   help_line[2]= 597; /* A forbidden control sequence occurred in skipped text. */
742   help_line[1]= 598; /* This kind of error happens when you say `\if...' and forget */
743   help_line[0]= 599; /* the matching `\fi'. I've inserted a `\fi'; this might work. */
744       } 
745       if(cur_cs != 0)
746       cur_cs = 0; 
747       else help_line[2]= 600; /* The file ended while I was skipping conditional text. */
748 /*      cur_tok = (hash_size + 4613);  */
749 /*      cur_tok = (hash_size + 4095 + 518);  */
750       cur_tok = (hash_size + hash_extra + 4095 + 518); /* 96/Jan/10 */
751       ins_error (); 
752   }
753     deletions_allowed = true; 
754   }
755
756 /*****************************************************************************/
757 /* get_next() moved from here to end for pragma optimize reasons 96/Sep/12 */
758 void get_next(void);
759 /*****************************************************************************/
760 void firm_up_the_line (void) 
761
762   integer k; 
763   cur_input.limit_field = last; 
764   if(eqtb[(hash_size + 3191)].cint > 0)
765     if(interaction > 1) {
766     ; 
767       print_ln (); 
768       if(cur_input.start_field < cur_input.limit_field) {
769         register integer for_end; 
770         k = cur_input.start_field; 
771         for_end = cur_input.limit_field - 1; 
772         if(k <= for_end) do print(buffer[k]); 
773         while(k++ < for_end);
774       } 
775       first = cur_input.limit_field; 
776       {
777       ; 
778         print(615); /* => */
779         term_input(615, 0); 
780       } 
781       if(last > first){
782         {
783           register integer for_end; 
784           k = first; 
785           for_end = last - 1; 
786           if(k <= for_end) do 
787             buffer[k + cur_input.start_field - first]= buffer[k]; 
788           while(k++ < for_end);
789         } 
790         cur_input.limit_field = cur_input.start_field + last - first; 
791       } 
792     } 
793
794 void get_token (void) 
795
796   no_new_control_sequence = false; 
797   get_next (); 
798   no_new_control_sequence = true; 
799   if(cur_cs == 0)cur_tok =(cur_cmd * 256)+ cur_chr; 
800   else cur_tok = 4095 + cur_cs; 
801
802 void macro_call (void) 
803 {/* 10 22 30 31 40 */ 
804   halfword r; 
805   halfword p; 
806   halfword q; 
807   halfword s; 
808   halfword t; 
809   halfword u, v; 
810   halfword rbraceptr; 
811   small_number n; 
812   halfword unbalance; 
813   halfword m; 
814   halfword refcount; 
815   small_number savescannerstatus; 
816   halfword savewarningindex; 
817   ASCII_code matchchr; 
818
819   savescannerstatus = scanner_status;  
820   savewarningindex = warning_index; 
821   warning_index = cur_cs; 
822   refcount = cur_chr; 
823   r = mem[refcount].hh.v.RH; 
824   n = 0; 
825   if(eqtb[(hash_size + 3193)].cint > 0)
826   {
827     begin_diagnostic (); 
828     print_ln (); 
829     print_cs(warning_index); 
830     token_show(refcount); 
831     end_diagnostic(false); 
832   } 
833   if(mem[r].hh.v.LH != 3584)
834   {
835     scanner_status = 3; 
836     unbalance = 0; 
837     long_state = eqtb[cur_cs].hh.b0; 
838     if(long_state >= 113)
839     long_state = long_state - 2; 
840     do {
841   mem[mem_top - 3].hh.v.RH = 0; /* repeat link(temp_head):=null; */
842       if((mem[r].hh.v.LH > 3583)||(mem[r].hh.v.LH < 3328)) 
843       s = 0; /* s:=null l.7984 */
844       else {
845     
846   matchchr = mem[r].hh.v.LH - 3328; 
847   s = mem[r].hh.v.RH; 
848   r = s; 
849   p = mem_top - 3; 
850   m = 0; 
851       } 
852       lab22: get_token (); 
853       if(cur_tok == mem[r].hh.v.LH)
854       {
855   r = mem[r].hh.v.RH; 
856   if((mem[r].hh.v.LH >= 3328)&&(mem[r].hh.v.LH <= 3584 
857   ))
858   {
859     if(cur_tok < 512)
860     decr(align_state); 
861     goto lab40; 
862   } 
863   else goto lab22; 
864       } 
865       if(s != r)
866       if(s == 0)
867       {
868   {
869     if(interaction == 3)
870   ; 
871     print_nl(262);    /* !  */
872     print(647);   /* Use of  */
873   } 
874   sprint_cs(warning_index); 
875   print(648);     /*  doesn't match its definition */
876   {
877     help_ptr = 4; 
878     help_line[3]= 649; /* If you say, e.g., `\def\a1{...}', then you must always */
879     help_line[2]= 650; /* put `1' after `\a', since control sequence names are */
880     help_line[1]= 651; /* made up of letters only. The macro here has not been */
881     help_line[0]= 652; /* followed by the required stuff, so I'm ignoring it. */
882   } 
883   error (); 
884   goto lab10; 
885       } 
886       else {
887     
888   t = s; 
889   do {
890       { 
891       q = get_avail (); 
892       mem[p].hh.v.RH = q; 
893       mem[q].hh.v.LH = mem[t].hh.v.LH; 
894       p = q; 
895     } 
896     incr(m); 
897     u = mem[t].hh.v.RH; 
898     v = s; 
899     while(true){
900       if(u == r)
901       if(cur_tok != mem[v].hh.v.LH)
902       goto lab30; 
903       else {
904     
905         r = mem[v].hh.v.RH; 
906         goto lab22; 
907       } 
908       if(mem[u].hh.v.LH != mem[v].hh.v.LH)
909       goto lab30; 
910       u = mem[u].hh.v.RH; 
911       v = mem[v].hh.v.RH; 
912     } 
913     lab30: t = mem[t].hh.v.RH; 
914   } while(!(t == r)); 
915   r = s; 
916       } 
917       if(cur_tok == par_token)
918       if(long_state != 112)
919       {
920   if(long_state == 111)
921   {
922     runaway (); 
923     {
924       if(interaction == 3)
925    ; 
926       print_nl(262);  /* !  */
927       print(642);   /* Paragraph ended before  */
928     } 
929     sprint_cs(warning_index); 
930     print(643);   /* was complete */
931     {
932       help_ptr = 3; 
933       help_line[2]= 644; /* I suspect you've forgotten a `}', causing me to apply this */
934       help_line[1]= 645; /* control sequence to too much text. How can we recover? */
935       help_line[0]= 646; /* My plan is to forget the whole thing and hope for the best. */
936     } 
937     back_error (); 
938   } 
939   pstack[n]= mem[mem_top - 3].hh.v.RH; 
940   align_state = align_state - unbalance; 
941   {
942     register integer for_end; 
943     m = 0; 
944     for_end = n; 
945     if(m <= for_end) do 
946       flush_list(pstack[m]); 
947     while(m++ < for_end);
948   } 
949   goto lab10; 
950       } 
951       if(cur_tok < 768)
952       if(cur_tok < 512)
953       {
954   unbalance = 1; 
955   while(true){
956     {
957       {
958         q = avail; 
959         if(q == 0)
960         q = get_avail (); 
961         else {
962       
963     avail = mem[q].hh.v.RH; 
964     mem[q].hh.v.RH = 0; 
965   ;
966 #ifdef STAT
967     incr(dyn_used); 
968 #endif /* STAT */
969         } 
970       } 
971       mem[p].hh.v.RH = q; 
972       mem[q].hh.v.LH = cur_tok; 
973       p = q; 
974     } 
975     get_token (); 
976     if(cur_tok == par_token)
977     if(long_state != 112)
978     {
979       if(long_state == 111)
980       {
981         runaway (); 
982         {
983     if(interaction == 3)
984     ; 
985     print_nl(262);  /* !  */
986     print(642);   /* Paragraph ended before  */
987         } 
988         sprint_cs(warning_index); 
989         print(643); /*  was complete */
990         {
991     help_ptr = 3; 
992     help_line[2]= 644; /* I suspect you've forgotten a `}', causing me to apply this */
993     help_line[1]= 645; /* control sequence to too much text. How can we recover? */
994     help_line[0]= 646; /* My plan is to forget the whole thing and hope for the best. */
995         } 
996         back_error (); 
997       } 
998       pstack[n]= mem[mem_top - 3].hh.v.RH; 
999       align_state = align_state - unbalance; 
1000       {
1001       register integer for_end; 
1002       m = 0; 
1003       for_end = n; 
1004       if(m <= for_end) do 
1005         flush_list(pstack[m]); 
1006       while(m++ < for_end);
1007     } 
1008       goto lab10; 
1009     } 
1010     if(cur_tok < 768)
1011     if(cur_tok < 512)
1012     incr(unbalance); 
1013     else {
1014         
1015       decr(unbalance); 
1016       if(unbalance == 0)
1017       goto lab31; 
1018     } 
1019   } 
1020   lab31: rbraceptr = p; 
1021   {
1022     q = get_avail (); 
1023     mem[p].hh.v.RH = q; 
1024     mem[q].hh.v.LH = cur_tok; 
1025     p = q; 
1026   } 
1027       } 
1028       else {
1029     
1030   back_input (); 
1031   {
1032     if(interaction == 3)
1033   ; 
1034     print_nl(262);    /* !  */
1035     print(634);   /* Argument of  */
1036   } 
1037   sprint_cs(warning_index); 
1038   print(635);     /*  has an extra } */
1039   {
1040     help_ptr = 6; 
1041     help_line[5]= 636; /* I've run across a `}' that doesn't seem to match anything. */
1042     help_line[4]= 637; /* For example, `\def\a#1{...}' and `\a}' would produce */
1043     help_line[3]= 638; /* this error. If you simply proceed now, the `\par' that */
1044     help_line[2]= 639; /* I've just inserted will cause me to report a runaway */
1045     help_line[1]= 640; /* argument that might be the root of the problem. But if */
1046     help_line[0]= 641; /* your `}' was spurious, just type `2' and it will go away. */
1047   } 
1048   incr(align_state); 
1049   long_state = 111; 
1050   cur_tok = par_token; 
1051   ins_error (); 
1052       } 
1053       else {
1054     
1055   if(cur_tok == 2592)
1056   if(mem[r].hh.v.LH <= 3584)
1057   if(mem[r].hh.v.LH >= 3328)
1058   goto lab22; 
1059   {
1060     q = get_avail (); 
1061     mem[p].hh.v.RH = q;   /* p may be used without having ... */
1062     mem[q].hh.v.LH = cur_tok; 
1063     p = q; 
1064   } 
1065       } 
1066       incr(m);          /* m may be used without having been ... */
1067       if(mem[r].hh.v.LH > 3584)
1068       goto lab22; 
1069       if(mem[r].hh.v.LH < 3328)
1070       goto lab22; 
1071       lab40: if(s != 0)
1072       {
1073   if((m == 1)&&(mem[p].hh.v.LH < 768)&&(p != mem_top - 3 
1074   ))
1075   {
1076     mem[rbraceptr].hh.v.RH = 0; /* rbraceptr may be used without ... */
1077     {
1078       mem[p].hh.v.RH = avail; 
1079       avail = p; 
1080   ;
1081 #ifdef STAT
1082       decr(dyn_used); 
1083 #endif /* STAT */
1084     } 
1085     p = mem[mem_top - 3].hh.v.RH; 
1086     pstack[n]= mem[p].hh.v.RH; 
1087     {
1088       mem[p].hh.v.RH = avail; 
1089       avail = p; 
1090   ;
1091 #ifdef STAT
1092       decr(dyn_used); 
1093 #endif /* STAT */
1094     } 
1095   } 
1096   else pstack[n]= mem[mem_top - 3].hh.v.RH; 
1097   incr(n); 
1098   if(eqtb[(hash_size + 3193)].cint > 0)
1099   {
1100     begin_diagnostic (); 
1101     print_nl(matchchr); /* matchchar may be used without ... */
1102     print_int(n); 
1103     print(653); /* <- */
1104     show_token_list(pstack[n - 1], 0, 1000); 
1105     end_diagnostic(false); 
1106   } 
1107       } 
1108     } while(!(mem[r].hh.v.LH == 3584)); 
1109   } 
1110 /* while (state=token_list)and(loc=null) do end_token_list; l.7956 */
1111   while((cur_input.state_field == 0)&&(cur_input.loc_field == 0)) 
1112   end_token_list (); 
1113   begin_token_list(refcount, 5); 
1114   cur_input.name_field = warning_index; 
1115   cur_input.loc_field = mem[r].hh.v.RH; 
1116   if(n > 0)
1117   {
1118     if(param_ptr + n > max_param_stack)
1119     {
1120       max_param_stack = param_ptr + n; 
1121 #ifdef ALLOCATEPARAMSTACK
1122     if(max_param_stack > current_param_size)
1123       param_stack = realloc_param_stack (increment_param_size);
1124     if(max_param_stack > current_param_size){ /* check again after allocation */
1125       overflow(633, current_param_size);
1126       return;     // abort_flag set
1127     }
1128 #else
1129     if(max_param_stack > param_size){
1130       overflow(633, param_size); /* parameter stack - not dynamic */
1131       return;     // abort_flag set
1132     }
1133 #endif
1134     } 
1135     {
1136     register integer for_end; 
1137     m = 0; 
1138     for_end = n - 1; 
1139     if(m <= for_end) 
1140       do param_stack[param_ptr + m]= pstack[m]; 
1141     while(m++ < for_end);
1142   } 
1143     param_ptr = param_ptr + n; 
1144   } 
1145   lab10: scanner_status = savescannerstatus; 
1146   warning_index = savewarningindex; 
1147 }
1148 void insert_relax (void) 
1149 {
1150 /* begin cur_tok:=cs_token_flag+cur_cs; back_input; */
1151   cur_tok = 4095 + cur_cs; 
1152   back_input (); 
1153 /* cur_tok:=cs_token_flag+frozen_relax; back_input; token_type:=inserted; */
1154 /*  cur_tok = (hash_size + 4616);  */
1155 /*  cur_tok = (hash_size + 4095 + 521);  */
1156   cur_tok = (hash_size + hash_extra + 4095 + 521);  /* 96/Jan/10 */
1157   back_input (); 
1158   cur_input.index_field = 4; 
1159
1160 void expand (void) 
1161 {
1162   halfword t; 
1163   halfword p, q, r; 
1164   integer j; 
1165   integer cvbackup; 
1166   small_number cvlbackup, radixbackup, cobackup; 
1167   halfword backupbackup; 
1168   small_number savescannerstatus; 
1169
1170   cvbackup = cur_val; 
1171   cvlbackup = cur_val_level;  
1172   radixbackup = radix;  
1173   cobackup = cur_order;  
1174   backupbackup = mem[mem_top - 13].hh.v.RH; 
1175   if(cur_cmd < 111)
1176   {
1177     if(eqtb[(hash_size + 3199)].cint > 1)
1178     show_cur_cmd_chr (); 
1179     switch(cur_cmd)
1180     {case 110 : 
1181       {
1182 /* begin if cur_mark[cur_chr]<>null then l.7881 */
1183   if(cur_mark[cur_chr]!= 0)
1184   begin_token_list(cur_mark[cur_chr], 14); 
1185       } 
1186       break; 
1187     case 102 : 
1188       {
1189   get_token (); 
1190   t = cur_tok; 
1191   get_token (); 
1192   if(cur_cmd > 100){
1193     expand ();
1194   }
1195   else back_input (); 
1196   cur_tok = t; 
1197   back_input (); 
1198       } 
1199       break; 
1200     case 103 : 
1201       {
1202   savescannerstatus = scanner_status;  
1203   scanner_status = 0; 
1204   get_token (); 
1205   scanner_status = savescannerstatus; 
1206   t = cur_tok; 
1207   back_input (); 
1208   if(t >= 4095)   /* if t>=cs_token_flag then */
1209   {
1210 /*   begin p:=get_avail; info(p):=cs_token_flag+frozen_dont_expand; */
1211     p = get_avail (); 
1212 /*    mem[p].hh.v.LH = (hash_size + 4618);  */
1213 /*    mem[p].hh.v.LH = (hash_size + 4095 + 523); */
1214     mem[p].hh.v.LH = (hash_size + hash_extra + 4095 + 523); /*96/Jan/10*/
1215     mem[p].hh.v.RH = cur_input.loc_field; 
1216     cur_input.start_field = p; 
1217     cur_input.loc_field = p; 
1218   } 
1219       } 
1220       break; 
1221     case 107 : 
1222       {
1223   r = get_avail (); 
1224   p = r; 
1225   do {
1226       get_x_token (); 
1227     if(cur_cs == 0){
1228       q = get_avail (); 
1229       mem[p].hh.v.RH = q; 
1230       mem[q].hh.v.LH = cur_tok; 
1231       p = q; 
1232     } 
1233   } while(!(cur_cs != 0)); 
1234   if(cur_cmd != 67)
1235   {
1236     {
1237       if(interaction == 3)
1238    ; 
1239       print_nl(262);  /* !  */
1240       print(622);   /* Missing  */
1241     } 
1242     print_esc(502); /* endcsname */
1243     print(623);   /*  inserted */
1244     {
1245       help_ptr = 2; 
1246       help_line[1]= 624; /* The control sequence marked <to be read again> should */
1247       help_line[0]= 625; /* not appear between \csname and \endcsname. */
1248     } 
1249     back_error (); 
1250   } 
1251   j = first; 
1252   p = mem[r].hh.v.RH; 
1253   while(p != 0){  /* while p<>null do l.7742 */
1254       
1255     if(j >= max_buf_stack)
1256     {
1257       max_buf_stack = j + 1; 
1258 #ifdef ALLOCATEBUFFER
1259     if(max_buf_stack == current_buf_size)
1260       buffer = realloc_buffer (increment_buf_size);
1261     if(max_buf_stack == current_buf_size){  /* check again after allocation */
1262       overflow(256, current_buf_size);
1263       return;     // abort_flag set
1264     }
1265 #else
1266     if(max_buf_stack == buf_size){
1267       overflow(256, buf_size); /* buffer size - not dynamic */
1268       return;     // abort_flag set
1269     }
1270 #endif
1271     } 
1272     buffer[j]= mem[p].hh.v.LH % 256; 
1273 /*    buffer[j]= mem[p].hh.v.LH & 255; */ /* last 8 bits */
1274     incr(j); 
1275     p = mem[p].hh.v.RH; 
1276   } 
1277   if(j > first + 1)
1278   {
1279     no_new_control_sequence = false; 
1280     cur_cs = id_lookup(first, j - first); 
1281     no_new_control_sequence = true; 
1282   } 
1283   else if(j == first)
1284   cur_cs = 513; 
1285 /* else cur_cs:=single_base+buffer[first] {the list has length one} */
1286   else cur_cs = 257 + buffer[first]; 
1287   flush_list(r); 
1288   if(eqtb[cur_cs].hh.b0 == 101)
1289   {
1290     eq_define(cur_cs, 0, 256); 
1291   } 
1292   cur_tok = cur_cs + 4095; 
1293   back_input (); 
1294       } 
1295       break; 
1296     case 108 : 
1297       conv_toks (); 
1298       break; 
1299     case 109 : 
1300       ins_the_toks (); 
1301       break; 
1302     case 105 : 
1303       conditional (); 
1304       break; 
1305     case 106 : 
1306       if(cur_chr > if_limit)
1307       if(if_limit == 1)
1308       insert_relax (); 
1309       else {
1310     
1311   {
1312     if(interaction == 3)
1313   ; 
1314     print_nl(262);    /* !  */
1315     print(773);   /* Extra  */
1316   } 
1317   print_cmd_chr(106, cur_chr);  /* j */
1318   {
1319     help_ptr = 1; 
1320     help_line[0]= 774; /* I'm ignoring this; it doesn't match any \if. */
1321   } 
1322   error (); 
1323       } 
1324       else {
1325     
1326   while(cur_chr != 2)pass_text (); 
1327   {
1328     p = cond_ptr; 
1329     if_line = mem[p + 1].cint; 
1330     cur_if = mem[p].hh.b1; 
1331     if_limit = mem[p].hh.b0; 
1332     cond_ptr = mem[p].hh.v.RH; 
1333     free_node(p, 2); 
1334   } 
1335       } 
1336       break; 
1337     case 104 : 
1338       if(cur_chr > 0)force_eof = true; 
1339       else if(name_in_progress)insert_relax (); 
1340       else start_input (); 
1341       break; 
1342       default: 
1343       {
1344   {
1345     if(interaction == 3)
1346   ; 
1347     print_nl(262);    /* !  */
1348     print(616);   /* Undefined control sequence */
1349   } 
1350   {
1351     help_ptr = 5; 
1352     help_line[4]= 617; /* The control sequence at the end of the top line */
1353     help_line[3]= 618; /* of your error message was never \def'ed. If you have */
1354     help_line[2]= 619; /* misspelled it (e.g., `\hobx'), type `I' and the correct */
1355     help_line[1]= 620; /* spelling (e.g., `I\hbox'). Otherwise just continue, */
1356     help_line[0]= 621; /* and I'll forget about whatever was undefined. */
1357   } 
1358   error (); 
1359       } 
1360       break; 
1361     } 
1362   } 
1363   else if(cur_cmd < 115){
1364     macro_call ();
1365   }
1366   else {
1367       
1368 /*    cur_tok = (hash_size + 4615);  */
1369 /*    cur_tok = (hash_size + 4095 + 520);  */
1370     cur_tok = (hash_size + hash_extra + 4095 + 520); /* 96/Jan/10 */
1371     back_input (); 
1372   } 
1373   cur_val = cvbackup; 
1374   cur_val_level = cvlbackup; 
1375   radix = radixbackup; 
1376   cur_order = cobackup; 
1377   mem[mem_top - 13].hh.v.RH = backupbackup; 
1378
1379 void get_x_token (void) 
1380 {/* 20 30 */ 
1381
1382 lab20:
1383   get_next (); 
1384   if(cur_cmd <= 100) goto lab30; 
1385   if(cur_cmd >= 111)
1386     if(cur_cmd < 115){
1387       macro_call ();
1388     }
1389     else {
1390 /*      cur_cs = (hash_size + 520);  */
1391       cur_cs = (hash_size + hash_extra + 520);  /* 96/Jan/10 */
1392       cur_cmd = 9; 
1393       goto lab30; 
1394     } 
1395   else {
1396     expand ();
1397   }
1398   goto lab20; 
1399 lab30: if(cur_cs == 0)
1400        cur_tok =(cur_cmd * 256)+ cur_chr; 
1401      else cur_tok = 4095 + cur_cs; 
1402
1403 void x_token (void) 
1404 {
1405   while(cur_cmd > 100){
1406     expand (); 
1407     get_next (); 
1408   } 
1409   if(cur_cs == 0)
1410   cur_tok =(cur_cmd * 256)+ cur_chr; 
1411   else cur_tok = 4095 + cur_cs; 
1412
1413 void scan_left_brace (void) 
1414
1415   do {
1416       get_x_token (); 
1417   } while(!((cur_cmd != 10)&&(cur_cmd != 0))); 
1418   if(cur_cmd != 1)
1419   {
1420     {
1421       if(interaction == 3)
1422    ; 
1423       print_nl(262);    /* !  */
1424       print(654);   /* Missing { inserted */
1425     } 
1426     {
1427       help_ptr = 4; 
1428       help_line[3]= 655; /* A left brace was mandatory here, so I've put one in. */
1429       help_line[2]= 656; /* You might want to delete and/or insert some corrections */
1430       help_line[1]= 657; /* so that I will find a matching right brace soon. */
1431       help_line[0]= 658; /* (If you're confused by all this, try typing `I}' now.) */
1432     } 
1433     back_error (); 
1434     cur_tok = 379; 
1435     cur_cmd = 1; 
1436     cur_chr = 123; 
1437     incr(align_state); 
1438   } 
1439
1440 void scan_optional_equals (void) 
1441 {
1442   do {
1443       get_x_token (); 
1444   } while(!(cur_cmd != 10)); 
1445   if(cur_tok != 3133)back_input (); 
1446
1447 bool scan_keyword_(str_number s)
1448 {/* 10 */ register bool Result; 
1449   halfword p; 
1450   halfword q; 
1451   pool_pointer k; 
1452   p = mem_top - 13; 
1453   mem[p].hh.v.RH = 0; 
1454   k = str_start[s]; 
1455   while(k < str_start[s + 1]){
1456     get_x_token (); 
1457     if((cur_cs == 0)&&((cur_chr == str_pool[k])||(cur_chr == 
1458     str_pool[k]- 32))) {
1459       {
1460   q = get_avail (); 
1461   mem[p].hh.v.RH = q; 
1462   mem[q].hh.v.LH = cur_tok; 
1463   p = q; 
1464       } 
1465       incr(k); 
1466     } 
1467     else if((cur_cmd != 10)||(p != mem_top - 13)) 
1468     {
1469       back_input (); 
1470       if(p != mem_top - 13)
1471       begin_token_list(mem[mem_top - 13].hh.v.RH, 3); 
1472       Result = false; 
1473       return(Result); 
1474     } 
1475   } 
1476   flush_list(mem[mem_top - 13].hh.v.RH); 
1477   Result = true; 
1478   return Result; 
1479
1480 void mu_error (void) 
1481
1482   {
1483     if(interaction == 3)
1484  ; 
1485     print_nl(262);  /* !  */
1486     print(659);   /* Incompatible glue units */
1487   } 
1488   {
1489     help_ptr = 1; 
1490     help_line[0]= 660; /* I'm going to assume that 1mu=1pt when they're mixed. */
1491   } 
1492   error (); 
1493
1494 void scan_eight_bit_int (void) 
1495
1496     scan_int (); 
1497   if((cur_val < 0)||(cur_val > 255)) 
1498   {
1499     {
1500       if(interaction == 3)
1501    ; 
1502       print_nl(262);    /* !  */
1503       print(684);   /* Bad register code */
1504     } 
1505     {
1506       help_ptr = 2; 
1507       help_line[1]= 685; /* A register number must be between 0 and 255. */
1508       help_line[0]= 686; /* I changed this one to zero. */
1509     } 
1510     int_error(cur_val); 
1511     cur_val = 0; 
1512   } 
1513
1514 void scan_char_num (void) 
1515 {
1516     scan_int (); 
1517   if((cur_val < 0)||(cur_val > 255)) 
1518   {
1519     {
1520       if(interaction == 3)
1521    ; 
1522       print_nl(262);    /* !  */
1523       print(687);   /* Bad character code */
1524     } 
1525     {
1526       help_ptr = 2; 
1527       help_line[1]= 688; /* A character number must be between 0 and 255. */
1528       help_line[0]= 686; /* I changed this one to zero. */
1529     } 
1530     int_error(cur_val); 
1531     cur_val = 0; 
1532   } 
1533
1534 void scan_four_bit_int (void) 
1535 {
1536     scan_int (); 
1537   if((cur_val < 0)||(cur_val > 15)) 
1538   {
1539     {
1540       if(interaction == 3)
1541    ; 
1542       print_nl(262);    /* !  */
1543       print(689);   /* Bad number */
1544     } 
1545     {
1546       help_ptr = 2; 
1547       help_line[1]= 690; /* Since I expected to read a number between 0 and 15, */
1548       help_line[0]= 686; /* I changed this one to zero. */
1549     } 
1550     int_error(cur_val); 
1551     cur_val = 0; 
1552   } 
1553
1554 void scan_fifteen_bit_int (void) 
1555
1556     scan_int (); 
1557   if((cur_val < 0)||(cur_val > 32767)) 
1558   {
1559     {
1560       if(interaction == 3)
1561    ; 
1562       print_nl(262);    /* !  */
1563       print(691);   /* Bad mathchar */
1564     } 
1565     {
1566       help_ptr = 2; 
1567       help_line[1]= 692; /* A mathchar number must be between 0 and 32767. */
1568       help_line[0]= 686; /* I changed this one to zero. */
1569     } 
1570     int_error(cur_val); 
1571     cur_val = 0; 
1572   } 
1573
1574 void scan_twenty_seven_bit_int (void) 
1575
1576     scan_int (); 
1577   if((cur_val < 0)||(cur_val > 134217727L)) /* 2^27 - 1 */
1578   {
1579     {
1580       if(interaction == 3)
1581    ; 
1582       print_nl(262);    /* !  */
1583       print(693);   /* Bad delimiter code */
1584     } 
1585     {
1586       help_ptr = 2; 
1587       help_line[1]= 694; /* A numeric delimiter code must be between 0 and 2^{27}-1. */
1588       help_line[0]= 686; /* I changed this one to zero. */
1589     } 
1590     int_error(cur_val); 
1591     cur_val = 0; 
1592   } 
1593
1594 void scan_font_ident (void) 
1595 {
1596   internal_font_number f; 
1597   halfword m; 
1598   do {
1599       get_x_token (); 
1600   } while(!(cur_cmd != 10)); 
1601   if(cur_cmd == 88)
1602   f = eqtb[(hash_size + 1834)].hh.v.RH; 
1603   else if(cur_cmd == 87)
1604   f = cur_chr; 
1605   else if(cur_cmd == 86)
1606   {
1607     m = cur_chr; 
1608     scan_four_bit_int (); 
1609     f = eqtb[m + cur_val].hh.v.RH; 
1610   } 
1611   else {
1612       
1613     {
1614       if(interaction == 3)
1615    ; 
1616       print_nl(262);    /* !  */
1617       print(811);   /* Missing font identifier */
1618     } 
1619     {
1620       help_ptr = 2; 
1621       help_line[1]= 812; /* I was looking for a control sequence whose */
1622       help_line[0]= 813; /* current meaning has been defined by \font. */
1623     } 
1624     back_error (); 
1625     f = 0; 
1626   }
1627   cur_val = f; 
1628
1629 void find_font_dimen_(bool writing)
1630
1631   internal_font_number f; 
1632   integer n; 
1633   scan_int (); 
1634   n = cur_val; 
1635   scan_font_ident (); 
1636   f = cur_val; 
1637 /*  if(n <= 0)*/            /* change 98/Oct/5 */
1638   if(n < 0 || (n == 0 && font_dimen_zero == 0))
1639     cur_val = fmem_ptr; 
1640   else {
1641 /* else  begin if writing and(n<=space_shrink_code)and@|
1642     (n>=space_code)and(font_glue[f]<>null) then
1643     begin delete_glue_ref(font_glue[f]); l.11225 */
1644     if(writing &&(n <= 4)&&(n >= 2)&&(font_glue[f]!= 0)) 
1645     {
1646     delete_glue_ref(font_glue[f]); 
1647     font_glue[f]= 0;  /* font_glue[f]:=null */
1648     } 
1649     if(n > font_params[f])
1650     if(f < font_ptr)
1651       cur_val = fmem_ptr; 
1652     else {
1653       do {
1654 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1655  #ifdef ALLOCATEFONT
1656         if(fmem_ptr == current_font_mem_size) { /* 93/Nov/28 ??? */
1657           font_info = realloc_font_info(increment_font_mem_size);
1658         }
1659         if(fmem_ptr == current_font_mem_size){    /* 94/Jan/24 */
1660           overflow(818, current_font_mem_size); /* font memory */
1661           return;     // abort_flag set
1662         }
1663 #else
1664 /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
1665         if(fmem_ptr == font_mem_size){
1666           overflow(818, font_mem_size); /* font memory */
1667           return;     // abort_flag set
1668         }
1669 #endif
1670         font_info[fmem_ptr].cint = 0; 
1671         incr(fmem_ptr); 
1672         incr(font_params[f]); 
1673       } while(!(n == font_params[f])); 
1674       cur_val = fmem_ptr - 1; 
1675     } 
1676 /*  else cur_val = n + param_base[f];   */      /* 98/Oct/5 */
1677   else if (n > 0) cur_val = n + param_base[f];    /* 98/Oct/5 */
1678   else cur_val = &font_check[f] - &font_info[0]; /* 98/Oct/5 */
1679 /*  checksum =  (((font_check[f].b0) << 8 | font_check[f].b1) << 8 |
1680         font_check[f].b2) << 8 | font_check[f].b3; */
1681   } 
1682 /* compiler error: '-' : incompatible types - from 'union fmemoryword *' to 'struct fourunsignedchars *' */
1683   if(cur_val == fmem_ptr){
1684     {
1685       if(interaction == 3)
1686    ; 
1687       print_nl(262);    /* !  */
1688       print(796);   /* Font  */
1689     } 
1690 /*    print_esc(hash[(hash_size + 524) + f].v.RH); */
1691     print_esc(hash[(hash_size + hash_extra + 524) + f].v.RH); /*96/Jan/10*/
1692     print(814); /* has  only  */
1693     print_int(font_params[f]); 
1694     print(815); /*  fontdimen parameters */
1695     {
1696       help_ptr = 2; 
1697       help_line[1]= 816; /* To increase the number of font parameters, you must */
1698       help_line[0]= 817; /* use \fontdimen immediately after the \font is loaded. */
1699     } 
1700     error (); 
1701   }
1702
1703
1704 /* NOTE: the above use of /fontdimen0 to access the checksum is a kludge */
1705 /* In future would be better to do this by allocating one more slot for */
1706 /* for parameters when a font is read rather than carry checksum separately */
1707 /* The above gets the value byte order reversed ... 98/Oct/5 */
1708
1709 void scan_something_internal_(small_number level, bool negative)
1710
1711   halfword m; 
1712   integer p; 
1713   m = cur_chr; 
1714   switch(cur_cmd)
1715   {case 85 : 
1716     {
1717       scan_char_num (); 
1718       if(m == (hash_size + 2907))
1719       {
1720   cur_val = eqtb[(hash_size + 2907) + cur_val].hh.v.RH; 
1721   cur_val_level = 0; 
1722       } 
1723       else if(m < (hash_size + 2907))
1724       {
1725   cur_val = eqtb[m + cur_val].hh.v.RH; 
1726   cur_val_level = 0; 
1727       } 
1728       else {
1729     
1730   cur_val = eqtb[m + cur_val].cint; 
1731   cur_val_level = 0; 
1732       } 
1733     } 
1734     break; 
1735   case 71 : 
1736   case 72 : 
1737   case 86 : 
1738   case 87 : 
1739   case 88 : 
1740     if(level != 5)
1741     {
1742       {
1743   if(interaction == 3)
1744   ; 
1745   print_nl(262);  /* !  */
1746   print(661);   /* Missing number, treated as zero */
1747       } 
1748       {
1749   help_ptr = 3; 
1750   help_line[2]= 662; /* A number should have been here; I inserted `0'. */
1751   help_line[1]= 663; /* (If you can't figure out why I needed to see a number, */
1752   help_line[0]= 664; /* look up `weird error' in the index to The TeXbook.) */
1753       } 
1754       back_error (); 
1755       {
1756       cur_val = 0; 
1757       cur_val_level = 1; 
1758       } 
1759     } 
1760     else if(cur_cmd <= 72)
1761     {
1762       if(cur_cmd < 72)
1763       {
1764   scan_eight_bit_int (); 
1765   m = (hash_size + 1322) + cur_val; 
1766       } 
1767       {
1768   cur_val = eqtb[m].hh.v.RH; 
1769   cur_val_level = 5; 
1770       } 
1771     } 
1772     else {
1773   
1774       back_input (); 
1775       scan_font_ident (); 
1776       {
1777 /*  cur_val = (hash_size + 524) + cur_val;  */
1778   cur_val = (hash_size + hash_extra + 524) + cur_val; /* 96/Jan/10 */
1779   cur_val_level = 4; 
1780       } 
1781     } 
1782     break; 
1783   case 73 : 
1784     {
1785       cur_val = eqtb[m].cint; 
1786       cur_val_level = 0; 
1787     } 
1788     break; 
1789   case 74 : 
1790     {
1791       cur_val = eqtb[m].cint; 
1792       cur_val_level = 1; 
1793     } 
1794     break; 
1795   case 75 : 
1796     {
1797       cur_val = eqtb[m].hh.v.RH; 
1798       cur_val_level = 2; 
1799     } 
1800     break; 
1801   case 76 : 
1802     {
1803       cur_val = eqtb[m].hh.v.RH; 
1804       cur_val_level = 3; 
1805     } 
1806     break; 
1807   case 79 : 
1808     if(abs(mode)!= m)
1809     {
1810       {
1811   if(interaction == 3)
1812   ; 
1813   print_nl(262);  /* !  */
1814   print(677);   /* Improper  */
1815       } 
1816       print_cmd_chr(79, m); /* O */
1817       {
1818   help_ptr = 4; 
1819   help_line[3]= 678; /* You can refer to \spacefactor only in horizontal mode; */
1820   help_line[2]= 679; /* you can refer to \prevdepth only in vertical mode; and */
1821   help_line[1]= 680; /* neither of these is meaningful inside \write. So */
1822   help_line[0]= 681; /* I'm forgetting what you said and using zero instead. */
1823       } 
1824       error (); 
1825       if(level != 5) {
1826       cur_val = 0; 
1827       cur_val_level = 1; 
1828       } 
1829       else {
1830     
1831   cur_val = 0; 
1832   cur_val_level = 0; 
1833       } 
1834     } 
1835     else if(m == 1)
1836     {
1837       cur_val = cur_list.aux_field.cint; 
1838       cur_val_level = 1; 
1839     } 
1840     else {
1841   
1842       cur_val = space_factor; 
1843       cur_val_level = 0; 
1844     } 
1845     break; 
1846   case 80 : 
1847     if(mode == 0)
1848     {
1849       cur_val = 0; 
1850       cur_val_level = 0; 
1851     } 
1852     else {
1853   
1854       nest[nest_ptr]= cur_list; 
1855       p = nest_ptr; 
1856       while(abs(nest[p].mode_field)!= 1)decr(p); 
1857       {
1858   cur_val = nest[p].pg_field; 
1859   cur_val_level = 0; 
1860       } 
1861     } 
1862     break; 
1863   case 82 : 
1864     {
1865       if(m == 0)
1866       cur_val = dead_cycles; 
1867       else cur_val = insert_penalties; 
1868       cur_val_level = 0; 
1869     } 
1870     break; 
1871   case 81 : 
1872     {
1873       if((page_contents == 0)&&(! output_active)) 
1874       if(m == 0)
1875       cur_val = 1073741823L;  /* 2^30 - 1 */
1876       else cur_val = 0; 
1877       else cur_val = page_so_far[m]; 
1878       cur_val_level = 1; 
1879     } 
1880     break; 
1881   case 84 : 
1882     {
1883       if(eqtb[(hash_size + 1312)].hh.v.RH == 0)
1884       cur_val = 0; 
1885       else cur_val = mem[eqtb[(hash_size + 1312)].hh.v.RH].hh.v.LH; 
1886       cur_val_level = 0; 
1887     } 
1888     break; 
1889   case 83 : 
1890     {
1891       scan_eight_bit_int (); 
1892       if(eqtb[(hash_size + 1578) + cur_val].hh.v.RH == 0)
1893       cur_val = 0; 
1894       else cur_val = mem[eqtb[(hash_size + 1578) + cur_val].hh.v.RH + m].cint; 
1895       cur_val_level = 1; 
1896     } 
1897     break; 
1898   case 68 : 
1899   case 69 : 
1900     {
1901       cur_val = cur_chr; 
1902       cur_val_level = 0; 
1903     } 
1904     break; 
1905   case 77 : 
1906     {
1907       find_font_dimen(false); 
1908       font_info[fmem_ptr].cint = 0; 
1909       {
1910   cur_val = font_info[cur_val].cint; 
1911   cur_val_level = 1; 
1912       } 
1913     } 
1914     break; 
1915   case 78 : 
1916     {
1917       scan_font_ident (); 
1918       if(m == 0){
1919   cur_val = hyphen_char[cur_val]; 
1920   cur_val_level = 0; 
1921       } 
1922       else {
1923     
1924   cur_val = skew_char[cur_val]; 
1925   cur_val_level = 0; 
1926       } 
1927     } 
1928     break; 
1929   case 89 : 
1930     {
1931       scan_eight_bit_int (); 
1932       switch(m)
1933       {case 0 : 
1934   cur_val = eqtb[(hash_size + 3218) + cur_val].cint; 
1935   break; 
1936       case 1 : 
1937   cur_val = eqtb[(hash_size + 3751) + cur_val].cint; 
1938   break; 
1939       case 2 : 
1940   cur_val = eqtb[(hash_size + 800) + cur_val].hh.v.RH; 
1941   break; 
1942       case 3 : 
1943   cur_val = eqtb[(hash_size + 1056) + cur_val].hh.v.RH; 
1944   break; 
1945       } 
1946       cur_val_level = m; 
1947     } 
1948     break; 
1949   case 70 : 
1950     if(cur_chr > 2)
1951     {
1952       if(cur_chr == 3)
1953       cur_val = line; 
1954       else cur_val = last_badness; 
1955       cur_val_level = 0; 
1956     } 
1957     else {
1958   
1959       if(cur_chr == 2)
1960       cur_val = 0; 
1961       else cur_val = 0; 
1962       cur_val_level = cur_chr; 
1963       if(!(tail >= hi_mem_min)&&(mode != 0)
1964     )
1965       switch(cur_chr)
1966       {case 0 : 
1967   if(mem[tail].hh.b0 == 12)
1968   cur_val = mem[tail + 1].cint; 
1969   break; 
1970       case 1 : 
1971   if(mem[tail].hh.b0 == 11)
1972   cur_val = mem[tail + 1].cint; 
1973   break; 
1974       case 2 : 
1975   if(mem[tail].hh.b0 == 10)
1976   {
1977     cur_val = mem[tail + 1].hh.v.LH; 
1978     if(mem[tail].hh.b1 == 99)
1979     cur_val_level = 3; 
1980   } 
1981   break; 
1982       } 
1983       else if((mode == 1)&&(tail == cur_list 
1984      .head_field)) 
1985       switch(cur_chr)
1986       {case 0 : 
1987   cur_val = last_penalty; 
1988   break; 
1989       case 1 : 
1990   cur_val = last_kern; 
1991   break; 
1992       case 2 : 
1993 /*  if(last_glue != 262143L) */ /* NO! */
1994   if(last_glue != empty_flag)
1995   cur_val = last_glue; 
1996   break; 
1997       } 
1998     } 
1999     break; 
2000     default: 
2001     {
2002       {
2003   if(interaction == 3)
2004   ; 
2005   print_nl(262);  /* !  */
2006   print(682);   /* You can't use ` */
2007       } 
2008       print_cmd_chr(cur_cmd, cur_chr); 
2009       print(683); /* ' after  */
2010       print_esc(534); /* the */
2011       {
2012   help_ptr = 1; 
2013   help_line[0]= 681; /* I'm forgetting what you said and using zero instead. */
2014       } 
2015       error (); 
2016       if(level != 5){
2017       cur_val = 0; 
2018       cur_val_level = 1; 
2019       } 
2020       else {
2021       cur_val = 0; 
2022       cur_val_level = 0; 
2023       } 
2024     } 
2025     break; 
2026   } 
2027   while(cur_val_level > level){
2028       
2029     if(cur_val_level == 2)
2030     cur_val = mem[cur_val + 1].cint; 
2031     else if(cur_val_level == 3){
2032     mu_error (); 
2033   }
2034     decr(cur_val_level); 
2035   } 
2036   if(negative)
2037   if(cur_val_level >= 2)
2038   {
2039     cur_val = new_spec(cur_val); 
2040     {
2041       mem[cur_val + 1].cint = - (integer) mem[cur_val + 1].cint; 
2042       mem[cur_val + 2].cint = - (integer) mem[cur_val + 2].cint; 
2043       mem[cur_val + 3].cint = - (integer) mem[cur_val + 3].cint; 
2044     } 
2045   } 
2046   else cur_val = - (integer) cur_val; 
2047   else if((cur_val_level >= 2)&&(cur_val_level <= 3)) 
2048   incr(mem[cur_val].hh.v.RH); 
2049
2050
2051 /*****************************************************************************/
2052
2053 /* Moved here to avoid question about pragma optimize 96/Sep/12 */
2054
2055 /* #pragma optimize ("a", off) */
2056
2057 void get_next (void) 
2058 {/* 20 25 21 26 40 10 */ 
2059   integer k; 
2060   halfword t; 
2061 /*  char cat; */    /* make this an int ? */
2062   int cat;      /* make this an int ? 95/Jan/7 */
2063   ASCII_code c, cc; 
2064   char d; 
2065
2066 lab20:
2067   cur_cs = 0; 
2068   if(cur_input.state_field != 0) {
2069     lab25: if(cur_input.loc_field <= cur_input.limit_field) {
2070       cur_chr = buffer[cur_input.loc_field]; 
2071       incr(cur_input.loc_field); 
2072       lab21: cur_cmd = eqtb[(hash_size + 1883) + cur_chr].hh.v.RH; 
2073       switch(cur_input.state_field + cur_cmd)
2074       {case 10 : 
2075       case 26 : 
2076       case 42 : 
2077       case 27 : 
2078       case 43 : 
2079   goto lab25; 
2080   break; 
2081       case 1 : 
2082       case 17 : 
2083       case 33 : 
2084   {
2085     if(cur_input.loc_field > cur_input.limit_field)
2086     cur_cs = 513; 
2087     else {
2088         
2089       lab26: k = cur_input.loc_field; 
2090       cur_chr = buffer[k]; 
2091       cat = eqtb[(hash_size + 1883) + cur_chr].hh.v.RH; 
2092       incr(k); 
2093       if(cat == 11)
2094       cur_input.state_field = 17; 
2095       else if(cat == 10)
2096       cur_input.state_field = 17; 
2097       else cur_input.state_field = 1; 
2098       if((cat == 11)&&(k <= cur_input.limit_field)) 
2099       {
2100         do {
2101       cur_chr = buffer[k]; 
2102     cat = eqtb[(hash_size + 1883) + cur_chr].hh.v.RH; 
2103     incr(k); 
2104         } while(!((cat != 11)||(k > cur_input.limit_field)))
2105      ; 
2106         {
2107     if(buffer[k]== cur_chr)
2108     if(cat == 7)
2109     if(k < cur_input.limit_field)
2110     {
2111       c = buffer[k + 1]; 
2112       if(c < 128)
2113       {
2114         d = 2; 
2115         if((((c >= 48)&&(c <= 57)) ||((c >= 97)&& 
2116        (c <= 102)))) 
2117         if(k + 2 <= cur_input.limit_field)
2118         {
2119           cc = buffer[k + 2]; 
2120           if((((cc >= 48)&&(cc <= 57)) ||((cc >= 97 
2121         )&&(cc <= 102)))) 
2122           incr(d); 
2123         } 
2124         if(d > 2)
2125         {
2126           if(c <= 57)
2127           cur_chr = c - 48; 
2128           else cur_chr = c - 87; 
2129           if(cc <= 57)
2130           cur_chr = 16 * cur_chr + cc - 48; 
2131           else cur_chr = 16 * cur_chr + cc - 87; 
2132           buffer[k - 1]= cur_chr; 
2133         } 
2134         else if(c < 64)
2135         buffer[k - 1]= c + 64; 
2136         else buffer[k - 1]= c - 64; 
2137         cur_input.limit_field = cur_input.limit_field - d; 
2138         first = first - d; 
2139         while(k <= cur_input.limit_field){
2140       
2141           buffer[k]= buffer[k + d]; 
2142           incr(k); 
2143         } 
2144         goto lab26; 
2145       } 
2146     } 
2147         } 
2148         if(cat != 11)
2149         decr(k); 
2150         if(k > cur_input.loc_field + 1)
2151         {
2152     cur_cs = id_lookup(cur_input.loc_field, k - cur_input.loc_field 
2153     ); 
2154     cur_input.loc_field = k; 
2155     goto lab40; 
2156         } 
2157       } 
2158       else {
2159     
2160         if(buffer[k]== cur_chr)
2161         if(cat == 7)
2162         if(k < cur_input.limit_field)
2163         {
2164     c = buffer[k + 1]; 
2165     if(c < 128)             /* ? */
2166     {
2167       d = 2; 
2168       if((((c >= 48)&&(c <= 57)) ||((c >= 97)&&(
2169       c <= 102)))) 
2170       if(k + 2 <= cur_input.limit_field)
2171       {
2172         cc = buffer[k + 2]; 
2173         if((((cc >= 48)&&(cc <= 57)) ||((cc >= 97)
2174         &&(cc <= 102)))) 
2175         incr(d); 
2176       } 
2177       if(d > 2)
2178       {
2179         if(c <= 57)
2180         cur_chr = c - 48; 
2181         else cur_chr = c - 87; 
2182         if(cc <= 57)          /* cc may be used without ... */
2183         cur_chr = 16 * cur_chr + cc - 48; 
2184         else cur_chr = 16 * cur_chr + cc - 87; 
2185         buffer[k - 1]= cur_chr; 
2186       } 
2187       else if(c < 64)
2188         buffer[k - 1]= c + 64; 
2189       else buffer[k - 1]= c - 64; 
2190       cur_input.limit_field = cur_input.limit_field - d; 
2191       first = first - d; 
2192       while(k <= cur_input.limit_field){
2193         buffer[k]= buffer[k + d]; 
2194         incr(k); 
2195       } 
2196       goto lab26; 
2197     } 
2198         } 
2199       } 
2200 /*   cur_cs:=single_base+buffer[loc]; incr(loc); */
2201       cur_cs = 257 + buffer[cur_input.loc_field]; 
2202       incr(cur_input.loc_field); 
2203     } 
2204     lab40: cur_cmd = eqtb[cur_cs].hh.b0; 
2205     cur_chr = eqtb[cur_cs].hh.v.RH; 
2206     if(cur_cmd >= 113){
2207       check_outer_validity ();
2208     }
2209   } 
2210   break; 
2211       case 14 : 
2212       case 30 : 
2213       case 46 : 
2214   {
2215     cur_cs = cur_chr + 1; 
2216     cur_cmd = eqtb[cur_cs].hh.b0; 
2217     cur_chr = eqtb[cur_cs].hh.v.RH; 
2218     cur_input.state_field = 1; 
2219     if(cur_cmd >= 113){
2220       check_outer_validity ();
2221     }
2222   } 
2223   break; 
2224       case 8 : 
2225       case 24 : 
2226       case 40 : 
2227   {
2228     if(cur_chr == buffer[cur_input.loc_field])
2229     if(cur_input.loc_field < cur_input.limit_field)
2230     {
2231       c = buffer[cur_input.loc_field + 1]; 
2232       if(c < 128)
2233       {
2234         cur_input.loc_field = cur_input.loc_field + 2; 
2235         if((((c >= 48)&&(c <= 57)) ||((c >= 97)&&(c <= 
2236         102)))) 
2237         if(cur_input.loc_field <= cur_input.limit_field)
2238         {
2239     cc = buffer[cur_input.loc_field]; 
2240     if((((cc >= 48)&&(cc <= 57)) ||((cc >= 97)&&(
2241     cc <= 102)))) 
2242     {
2243       incr(cur_input.loc_field); 
2244       if(c <= 57)
2245       cur_chr = c - 48; 
2246       else cur_chr = c - 87; 
2247       if(cc <= 57)
2248       cur_chr = 16 * cur_chr + cc - 48; 
2249       else cur_chr = 16 * cur_chr + cc - 87; 
2250       goto lab21; 
2251     } 
2252         } 
2253         if(c < 64)
2254         cur_chr = c + 64; 
2255         else cur_chr = c - 64; 
2256         goto lab21; 
2257       } 
2258     } 
2259     cur_input.state_field = 1; 
2260   } 
2261   break; 
2262       case 16 : 
2263       case 32 : 
2264       case 48 : 
2265   {
2266     {
2267       if(interaction == 3)
2268    ; 
2269       print_nl(262);  /* !  */
2270       print(610);   /* Text line contains an invalid character */
2271     } 
2272     {
2273       help_ptr = 2; 
2274       help_line[1]= 611; /* A funny symbol that I can't read has just been input. */
2275       help_line[0]= 612; /* Continue, and I'll forget that it ever happened. */
2276     } 
2277     deletions_allowed = false; 
2278     error (); 
2279     deletions_allowed = true; 
2280     goto lab20; 
2281   } 
2282   break; 
2283       case 11 : 
2284   {
2285     cur_input.state_field = 17; 
2286     cur_chr = 32; 
2287   } 
2288   break; 
2289       case 6 : 
2290   {
2291     cur_input.loc_field = cur_input.limit_field + 1; 
2292     cur_cmd = 10; 
2293     cur_chr = 32; 
2294   } 
2295   break; 
2296       case 22 : 
2297       case 15 : 
2298       case 31 : 
2299       case 47 : 
2300   {
2301     cur_input.loc_field = cur_input.limit_field + 1; 
2302     goto lab25; 
2303   } 
2304   break; 
2305       case 38 : 
2306   {
2307     cur_input.loc_field = cur_input.limit_field + 1; 
2308     cur_cs = par_loc; 
2309     cur_cmd = eqtb[cur_cs].hh.b0; 
2310     cur_chr = eqtb[cur_cs].hh.v.RH; 
2311     if(cur_cmd >= 113){
2312       check_outer_validity ();
2313     }
2314   } 
2315   break; 
2316       case 2 : 
2317   incr(align_state); 
2318   break; 
2319       case 18 : 
2320       case 34 : 
2321   {
2322     cur_input.state_field = 1; 
2323     incr(align_state); 
2324   } 
2325   break; 
2326       case 3 : 
2327   decr(align_state); 
2328   break; 
2329       case 19 : 
2330       case 35 : 
2331   {
2332     cur_input.state_field = 1; 
2333     decr(align_state); 
2334   } 
2335   break; 
2336       case 20 : 
2337       case 21 : 
2338       case 23 : 
2339       case 25 : 
2340       case 28 : 
2341       case 29 : 
2342       case 36 : 
2343       case 37 : 
2344       case 39 : 
2345       case 41 : 
2346       case 44 : 
2347       case 45 : 
2348   cur_input.state_field = 1; 
2349   break; 
2350   default: 
2351   ; 
2352   break; 
2353       } 
2354     } 
2355     else {
2356       cur_input.state_field = 33; 
2357       if(cur_input.name_field > 17) {
2358       incr(line); 
2359       first = cur_input.start_field; 
2360       if(! force_eof){
2361         if(input_ln(input_file[cur_input.index_field], true)) {
2362           firm_up_the_line ();
2363         }
2364         else force_eof = true; 
2365       } 
2366       if(force_eof){
2367         print_char(41);   /*)*/
2368         decr(open_parens); 
2369 #ifndef _WINDOWS
2370         fflush(stdout); 
2371 #endif
2372         force_eof = false; 
2373         end_file_reading (); 
2374         check_outer_validity (); 
2375         goto lab20; 
2376       } 
2377       if((eqtb[(hash_size + 3211)].cint < 0)||
2378         (eqtb[(hash_size + 3211)].cint > 255)) 
2379         decr(cur_input.limit_field); 
2380 /*    long to unsigned char ... */
2381       else buffer[cur_input.limit_field]= eqtb[(hash_size + 3211)].cint; 
2382       first = cur_input.limit_field + 1; 
2383       cur_input.loc_field = cur_input.start_field; 
2384     } 
2385     else {
2386       if(!(cur_input.name_field == 0)) {
2387         cur_cmd = 0; 
2388         cur_chr = 0; 
2389         return; 
2390       } 
2391       if(input_ptr > 0){
2392         end_file_reading (); 
2393         goto lab20; 
2394       } 
2395       if(selector < 18) open_log_file (); 
2396       if(interaction > 1){
2397         if((eqtb[(hash_size + 3211)].cint < 0)||
2398           (eqtb[(hash_size + 3211)].cint > 255)
2399         )
2400           incr(cur_input.limit_field); 
2401         if(cur_input.limit_field == cur_input.start_field)
2402           print_nl(613);    /* (Please type a command or say `\end') */
2403         print_ln (); 
2404         first = cur_input.start_field; 
2405         {
2406         ; 
2407           print(42);    /* * */
2408           term_input(42, 0); 
2409         } 
2410         cur_input.limit_field = last; 
2411         if((eqtb[(hash_size + 3211)].cint < 0)||
2412           (eqtb[(hash_size + 3211)].cint > 255)
2413         )
2414           decr(cur_input.limit_field); 
2415 /*    long to unsigned char ... */
2416         else buffer[cur_input.limit_field]= eqtb[(hash_size + 3211)].cint; 
2417         first = cur_input.limit_field + 1; 
2418         cur_input.loc_field = cur_input.start_field; 
2419       } 
2420       else {
2421         fatal_error(614); /* *** (job aborted, no legal \end found) */
2422         return;     // abort_flag set
2423       }
2424     } 
2425     {
2426       if(interrupt != 0){
2427         pause_for_instructions ();
2428       }
2429       } 
2430       goto lab25; 
2431     } 
2432   } 
2433   else if(cur_input.loc_field != 0)
2434   {
2435     t = mem[cur_input.loc_field].hh.v.LH; 
2436     cur_input.loc_field = mem[cur_input.loc_field].hh.v.RH; 
2437     if(t >= 4095)
2438     {
2439       cur_cs = t - 4095; 
2440       cur_cmd = eqtb[cur_cs].hh.b0; 
2441       cur_chr = eqtb[cur_cs].hh.v.RH; 
2442       if(cur_cmd >= 113)
2443       if(cur_cmd == 116)
2444       {
2445   cur_cs = mem[cur_input.loc_field].hh.v.LH - 4095; 
2446   cur_input.loc_field = 0; 
2447   cur_cmd = eqtb[cur_cs].hh.b0; 
2448   cur_chr = eqtb[cur_cs].hh.v.RH; 
2449   if(cur_cmd > 100)
2450   {
2451     cur_cmd = 0; 
2452     cur_chr = 257; 
2453   } 
2454       } 
2455       else {
2456       check_outer_validity ();
2457     }
2458     } 
2459     else {
2460   
2461       cur_cmd = t / 256; 
2462 /*      cur_cmd = t >> 8; */  /* top 8 bits */
2463       cur_chr = t % 256; 
2464 /*      cur_chr = t & 255; */ /* last 8 bits */
2465       switch(cur_cmd)
2466       {case 1 : 
2467   incr(align_state); 
2468   break; 
2469       case 2 : 
2470   decr(align_state); 
2471   break; 
2472       case 5 : 
2473   {
2474     begin_token_list(param_stack[cur_input.limit_field + cur_chr - 1], 
2475     0); 
2476     goto lab20; 
2477   } 
2478   break; 
2479   default: 
2480   ; 
2481   break; 
2482       } 
2483     } 
2484   } 
2485   else {
2486     end_token_list (); 
2487     goto lab20; 
2488   } 
2489   if(cur_cmd <= 5)
2490   if(cur_cmd >= 4)
2491   if(align_state == 0)
2492   {
2493     if(scanner_status == 4){
2494     fatal_error(592); /* (interwoven alignment preambles are not allowed) */
2495     return;     // abort_flag set
2496   }
2497
2498     cur_cmd = mem[cur_align + 5].hh.v.LH; 
2499     mem[cur_align + 5].hh.v.LH = cur_chr; 
2500     if(cur_cmd == 63)
2501     begin_token_list(mem_top - 10, 2); 
2502     else begin_token_list(mem[cur_align + 2].cint, 2); 
2503     align_state = 1000000L; 
2504     goto lab20; 
2505   } 
2506
2507
2508 #pragma optimize ("", on)             /* 96/Sep/12 */
2509
2510 /*****************************************************************************/