OSDN Git Service

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