OSDN Git Service

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