1 /* stb.c -- Implementation File (module.c template V1.0)
2 Copyright (C) 1995, 1996, 2002, 2003
3 Free Software Foundation, Inc.
4 Contributed by James Craig Burley.
6 This file is part of GNU Fortran.
8 GNU Fortran is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2, or (at your option)
13 GNU Fortran is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GNU Fortran; see the file COPYING. If not, write to
20 the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
27 Parses the proper form for statements, builds up expression trees for
28 them, but does not actually implement them. Uses ffebad (primarily via
29 ffesta_ffebad_start) to indicate errors in form. In many cases, an invalid
30 statement form indicates another possible statement needs to be looked at
31 by ffest. In a few cases, a valid statement form might not completely
32 determine the nature of the statement, as in REALFUNCTIONA(B), which is
33 a valid form for either the first statement of a function named A taking
34 an argument named B or for the declaration of a real array named FUNCTIONA
35 with an adjustable size of B. A similar (though somewhat easier) choice
36 must be made for the statement-function-def vs. assignment forms, as in
37 the case of FOO(A) = A+2.0.
39 A given parser consists of one or more state handlers, the first of which
40 is the initial state, and the last of which (for any given input) returns
41 control to a final state handler (ffesta_zero or ffesta_two, explained
42 below). The functions handling the states for a given parser usually have
43 the same names, differing only in the final number, as in ffestb_foo_
44 (handles the initial state), ffestb_foo_1_, ffestb_foo_2_ (handle
45 subsequent states), although liberties sometimes are taken with the "foo"
46 part either when keywords are clarified into given statements or are
47 transferred into other possible areas. (For example, the type-name
48 states can hop over to _dummy_ functions when the FUNCTION or RECURSIVE
49 keywords are seen, though this kind of thing is kept to a minimum.) Only
50 the names without numbers are exported to the rest of ffest; the others
53 Each initial state is provided with the first token in ffesta_tokens[0],
54 which will be killed upon return to the final state (ffesta_zero or
55 ffelex_swallow_tokens passed through to ffesta_zero), so while it may
56 be changed to another token, a valid token must be left there to be
57 killed. Also, a "convenient" array of tokens are left in
58 ffesta_tokens[1..FFESTA_tokensMAX]. The initial state of this set of
59 elements is undefined, thus, if tokens are stored here, they must be
60 killed before returning to the final state. Any parser may also use
61 cross-state local variables by sticking a structure containing storage
62 for those variables in the local union ffestb_local_ (unless the union
63 goes on strike). Furthermore, parsers that handle more than one first or
64 second tokens (like _varlist_, which handles EXTERNAL, INTENT, INTRINSIC,
66 PUBLIC, or PRIVATE, and _endxyz_, which handles ENDBLOCK, ENDBLOCKDATA,
67 ENDDO, ENDIF, and so on) may expect arguments from ffest in the
68 ffest-wide union ffest_args_, the substructure specific to the parser.
70 A parser's responsibility is: to call either ffesta_confirmed or
71 ffest_ffebad_start before returning to the final state; to be the only
72 parser that can possibly call ffesta_confirmed for a given statement;
73 to call ffest_ffebad_start immediately upon recognizing a bad token
74 (specifically one that another statement parser might confirm upon);
75 to call ffestc functions only after calling ffesta_confirmed and only
76 when ffesta_is_inhibited returns FALSE; and to call ffesta_is_inhibited
77 only after calling ffesta_confirmed. Confirm as early as reasonably
78 possible, even when only one ffestc function is called for the statement
79 later on, because early confirmation can enhance the error-reporting
80 capabilities if a subsequent error is detected and this parser isn't
81 the first possibility for the statement.
83 To assist the parser, functions like ffesta_ffebad_1t and _1p_ have
84 been provided to make use of ffest_ffebad_start fairly easy.
103 /* Externals defined here. */
105 struct _ffestb_args_ ffestb_args
;
107 /* Simple definitions and enumerations. */
109 #define FFESTB_KILL_EASY_ 1 /* 1 for only one _subr_kill_xyz_ fn. */
111 /* Internal typedefs. */
113 union ffestb_subrargs_u_
117 ffesttTokenList labels
; /* Input arg, must not be NULL. */
118 ffelexHandler handler
; /* Input arg, call me when done. */
119 bool ok
; /* Output arg, TRUE if list ended in
125 ffesttDimList dims
; /* Input arg, must not be NULL. */
126 ffelexHandler handler
; /* Input arg, call me when done. */
127 mallocPool pool
; /* Pool to allocate into. */
128 bool ok
; /* Output arg, TRUE if list ended in
130 ffeexprContext ctx
; /* DIMLIST or DIMLISTCOMMON. */
131 #ifdef FFECOM_dimensionsMAX
132 int ndims
; /* For backends that really can't have
139 ffesttTokenList args
; /* Input arg, must not be NULL. */
140 ffelexHandler handler
; /* Input arg, call me when done. */
141 ffelexToken close_paren
;/* Output arg if ok, CLOSE_PAREN token. */
142 bool is_subr
; /* Input arg, TRUE if list in subr-def
144 bool ok
; /* Output arg, TRUE if list ended in
146 bool names
; /* Do ffelex_set_names(TRUE) before return. */
151 union ffestb_local_u_
166 bool vxtparam
; /* If assignment might really be VXT
205 ffesttExprList exprs
;
228 ffestpFormatType current
; /* What we're currently working on. */
229 ffelexToken t
; /* Token of what we're currently working on. */
230 ffesttFormatValue pre
;
231 ffesttFormatValue post
;
232 ffesttFormatValue dot
;
233 ffesttFormatValue exp
;
234 bool sign
; /* _3_, pos/neg; elsewhere, signed/unsigned. */
235 bool complained
; /* If run-time expr seen in nonexec context. */
245 ffesttCaseList cases
;
258 ffeexprContext context
;
266 ffeexprContext context
;
274 ffeexprContext context
;
282 ffeexprContext context
;
290 ffeexprContext context
;
291 bool may_be_iolength
;
299 ffeexprContext context
;
307 ffeexprContext context
;
315 ffeexprContext context
;
323 ffeexprContext context
;
331 ffeexprContext context
;
352 ffestrFirst first_kw
;
358 ffebld kind
; /* Kind type parameter, if any. */
359 ffelexToken kindt
; /* Kind type first token, if any. */
360 ffebld len
; /* Length type parameter, if any. */
361 ffelexToken lent
; /* Length type parameter, if any. */
362 ffelexHandler handler
;
363 ffelexToken recursive
;
365 ffesttTokenList toklist
;/* For ambiguity resolution. */
366 ffesttImpList imps
; /* List of IMPLICIT letters. */
367 ffelexHandler imp_handler
; /* Call if paren list wasn't letters. */
369 ffestrOther kw
; /* INTENT(IN/OUT/INOUT). */
371 bool parameter
; /* If PARAMETER attribute seen (governs =expr
373 bool coloncolon
; /* If COLONCOLON seen (allows =expr). */
374 bool aster_after
; /* "*" seen after, not before,
375 [RECURSIVE]FUNCTIONxyz. */
376 bool empty
; /* Ambig function dummy arg list empty so
378 bool imp_started
; /* Started IMPLICIT statement already. */
379 bool imp_seen_comma
; /* TRUE if next COMMA within parens means not
388 }; /* Merge with the one in ffestb later. */
390 /* Private include files. */
393 /* Internal structure definitions. */
396 /* Static objects accessed by functions in this module. */
398 static union ffestb_subrargs_u_ ffestb_subrargs_
;
399 static union ffestb_local_u_ ffestb_local_
;
401 /* Static functions (internal). */
403 static void ffestb_subr_ambig_to_ents_ (void);
404 static ffelexHandler
ffestb_subr_ambig_nope_ (ffelexToken t
);
405 static ffelexHandler
ffestb_subr_dimlist_ (ffelexToken ft
, ffebld expr
,
407 static ffelexHandler
ffestb_subr_dimlist_1_ (ffelexToken ft
, ffebld expr
,
409 static ffelexHandler
ffestb_subr_dimlist_2_ (ffelexToken ft
, ffebld expr
,
411 static ffelexHandler
ffestb_subr_name_list_ (ffelexToken t
);
412 static ffelexHandler
ffestb_subr_name_list_1_ (ffelexToken t
);
413 static void ffestb_subr_R1001_append_p_ (void);
414 static ffelexHandler
ffestb_decl_kindparam_ (ffelexToken t
);
415 static ffelexHandler
ffestb_decl_kindparam_1_ (ffelexToken t
);
416 static ffelexHandler
ffestb_decl_kindparam_2_ (ffelexToken ft
, ffebld expr
,
418 static ffelexHandler
ffestb_decl_starkind_ (ffelexToken t
);
419 static ffelexHandler
ffestb_decl_starlen_ (ffelexToken t
);
420 static ffelexHandler
ffestb_decl_starlen_1_ (ffelexToken ft
, ffebld expr
,
422 static ffelexHandler
ffestb_decl_typeparams_ (ffelexToken t
);
423 static ffelexHandler
ffestb_decl_typeparams_1_ (ffelexToken t
);
424 static ffelexHandler
ffestb_decl_typeparams_2_ (ffelexToken ft
, ffebld expr
,
426 static ffelexHandler
ffestb_decl_typeparams_3_ (ffelexToken ft
, ffebld expr
,
428 static ffelexHandler
ffestb_subr_label_list_ (ffelexToken t
);
429 static ffelexHandler
ffestb_subr_label_list_1_ (ffelexToken t
);
430 static ffelexHandler
ffestb_do1_ (ffelexToken t
);
431 static ffelexHandler
ffestb_do2_ (ffelexToken t
);
432 static ffelexHandler
ffestb_do3_ (ffelexToken t
);
433 static ffelexHandler
ffestb_do4_ (ffelexToken ft
, ffebld expr
,
435 static ffelexHandler
ffestb_do5_ (ffelexToken t
);
436 static ffelexHandler
ffestb_do6_ (ffelexToken ft
, ffebld expr
,
438 static ffelexHandler
ffestb_do7_ (ffelexToken ft
, ffebld expr
,
440 static ffelexHandler
ffestb_do8_ (ffelexToken ft
, ffebld expr
,
442 static ffelexHandler
ffestb_do9_ (ffelexToken ft
, ffebld expr
,
444 static ffelexHandler
ffestb_else1_ (ffelexToken t
);
445 static ffelexHandler
ffestb_else2_ (ffelexToken ft
, ffebld expr
,
447 static ffelexHandler
ffestb_else3_ (ffelexToken t
);
448 static ffelexHandler
ffestb_else4_ (ffelexToken t
);
449 static ffelexHandler
ffestb_else5_ (ffelexToken t
);
450 static ffelexHandler
ffestb_end1_ (ffelexToken t
);
451 static ffelexHandler
ffestb_end2_ (ffelexToken t
);
452 static ffelexHandler
ffestb_end3_ (ffelexToken t
);
453 static ffelexHandler
ffestb_goto1_ (ffelexToken t
);
454 static ffelexHandler
ffestb_goto2_ (ffelexToken t
);
455 static ffelexHandler
ffestb_goto3_ (ffelexToken t
);
456 static ffelexHandler
ffestb_goto4_ (ffelexToken ft
, ffebld expr
,
458 static ffelexHandler
ffestb_goto5_ (ffelexToken ft
, ffebld expr
,
460 static ffelexHandler
ffestb_goto6_ (ffelexToken t
);
461 static ffelexHandler
ffestb_goto7_ (ffelexToken t
);
462 static ffelexHandler
ffestb_halt1_ (ffelexToken ft
, ffebld expr
,
464 static ffelexHandler
ffestb_if1_ (ffelexToken ft
, ffebld expr
,
466 static ffelexHandler
ffestb_if2_ (ffelexToken t
);
467 static ffelexHandler
ffestb_if3_ (ffelexToken t
);
468 static ffelexHandler
ffestb_let1_ (ffelexToken ft
, ffebld expr
,
470 static ffelexHandler
ffestb_let2_ (ffelexToken ft
, ffebld expr
,
472 static ffelexHandler
ffestb_varlist5_ (ffelexToken t
);
473 static ffelexHandler
ffestb_varlist6_ (ffelexToken t
);
474 static ffelexHandler
ffestb_R5221_ (ffelexToken t
);
475 static ffelexHandler
ffestb_R5222_ (ffelexToken t
);
476 static ffelexHandler
ffestb_R5223_ (ffelexToken t
);
477 static ffelexHandler
ffestb_R5224_ (ffelexToken t
);
478 static ffelexHandler
ffestb_R5281_ (ffelexToken ft
, ffebld expr
,
480 static ffelexHandler
ffestb_R5282_ (ffelexToken ft
, ffebld expr
,
482 static ffelexHandler
ffestb_R5283_ (ffelexToken ft
, ffebld expr
,
484 static ffelexHandler
ffestb_R5284_ (ffelexToken t
);
485 static ffelexHandler
ffestb_R5371_ (ffelexToken ft
, ffebld expr
,
487 static ffelexHandler
ffestb_R5372_ (ffelexToken ft
, ffebld expr
,
489 static ffelexHandler
ffestb_R5373_ (ffelexToken t
);
490 static ffelexHandler
ffestb_R5421_ (ffelexToken t
);
491 static ffelexHandler
ffestb_R5422_ (ffelexToken t
);
492 static ffelexHandler
ffestb_R5423_ (ffelexToken t
);
493 static ffelexHandler
ffestb_R5424_ (ffelexToken t
);
494 static ffelexHandler
ffestb_R5425_ (ffelexToken t
);
495 static ffelexHandler
ffestb_R5441_ (ffelexToken ft
, ffebld expr
,
497 static ffelexHandler
ffestb_R5442_ (ffelexToken ft
, ffebld expr
,
499 static ffelexHandler
ffestb_R5443_ (ffelexToken t
);
500 static ffelexHandler
ffestb_R5444_ (ffelexToken t
);
501 static ffelexHandler
ffestb_R8341_ (ffelexToken t
);
502 static ffelexHandler
ffestb_R8351_ (ffelexToken t
);
503 static ffelexHandler
ffestb_R8381_ (ffelexToken t
);
504 static ffelexHandler
ffestb_R8382_ (ffelexToken t
);
505 static ffelexHandler
ffestb_R8383_ (ffelexToken ft
, ffebld expr
,
507 static ffelexHandler
ffestb_R8401_ (ffelexToken ft
, ffebld expr
,
509 static ffelexHandler
ffestb_R8402_ (ffelexToken t
);
510 static ffelexHandler
ffestb_R8403_ (ffelexToken t
);
511 static ffelexHandler
ffestb_R8404_ (ffelexToken t
);
512 static ffelexHandler
ffestb_R8405_ (ffelexToken t
);
513 static ffelexHandler
ffestb_R8406_ (ffelexToken t
);
514 static ffelexHandler
ffestb_R8407_ (ffelexToken t
);
515 static ffelexHandler
ffestb_R11021_ (ffelexToken t
);
516 static ffelexHandler
ffestb_R1111_1_ (ffelexToken t
);
517 static ffelexHandler
ffestb_R1111_2_ (ffelexToken t
);
518 static ffelexHandler
ffestb_R12121_ (ffelexToken ft
, ffebld expr
,
520 static ffelexHandler
ffestb_R12271_ (ffelexToken ft
, ffebld expr
,
522 static ffelexHandler
ffestb_construct1_ (ffelexToken t
);
523 static ffelexHandler
ffestb_construct2_ (ffelexToken t
);
524 static ffelexHandler
ffestb_R8091_ (ffelexToken t
);
525 static ffelexHandler
ffestb_R8092_ (ffelexToken ft
, ffebld expr
,
527 static ffelexHandler
ffestb_R8093_ (ffelexToken t
);
528 static ffelexHandler
ffestb_R8101_ (ffelexToken t
);
529 static ffelexHandler
ffestb_R8102_ (ffelexToken t
);
530 static ffelexHandler
ffestb_R8103_ (ffelexToken ft
, ffebld expr
,
532 static ffelexHandler
ffestb_R8104_ (ffelexToken ft
, ffebld expr
,
534 static ffelexHandler
ffestb_R10011_ (ffelexToken t
);
535 static ffelexHandler
ffestb_R10012_ (ffelexToken t
);
536 static ffelexHandler
ffestb_R10013_ (ffelexToken t
);
537 static ffelexHandler
ffestb_R10014_ (ffelexToken t
);
538 static ffelexHandler
ffestb_R10015_ (ffelexToken t
);
539 static ffelexHandler
ffestb_R10016_ (ffelexToken t
);
540 static ffelexHandler
ffestb_R10017_ (ffelexToken t
);
541 static ffelexHandler
ffestb_R10018_ (ffelexToken t
);
542 static ffelexHandler
ffestb_R10019_ (ffelexToken t
);
543 static ffelexHandler
ffestb_R100110_ (ffelexToken t
);
544 static ffelexHandler
ffestb_R100111_ (ffelexToken t
);
545 static ffelexHandler
ffestb_R100112_ (ffelexToken t
);
546 static ffelexHandler
ffestb_R100113_ (ffelexToken t
);
547 static ffelexHandler
ffestb_R100114_ (ffelexToken t
);
548 static ffelexHandler
ffestb_R100115_ (ffelexToken ft
, ffebld expr
,
550 static ffelexHandler
ffestb_R100116_ (ffelexToken ft
, ffebld expr
,
552 static ffelexHandler
ffestb_R100117_ (ffelexToken ft
, ffebld expr
,
554 static ffelexHandler
ffestb_R100118_ (ffelexToken ft
, ffebld expr
,
556 static ffelexHandler
ffestb_S3P41_ (ffelexToken ft
, ffebld expr
,
558 static ffelexHandler
ffestb_V0141_ (ffelexToken t
);
559 static ffelexHandler
ffestb_V0142_ (ffelexToken t
);
560 static ffelexHandler
ffestb_V0143_ (ffelexToken t
);
561 static ffelexHandler
ffestb_V0144_ (ffelexToken t
);
562 #if FFESTB_KILL_EASY_
563 static void ffestb_subr_kill_easy_ (ffestpInquireIx max
);
565 static void ffestb_subr_kill_accept_ (void);
566 static void ffestb_subr_kill_beru_ (void);
567 static void ffestb_subr_kill_close_ (void);
568 static void ffestb_subr_kill_delete_ (void);
569 static void ffestb_subr_kill_find_ (void); /* Not written yet. */
570 static void ffestb_subr_kill_inquire_ (void);
571 static void ffestb_subr_kill_open_ (void);
572 static void ffestb_subr_kill_print_ (void);
573 static void ffestb_subr_kill_read_ (void);
574 static void ffestb_subr_kill_rewrite_ (void);
575 static void ffestb_subr_kill_type_ (void);
576 static void ffestb_subr_kill_vxtcode_ (void); /* Not written yet. */
577 static void ffestb_subr_kill_write_ (void);
579 static ffelexHandler
ffestb_beru1_ (ffelexToken ft
, ffebld expr
,
581 static ffelexHandler
ffestb_beru2_ (ffelexToken t
);
582 static ffelexHandler
ffestb_beru3_ (ffelexToken t
);
583 static ffelexHandler
ffestb_beru4_ (ffelexToken ft
, ffebld expr
,
585 static ffelexHandler
ffestb_beru5_ (ffelexToken t
);
586 static ffelexHandler
ffestb_beru6_ (ffelexToken t
);
587 static ffelexHandler
ffestb_beru7_ (ffelexToken ft
, ffebld expr
,
589 static ffelexHandler
ffestb_beru8_ (ffelexToken t
);
590 static ffelexHandler
ffestb_beru9_ (ffelexToken t
);
591 static ffelexHandler
ffestb_beru10_ (ffelexToken t
);
592 static ffelexHandler
ffestb_R9041_ (ffelexToken t
);
593 static ffelexHandler
ffestb_R9042_ (ffelexToken t
);
594 static ffelexHandler
ffestb_R9043_ (ffelexToken ft
, ffebld expr
,
596 static ffelexHandler
ffestb_R9044_ (ffelexToken t
);
597 static ffelexHandler
ffestb_R9045_ (ffelexToken t
);
598 static ffelexHandler
ffestb_R9046_ (ffelexToken ft
, ffebld expr
,
600 static ffelexHandler
ffestb_R9047_ (ffelexToken t
);
601 static ffelexHandler
ffestb_R9048_ (ffelexToken t
);
602 static ffelexHandler
ffestb_R9049_ (ffelexToken t
);
603 static ffelexHandler
ffestb_R9071_ (ffelexToken t
);
604 static ffelexHandler
ffestb_R9072_ (ffelexToken t
);
605 static ffelexHandler
ffestb_R9073_ (ffelexToken ft
, ffebld expr
,
607 static ffelexHandler
ffestb_R9074_ (ffelexToken t
);
608 static ffelexHandler
ffestb_R9075_ (ffelexToken t
);
609 static ffelexHandler
ffestb_R9076_ (ffelexToken ft
, ffebld expr
,
611 static ffelexHandler
ffestb_R9077_ (ffelexToken t
);
612 static ffelexHandler
ffestb_R9078_ (ffelexToken t
);
613 static ffelexHandler
ffestb_R9079_ (ffelexToken t
);
614 static ffelexHandler
ffestb_R9091_ (ffelexToken ft
, ffebld expr
,
616 static ffelexHandler
ffestb_R9092_ (ffelexToken t
);
617 static ffelexHandler
ffestb_R9093_ (ffelexToken t
);
618 static ffelexHandler
ffestb_R9094_ (ffelexToken ft
, ffebld expr
,
620 static ffelexHandler
ffestb_R9095_ (ffelexToken t
);
621 static ffelexHandler
ffestb_R9096_ (ffelexToken t
);
622 static ffelexHandler
ffestb_R9097_ (ffelexToken ft
, ffebld expr
,
624 static ffelexHandler
ffestb_R9098_ (ffelexToken t
);
625 static ffelexHandler
ffestb_R9099_ (ffelexToken t
);
626 static ffelexHandler
ffestb_R90910_ (ffelexToken ft
, ffebld expr
,
628 static ffelexHandler
ffestb_R90911_ (ffelexToken t
);
629 static ffelexHandler
ffestb_R90912_ (ffelexToken t
);
630 static ffelexHandler
ffestb_R90913_ (ffelexToken t
);
631 static ffelexHandler
ffestb_R90914_ (ffelexToken ft
, ffebld expr
,
633 static ffelexHandler
ffestb_R90915_ (ffelexToken ft
, ffebld expr
,
635 static ffelexHandler
ffestb_R9101_ (ffelexToken t
);
636 static ffelexHandler
ffestb_R9102_ (ffelexToken t
);
637 static ffelexHandler
ffestb_R9103_ (ffelexToken ft
, ffebld expr
,
639 static ffelexHandler
ffestb_R9104_ (ffelexToken t
);
640 static ffelexHandler
ffestb_R9105_ (ffelexToken t
);
641 static ffelexHandler
ffestb_R9106_ (ffelexToken ft
, ffebld expr
,
643 static ffelexHandler
ffestb_R9107_ (ffelexToken t
);
644 static ffelexHandler
ffestb_R9108_ (ffelexToken t
);
645 static ffelexHandler
ffestb_R9109_ (ffelexToken ft
, ffebld expr
,
647 static ffelexHandler
ffestb_R91010_ (ffelexToken t
);
648 static ffelexHandler
ffestb_R91011_ (ffelexToken t
);
649 static ffelexHandler
ffestb_R91012_ (ffelexToken t
);
650 static ffelexHandler
ffestb_R91013_ (ffelexToken ft
, ffebld expr
,
652 static ffelexHandler
ffestb_R91014_ (ffelexToken ft
, ffebld expr
,
654 static ffelexHandler
ffestb_R9111_ (ffelexToken ft
, ffebld expr
,
656 static ffelexHandler
ffestb_R9112_ (ffelexToken ft
, ffebld expr
,
658 static ffelexHandler
ffestb_R9231_ (ffelexToken t
);
659 static ffelexHandler
ffestb_R9232_ (ffelexToken t
);
660 static ffelexHandler
ffestb_R9233_ (ffelexToken ft
, ffebld expr
,
662 static ffelexHandler
ffestb_R9234_ (ffelexToken t
);
663 static ffelexHandler
ffestb_R9235_ (ffelexToken t
);
664 static ffelexHandler
ffestb_R9236_ (ffelexToken ft
, ffebld expr
,
666 static ffelexHandler
ffestb_R9237_ (ffelexToken t
);
667 static ffelexHandler
ffestb_R9238_ (ffelexToken t
);
668 static ffelexHandler
ffestb_R9239_ (ffelexToken t
);
669 static ffelexHandler
ffestb_R92310_ (ffelexToken t
);
670 static ffelexHandler
ffestb_R92311_ (ffelexToken ft
, ffebld expr
,
672 static ffelexHandler
ffestb_V0201_ (ffelexToken ft
, ffebld expr
,
674 static ffelexHandler
ffestb_V0202_ (ffelexToken ft
, ffebld expr
,
676 static ffelexHandler
ffestb_dummy1_ (ffelexToken t
);
677 static ffelexHandler
ffestb_dummy2_ (ffelexToken t
);
678 static ffelexHandler
ffestb_R5241_ (ffelexToken t
);
679 static ffelexHandler
ffestb_R5242_ (ffelexToken t
);
680 static ffelexHandler
ffestb_R5243_ (ffelexToken t
);
681 static ffelexHandler
ffestb_R5244_ (ffelexToken t
);
682 static ffelexHandler
ffestb_R5471_ (ffelexToken t
);
683 static ffelexHandler
ffestb_R5472_ (ffelexToken t
);
684 static ffelexHandler
ffestb_R5473_ (ffelexToken t
);
685 static ffelexHandler
ffestb_R5474_ (ffelexToken t
);
686 static ffelexHandler
ffestb_R5475_ (ffelexToken t
);
687 static ffelexHandler
ffestb_R5476_ (ffelexToken t
);
688 static ffelexHandler
ffestb_R5477_ (ffelexToken t
);
689 static ffelexHandler
ffestb_R12291_ (ffelexToken t
);
690 static ffelexHandler
ffestb_R12292_ (ffelexToken ft
, ffebld expr
,
692 static ffelexHandler
ffestb_decl_chartype1_ (ffelexToken t
);
693 static ffelexHandler
ffestb_decl_attrs_ (ffelexToken t
);
694 static ffelexHandler
ffestb_decl_attrs_1_ (ffelexToken t
);
695 static ffelexHandler
ffestb_decl_attrs_2_ (ffelexToken t
);
696 static ffelexHandler
ffestb_decl_attrs_7_ (ffelexToken t
);
697 static ffelexHandler
ffestb_decl_attrsp_ (ffelexToken t
);
698 static ffelexHandler
ffestb_decl_ents_ (ffelexToken t
);
699 static ffelexHandler
ffestb_decl_ents_1_ (ffelexToken t
);
700 static ffelexHandler
ffestb_decl_ents_2_ (ffelexToken t
);
701 static ffelexHandler
ffestb_decl_ents_3_ (ffelexToken t
);
702 static ffelexHandler
ffestb_decl_ents_4_ (ffelexToken t
);
703 static ffelexHandler
ffestb_decl_ents_5_ (ffelexToken t
);
704 static ffelexHandler
ffestb_decl_ents_6_ (ffelexToken ft
, ffebld expr
,
706 static ffelexHandler
ffestb_decl_ents_7_ (ffelexToken t
);
707 static ffelexHandler
ffestb_decl_ents_8_ (ffelexToken ft
, ffebld expr
,
709 static ffelexHandler
ffestb_decl_ents_9_ (ffelexToken ft
, ffebld expr
,
711 static ffelexHandler
ffestb_decl_ents_10_ (ffelexToken ft
, ffebld expr
,
713 static ffelexHandler
ffestb_decl_ents_11_ (ffelexToken t
);
714 static ffelexHandler
ffestb_decl_entsp_ (ffelexToken t
);
715 static ffelexHandler
ffestb_decl_entsp_1_ (ffelexToken t
);
716 static ffelexHandler
ffestb_decl_entsp_2_ (ffelexToken t
);
717 static ffelexHandler
ffestb_decl_entsp_3_ (ffelexToken t
);
718 static ffelexHandler
ffestb_decl_entsp_4_ (ffelexToken ft
, ffebld expr
,
720 static ffelexHandler
ffestb_decl_entsp_5_ (ffelexToken t
);
721 static ffelexHandler
ffestb_decl_entsp_6_ (ffelexToken t
);
722 static ffelexHandler
ffestb_decl_entsp_7_ (ffelexToken t
);
723 static ffelexHandler
ffestb_decl_entsp_8_ (ffelexToken t
);
724 static ffelexHandler
ffestb_decl_funcname_ (ffelexToken t
);
725 static ffelexHandler
ffestb_decl_funcname_1_ (ffelexToken t
);
726 static ffelexHandler
ffestb_decl_funcname_2_ (ffelexToken t
);
727 static ffelexHandler
ffestb_decl_funcname_3_ (ffelexToken ft
, ffebld expr
,
729 static ffelexHandler
ffestb_decl_funcname_4_ (ffelexToken t
);
730 static ffelexHandler
ffestb_decl_funcname_5_ (ffelexToken t
);
731 static ffelexHandler
ffestb_decl_funcname_6_ (ffelexToken t
);
732 static ffelexHandler
ffestb_decl_funcname_7_ (ffelexToken t
);
733 static ffelexHandler
ffestb_decl_funcname_8_ (ffelexToken t
);
734 static ffelexHandler
ffestb_decl_funcname_9_ (ffelexToken t
);
735 static ffelexHandler
ffestb_V0271_ (ffelexToken t
);
736 static ffelexHandler
ffestb_V0272_ (ffelexToken ft
, ffebld expr
,
738 static ffelexHandler
ffestb_V0273_ (ffelexToken t
);
739 static ffelexHandler
ffestb_decl_R5391_ (ffelexToken t
);
740 static ffelexHandler
ffestb_decl_R5392_ (ffelexToken t
);
741 static ffelexHandler
ffestb_decl_R5394_ (ffelexToken t
);
742 static ffelexHandler
ffestb_decl_R5395_ (ffelexToken t
);
743 static ffelexHandler
ffestb_decl_R539letters_ (ffelexToken t
);
744 static ffelexHandler
ffestb_decl_R539letters_1_ (ffelexToken t
);
745 static ffelexHandler
ffestb_decl_R539letters_2_ (ffelexToken t
);
746 static ffelexHandler
ffestb_decl_R539letters_3_ (ffelexToken t
);
747 static ffelexHandler
ffestb_decl_R539letters_4_ (ffelexToken t
);
748 static ffelexHandler
ffestb_decl_R539letters_5_ (ffelexToken t
);
749 static ffelexHandler
ffestb_decl_R539maybe_ (ffelexToken t
);
750 static ffelexHandler
ffestb_decl_R539maybe_1_ (ffelexToken t
);
751 static ffelexHandler
ffestb_decl_R539maybe_2_ (ffelexToken t
);
752 static ffelexHandler
ffestb_decl_R539maybe_3_ (ffelexToken t
);
753 static ffelexHandler
ffestb_decl_R539maybe_4_ (ffelexToken t
);
754 static ffelexHandler
ffestb_decl_R539maybe_5_ (ffelexToken t
);
756 /* Internal macros. */
758 #if FFESTB_KILL_EASY_
759 #define ffestb_subr_kill_accept_() \
760 ffestb_subr_kill_easy_((ffestpInquireIx) FFESTP_acceptix)
761 #define ffestb_subr_kill_beru_() \
762 ffestb_subr_kill_easy_((ffestpInquireIx) FFESTP_beruix)
763 #define ffestb_subr_kill_close_() \
764 ffestb_subr_kill_easy_((ffestpInquireIx) FFESTP_closeix)
765 #define ffestb_subr_kill_delete_() \
766 ffestb_subr_kill_easy_((ffestpInquireIx) FFESTP_deleteix)
767 #define ffestb_subr_kill_find_() \
768 ffestb_subr_kill_easy_((ffestpInquireIx) FFESTP_findix)
769 #define ffestb_subr_kill_inquire_() \
770 ffestb_subr_kill_easy_((ffestpInquireIx) FFESTP_inquireix)
771 #define ffestb_subr_kill_open_() \
772 ffestb_subr_kill_easy_((ffestpInquireIx) FFESTP_openix)
773 #define ffestb_subr_kill_print_() \
774 ffestb_subr_kill_easy_((ffestpInquireIx) FFESTP_printix)
775 #define ffestb_subr_kill_read_() \
776 ffestb_subr_kill_easy_((ffestpInquireIx) FFESTP_readix)
777 #define ffestb_subr_kill_rewrite_() \
778 ffestb_subr_kill_easy_((ffestpInquireIx) FFESTP_rewriteix)
779 #define ffestb_subr_kill_type_() \
780 ffestb_subr_kill_easy_((ffestpInquireIx) FFESTP_typeix)
781 #define ffestb_subr_kill_vxtcode_() \
782 ffestb_subr_kill_easy_((ffestpInquireIx) FFESTP_vxtcodeix)
783 #define ffestb_subr_kill_write_() \
784 ffestb_subr_kill_easy_((ffestpInquireIx) FFESTP_writeix)
787 /* ffestb_subr_ambig_nope_ -- Cleans up and aborts ambig w/o confirming
789 ffestb_subr_ambig_nope_();
791 Switch from ambiguity handling in _entsp_ functions to handling entities
792 in _ents_ (perform housekeeping tasks). */
795 ffestb_subr_ambig_nope_ (ffelexToken t
)
797 if (ffestb_local_
.decl
.recursive
!= NULL
)
798 ffelex_token_kill (ffestb_local_
.decl
.recursive
);
799 if (ffestb_local_
.decl
.kindt
!= NULL
)
800 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
801 if (ffestb_local_
.decl
.lent
!= NULL
)
802 ffelex_token_kill (ffestb_local_
.decl
.lent
);
803 ffelex_token_kill (ffesta_tokens
[1]);
804 ffelex_token_kill (ffesta_tokens
[2]);
805 ffestt_tokenlist_kill (ffestb_local_
.decl
.toklist
);
806 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "FUNCTION", t
);
807 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
810 /* ffestb_subr_ambig_to_ents_ -- Switches from ambiguity to entity decl
812 ffestb_subr_ambig_to_ents_();
814 Switch from ambiguity handling in _entsp_ functions to handling entities
815 in _ents_ (perform housekeeping tasks). */
818 ffestb_subr_ambig_to_ents_ (void)
822 nt
= ffelex_token_name_from_names (ffesta_tokens
[1], 0, 0);
823 ffelex_token_kill (ffesta_tokens
[1]);
824 ffelex_token_kill (ffesta_tokens
[2]);
825 ffesta_tokens
[1] = nt
;
826 if (ffestb_local_
.decl
.recursive
!= NULL
)
827 ffelex_token_kill (ffestb_local_
.decl
.recursive
);
828 if (!ffestb_local_
.decl
.aster_after
)
830 if (ffestb_local_
.decl
.type
== FFESTP_typeCHARACTER
)
832 if (!ffesta_is_inhibited ())
833 ffestc_decl_start (ffestb_local_
.decl
.type
, ffesta_tokens
[0],
834 ffestb_local_
.decl
.kind
, ffestb_local_
.decl
.kindt
,
835 ffestb_local_
.decl
.len
, ffestb_local_
.decl
.lent
);
836 if (ffestb_local_
.decl
.kindt
!= NULL
)
838 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
839 ffestb_local_
.decl
.kind
= NULL
;
840 ffestb_local_
.decl
.kindt
= NULL
;
842 if (ffestb_local_
.decl
.lent
!= NULL
)
844 ffelex_token_kill (ffestb_local_
.decl
.lent
);
845 ffestb_local_
.decl
.len
= NULL
;
846 ffestb_local_
.decl
.lent
= NULL
;
851 if (!ffesta_is_inhibited ())
852 ffestc_decl_start (ffestb_local_
.decl
.type
, ffesta_tokens
[0],
853 ffestb_local_
.decl
.kind
, ffestb_local_
.decl
.kindt
, NULL
,
855 if (ffestb_local_
.decl
.kindt
!= NULL
)
857 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
858 ffestb_local_
.decl
.kind
= NULL
;
859 ffestb_local_
.decl
.kindt
= NULL
;
864 if (ffestb_local_
.decl
.type
== FFESTP_typeCHARACTER
)
866 if (!ffesta_is_inhibited ())
867 ffestc_decl_start (ffestb_local_
.decl
.type
, ffesta_tokens
[0],
868 ffestb_local_
.decl
.kind
, ffestb_local_
.decl
.kindt
, NULL
, NULL
);
869 if (ffestb_local_
.decl
.kindt
!= NULL
)
871 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
872 ffestb_local_
.decl
.kind
= NULL
;
873 ffestb_local_
.decl
.kindt
= NULL
;
876 else if (!ffesta_is_inhibited ())
877 ffestc_decl_start (ffestb_local_
.decl
.type
, ffesta_tokens
[0],
878 NULL
, NULL
, NULL
, NULL
);
879 /* NAME/NAMES token already in ffesta_tokens[1]. */
882 /* ffestb_subr_dimlist_ -- OPEN_PAREN expr
884 (ffestb_subr_dimlist_) // to expression handler
886 Deal with a dimension list.
889 Detect too many dimensions if backend wants it. */
892 ffestb_subr_dimlist_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
894 switch (ffelex_token_type (t
))
896 case FFELEX_typeCLOSE_PAREN
:
899 #ifdef FFECOM_dimensionsMAX
900 if (ffestb_subrargs_
.dim_list
.ndims
++ == FFECOM_dimensionsMAX
)
902 ffesta_ffebad_1t (FFEBAD_TOO_MANY_DIMS
, ft
);
903 ffestb_subrargs_
.dim_list
.ok
= TRUE
; /* Not a parse error, really. */
904 return (ffelexHandler
) ffestb_subrargs_
.dim_list
.handler
;
907 ffestt_dimlist_append (ffestb_subrargs_
.dim_list
.dims
, NULL
, expr
,
908 ffelex_token_use (t
));
909 ffestb_subrargs_
.dim_list
.ok
= TRUE
;
910 return (ffelexHandler
) ffestb_subrargs_
.dim_list
.handler
;
912 case FFELEX_typeCOMMA
:
913 if ((expr
!= NULL
) && (ffebld_op (expr
) == FFEBLD_opSTAR
))
915 #ifdef FFECOM_dimensionsMAX
916 if (ffestb_subrargs_
.dim_list
.ndims
++ == FFECOM_dimensionsMAX
)
918 ffesta_ffebad_1t (FFEBAD_TOO_MANY_DIMS
, ft
);
919 return (ffelexHandler
) ffeexpr_rhs (ffestb_subrargs_
.dim_list
.pool
,
920 ffestb_subrargs_
.dim_list
.ctx
,
921 (ffeexprCallback
) ffestb_subr_dimlist_2_
);
924 ffestt_dimlist_append (ffestb_subrargs_
.dim_list
.dims
, NULL
, expr
,
925 ffelex_token_use (t
));
926 return (ffelexHandler
) ffeexpr_rhs (ffestb_subrargs_
.dim_list
.pool
,
927 ffestb_subrargs_
.dim_list
.ctx
,
928 (ffeexprCallback
) ffestb_subr_dimlist_
);
930 case FFELEX_typeCOLON
:
931 if ((expr
!= NULL
) && (ffebld_op (expr
) == FFEBLD_opSTAR
))
933 #ifdef FFECOM_dimensionsMAX
934 if (ffestb_subrargs_
.dim_list
.ndims
++ == FFECOM_dimensionsMAX
)
936 ffesta_ffebad_1t (FFEBAD_TOO_MANY_DIMS
, ft
);
937 return (ffelexHandler
) ffeexpr_rhs (ffestb_subrargs_
.dim_list
.pool
,
938 ffestb_subrargs_
.dim_list
.ctx
,
939 (ffeexprCallback
) ffestb_subr_dimlist_2_
);
942 ffestt_dimlist_append (ffestb_subrargs_
.dim_list
.dims
, expr
, NULL
,
943 ffelex_token_use (t
)); /* NULL second expr for
944 now, just plug in. */
945 return (ffelexHandler
) ffeexpr_rhs (ffestb_subrargs_
.dim_list
.pool
,
946 ffestb_subrargs_
.dim_list
.ctx
,
947 (ffeexprCallback
) ffestb_subr_dimlist_1_
);
953 ffestb_subrargs_
.dim_list
.ok
= FALSE
;
954 return (ffelexHandler
) ffestb_subrargs_
.dim_list
.handler (t
);
957 /* ffestb_subr_dimlist_1_ -- OPEN_PAREN expr COLON expr
959 (ffestb_subr_dimlist_1_) // to expression handler
961 Get the upper bound. */
964 ffestb_subr_dimlist_1_ (ffelexToken ft UNUSED
, ffebld expr
, ffelexToken t
)
966 switch (ffelex_token_type (t
))
968 case FFELEX_typeCLOSE_PAREN
:
969 ffestb_subrargs_
.dim_list
.dims
->previous
->upper
= expr
;
970 ffestb_subrargs_
.dim_list
.ok
= TRUE
;
971 return (ffelexHandler
) ffestb_subrargs_
.dim_list
.handler
;
973 case FFELEX_typeCOMMA
:
974 if ((expr
!= NULL
) && (ffebld_op (expr
) == FFEBLD_opSTAR
))
976 ffestb_subrargs_
.dim_list
.dims
->previous
->upper
= expr
;
977 return (ffelexHandler
) ffeexpr_rhs (ffestb_subrargs_
.dim_list
.pool
,
978 ffestb_subrargs_
.dim_list
.ctx
, (ffeexprCallback
) ffestb_subr_dimlist_
);
984 ffestb_subrargs_
.dim_list
.ok
= FALSE
;
985 return (ffelexHandler
) ffestb_subrargs_
.dim_list
.handler (t
);
988 /* ffestb_subr_dimlist_2_ -- OPEN_PAREN too-many-dim-exprs
990 (ffestb_subr_dimlist_2_) // to expression handler
992 Get the upper bound. */
995 ffestb_subr_dimlist_2_ (ffelexToken ft UNUSED
, ffebld expr
, ffelexToken t
)
997 switch (ffelex_token_type (t
))
999 case FFELEX_typeCLOSE_PAREN
:
1000 ffestb_subrargs_
.dim_list
.ok
= TRUE
; /* Not a parse error, really. */
1001 return (ffelexHandler
) ffestb_subrargs_
.dim_list
.handler
;
1003 case FFELEX_typeCOMMA
:
1004 case FFELEX_typeCOLON
:
1005 if ((expr
!= NULL
) && (ffebld_op (expr
) == FFEBLD_opSTAR
))
1007 return (ffelexHandler
) ffeexpr_rhs (ffestb_subrargs_
.dim_list
.pool
,
1008 ffestb_subrargs_
.dim_list
.ctx
,
1009 (ffeexprCallback
) ffestb_subr_dimlist_2_
);
1015 ffestb_subrargs_
.dim_list
.ok
= FALSE
;
1016 return (ffelexHandler
) ffestb_subrargs_
.dim_list
.handler (t
);
1019 /* ffestb_subr_name_list_ -- Collect a list of name args and close-paren
1021 return ffestb_subr_name_list_; // to lexer after seeing OPEN_PAREN
1023 This implements R1224 in the Fortran 90 spec. The arg list may be
1024 empty, or be a comma-separated list (an optional trailing comma currently
1025 results in a warning but no other effect) of arguments. For functions,
1026 however, "*" is invalid (we implement dummy-arg-name, rather than R1224
1027 dummy-arg, which itself is either dummy-arg-name or "*"). */
1029 static ffelexHandler
1030 ffestb_subr_name_list_ (ffelexToken t
)
1032 switch (ffelex_token_type (t
))
1034 case FFELEX_typeCLOSE_PAREN
:
1035 if (ffestt_tokenlist_count (ffestb_subrargs_
.name_list
.args
) != 0)
1036 { /* Trailing comma, warn. */
1037 ffebad_start (FFEBAD_TRAILING_COMMA
);
1038 ffebad_here (0, ffelex_token_where_line (t
), ffelex_token_where_column (t
));
1041 ffestb_subrargs_
.name_list
.ok
= TRUE
;
1042 ffestb_subrargs_
.name_list
.close_paren
= ffelex_token_use (t
);
1043 if (ffestb_subrargs_
.name_list
.names
)
1044 ffelex_set_names (TRUE
);
1045 return (ffelexHandler
) ffestb_subrargs_
.name_list
.handler
;
1047 case FFELEX_typeASTERISK
:
1048 if (!ffestb_subrargs_
.name_list
.is_subr
)
1051 case FFELEX_typeNAME
:
1052 ffestt_tokenlist_append (ffestb_subrargs_
.name_list
.args
,
1053 ffelex_token_use (t
));
1054 return (ffelexHandler
) ffestb_subr_name_list_1_
;
1060 ffestb_subrargs_
.name_list
.ok
= FALSE
;
1061 ffestb_subrargs_
.name_list
.close_paren
= ffelex_token_use (t
);
1062 if (ffestb_subrargs_
.name_list
.names
)
1063 ffelex_set_names (TRUE
);
1064 return (ffelexHandler
) (*ffestb_subrargs_
.name_list
.handler
) (t
);
1067 /* ffestb_subr_name_list_1_ -- NAME or ASTERISK
1069 return ffestb_subr_name_list_1_; // to lexer
1071 The next token must be COMMA or CLOSE_PAREN, either way go to original
1072 state, but only after adding the appropriate name list item. */
1074 static ffelexHandler
1075 ffestb_subr_name_list_1_ (ffelexToken t
)
1077 switch (ffelex_token_type (t
))
1079 case FFELEX_typeCOMMA
:
1080 return (ffelexHandler
) ffestb_subr_name_list_
;
1082 case FFELEX_typeCLOSE_PAREN
:
1083 ffestb_subrargs_
.name_list
.ok
= TRUE
;
1084 ffestb_subrargs_
.name_list
.close_paren
= ffelex_token_use (t
);
1085 if (ffestb_subrargs_
.name_list
.names
)
1086 ffelex_set_names (TRUE
);
1087 return (ffelexHandler
) ffestb_subrargs_
.name_list
.handler
;
1090 ffestb_subrargs_
.name_list
.ok
= FALSE
;
1091 ffestb_subrargs_
.name_list
.close_paren
= ffelex_token_use (t
);
1092 if (ffestb_subrargs_
.name_list
.names
)
1093 ffelex_set_names (TRUE
);
1094 return (ffelexHandler
) (*ffestb_subrargs_
.name_list
.handler
) (t
);
1099 ffestb_subr_R1001_append_p_ (void)
1103 if (!ffestb_local_
.format
.pre
.present
)
1105 ffesta_ffebad_1t (FFEBAD_FORMAT_BAD_P_SPEC
, ffestb_local_
.format
.t
);
1106 ffelex_token_kill (ffestb_local_
.format
.t
);
1110 f
= ffestt_formatlist_append (ffestb_local_
.format
.f
);
1111 f
->type
= FFESTP_formattypeP
;
1112 f
->t
= ffestb_local_
.format
.t
;
1113 f
->u
.R1010
.val
= ffestb_local_
.format
.pre
;
1116 /* ffestb_decl_kindparam_ -- "type" OPEN_PAREN
1118 return ffestb_decl_kindparam_; // to lexer
1120 Handle "[KIND=]expr)". */
1122 static ffelexHandler
1123 ffestb_decl_kindparam_ (ffelexToken t
)
1125 switch (ffelex_token_type (t
))
1127 case FFELEX_typeNAME
:
1128 ffesta_tokens
[1] = ffelex_token_use (t
);
1129 return (ffelexHandler
) ffestb_decl_kindparam_1_
;
1132 return (ffelexHandler
) (*((ffelexHandler
)
1133 ffeexpr_rhs (ffesta_output_pool
,
1134 FFEEXPR_contextKINDTYPE
,
1135 (ffeexprCallback
) ffestb_decl_kindparam_2_
)))
1140 /* ffestb_decl_kindparam_1_ -- "type" OPEN_PAREN NAME
1142 return ffestb_decl_kindparam_1_; // to lexer
1144 Handle "[KIND=]expr)". */
1146 static ffelexHandler
1147 ffestb_decl_kindparam_1_ (ffelexToken t
)
1152 switch (ffelex_token_type (t
))
1154 case FFELEX_typeEQUALS
:
1155 ffesta_confirmed ();
1156 if (ffestr_other (ffesta_tokens
[1]) != FFESTR_otherKIND
)
1158 ffelex_token_kill (ffesta_tokens
[1]);
1159 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
1160 FFEEXPR_contextKINDTYPE
, (ffeexprCallback
) ffestb_decl_kindparam_2_
);
1163 nt
= ffesta_tokens
[1];
1164 next
= (ffelexHandler
) (*((ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
1165 FFEEXPR_contextKINDTYPE
, (ffeexprCallback
) ffestb_decl_kindparam_2_
)))
1167 ffelex_token_kill (nt
);
1168 return (ffelexHandler
) (*next
) (t
);
1171 if (ffestb_local_
.decl
.recursive
!= NULL
)
1172 ffelex_token_kill (ffestb_local_
.decl
.recursive
);
1173 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
,
1174 ffestb_local_
.decl
.badname
,
1176 ffelex_token_kill (ffesta_tokens
[1]);
1177 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
1180 /* ffestb_decl_kindparam_2_ -- "type" OPEN_PAREN ["KIND="] expr
1182 (ffestb_decl_kindparam_2_) // to expression handler
1184 Handle "[KIND=]expr)". */
1186 static ffelexHandler
1187 ffestb_decl_kindparam_2_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
1189 switch (ffelex_token_type (t
))
1191 case FFELEX_typeCLOSE_PAREN
:
1192 ffestb_local_
.decl
.kind
= expr
;
1193 ffestb_local_
.decl
.kindt
= ffelex_token_use (ft
);
1194 ffestb_local_
.decl
.len
= NULL
;
1195 ffestb_local_
.decl
.lent
= NULL
;
1196 ffelex_set_names (TRUE
);
1197 return (ffelexHandler
) ffestb_local_
.decl
.handler
;
1203 if (ffestb_local_
.decl
.recursive
!= NULL
)
1204 ffelex_token_kill (ffestb_local_
.decl
.recursive
);
1205 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
,
1206 ffestb_local_
.decl
.badname
,
1208 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
1211 /* ffestb_decl_starkind_ -- "type" ASTERISK
1213 return ffestb_decl_starkind_; // to lexer
1217 static ffelexHandler
1218 ffestb_decl_starkind_ (ffelexToken t
)
1220 switch (ffelex_token_type (t
))
1222 case FFELEX_typeNUMBER
:
1223 ffestb_local_
.decl
.kindt
= ffelex_token_use (t
);
1224 ffestb_local_
.decl
.kind
= NULL
;
1225 ffestb_local_
.decl
.len
= NULL
;
1226 ffestb_local_
.decl
.lent
= NULL
;
1227 ffelex_set_names (TRUE
);
1228 return (ffelexHandler
) ffestb_local_
.decl
.handler
;
1234 if (ffestb_local_
.decl
.recursive
!= NULL
)
1235 ffelex_token_kill (ffestb_local_
.decl
.recursive
);
1236 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
,
1237 ffestb_local_
.decl
.badname
,
1239 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
1242 /* ffestb_decl_starlen_ -- "CHARACTER" ASTERISK
1244 return ffestb_decl_starlen_; // to lexer
1248 static ffelexHandler
1249 ffestb_decl_starlen_ (ffelexToken t
)
1251 switch (ffelex_token_type (t
))
1253 case FFELEX_typeNUMBER
:
1254 ffestb_local_
.decl
.kind
= NULL
;
1255 ffestb_local_
.decl
.kindt
= NULL
;
1256 ffestb_local_
.decl
.len
= NULL
;
1257 ffestb_local_
.decl
.lent
= ffelex_token_use (t
);
1258 ffelex_set_names (TRUE
);
1259 return (ffelexHandler
) ffestb_local_
.decl
.handler
;
1261 case FFELEX_typeOPEN_PAREN
:
1262 ffestb_local_
.decl
.kind
= NULL
;
1263 ffestb_local_
.decl
.kindt
= NULL
;
1264 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
1265 FFEEXPR_contextCHARACTERSIZE
,
1266 (ffeexprCallback
) ffestb_decl_starlen_1_
);
1272 if (ffestb_local_
.decl
.recursive
!= NULL
)
1273 ffelex_token_kill (ffestb_local_
.decl
.recursive
);
1274 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
,
1275 ffestb_local_
.decl
.badname
,
1277 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
1280 /* ffestb_decl_starlen_1_ -- "CHARACTER" ASTERISK OPEN_PAREN expr
1282 (ffestb_decl_starlen_1_) // to expression handler
1284 Handle CLOSE_PAREN. */
1286 static ffelexHandler
1287 ffestb_decl_starlen_1_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
1289 switch (ffelex_token_type (t
))
1291 case FFELEX_typeCLOSE_PAREN
:
1294 ffestb_local_
.decl
.len
= expr
;
1295 ffestb_local_
.decl
.lent
= ffelex_token_use (ft
);
1296 ffelex_set_names (TRUE
);
1297 return (ffelexHandler
) ffestb_local_
.decl
.handler
;
1303 if (ffestb_local_
.decl
.recursive
!= NULL
)
1304 ffelex_token_kill (ffestb_local_
.decl
.recursive
);
1305 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
,
1306 ffestb_local_
.decl
.badname
,
1308 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
1311 /* ffestb_decl_typeparams_ -- "CHARACTER" OPEN_PAREN
1313 return ffestb_decl_typeparams_; // to lexer
1315 Handle "[KIND=]expr)". */
1317 static ffelexHandler
1318 ffestb_decl_typeparams_ (ffelexToken t
)
1320 switch (ffelex_token_type (t
))
1322 case FFELEX_typeNAME
:
1323 ffesta_tokens
[1] = ffelex_token_use (t
);
1324 return (ffelexHandler
) ffestb_decl_typeparams_1_
;
1327 if (ffestb_local_
.decl
.lent
== NULL
)
1328 return (ffelexHandler
) (*((ffelexHandler
)
1329 ffeexpr_rhs (ffesta_output_pool
,
1330 FFEEXPR_contextCHARACTERSIZE
,
1331 (ffeexprCallback
) ffestb_decl_typeparams_2_
)))
1333 if (ffestb_local_
.decl
.kindt
!= NULL
)
1335 return (ffelexHandler
) (*((ffelexHandler
)
1336 ffeexpr_rhs (ffesta_output_pool
,
1337 FFEEXPR_contextKINDTYPE
,
1338 (ffeexprCallback
) ffestb_decl_typeparams_3_
)))
1342 if (ffestb_local_
.decl
.recursive
!= NULL
)
1343 ffelex_token_kill (ffestb_local_
.decl
.recursive
);
1344 if (ffestb_local_
.decl
.kindt
!= NULL
)
1345 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
1346 if (ffestb_local_
.decl
.lent
!= NULL
)
1347 ffelex_token_kill (ffestb_local_
.decl
.lent
);
1348 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
,
1349 ffestb_local_
.decl
.badname
,
1351 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
1354 /* ffestb_decl_typeparams_1_ -- "CHARACTER" OPEN_PAREN NAME
1356 return ffestb_decl_typeparams_1_; // to lexer
1358 Handle "[KIND=]expr)". */
1360 static ffelexHandler
1361 ffestb_decl_typeparams_1_ (ffelexToken t
)
1366 switch (ffelex_token_type (t
))
1368 case FFELEX_typeEQUALS
:
1369 ffesta_confirmed ();
1370 switch (ffestr_other (ffesta_tokens
[1]))
1372 case FFESTR_otherLEN
:
1373 if (ffestb_local_
.decl
.lent
!= NULL
)
1375 ffelex_token_kill (ffesta_tokens
[1]);
1376 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
1377 FFEEXPR_contextCHARACTERSIZE
,
1378 (ffeexprCallback
) ffestb_decl_typeparams_2_
);
1380 case FFESTR_otherKIND
:
1381 if (ffestb_local_
.decl
.kindt
!= NULL
)
1383 ffelex_token_kill (ffesta_tokens
[1]);
1384 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
1385 FFEEXPR_contextKINDTYPE
,
1386 (ffeexprCallback
) ffestb_decl_typeparams_3_
);
1394 nt
= ffesta_tokens
[1];
1395 if (ffestb_local_
.decl
.lent
== NULL
)
1396 next
= (ffelexHandler
) (*((ffelexHandler
)
1397 ffeexpr_rhs (ffesta_output_pool
,
1398 FFEEXPR_contextCHARACTERSIZE
,
1399 (ffeexprCallback
) ffestb_decl_typeparams_2_
)))
1401 else if (ffestb_local_
.decl
.kindt
== NULL
)
1402 next
= (ffelexHandler
) (*((ffelexHandler
)
1403 ffeexpr_rhs (ffesta_output_pool
,
1404 FFEEXPR_contextKINDTYPE
,
1405 (ffeexprCallback
) ffestb_decl_typeparams_3_
)))
1409 ffesta_tokens
[1] = nt
;
1412 ffelex_token_kill (nt
);
1413 return (ffelexHandler
) (*next
) (t
);
1416 if (ffestb_local_
.decl
.recursive
!= NULL
)
1417 ffelex_token_kill (ffestb_local_
.decl
.recursive
);
1418 if (ffestb_local_
.decl
.kindt
!= NULL
)
1419 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
1420 if (ffestb_local_
.decl
.lent
!= NULL
)
1421 ffelex_token_kill (ffestb_local_
.decl
.lent
);
1422 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
,
1423 ffestb_local_
.decl
.badname
,
1425 ffelex_token_kill (ffesta_tokens
[1]);
1426 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
1429 /* ffestb_decl_typeparams_2_ -- "CHARACTER" OPEN_PAREN ["LEN="] expr
1431 (ffestb_decl_typeparams_2_) // to expression handler
1433 Handle "[LEN=]expr)". */
1435 static ffelexHandler
1436 ffestb_decl_typeparams_2_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
1438 switch (ffelex_token_type (t
))
1440 case FFELEX_typeCLOSE_PAREN
:
1441 ffestb_local_
.decl
.len
= expr
;
1442 ffestb_local_
.decl
.lent
= ffelex_token_use (ft
);
1443 ffelex_set_names (TRUE
);
1444 return (ffelexHandler
) ffestb_local_
.decl
.handler
;
1446 case FFELEX_typeCOMMA
:
1447 ffestb_local_
.decl
.len
= expr
;
1448 ffestb_local_
.decl
.lent
= ffelex_token_use (ft
);
1449 return (ffelexHandler
) ffestb_decl_typeparams_
;
1455 if (ffestb_local_
.decl
.recursive
!= NULL
)
1456 ffelex_token_kill (ffestb_local_
.decl
.recursive
);
1457 if (ffestb_local_
.decl
.kindt
!= NULL
)
1458 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
1459 if (ffestb_local_
.decl
.lent
!= NULL
)
1460 ffelex_token_kill (ffestb_local_
.decl
.lent
);
1461 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
,
1462 ffestb_local_
.decl
.badname
,
1464 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
1467 /* ffestb_decl_typeparams_3_ -- "CHARACTER" OPEN_PAREN ["KIND="] expr
1469 (ffestb_decl_typeparams_3_) // to expression handler
1471 Handle "[KIND=]expr)". */
1473 static ffelexHandler
1474 ffestb_decl_typeparams_3_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
1476 switch (ffelex_token_type (t
))
1478 case FFELEX_typeCLOSE_PAREN
:
1479 ffestb_local_
.decl
.kind
= expr
;
1480 ffestb_local_
.decl
.kindt
= ffelex_token_use (ft
);
1481 ffelex_set_names (TRUE
);
1482 return (ffelexHandler
) ffestb_local_
.decl
.handler
;
1484 case FFELEX_typeCOMMA
:
1485 ffestb_local_
.decl
.kind
= expr
;
1486 ffestb_local_
.decl
.kindt
= ffelex_token_use (ft
);
1487 return (ffelexHandler
) ffestb_decl_typeparams_
;
1493 if (ffestb_local_
.decl
.recursive
!= NULL
)
1494 ffelex_token_kill (ffestb_local_
.decl
.recursive
);
1495 if (ffestb_local_
.decl
.kindt
!= NULL
)
1496 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
1497 if (ffestb_local_
.decl
.lent
!= NULL
)
1498 ffelex_token_kill (ffestb_local_
.decl
.lent
);
1499 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
,
1500 ffestb_local_
.decl
.badname
,
1502 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
1505 /* ffestb_subr_label_list_ -- Collect a tokenlist of labels and close-paren
1507 return ffestb_subr_label_list_; // to lexer after seeing OPEN_PAREN
1509 First token must be a NUMBER. Must be followed by zero or more COMMA
1510 NUMBER pairs. Must then be followed by a CLOSE_PAREN. If all ok, put
1511 the NUMBER tokens in a token list and return via the handler for the
1512 token after CLOSE_PAREN. Else return via
1513 same handler, but with the ok return value set FALSE. */
1515 static ffelexHandler
1516 ffestb_subr_label_list_ (ffelexToken t
)
1518 if (ffelex_token_type (t
) == FFELEX_typeNUMBER
)
1520 ffestt_tokenlist_append (ffestb_subrargs_
.label_list
.labels
,
1521 ffelex_token_use (t
));
1522 return (ffelexHandler
) ffestb_subr_label_list_1_
;
1525 ffestb_subrargs_
.label_list
.ok
= FALSE
;
1526 return (ffelexHandler
) (*ffestb_subrargs_
.label_list
.handler
) (t
);
1529 /* ffestb_subr_label_list_1_ -- NUMBER
1531 return ffestb_subr_label_list_1_; // to lexer after seeing NUMBER
1533 The next token must be COMMA, in which case go back to
1534 ffestb_subr_label_list_, or CLOSE_PAREN, in which case set ok to TRUE
1535 and go to the handler. */
1537 static ffelexHandler
1538 ffestb_subr_label_list_1_ (ffelexToken t
)
1540 switch (ffelex_token_type (t
))
1542 case FFELEX_typeCOMMA
:
1543 return (ffelexHandler
) ffestb_subr_label_list_
;
1545 case FFELEX_typeCLOSE_PAREN
:
1546 ffestb_subrargs_
.label_list
.ok
= TRUE
;
1547 return (ffelexHandler
) ffestb_subrargs_
.label_list
.handler
;
1550 ffestb_subrargs_
.label_list
.ok
= FALSE
;
1551 return (ffelexHandler
) (*ffestb_subrargs_
.label_list
.handler
) (t
);
1555 /* ffestb_do -- Parse the DO statement
1557 return ffestb_do; // to lexer
1559 Make sure the statement has a valid form for the DO statement. If it
1560 does, implement the statement. */
1563 ffestb_do (ffelexToken t
)
1566 unsigned const char *p
;
1571 switch (ffelex_token_type (ffesta_tokens
[0]))
1573 case FFELEX_typeNAME
:
1574 if (ffesta_first_kw
!= FFESTR_firstDO
)
1575 goto bad_0
; /* :::::::::::::::::::: */
1576 switch (ffelex_token_type (t
))
1578 case FFELEX_typeNUMBER
:
1579 ffesta_confirmed ();
1580 ffesta_tokens
[1] = ffelex_token_use (t
);
1581 return (ffelexHandler
) ffestb_do1_
;
1583 case FFELEX_typeCOMMA
:
1584 ffesta_confirmed ();
1585 ffesta_tokens
[1] = NULL
;
1586 return (ffelexHandler
) ffestb_do2_
;
1588 case FFELEX_typeNAME
:
1589 ffesta_confirmed ();
1590 ffesta_tokens
[1] = NULL
;
1591 ffesta_tokens
[2] = ffelex_token_use (t
);
1592 return (ffelexHandler
) ffestb_do3_
;
1594 case FFELEX_typeEOS
:
1595 case FFELEX_typeSEMICOLON
:
1596 ffesta_confirmed ();
1597 ffesta_tokens
[1] = NULL
;
1598 return (ffelexHandler
) ffestb_do1_ (t
);
1600 case FFELEX_typeCOLONCOLON
:
1601 ffesta_confirmed (); /* Error, but clearly intended. */
1602 goto bad_1
; /* :::::::::::::::::::: */
1605 goto bad_1
; /* :::::::::::::::::::: */
1608 case FFELEX_typeNAMES
:
1609 if (ffesta_first_kw
!= FFESTR_firstDO
)
1610 goto bad_0
; /* :::::::::::::::::::: */
1611 p
= ffelex_token_text (ffesta_tokens
[0]) + (i
= FFESTR_firstlDO
);
1612 switch (ffelex_token_type (t
))
1614 case FFELEX_typeCOLONCOLON
:
1615 ffesta_confirmed (); /* Error, but clearly intended. */
1616 goto bad_1
; /* :::::::::::::::::::: */
1619 goto bad_1
; /* :::::::::::::::::::: */
1621 case FFELEX_typeOPEN_PAREN
: /* Must be "DO" label "WHILE". */
1623 goto bad_i
; /* :::::::::::::::::::: */
1624 ffesta_tokens
[1] = ffelex_token_number_from_names (ffesta_tokens
[0],
1626 p
+= ffelex_token_length (ffesta_tokens
[1]);
1627 i
+= ffelex_token_length (ffesta_tokens
[1]);
1628 if (((*p
) != 'W') && ((*p
) != 'w'))
1629 goto bad_i1
; /* :::::::::::::::::::: */
1630 nt
= ffelex_token_name_from_names (ffesta_tokens
[0], i
, 0);
1631 kw
= ffestr_second (nt
);
1632 ffelex_token_kill (nt
);
1633 if (kw
!= FFESTR_secondWHILE
)
1634 goto bad_i1
; /* :::::::::::::::::::: */
1635 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
1636 FFEEXPR_contextDOWHILE
, (ffeexprCallback
) ffestb_do4_
);
1638 case FFELEX_typeCOMMA
:
1639 ffesta_confirmed ();
1642 ffesta_tokens
[1] = NULL
;
1643 return (ffelexHandler
) ffestb_do2_
;
1646 goto bad_i
; /* :::::::::::::::::::: */
1647 ffesta_tokens
[1] = ffelex_token_number_from_names (ffesta_tokens
[0],
1649 p
+= ffelex_token_length (ffesta_tokens
[1]);
1650 i
+= ffelex_token_length (ffesta_tokens
[1]);
1652 goto bad_i1
; /* :::::::::::::::::::: */
1653 return (ffelexHandler
) ffestb_do2_
;
1655 case FFELEX_typeEQUALS
:
1659 = ffelex_token_number_from_names (ffesta_tokens
[0], i
);
1660 p
+= ffelex_token_length (ffesta_tokens
[1]);
1661 i
+= ffelex_token_length (ffesta_tokens
[1]);
1664 ffesta_tokens
[1] = NULL
;
1665 if (!ffesrc_is_name_init (*p
))
1666 goto bad_i1
; /* :::::::::::::::::::: */
1667 nt
= ffelex_token_name_from_names (ffesta_tokens
[0], i
, 0);
1668 next
= (ffelexHandler
) (*((ffelexHandler
) ffeexpr_lhs
1669 (ffesta_output_pool
, FFEEXPR_contextDO
,
1670 (ffeexprCallback
) ffestb_do6_
)))
1672 ffelex_token_kill (nt
); /* Will get it back in _6_... */
1673 return (ffelexHandler
) (*next
) (t
);
1675 case FFELEX_typeEOS
:
1676 case FFELEX_typeSEMICOLON
:
1677 ffesta_confirmed ();
1681 = ffelex_token_number_from_names (ffesta_tokens
[0], i
);
1682 p
+= ffelex_token_length (ffesta_tokens
[1]);
1683 i
+= ffelex_token_length (ffesta_tokens
[1]);
1686 ffesta_tokens
[1] = NULL
;
1688 goto bad_i1
; /* :::::::::::::::::::: */
1689 return (ffelexHandler
) ffestb_do1_ (t
);
1693 goto bad_0
; /* :::::::::::::::::::: */
1696 bad_0
: /* :::::::::::::::::::: */
1697 if (ffesta_construct_name
!= NULL
)
1699 ffelex_token_kill (ffesta_construct_name
);
1700 ffesta_construct_name
= NULL
;
1702 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "DO", ffesta_tokens
[0]);
1703 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
1705 bad_1
: /* :::::::::::::::::::: */
1706 if (ffesta_construct_name
!= NULL
)
1708 ffelex_token_kill (ffesta_construct_name
);
1709 ffesta_construct_name
= NULL
;
1711 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "DO", t
);
1712 return (ffelexHandler
) ffelex_swallow_tokens (t
,
1713 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
1715 bad_i1
: /* :::::::::::::::::::: */
1716 if (ffesta_tokens
[1])
1717 ffelex_token_kill (ffesta_tokens
[1]);
1719 bad_i
: /* :::::::::::::::::::: */
1720 if (ffesta_construct_name
!= NULL
)
1722 ffelex_token_kill (ffesta_construct_name
);
1723 ffesta_construct_name
= NULL
;
1725 ffesta_ffebad_1sp (FFEBAD_INVALID_STMT_FORM
, "DO", ffesta_tokens
[0], i
, t
);
1726 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
1729 /* ffestb_dowhile -- Parse the DOWHILE statement
1731 return ffestb_dowhile; // to lexer
1733 Make sure the statement has a valid form for the DOWHILE statement. If it
1734 does, implement the statement. */
1737 ffestb_dowhile (ffelexToken t
)
1744 switch (ffelex_token_type (ffesta_tokens
[0]))
1746 case FFELEX_typeNAMES
:
1747 if (ffesta_first_kw
!= FFESTR_firstDOWHILE
)
1748 goto bad_0
; /* :::::::::::::::::::: */
1749 switch (ffelex_token_type (t
))
1751 case FFELEX_typeEOS
:
1752 case FFELEX_typeSEMICOLON
:
1753 case FFELEX_typeCOMMA
:
1754 case FFELEX_typeCOLONCOLON
:
1755 ffesta_confirmed (); /* Error, but clearly intended. */
1756 goto bad_1
; /* :::::::::::::::::::: */
1759 goto bad_1
; /* :::::::::::::::::::: */
1761 case FFELEX_typeOPEN_PAREN
:
1762 p
= ffelex_token_text (ffesta_tokens
[0]) + (i
= FFESTR_firstlDOWHILE
);
1764 goto bad_i
; /* :::::::::::::::::::: */
1765 ffesta_tokens
[1] = NULL
;
1766 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
1767 FFEEXPR_contextDOWHILE
, (ffeexprCallback
) ffestb_do4_
);
1769 case FFELEX_typeEQUALS
:/* Not really DOWHILE, but DOWHILExyz=.... */
1770 ffesta_tokens
[1] = NULL
;
1771 nt
= ffelex_token_name_from_names (ffesta_tokens
[0], FFESTR_firstlDO
,
1773 next
= (ffelexHandler
) (*((ffelexHandler
) ffeexpr_lhs
1774 (ffesta_output_pool
, FFEEXPR_contextDO
,
1775 (ffeexprCallback
) ffestb_do6_
)))
1777 ffelex_token_kill (nt
); /* Will get it back in _6_... */
1778 return (ffelexHandler
) (*next
) (t
);
1782 goto bad_0
; /* :::::::::::::::::::: */
1785 bad_0
: /* :::::::::::::::::::: */
1786 if (ffesta_construct_name
!= NULL
)
1788 ffelex_token_kill (ffesta_construct_name
);
1789 ffesta_construct_name
= NULL
;
1791 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "DO", ffesta_tokens
[0]);
1792 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
1794 bad_1
: /* :::::::::::::::::::: */
1795 if (ffesta_construct_name
!= NULL
)
1797 ffelex_token_kill (ffesta_construct_name
);
1798 ffesta_construct_name
= NULL
;
1800 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "DO", t
);
1801 return (ffelexHandler
) ffelex_swallow_tokens (t
,
1802 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
1804 bad_i
: /* :::::::::::::::::::: */
1805 if (ffesta_construct_name
!= NULL
)
1807 ffelex_token_kill (ffesta_construct_name
);
1808 ffesta_construct_name
= NULL
;
1810 ffesta_ffebad_1sp (FFEBAD_INVALID_STMT_FORM
, "DO", ffesta_tokens
[0], i
, t
);
1811 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
1814 /* ffestb_do1_ -- "DO" [label]
1816 return ffestb_do1_; // to lexer
1818 Make sure the statement has a valid form for the DO statement. If it
1819 does, implement the statement. */
1821 static ffelexHandler
1822 ffestb_do1_ (ffelexToken t
)
1824 switch (ffelex_token_type (t
))
1826 case FFELEX_typeCOMMA
:
1827 ffesta_confirmed ();
1828 return (ffelexHandler
) ffestb_do2_
;
1830 case FFELEX_typeEOS
:
1831 case FFELEX_typeSEMICOLON
:
1832 ffesta_confirmed ();
1833 if (!ffesta_is_inhibited ())
1835 if (ffesta_tokens
[1] != NULL
)
1836 ffestc_R819B (ffesta_construct_name
, ffesta_tokens
[1], NULL
,
1839 ffestc_R820B (ffesta_construct_name
, NULL
, NULL
);
1841 if (ffesta_tokens
[1] != NULL
)
1842 ffelex_token_kill (ffesta_tokens
[1]);
1843 if (ffesta_construct_name
!= NULL
)
1845 ffelex_token_kill (ffesta_construct_name
);
1846 ffesta_construct_name
= NULL
;
1848 return (ffelexHandler
) ffesta_zero (t
);
1850 case FFELEX_typeNAME
:
1851 return (ffelexHandler
) ffestb_do2_ (t
);
1857 if (ffesta_tokens
[1] != NULL
)
1858 ffelex_token_kill (ffesta_tokens
[1]);
1859 if (ffesta_construct_name
!= NULL
)
1861 ffelex_token_kill (ffesta_construct_name
);
1862 ffesta_construct_name
= NULL
;
1864 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "DO", t
);
1865 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
1868 /* ffestb_do2_ -- "DO" [label] [,]
1870 return ffestb_do2_; // to lexer
1872 Make sure the statement has a valid form for the DO statement. If it
1873 does, implement the statement. */
1875 static ffelexHandler
1876 ffestb_do2_ (ffelexToken t
)
1878 switch (ffelex_token_type (t
))
1880 case FFELEX_typeNAME
:
1881 ffesta_tokens
[2] = ffelex_token_use (t
);
1882 return (ffelexHandler
) ffestb_do3_
;
1888 if (ffesta_tokens
[1] != NULL
)
1889 ffelex_token_kill (ffesta_tokens
[1]);
1890 if (ffesta_construct_name
!= NULL
)
1892 ffelex_token_kill (ffesta_construct_name
);
1893 ffesta_construct_name
= NULL
;
1895 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "DO", t
);
1896 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
1899 /* ffestb_do3_ -- "DO" [label] [,] NAME
1901 return ffestb_do3_; // to lexer
1903 Make sure the statement has a valid form for the DO statement. If it
1904 does, implement the statement. */
1906 static ffelexHandler
1907 ffestb_do3_ (ffelexToken t
)
1911 switch (ffelex_token_type (t
))
1913 case FFELEX_typeEQUALS
:
1914 next
= (ffelexHandler
) (*((ffelexHandler
) ffeexpr_lhs (ffesta_output_pool
,
1915 FFEEXPR_contextDO
, (ffeexprCallback
) ffestb_do6_
)))
1917 ffelex_token_kill (ffesta_tokens
[2]); /* Will get it back in _6_... */
1918 return (ffelexHandler
) (*next
) (t
);
1920 case FFELEX_typeOPEN_PAREN
:
1921 if (ffestr_second (ffesta_tokens
[2]) != FFESTR_secondWHILE
)
1923 if (ffesta_tokens
[1] != NULL
)
1924 ffelex_token_kill (ffesta_tokens
[1]);
1925 if (ffesta_construct_name
!= NULL
)
1927 ffelex_token_kill (ffesta_construct_name
);
1928 ffesta_construct_name
= NULL
;
1930 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "DO", ffesta_tokens
[2]);
1931 ffelex_token_kill (ffesta_tokens
[2]);
1932 return (ffelexHandler
) ffelex_swallow_tokens (t
,
1933 (ffelexHandler
) ffesta_zero
); /* Invalid token. */
1935 ffelex_token_kill (ffesta_tokens
[2]);
1936 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
1937 FFEEXPR_contextDOWHILE
, (ffeexprCallback
) ffestb_do4_
);
1943 ffelex_token_kill (ffesta_tokens
[2]);
1944 if (ffesta_tokens
[1] != NULL
)
1945 ffelex_token_kill (ffesta_tokens
[1]);
1946 if (ffesta_construct_name
!= NULL
)
1948 ffelex_token_kill (ffesta_construct_name
);
1949 ffesta_construct_name
= NULL
;
1951 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "DO", t
);
1952 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
1955 /* ffestb_do4_ -- "DO" [label] [,] "WHILE" OPEN_PAREN expr
1957 (ffestb_do4_) // to expression handler
1959 Make sure the statement has a valid form for the DO statement. If it
1960 does, implement the statement. */
1962 static ffelexHandler
1963 ffestb_do4_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
1965 switch (ffelex_token_type (t
))
1967 case FFELEX_typeCLOSE_PAREN
:
1970 ffesta_tokens
[2] = ffelex_token_use (ft
);
1971 ffestb_local_
.dowhile
.expr
= expr
;
1972 return (ffelexHandler
) ffestb_do5_
;
1978 if (ffesta_tokens
[1] != NULL
)
1979 ffelex_token_kill (ffesta_tokens
[1]);
1980 if (ffesta_construct_name
!= NULL
)
1982 ffelex_token_kill (ffesta_construct_name
);
1983 ffesta_construct_name
= NULL
;
1985 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "DO", t
);
1986 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
1989 /* ffestb_do5_ -- "DO" [label] [,] "WHILE" OPEN_PAREN expr CLOSE_PAREN
1991 return ffestb_do5_; // to lexer
1993 Make sure the statement has a valid form for the DO statement. If it
1994 does, implement the statement. */
1996 static ffelexHandler
1997 ffestb_do5_ (ffelexToken t
)
1999 switch (ffelex_token_type (t
))
2001 case FFELEX_typeEOS
:
2002 case FFELEX_typeSEMICOLON
:
2003 ffesta_confirmed ();
2004 if (!ffesta_is_inhibited ())
2006 if (ffesta_tokens
[1] != NULL
)
2007 ffestc_R819B (ffesta_construct_name
, ffesta_tokens
[1],
2008 ffestb_local_
.dowhile
.expr
, ffesta_tokens
[2]);
2010 ffestc_R820B (ffesta_construct_name
, ffestb_local_
.dowhile
.expr
,
2013 ffelex_token_kill (ffesta_tokens
[2]);
2014 if (ffesta_tokens
[1] != NULL
)
2015 ffelex_token_kill (ffesta_tokens
[1]);
2016 if (ffesta_construct_name
!= NULL
)
2018 ffelex_token_kill (ffesta_construct_name
);
2019 ffesta_construct_name
= NULL
;
2021 return (ffelexHandler
) ffesta_zero (t
);
2027 ffelex_token_kill (ffesta_tokens
[2]);
2028 if (ffesta_tokens
[1] != NULL
)
2029 ffelex_token_kill (ffesta_tokens
[1]);
2030 if (ffesta_construct_name
!= NULL
)
2032 ffelex_token_kill (ffesta_construct_name
);
2033 ffesta_construct_name
= NULL
;
2035 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "DO", t
);
2036 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
2039 /* ffestb_do6_ -- "DO" [label] [,] var-expr
2041 (ffestb_do6_) // to expression handler
2043 Make sure the statement has a valid form for the DO statement. If it
2044 does, implement the statement. */
2046 static ffelexHandler
2047 ffestb_do6_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
2049 /* _3_ already ensured that this would be an EQUALS token. If not, it is a
2052 assert (ffelex_token_type (t
) == FFELEX_typeEQUALS
);
2054 ffesta_tokens
[2] = ffelex_token_use (ft
);
2055 ffestb_local_
.do_stmt
.var
= expr
;
2056 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
2057 FFEEXPR_contextDO
, (ffeexprCallback
) ffestb_do7_
);
2060 /* ffestb_do7_ -- "DO" [label] [,] var-expr EQUALS expr
2062 (ffestb_do7_) // to expression handler
2064 Make sure the statement has a valid form for the DO statement. If it
2065 does, implement the statement. */
2067 static ffelexHandler
2068 ffestb_do7_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
2070 switch (ffelex_token_type (t
))
2072 case FFELEX_typeCOMMA
:
2073 ffesta_confirmed ();
2076 ffesta_tokens
[3] = ffelex_token_use (ft
);
2077 ffestb_local_
.do_stmt
.start
= expr
;
2078 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
2079 FFEEXPR_contextDO
, (ffeexprCallback
) ffestb_do8_
);
2085 ffelex_token_kill (ffesta_tokens
[2]);
2086 if (ffesta_tokens
[1] != NULL
)
2087 ffelex_token_kill (ffesta_tokens
[1]);
2088 if (ffesta_construct_name
!= NULL
)
2090 ffelex_token_kill (ffesta_construct_name
);
2091 ffesta_construct_name
= NULL
;
2093 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "DO", t
);
2094 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
2097 /* ffestb_do8_ -- "DO" [label] [,] var-expr EQUALS expr COMMA expr
2099 (ffestb_do8_) // to expression handler
2101 Make sure the statement has a valid form for the DO statement. If it
2102 does, implement the statement. */
2104 static ffelexHandler
2105 ffestb_do8_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
2107 switch (ffelex_token_type (t
))
2109 case FFELEX_typeCOMMA
:
2112 ffesta_tokens
[4] = ffelex_token_use (ft
);
2113 ffestb_local_
.do_stmt
.end
= expr
;
2114 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
2115 FFEEXPR_contextDO
, (ffeexprCallback
) ffestb_do9_
);
2117 case FFELEX_typeEOS
:
2118 case FFELEX_typeSEMICOLON
:
2121 ffesta_tokens
[4] = ffelex_token_use (ft
);
2122 ffestb_local_
.do_stmt
.end
= expr
;
2123 return (ffelexHandler
) ffestb_do9_ (NULL
, NULL
, t
);
2129 ffelex_token_kill (ffesta_tokens
[3]);
2130 ffelex_token_kill (ffesta_tokens
[2]);
2131 if (ffesta_tokens
[1] != NULL
)
2132 ffelex_token_kill (ffesta_tokens
[1]);
2133 if (ffesta_construct_name
!= NULL
)
2135 ffelex_token_kill (ffesta_construct_name
);
2136 ffesta_construct_name
= NULL
;
2138 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "DO", t
);
2139 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
2142 /* ffestb_do9_ -- "DO" [label] [,] var-expr EQUALS expr COMMA expr
2145 (ffestb_do9_) // to expression handler
2147 Make sure the statement has a valid form for the DO statement. If it
2148 does, implement the statement. */
2150 static ffelexHandler
2151 ffestb_do9_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
2153 switch (ffelex_token_type (t
))
2155 case FFELEX_typeEOS
:
2156 case FFELEX_typeSEMICOLON
:
2157 if ((expr
== NULL
) && (ft
!= NULL
))
2159 if (!ffesta_is_inhibited ())
2161 if (ffesta_tokens
[1] != NULL
)
2162 ffestc_R819A (ffesta_construct_name
, ffesta_tokens
[1],
2163 ffestb_local_
.do_stmt
.var
, ffesta_tokens
[2],
2164 ffestb_local_
.do_stmt
.start
, ffesta_tokens
[3],
2165 ffestb_local_
.do_stmt
.end
, ffesta_tokens
[4], expr
, ft
);
2167 ffestc_R820A (ffesta_construct_name
, ffestb_local_
.do_stmt
.var
,
2168 ffesta_tokens
[2], ffestb_local_
.do_stmt
.start
,
2169 ffesta_tokens
[3], ffestb_local_
.do_stmt
.end
,
2170 ffesta_tokens
[4], expr
, ft
);
2172 ffelex_token_kill (ffesta_tokens
[4]);
2173 ffelex_token_kill (ffesta_tokens
[3]);
2174 ffelex_token_kill (ffesta_tokens
[2]);
2175 if (ffesta_tokens
[1] != NULL
)
2176 ffelex_token_kill (ffesta_tokens
[1]);
2177 if (ffesta_construct_name
!= NULL
)
2179 ffelex_token_kill (ffesta_construct_name
);
2180 ffesta_construct_name
= NULL
;
2183 return (ffelexHandler
) ffesta_zero (t
);
2189 ffelex_token_kill (ffesta_tokens
[4]);
2190 ffelex_token_kill (ffesta_tokens
[3]);
2191 ffelex_token_kill (ffesta_tokens
[2]);
2192 if (ffesta_tokens
[1] != NULL
)
2193 ffelex_token_kill (ffesta_tokens
[1]);
2194 if (ffesta_construct_name
!= NULL
)
2196 ffelex_token_kill (ffesta_construct_name
);
2197 ffesta_construct_name
= NULL
;
2199 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "DO", t
);
2200 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
2203 /* ffestb_else -- Parse the ELSE statement
2205 return ffestb_else; // to lexer
2207 Make sure the statement has a valid form for the ELSE statement. If it
2208 does, implement the statement. */
2211 ffestb_else (ffelexToken t
)
2214 unsigned const char *p
;
2216 switch (ffelex_token_type (ffesta_tokens
[0]))
2218 case FFELEX_typeNAME
:
2219 if (ffesta_first_kw
!= FFESTR_firstELSE
)
2220 goto bad_0
; /* :::::::::::::::::::: */
2221 switch (ffelex_token_type (t
))
2223 case FFELEX_typeEOS
:
2224 case FFELEX_typeSEMICOLON
:
2225 ffesta_confirmed ();
2226 ffesta_tokens
[1] = NULL
;
2227 ffestb_args
.elsexyz
.second
= FFESTR_secondNone
;
2228 return (ffelexHandler
) ffestb_else1_ (t
);
2230 case FFELEX_typeCOMMA
:
2231 case FFELEX_typeCOLONCOLON
:
2232 ffesta_confirmed (); /* Error, but clearly intended. */
2233 goto bad_1
; /* :::::::::::::::::::: */
2236 goto bad_1
; /* :::::::::::::::::::: */
2238 case FFELEX_typeNAME
:
2242 ffesta_confirmed ();
2243 ffestb_args
.elsexyz
.second
= ffesta_second_kw
;
2244 ffesta_tokens
[1] = ffelex_token_use (t
);
2245 return (ffelexHandler
) ffestb_else1_
;
2247 case FFELEX_typeNAMES
:
2248 if (ffesta_first_kw
!= FFESTR_firstELSE
)
2249 goto bad_0
; /* :::::::::::::::::::: */
2250 switch (ffelex_token_type (t
))
2252 case FFELEX_typeCOMMA
:
2253 case FFELEX_typeCOLONCOLON
:
2254 ffesta_confirmed (); /* Error, but clearly intended. */
2255 goto bad_1
; /* :::::::::::::::::::: */
2258 goto bad_1
; /* :::::::::::::::::::: */
2260 case FFELEX_typeEOS
:
2261 case FFELEX_typeSEMICOLON
:
2264 ffesta_confirmed ();
2265 if (ffelex_token_length (ffesta_tokens
[0]) != FFESTR_firstlELSE
)
2267 p
= ffelex_token_text (ffesta_tokens
[0]) + (i
= FFESTR_firstlELSE
);
2268 if (!ffesrc_is_name_init (*p
))
2269 goto bad_i
; /* :::::::::::::::::::: */
2271 = ffelex_token_name_from_names (ffesta_tokens
[0], i
, 0);
2274 ffesta_tokens
[1] = NULL
;
2275 ffestb_args
.elsexyz
.second
= FFESTR_secondNone
;
2276 return (ffelexHandler
) ffestb_else1_ (t
);
2279 goto bad_0
; /* :::::::::::::::::::: */
2282 bad_0
: /* :::::::::::::::::::: */
2283 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "ELSE", ffesta_tokens
[0]);
2284 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
2286 bad_1
: /* :::::::::::::::::::: */
2287 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "ELSE", t
);
2288 return (ffelexHandler
) ffelex_swallow_tokens (t
,
2289 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
2291 bad_i
: /* :::::::::::::::::::: */
2292 ffesta_ffebad_1sp (FFEBAD_INVALID_STMT_FORM
, "ELSE", ffesta_tokens
[0], i
, t
);
2293 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
2296 /* ffestb_elsexyz -- Parse an ELSEIF/ELSEWHERE statement
2298 return ffestb_elsexyz; // to lexer
2300 Expects len and second to be set in ffestb_args.elsexyz to the length
2301 of the ELSExyz keyword involved and the corresponding ffestrSecond value. */
2304 ffestb_elsexyz (ffelexToken t
)
2309 switch (ffelex_token_type (ffesta_tokens
[0]))
2311 case FFELEX_typeNAME
:
2312 switch (ffelex_token_type (t
))
2314 case FFELEX_typeEOS
:
2315 case FFELEX_typeSEMICOLON
:
2316 if (ffesta_first_kw
== FFESTR_firstELSEIF
)
2317 goto bad_0
; /* :::::::::::::::::::: */
2318 ffesta_confirmed ();
2319 ffesta_tokens
[1] = NULL
;
2320 return (ffelexHandler
) ffestb_else1_ (t
);
2322 case FFELEX_typeNAME
:
2323 ffesta_confirmed ();
2324 goto bad_1
; /* :::::::::::::::::::: */
2326 case FFELEX_typeOPEN_PAREN
:
2327 if (ffesta_first_kw
!= FFESTR_firstELSEIF
)
2328 goto bad_0
; /* :::::::::::::::::::: */
2329 ffesta_tokens
[1] = NULL
;
2330 return (ffelexHandler
) ffestb_else1_ (t
);
2332 case FFELEX_typeCOMMA
:
2333 case FFELEX_typeCOLONCOLON
:
2334 ffesta_confirmed (); /* Error, but clearly intended. */
2335 goto bad_1
; /* :::::::::::::::::::: */
2338 goto bad_1
; /* :::::::::::::::::::: */
2341 case FFELEX_typeNAMES
:
2342 switch (ffelex_token_type (t
))
2344 case FFELEX_typeCOMMA
:
2345 case FFELEX_typeCOLONCOLON
:
2346 ffesta_confirmed (); /* Error, but clearly intended. */
2347 goto bad_1
; /* :::::::::::::::::::: */
2350 goto bad_1
; /* :::::::::::::::::::: */
2352 case FFELEX_typeOPEN_PAREN
:
2353 if (ffesta_first_kw
!= FFESTR_firstELSEIF
)
2354 goto bad_1
; /* :::::::::::::::::::: */
2355 if (ffelex_token_length (ffesta_tokens
[0]) != FFESTR_firstlELSEIF
)
2357 i
= FFESTR_firstlELSEIF
;
2358 goto bad_i
; /* :::::::::::::::::::: */
2360 ffesta_tokens
[1] = NULL
;
2361 return (ffelexHandler
) ffestb_else1_ (t
);
2363 case FFELEX_typeEOS
:
2364 case FFELEX_typeSEMICOLON
:
2367 ffesta_confirmed ();
2368 p
= ffelex_token_text (ffesta_tokens
[0]) + (i
= FFESTR_firstlELSE
);
2370 = ffelex_token_name_from_names (ffesta_tokens
[0], i
, 0);
2371 return (ffelexHandler
) ffestb_else1_ (t
);
2374 goto bad_0
; /* :::::::::::::::::::: */
2377 bad_0
: /* :::::::::::::::::::: */
2378 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "ELSE", ffesta_tokens
[0]);
2379 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
2381 bad_1
: /* :::::::::::::::::::: */
2382 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "ELSE", t
);
2383 return (ffelexHandler
) ffelex_swallow_tokens (t
,
2384 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
2386 bad_i
: /* :::::::::::::::::::: */
2387 ffesta_ffebad_1sp (FFEBAD_INVALID_STMT_FORM
, "ELSE IF", ffesta_tokens
[0], i
, t
);
2388 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
2391 /* ffestb_else1_ -- "ELSE" (NAME)
2393 return ffestb_else1_; // to lexer
2395 If EOS/SEMICOLON, implement the appropriate statement (keep in mind that
2396 "ELSE WHERE" is ambiguous at the syntactic level). If OPEN_PAREN, start
2397 expression analysis with callback at _2_. */
2399 static ffelexHandler
2400 ffestb_else1_ (ffelexToken t
)
2402 switch (ffelex_token_type (t
))
2404 case FFELEX_typeOPEN_PAREN
:
2405 if (ffestb_args
.elsexyz
.second
== FFESTR_secondIF
)
2407 if (ffesta_tokens
[1] != NULL
)
2408 ffelex_token_kill (ffesta_tokens
[1]);
2409 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
2410 FFEEXPR_contextIF
, (ffeexprCallback
) ffestb_else2_
);
2414 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "ELSE", t
);
2415 if (ffesta_tokens
[1] != NULL
)
2416 ffelex_token_kill (ffesta_tokens
[1]);
2417 return (ffelexHandler
) ffelex_swallow_tokens (t
,
2418 (ffelexHandler
) ffesta_zero
);
2420 case FFELEX_typeEOS
:
2421 case FFELEX_typeSEMICOLON
:
2422 ffesta_confirmed ();
2427 switch (ffestb_args
.elsexyz
.second
)
2431 if (!ffesta_is_inhibited ())
2432 ffestc_R805 (ffesta_tokens
[1]);
2436 if (ffesta_tokens
[1] != NULL
)
2437 ffelex_token_kill (ffesta_tokens
[1]);
2438 return (ffelexHandler
) ffesta_zero (t
);
2441 /* ffestb_else2_ -- "ELSE" "IF" OPEN_PAREN expr
2443 (ffestb_else2_) // to expression handler
2445 Make sure the next token is CLOSE_PAREN. */
2447 static ffelexHandler
2448 ffestb_else2_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
2450 ffestb_local_
.else_stmt
.expr
= expr
;
2452 switch (ffelex_token_type (t
))
2454 case FFELEX_typeCLOSE_PAREN
:
2457 ffesta_tokens
[1] = ffelex_token_use (ft
);
2458 ffelex_set_names (TRUE
);
2459 return (ffelexHandler
) ffestb_else3_
;
2465 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "ELSE IF", t
);
2466 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
2469 /* ffestb_else3_ -- "ELSE" "IF" OPEN_PAREN expr CLOSE_PAREN
2471 return ffestb_else3_; // to lexer
2473 Make sure the next token is "THEN". */
2475 static ffelexHandler
2476 ffestb_else3_ (ffelexToken t
)
2479 unsigned const char *p
;
2481 ffelex_set_names (FALSE
);
2483 switch (ffelex_token_type (t
))
2485 case FFELEX_typeNAME
:
2486 ffesta_confirmed ();
2487 if (ffestr_first (t
) == FFESTR_firstTHEN
)
2488 return (ffelexHandler
) ffestb_else4_
;
2491 case FFELEX_typeNAMES
:
2492 ffesta_confirmed ();
2493 if (ffestr_first (t
) != FFESTR_firstTHEN
)
2495 if (ffelex_token_length (t
) == FFESTR_firstlTHEN
)
2496 return (ffelexHandler
) ffestb_else4_
;
2497 p
= ffelex_token_text (t
) + (i
= FFESTR_firstlTHEN
);
2498 if (!ffesrc_is_name_init (*p
))
2499 goto bad_i
; /* :::::::::::::::::::: */
2500 ffesta_tokens
[2] = ffelex_token_name_from_names (t
, i
, 0);
2501 return (ffelexHandler
) ffestb_else5_
;
2507 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "ELSE IF", t
);
2508 ffelex_token_kill (ffesta_tokens
[1]);
2509 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
2511 bad_i
: /* :::::::::::::::::::: */
2512 ffesta_ffebad_1sp (FFEBAD_INVALID_STMT_FORM
, "ELSE IF", t
, i
, NULL
);
2513 ffelex_token_kill (ffesta_tokens
[1]);
2514 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
2517 /* ffestb_else4_ -- "ELSE" "IF" OPEN_PAREN expr CLOSE_PAREN "THEN"
2519 return ffestb_else4_; // to lexer
2521 Handle a NAME or EOS/SEMICOLON, then go to state _5_. */
2523 static ffelexHandler
2524 ffestb_else4_ (ffelexToken t
)
2526 ffelex_set_names (FALSE
);
2528 switch (ffelex_token_type (t
))
2530 case FFELEX_typeEOS
:
2531 case FFELEX_typeSEMICOLON
:
2532 ffesta_tokens
[2] = NULL
;
2533 return (ffelexHandler
) ffestb_else5_ (t
);
2535 case FFELEX_typeNAME
:
2536 ffesta_tokens
[2] = ffelex_token_use (t
);
2537 return (ffelexHandler
) ffestb_else5_
;
2543 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "ELSE IF", t
);
2544 ffelex_token_kill (ffesta_tokens
[1]);
2545 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
2548 /* ffestb_else5_ -- "ELSE" "IF" OPEN_PAREN expr CLOSE_PAREN "THEN"
2550 return ffestb_else5_; // to lexer
2552 Make sure the next token is EOS or SEMICOLON; implement R804. */
2554 static ffelexHandler
2555 ffestb_else5_ (ffelexToken t
)
2557 switch (ffelex_token_type (t
))
2559 case FFELEX_typeEOS
:
2560 case FFELEX_typeSEMICOLON
:
2561 if (!ffesta_is_inhibited ())
2562 ffestc_R804 (ffestb_local_
.else_stmt
.expr
, ffesta_tokens
[1],
2564 ffelex_token_kill (ffesta_tokens
[1]);
2565 if (ffesta_tokens
[2] != NULL
)
2566 ffelex_token_kill (ffesta_tokens
[2]);
2567 return (ffelexHandler
) ffesta_zero (t
);
2573 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "ELSE IF", t
);
2574 ffelex_token_kill (ffesta_tokens
[1]);
2575 if (ffesta_tokens
[2] != NULL
)
2576 ffelex_token_kill (ffesta_tokens
[2]);
2577 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
2580 /* ffestb_end -- Parse the END statement
2582 return ffestb_end; // to lexer
2584 Make sure the statement has a valid form for the END statement. If it
2585 does, implement the statement. */
2588 ffestb_end (ffelexToken t
)
2592 switch (ffelex_token_type (ffesta_tokens
[0]))
2594 case FFELEX_typeNAME
:
2595 if (ffesta_first_kw
!= FFESTR_firstEND
)
2596 goto bad_0
; /* :::::::::::::::::::: */
2597 switch (ffelex_token_type (t
))
2599 case FFELEX_typeEOS
:
2600 case FFELEX_typeSEMICOLON
:
2601 ffesta_tokens
[1] = NULL
;
2602 ffestb_args
.endxyz
.second
= FFESTR_secondNone
;
2603 return (ffelexHandler
) ffestb_end3_ (t
);
2605 case FFELEX_typeCOMMA
:
2606 case FFELEX_typeCOLONCOLON
:
2607 ffesta_confirmed (); /* Error, but clearly intended. */
2608 goto bad_1
; /* :::::::::::::::::::: */
2611 goto bad_1
; /* :::::::::::::::::::: */
2613 case FFELEX_typeNAME
:
2617 ffesta_confirmed ();
2618 ffestb_args
.endxyz
.second
= ffesta_second_kw
;
2619 switch (ffesta_second_kw
)
2621 case FFESTR_secondFILE
:
2622 ffestb_args
.beru
.badname
= "ENDFILE";
2623 return (ffelexHandler
) ffestb_beru
;
2625 case FFESTR_secondBLOCK
:
2626 return (ffelexHandler
) ffestb_end1_
;
2628 case FFESTR_secondNone
:
2629 goto bad_1
; /* :::::::::::::::::::: */
2632 return (ffelexHandler
) ffestb_end2_
;
2635 case FFELEX_typeNAMES
:
2636 if (ffesta_first_kw
!= FFESTR_firstEND
)
2637 goto bad_0
; /* :::::::::::::::::::: */
2638 switch (ffelex_token_type (t
))
2640 case FFELEX_typeCOMMA
:
2641 case FFELEX_typeCOLONCOLON
:
2642 ffesta_confirmed (); /* Error, but clearly intended. */
2643 goto bad_1
; /* :::::::::::::::::::: */
2646 goto bad_1
; /* :::::::::::::::::::: */
2648 case FFELEX_typeEOS
:
2649 case FFELEX_typeSEMICOLON
:
2652 ffesta_confirmed ();
2653 if (ffelex_token_length (ffesta_tokens
[0]) != FFESTR_firstlEND
)
2655 i
= FFESTR_firstlEND
;
2656 goto bad_i
; /* :::::::::::::::::::: */
2658 ffesta_tokens
[1] = NULL
;
2659 ffestb_args
.endxyz
.second
= FFESTR_secondNone
;
2660 return (ffelexHandler
) ffestb_end3_ (t
);
2663 goto bad_0
; /* :::::::::::::::::::: */
2666 bad_0
: /* :::::::::::::::::::: */
2667 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "END", ffesta_tokens
[0]);
2668 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
2670 bad_1
: /* :::::::::::::::::::: */
2671 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "END", t
);
2672 return (ffelexHandler
) ffelex_swallow_tokens (t
,
2673 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
2675 bad_i
: /* :::::::::::::::::::: */
2676 ffesta_ffebad_1sp (FFEBAD_INVALID_STMT_FORM
, "END", ffesta_tokens
[0], i
, t
);
2677 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
2680 /* ffestb_endxyz -- Parse an ENDxyz statement
2682 return ffestb_endxyz; // to lexer
2684 Expects len and second to be set in ffestb_args.endxyz to the length
2685 of the ENDxyz keyword involved and the corresponding ffestrSecond value. */
2688 ffestb_endxyz (ffelexToken t
)
2691 unsigned const char *p
;
2693 switch (ffelex_token_type (ffesta_tokens
[0]))
2695 case FFELEX_typeNAME
:
2696 switch (ffelex_token_type (t
))
2698 case FFELEX_typeEOS
:
2699 case FFELEX_typeSEMICOLON
:
2700 ffesta_confirmed ();
2701 ffesta_tokens
[1] = NULL
;
2702 return (ffelexHandler
) ffestb_end3_ (t
);
2704 case FFELEX_typeNAME
:
2705 ffesta_confirmed ();
2706 switch (ffestb_args
.endxyz
.second
)
2708 case FFESTR_secondBLOCK
:
2709 if (ffesta_second_kw
!= FFESTR_secondDATA
)
2710 goto bad_1
; /* :::::::::::::::::::: */
2711 return (ffelexHandler
) ffestb_end2_
;
2714 return (ffelexHandler
) ffestb_end2_ (t
);
2717 case FFELEX_typeCOMMA
:
2718 case FFELEX_typeCOLONCOLON
:
2719 ffesta_confirmed (); /* Error, but clearly intended. */
2720 goto bad_1
; /* :::::::::::::::::::: */
2723 goto bad_1
; /* :::::::::::::::::::: */
2726 case FFELEX_typeNAMES
:
2727 switch (ffelex_token_type (t
))
2729 case FFELEX_typeCOMMA
:
2730 case FFELEX_typeCOLONCOLON
:
2731 ffesta_confirmed (); /* Error, but clearly intended. */
2732 goto bad_1
; /* :::::::::::::::::::: */
2735 goto bad_1
; /* :::::::::::::::::::: */
2737 case FFELEX_typeEOS
:
2738 case FFELEX_typeSEMICOLON
:
2741 ffesta_confirmed ();
2742 if (ffestb_args
.endxyz
.second
== FFESTR_secondBLOCK
)
2744 i
= FFESTR_firstlEND
;
2745 goto bad_i
; /* :::::::::::::::::::: */
2747 if (ffelex_token_length (ffesta_tokens
[0]) != ffestb_args
.endxyz
.len
)
2749 p
= ffelex_token_text (ffesta_tokens
[0])
2750 + (i
= ffestb_args
.endxyz
.len
);
2751 if (!ffesrc_is_name_init (*p
))
2752 goto bad_i
; /* :::::::::::::::::::: */
2754 = ffelex_token_name_from_names (ffesta_tokens
[0], i
, 0);
2755 return (ffelexHandler
) ffestb_end3_ (t
);
2757 ffesta_tokens
[1] = NULL
;
2758 return (ffelexHandler
) ffestb_end3_ (t
);
2761 goto bad_0
; /* :::::::::::::::::::: */
2764 bad_0
: /* :::::::::::::::::::: */
2765 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "END", ffesta_tokens
[0]);
2766 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
2768 bad_1
: /* :::::::::::::::::::: */
2769 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "END", t
);
2770 return (ffelexHandler
) ffelex_swallow_tokens (t
,
2771 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
2773 bad_i
: /* :::::::::::::::::::: */
2774 ffesta_ffebad_1sp (FFEBAD_INVALID_STMT_FORM
, "END", ffesta_tokens
[0], i
, t
);
2775 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
2778 /* ffestb_end1_ -- "END" "BLOCK"
2780 return ffestb_end1_; // to lexer
2782 Make sure the next token is "DATA". */
2784 static ffelexHandler
2785 ffestb_end1_ (ffelexToken t
)
2787 if ((ffelex_token_type (t
) == FFELEX_typeNAME
)
2788 && (ffesrc_strcmp_2c (ffe_case_match (), ffelex_token_text (t
), "DATA",
2792 return (ffelexHandler
) ffestb_end2_
;
2795 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "END", t
);
2796 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
2799 /* ffestb_end2_ -- "END" <unit-kind>
2801 return ffestb_end2_; // to lexer
2803 Make sure the next token is a NAME or EOS. */
2805 static ffelexHandler
2806 ffestb_end2_ (ffelexToken t
)
2808 switch (ffelex_token_type (t
))
2810 case FFELEX_typeNAME
:
2811 ffesta_tokens
[1] = ffelex_token_use (t
);
2812 return (ffelexHandler
) ffestb_end3_
;
2814 case FFELEX_typeEOS
:
2815 case FFELEX_typeSEMICOLON
:
2816 ffesta_tokens
[1] = NULL
;
2817 return (ffelexHandler
) ffestb_end3_ (t
);
2820 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "END", t
);
2821 return (ffelexHandler
) ffelex_swallow_tokens (t
,
2822 (ffelexHandler
) ffesta_zero
);
2826 /* ffestb_end3_ -- "END" <unit-kind> (NAME)
2828 return ffestb_end3_; // to lexer
2830 Make sure the next token is an EOS, then implement the statement. */
2832 static ffelexHandler
2833 ffestb_end3_ (ffelexToken t
)
2835 switch (ffelex_token_type (t
))
2838 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "END", t
);
2839 if (ffesta_tokens
[1] != NULL
)
2840 ffelex_token_kill (ffesta_tokens
[1]);
2841 return (ffelexHandler
) ffelex_swallow_tokens (t
,
2842 (ffelexHandler
) ffesta_zero
);
2844 case FFELEX_typeEOS
:
2845 case FFELEX_typeSEMICOLON
:
2846 ffesta_confirmed ();
2847 if (ffestb_args
.endxyz
.second
== FFESTR_secondNone
)
2849 if (!ffesta_is_inhibited ())
2851 return (ffelexHandler
) ffesta_zero (t
);
2856 switch (ffestb_args
.endxyz
.second
)
2858 case FFESTR_secondIF
:
2859 if (!ffesta_is_inhibited ())
2860 ffestc_R806 (ffesta_tokens
[1]);
2863 case FFESTR_secondSELECT
:
2864 if (!ffesta_is_inhibited ())
2865 ffestc_R811 (ffesta_tokens
[1]);
2868 case FFESTR_secondDO
:
2869 if (!ffesta_is_inhibited ())
2870 ffestc_R825 (ffesta_tokens
[1]);
2873 case FFESTR_secondPROGRAM
:
2874 if (!ffesta_is_inhibited ())
2875 ffestc_R1103 (ffesta_tokens
[1]);
2878 case FFESTR_secondBLOCK
:
2879 case FFESTR_secondBLOCKDATA
:
2880 if (!ffesta_is_inhibited ())
2881 ffestc_R1112 (ffesta_tokens
[1]);
2884 case FFESTR_secondFUNCTION
:
2885 if (!ffesta_is_inhibited ())
2886 ffestc_R1221 (ffesta_tokens
[1]);
2889 case FFESTR_secondSUBROUTINE
:
2890 if (!ffesta_is_inhibited ())
2891 ffestc_R1225 (ffesta_tokens
[1]);
2895 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "END", ffesta_tokens
[0]);
2896 if (ffesta_tokens
[1] != NULL
)
2897 ffelex_token_kill (ffesta_tokens
[1]);
2898 return (ffelexHandler
) ffelex_swallow_tokens (t
,
2899 (ffelexHandler
) ffesta_zero
);
2902 if (ffesta_tokens
[1] != NULL
)
2903 ffelex_token_kill (ffesta_tokens
[1]);
2904 return (ffelexHandler
) ffesta_zero (t
);
2907 /* ffestb_goto -- Parse the GOTO statement
2909 return ffestb_goto; // to lexer
2911 Make sure the statement has a valid form for the GOTO statement. If it
2912 does, implement the statement. */
2915 ffestb_goto (ffelexToken t
)
2918 unsigned const char *p
;
2922 switch (ffelex_token_type (ffesta_tokens
[0]))
2924 case FFELEX_typeNAME
:
2925 switch (ffesta_first_kw
)
2927 case FFESTR_firstGO
:
2928 if ((ffelex_token_type (t
) != FFELEX_typeNAME
)
2929 || (ffesta_second_kw
!= FFESTR_secondTO
))
2930 goto bad_1
; /* :::::::::::::::::::: */
2931 ffesta_confirmed ();
2932 return (ffelexHandler
) ffestb_goto1_
;
2934 case FFESTR_firstGOTO
:
2935 return (ffelexHandler
) ffestb_goto1_ (t
);
2938 goto bad_0
; /* :::::::::::::::::::: */
2941 case FFELEX_typeNAMES
:
2942 if (ffesta_first_kw
!= FFESTR_firstGOTO
)
2943 goto bad_0
; /* :::::::::::::::::::: */
2944 switch (ffelex_token_type (t
))
2946 case FFELEX_typeCOLONCOLON
:
2947 ffesta_confirmed (); /* Error, but clearly intended. */
2948 goto bad_1
; /* :::::::::::::::::::: */
2951 goto bad_1
; /* :::::::::::::::::::: */
2953 case FFELEX_typeOPEN_PAREN
:
2954 case FFELEX_typePERCENT
: /* Since GOTO I%J is apparently valid
2956 case FFELEX_typeCOMMA
:
2959 case FFELEX_typeEOS
:
2960 case FFELEX_typeSEMICOLON
:
2961 ffesta_confirmed ();
2964 if (ffelex_token_length (ffesta_tokens
[0]) != FFESTR_firstlGOTO
)
2966 p
= ffelex_token_text (ffesta_tokens
[0]) + (i
= FFESTR_firstlGOTO
);
2969 nt
= ffelex_token_number_from_names (ffesta_tokens
[0], i
);
2970 p
+= ffelex_token_length (nt
);
2971 i
+= ffelex_token_length (nt
);
2974 ffelex_token_kill (nt
);
2975 goto bad_i
; /* :::::::::::::::::::: */
2978 else if (ffesrc_is_name_init (*p
))
2980 nt
= ffelex_token_name_from_names (ffesta_tokens
[0], i
, 0);
2983 goto bad_i
; /* :::::::::::::::::::: */
2984 next
= (ffelexHandler
) ffestb_goto1_ (nt
);
2985 ffelex_token_kill (nt
);
2986 return (ffelexHandler
) (*next
) (t
);
2988 return (ffelexHandler
) ffestb_goto1_ (t
);
2991 goto bad_0
; /* :::::::::::::::::::: */
2994 bad_0
: /* :::::::::::::::::::: */
2995 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "GO TO", ffesta_tokens
[0]);
2996 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
2998 bad_1
: /* :::::::::::::::::::: */
2999 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "GO TO", t
);
3000 return (ffelexHandler
) ffelex_swallow_tokens (t
,
3001 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
3003 bad_i
: /* :::::::::::::::::::: */
3004 ffesta_ffebad_1sp (FFEBAD_INVALID_STMT_FORM
, "GO TO", ffesta_tokens
[0], i
, t
);
3005 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
3008 /* ffestb_goto1_ -- "GOTO" or "GO" "TO"
3010 return ffestb_goto1_; // to lexer
3012 Make sure the statement has a valid form for the GOTO statement. If it
3013 does, implement the statement. */
3015 static ffelexHandler
3016 ffestb_goto1_ (ffelexToken t
)
3018 switch (ffelex_token_type (t
))
3020 case FFELEX_typeNUMBER
:
3021 if (ffelex_token_type (ffesta_tokens
[0]) == FFELEX_typeNAME
)
3022 ffesta_confirmed ();
3023 ffesta_tokens
[1] = ffelex_token_use (t
);
3024 return (ffelexHandler
) ffestb_goto2_
;
3026 case FFELEX_typeOPEN_PAREN
:
3027 ffesta_tokens
[1] = ffelex_token_use (t
);
3028 ffestb_subrargs_
.label_list
.labels
= ffestt_tokenlist_create ();
3029 ffestb_subrargs_
.label_list
.handler
= (ffelexHandler
) ffestb_goto3_
;
3030 return (ffelexHandler
) ffestb_subr_label_list_
;
3032 case FFELEX_typeNAME
:
3033 if (ffelex_token_type (ffesta_tokens
[0]) == FFELEX_typeNAME
)
3034 ffesta_confirmed ();
3035 return (ffelexHandler
) (*((ffelexHandler
)
3036 ffeexpr_lhs (ffesta_output_pool
,
3037 FFEEXPR_contextAGOTO
,
3038 (ffeexprCallback
) ffestb_goto4_
)))
3041 case FFELEX_typeEOS
:
3042 case FFELEX_typeSEMICOLON
:
3043 case FFELEX_typeCOMMA
:
3044 case FFELEX_typeCOLONCOLON
:
3045 ffesta_confirmed (); /* Error, but clearly intended. */
3052 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "GO TO", t
);
3053 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
3056 /* ffestb_goto2_ -- "GO/TO" NUMBER
3058 return ffestb_goto2_; // to lexer
3060 Make sure the statement has a valid form for the GOTO statement. If it
3061 does, implement the statement. */
3063 static ffelexHandler
3064 ffestb_goto2_ (ffelexToken t
)
3066 switch (ffelex_token_type (t
))
3068 case FFELEX_typeEOS
:
3069 case FFELEX_typeSEMICOLON
:
3070 ffesta_confirmed ();
3071 if (!ffesta_is_inhibited ())
3072 ffestc_R836 (ffesta_tokens
[1]);
3073 ffelex_token_kill (ffesta_tokens
[1]);
3074 return (ffelexHandler
) ffesta_zero (t
);
3080 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "GO TO", t
);
3081 ffelex_token_kill (ffesta_tokens
[1]);
3082 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
3085 /* ffestb_goto3_ -- "GO/TO" OPEN_PAREN label-list CLOSE_PAREN
3087 return ffestb_goto3_; // to lexer
3089 Make sure the statement has a valid form for the GOTO statement. If it
3090 does, implement the statement. */
3092 static ffelexHandler
3093 ffestb_goto3_ (ffelexToken t
)
3095 if (!ffestb_subrargs_
.label_list
.ok
)
3096 goto bad
; /* :::::::::::::::::::: */
3098 switch (ffelex_token_type (t
))
3100 case FFELEX_typeCOMMA
:
3101 ffesta_confirmed ();
3102 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
, FFEEXPR_contextCGOTO
,
3103 (ffeexprCallback
) ffestb_goto5_
);
3105 case FFELEX_typeEQUALS
:
3106 case FFELEX_typePOINTS
:
3107 case FFELEX_typeEOS
:
3108 case FFELEX_typeSEMICOLON
:
3112 ffesta_confirmed ();
3114 case FFELEX_typeOPEN_PAREN
: /* Could still be assignment!! */
3115 return (ffelexHandler
) (*((ffelexHandler
)
3116 ffeexpr_rhs (ffesta_output_pool
, FFEEXPR_contextCGOTO
,
3117 (ffeexprCallback
) ffestb_goto5_
)))
3121 bad
: /* :::::::::::::::::::: */
3122 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "computed-GOTO", t
);
3123 ffelex_token_kill (ffesta_tokens
[1]);
3124 ffestt_tokenlist_kill (ffestb_subrargs_
.label_list
.labels
);
3125 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
3128 /* ffestb_goto4_ -- "GO/TO" expr
3130 (ffestb_goto4_) // to expression handler
3132 Make sure the statement has a valid form for the GOTO statement. If it
3133 does, implement the statement. */
3135 static ffelexHandler
3136 ffestb_goto4_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
3138 switch (ffelex_token_type (t
))
3140 case FFELEX_typeCOMMA
:
3141 ffesta_confirmed ();
3144 ffesta_tokens
[1] = ffelex_token_use (ft
);
3145 ffestb_local_
.go_to
.expr
= expr
;
3146 return (ffelexHandler
) ffestb_goto6_
;
3148 case FFELEX_typeOPEN_PAREN
:
3151 ffesta_tokens
[1] = ffelex_token_use (ft
);
3152 ffestb_local_
.go_to
.expr
= expr
;
3153 return (ffelexHandler
) ffestb_goto6_ (t
);
3155 case FFELEX_typeEOS
:
3156 case FFELEX_typeSEMICOLON
:
3157 ffesta_confirmed ();
3160 if (!ffesta_is_inhibited ())
3161 ffestc_R839 (expr
, ft
, NULL
);
3162 return (ffelexHandler
) ffesta_zero (t
);
3168 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "assigned-GOTO", t
);
3169 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
3172 /* ffestb_goto5_ -- "GO/TO" OPEN_PAREN label-list CLOSE_PAREN (COMMA) expr
3174 (ffestb_goto5_) // to expression handler
3176 Make sure the statement has a valid form for the GOTO statement. If it
3177 does, implement the statement. */
3179 static ffelexHandler
3180 ffestb_goto5_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
3182 switch (ffelex_token_type (t
))
3184 case FFELEX_typeEOS
:
3185 case FFELEX_typeSEMICOLON
:
3188 ffesta_confirmed ();
3189 if (!ffesta_is_inhibited ())
3190 ffestc_R837 (ffestb_subrargs_
.label_list
.labels
, expr
, ft
);
3191 ffelex_token_kill (ffesta_tokens
[1]);
3192 ffestt_tokenlist_kill (ffestb_subrargs_
.label_list
.labels
);
3193 return (ffelexHandler
) ffesta_zero (t
);
3199 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "computed-GOTO", t
);
3200 ffelex_token_kill (ffesta_tokens
[1]);
3201 ffestt_tokenlist_kill (ffestb_subrargs_
.label_list
.labels
);
3202 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
3205 /* ffestb_goto6_ -- "GO/TO" expr (COMMA)
3207 return ffestb_goto6_; // to lexer
3209 Make sure the statement has a valid form for the GOTO statement. If it
3210 does, implement the statement. */
3212 static ffelexHandler
3213 ffestb_goto6_ (ffelexToken t
)
3215 switch (ffelex_token_type (t
))
3217 case FFELEX_typeOPEN_PAREN
:
3218 ffesta_tokens
[2] = ffelex_token_use (t
);
3219 ffestb_subrargs_
.label_list
.labels
= ffestt_tokenlist_create ();
3220 ffestb_subrargs_
.label_list
.handler
= (ffelexHandler
) ffestb_goto7_
;
3221 return (ffelexHandler
) ffestb_subr_label_list_
;
3227 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "assigned-GOTO", t
);
3228 ffelex_token_kill (ffesta_tokens
[1]);
3229 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
3232 /* ffestb_goto7_ -- "GO/TO" expr (COMMA) OPEN_PAREN label-list CLOSE_PAREN
3234 return ffestb_goto7_; // to lexer
3236 Make sure the statement has a valid form for the GOTO statement. If it
3237 does, implement the statement. */
3239 static ffelexHandler
3240 ffestb_goto7_ (ffelexToken t
)
3242 if (!ffestb_subrargs_
.label_list
.ok
)
3243 goto bad
; /* :::::::::::::::::::: */
3245 switch (ffelex_token_type (t
))
3247 case FFELEX_typeEOS
:
3248 case FFELEX_typeSEMICOLON
:
3249 ffesta_confirmed ();
3250 if (!ffesta_is_inhibited ())
3251 ffestc_R839 (ffestb_local_
.go_to
.expr
, ffesta_tokens
[1],
3252 ffestb_subrargs_
.label_list
.labels
);
3253 ffelex_token_kill (ffesta_tokens
[1]);
3254 ffelex_token_kill (ffesta_tokens
[2]);
3255 ffestt_tokenlist_kill (ffestb_subrargs_
.label_list
.labels
);
3256 return (ffelexHandler
) ffesta_zero (t
);
3262 bad
: /* :::::::::::::::::::: */
3263 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "assigned-GOTO", t
);
3264 ffelex_token_kill (ffesta_tokens
[1]);
3265 ffelex_token_kill (ffesta_tokens
[2]);
3266 ffestt_tokenlist_kill (ffestb_subrargs_
.label_list
.labels
);
3267 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
3270 /* ffestb_halt -- Parse the STOP/PAUSE statement
3272 return ffestb_halt; // to lexer
3274 Make sure the statement has a valid form for the STOP/PAUSE statement. If
3275 it does, implement the statement. */
3278 ffestb_halt (ffelexToken t
)
3282 switch (ffelex_token_type (ffesta_tokens
[0]))
3284 case FFELEX_typeNAME
:
3285 switch (ffelex_token_type (t
))
3287 case FFELEX_typeCOMMA
:
3288 case FFELEX_typeCOLONCOLON
:
3289 ffesta_confirmed (); /* Error, but clearly intended. */
3290 goto bad_1
; /* :::::::::::::::::::: */
3293 goto bad_1
; /* :::::::::::::::::::: */
3295 case FFELEX_typeEOS
:
3296 case FFELEX_typeSEMICOLON
:
3297 case FFELEX_typeNAME
:
3298 case FFELEX_typeNUMBER
:
3299 case FFELEX_typeAPOSTROPHE
:
3300 case FFELEX_typeQUOTE
:
3301 ffesta_confirmed ();
3305 return (ffelexHandler
) (*((ffelexHandler
)
3306 ffeexpr_rhs (ffesta_output_pool
,
3307 FFEEXPR_contextSTOP
,
3308 (ffeexprCallback
) ffestb_halt1_
)))
3311 case FFELEX_typeNAMES
:
3312 switch (ffelex_token_type (t
))
3315 goto bad_1
; /* :::::::::::::::::::: */
3317 case FFELEX_typeEOS
:
3318 case FFELEX_typeSEMICOLON
:
3319 case FFELEX_typeNAME
:
3320 case FFELEX_typeNUMBER
:
3321 case FFELEX_typeAPOSTROPHE
:
3322 case FFELEX_typeQUOTE
:
3323 ffesta_confirmed ();
3326 next
= (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
3327 FFEEXPR_contextSTOP
,
3328 (ffeexprCallback
) ffestb_halt1_
);
3329 next
= (ffelexHandler
) ffelex_splice_tokens (next
, ffesta_tokens
[0],
3330 ffestb_args
.halt
.len
);
3332 return (ffelexHandler
) ffelex_swallow_tokens (t
,
3333 (ffelexHandler
) ffesta_zero
);
3334 return (ffelexHandler
) (*next
) (t
);
3337 goto bad_0
; /* :::::::::::::::::::: */
3340 bad_0
: /* :::::::::::::::::::: */
3341 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
,
3342 (ffesta_first_kw
== FFESTR_firstSTOP
)
3345 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
3347 bad_1
: /* :::::::::::::::::::: */
3348 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
,
3349 (ffesta_first_kw
== FFESTR_firstSTOP
)
3352 return (ffelexHandler
) ffelex_swallow_tokens (t
,
3353 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
3356 /* ffestb_halt1_ -- "STOP/PAUSE" expr
3358 (ffestb_halt1_) // to expression handler
3360 Make sure the next token is an EOS or SEMICOLON. */
3362 static ffelexHandler
3363 ffestb_halt1_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
3365 switch (ffelex_token_type (t
))
3367 case FFELEX_typeEOS
:
3368 case FFELEX_typeSEMICOLON
:
3369 ffesta_confirmed ();
3370 if (!ffesta_is_inhibited ())
3372 if (ffesta_first_kw
== FFESTR_firstSTOP
)
3373 ffestc_R842 (expr
, ft
);
3375 ffestc_R843 (expr
, ft
);
3377 return (ffelexHandler
) ffesta_zero (t
);
3380 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
,
3381 (ffesta_first_kw
== FFESTR_firstSTOP
)
3387 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
3390 /* ffestb_if -- Parse an IF statement
3392 return ffestb_if; // to lexer
3394 Make sure the statement has a valid form for an IF statement.
3395 If it does, implement the statement. */
3398 ffestb_if (ffelexToken t
)
3400 switch (ffelex_token_type (ffesta_tokens
[0]))
3402 case FFELEX_typeNAME
:
3403 if (ffesta_first_kw
!= FFESTR_firstIF
)
3404 goto bad_0
; /* :::::::::::::::::::: */
3407 case FFELEX_typeNAMES
:
3408 if (ffesta_first_kw
!= FFESTR_firstIF
)
3409 goto bad_0
; /* :::::::::::::::::::: */
3410 if (ffelex_token_length (ffesta_tokens
[0]) != FFESTR_firstlIF
)
3411 goto bad_0
; /* :::::::::::::::::::: */
3415 goto bad_0
; /* :::::::::::::::::::: */
3418 switch (ffelex_token_type (t
))
3420 case FFELEX_typeOPEN_PAREN
:
3423 case FFELEX_typeEOS
:
3424 case FFELEX_typeSEMICOLON
:
3425 case FFELEX_typeCOMMA
:
3426 case FFELEX_typeCOLONCOLON
:
3427 ffesta_confirmed (); /* Error, but clearly intended. */
3428 goto bad_1
; /* :::::::::::::::::::: */
3431 goto bad_1
; /* :::::::::::::::::::: */
3434 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
, FFEEXPR_contextIF
,
3435 (ffeexprCallback
) ffestb_if1_
);
3437 bad_0
: /* :::::::::::::::::::: */
3438 if (ffesta_construct_name
!= NULL
)
3440 ffelex_token_kill (ffesta_construct_name
);
3441 ffesta_construct_name
= NULL
;
3443 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "IF", ffesta_tokens
[0]);
3444 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
3446 bad_1
: /* :::::::::::::::::::: */
3447 if (ffesta_construct_name
!= NULL
)
3449 ffelex_token_kill (ffesta_construct_name
);
3450 ffesta_construct_name
= NULL
;
3452 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "IF", t
);
3453 return (ffelexHandler
) ffelex_swallow_tokens (t
,
3454 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
3457 /* ffestb_if1_ -- "IF" OPEN_PAREN expr
3459 (ffestb_if1_) // to expression handler
3461 Make sure the next token is CLOSE_PAREN. */
3463 static ffelexHandler
3464 ffestb_if1_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
3466 ffestb_local_
.if_stmt
.expr
= expr
;
3468 switch (ffelex_token_type (t
))
3470 case FFELEX_typeCLOSE_PAREN
:
3473 ffesta_tokens
[1] = ffelex_token_use (ft
);
3474 ffelex_set_names (TRUE
);
3475 return (ffelexHandler
) ffestb_if2_
;
3481 if (ffesta_construct_name
!= NULL
)
3483 ffelex_token_kill (ffesta_construct_name
);
3484 ffesta_construct_name
= NULL
;
3486 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "IF", t
);
3487 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
3490 /* ffestb_if2_ -- "IF" OPEN_PAREN expr CLOSE_PAREN
3492 return ffestb_if2_; // to lexer
3494 Make sure the next token is NAME. */
3496 static ffelexHandler
3497 ffestb_if2_ (ffelexToken t
)
3499 ffelex_set_names (FALSE
);
3501 switch (ffelex_token_type (t
))
3503 case FFELEX_typeNAME
:
3504 case FFELEX_typeNAMES
:
3505 ffesta_confirmed ();
3506 ffesta_tokens
[2] = ffelex_token_use (t
);
3507 return (ffelexHandler
) ffestb_if3_
;
3513 ffelex_token_kill (ffesta_tokens
[1]);
3514 if ((ffesta_construct_name
== NULL
)
3515 || (ffelex_token_type (t
) != FFELEX_typeNUMBER
))
3516 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "IF", t
);
3518 ffesta_ffebad_2st (FFEBAD_INVALID_STMT_FORM
, "CONSTRUCT",
3519 ffesta_construct_name
, t
);
3520 if (ffesta_construct_name
!= NULL
)
3522 ffelex_token_kill (ffesta_construct_name
);
3523 ffesta_construct_name
= NULL
;
3525 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
3528 /* ffestb_if3_ -- "IF" OPEN_PAREN expr CLOSE_PAREN NAME
3530 return ffestb_if3_; // to lexer
3532 If the next token is EOS or SEMICOLON and the preceding NAME was "THEN",
3533 implement R803. Else, implement R807 and send the preceding NAME followed
3534 by the current token. */
3536 static ffelexHandler
3537 ffestb_if3_ (ffelexToken t
)
3541 switch (ffelex_token_type (t
))
3543 case FFELEX_typeEOS
:
3544 case FFELEX_typeSEMICOLON
:
3545 if (ffestr_first (ffesta_tokens
[2]) == FFESTR_firstTHEN
)
3547 if (!ffesta_is_inhibited ())
3548 ffestc_R803 (ffesta_construct_name
, ffestb_local_
.if_stmt
.expr
,
3550 ffelex_token_kill (ffesta_tokens
[1]);
3551 ffelex_token_kill (ffesta_tokens
[2]);
3552 if (ffesta_construct_name
!= NULL
)
3554 ffelex_token_kill (ffesta_construct_name
);
3555 ffesta_construct_name
= NULL
;
3557 return (ffelexHandler
) ffesta_zero (t
);
3565 if (ffesta_construct_name
!= NULL
)
3567 if (!ffesta_is_inhibited ())
3568 ffesta_ffebad_2st (FFEBAD_INVALID_STMT_FORM
, "CONSTRUCT",
3569 ffesta_construct_name
, ffesta_tokens
[2]);
3570 ffelex_token_kill (ffesta_construct_name
);
3571 ffesta_construct_name
= NULL
;
3572 ffelex_token_kill (ffesta_tokens
[1]);
3573 ffelex_token_kill (ffesta_tokens
[2]);
3574 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
3577 if (!ffesta_is_inhibited ())
3578 ffestc_R807 (ffestb_local_
.if_stmt
.expr
, ffesta_tokens
[1]);
3579 ffelex_token_kill (ffesta_tokens
[1]);
3581 ffelexToken my_2
= ffesta_tokens
[2];
3583 next
= (ffelexHandler
) ffesta_two (my_2
, t
);
3584 ffelex_token_kill (my_2
);
3586 return (ffelexHandler
) next
;
3589 /* ffestb_let -- Parse an assignment statement
3591 return ffestb_let; // to lexer
3593 Make sure the statement has a valid form for an assignment statement. If
3594 it does, implement the statement. */
3597 ffestb_let (ffelexToken t
)
3600 bool vxtparam
; /* TRUE if it might really be a VXT PARAMETER
3602 unsigned const char *p
;
3604 switch (ffelex_token_type (ffesta_tokens
[0]))
3606 case FFELEX_typeNAME
:
3610 case FFELEX_typeNAMES
:
3615 goto bad_0
; /* :::::::::::::::::::: */
3618 switch (ffelex_token_type (t
))
3620 case FFELEX_typeOPEN_PAREN
:
3621 case FFELEX_typePERCENT
:
3622 case FFELEX_typePOINTS
:
3623 ffestb_local_
.let
.vxtparam
= FALSE
;
3626 case FFELEX_typeEQUALS
:
3627 if (!vxtparam
|| (ffesta_first_kw
!= FFESTR_firstPARAMETER
))
3629 ffestb_local_
.let
.vxtparam
= FALSE
;
3632 p
= ffelex_token_text (ffesta_tokens
[0]) + FFESTR_firstlPARAMETER
;
3633 ffestb_local_
.let
.vxtparam
= ffesrc_is_name_init (*p
);
3637 goto bad_1
; /* :::::::::::::::::::: */
3640 next
= (ffelexHandler
) (*((ffelexHandler
)
3641 ffeexpr_lhs (ffesta_output_pool
,
3643 (ffeexprCallback
) ffestb_let1_
)))
3645 return (ffelexHandler
) (*next
) (t
);
3647 bad_0
: /* :::::::::::::::::::: */
3648 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "assignment", ffesta_tokens
[0]);
3649 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
3651 bad_1
: /* :::::::::::::::::::: */
3652 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "assignment", t
);
3653 return (ffelexHandler
) ffelex_swallow_tokens (t
,
3654 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
3657 /* ffestb_let1_ -- expr
3659 (ffestb_let1_) // to expression handler
3661 Make sure the next token is EQUALS or POINTS. */
3663 static ffelexHandler
3664 ffestb_let1_ (ffelexToken ft UNUSED
, ffebld expr
, ffelexToken t
)
3666 ffestb_local_
.let
.dest
= expr
;
3668 switch (ffelex_token_type (t
))
3670 case FFELEX_typeEQUALS
:
3673 ffesta_tokens
[1] = ffelex_token_use (t
);
3674 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
3675 FFEEXPR_contextLET
, (ffeexprCallback
) ffestb_let2_
);
3681 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "assignment", t
);
3682 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
3685 /* ffestb_let2_ -- expr EQUALS/POINTS expr
3687 (ffestb_end2_) // to expression handler
3689 Make sure the next token is EOS or SEMICOLON; implement the statement. */
3691 static ffelexHandler
3692 ffestb_let2_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
3694 switch (ffelex_token_type (t
))
3696 case FFELEX_typeEOS
:
3697 case FFELEX_typeSEMICOLON
:
3700 if (ffestb_local_
.let
.vxtparam
&& !ffestc_is_let_not_V027 ())
3702 ffesta_confirmed ();
3703 if (!ffesta_is_inhibited ())
3704 ffestc_let (ffestb_local_
.let
.dest
, expr
, ft
);
3705 ffelex_token_kill (ffesta_tokens
[1]);
3706 return (ffelexHandler
) ffesta_zero (t
);
3712 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
,
3713 (ffelex_token_type (ffesta_tokens
[1]) == FFELEX_typeEQUALS
)
3714 ? "assignment" : "pointer-assignment",
3716 ffelex_token_kill (ffesta_tokens
[1]);
3717 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
3720 /* ffestb_varlist -- Parse EXTERNAL/INTENT/INTRINSIC/OPTIONAL/PUBLIC/PRIVATE
3723 return ffestb_varlist; // to lexer
3725 Make sure the statement has a valid form. If it
3726 does, implement the statement. */
3729 ffestb_varlist (ffelexToken t
)
3732 unsigned const char *p
;
3736 switch (ffelex_token_type (ffesta_tokens
[0]))
3738 case FFELEX_typeNAME
:
3739 switch (ffelex_token_type (t
))
3741 case FFELEX_typeEOS
:
3742 case FFELEX_typeSEMICOLON
:
3743 ffesta_confirmed ();
3744 goto bad_1
; /* :::::::::::::::::::: */
3746 case FFELEX_typeCOMMA
:
3747 ffesta_confirmed (); /* Error, but clearly intended. */
3748 goto bad_1
; /* :::::::::::::::::::: */
3750 case FFELEX_typeCOLONCOLON
:
3751 ffesta_confirmed ();
3752 ffesta_confirmed (); /* Error, but clearly intended. */
3753 goto bad_1
; /* :::::::::::::::::::: */
3756 goto bad_1
; /* :::::::::::::::::::: */
3758 case FFELEX_typeOPEN_PAREN
:
3759 goto bad_1
; /* :::::::::::::::::::: */
3761 case FFELEX_typeNAME
:
3762 ffesta_confirmed ();
3763 switch (ffesta_first_kw
)
3765 case FFESTR_firstEXTERNAL
:
3766 if (!ffesta_is_inhibited ())
3767 ffestc_R1207_start ();
3770 case FFESTR_firstINTRINSIC
:
3771 if (!ffesta_is_inhibited ())
3772 ffestc_R1208_start ();
3778 return (ffelexHandler
) ffestb_varlist5_ (t
);
3781 case FFELEX_typeNAMES
:
3782 p
= ffelex_token_text (ffesta_tokens
[0]) + (i
= ffestb_args
.varlist
.len
);
3783 switch (ffelex_token_type (t
))
3785 case FFELEX_typeEOS
:
3786 case FFELEX_typeSEMICOLON
:
3787 ffesta_confirmed ();
3790 goto bad_1
; /* :::::::::::::::::::: */
3792 case FFELEX_typeCOMMA
:
3793 ffesta_confirmed (); /* Error, but clearly intended. */
3797 goto bad_1
; /* :::::::::::::::::::: */
3799 case FFELEX_typeCOLONCOLON
:
3800 ffesta_confirmed ();
3801 goto bad_1
; /* :::::::::::::::::::: */
3803 case FFELEX_typeOPEN_PAREN
:
3804 goto bad_1
; /* :::::::::::::::::::: */
3806 case FFELEX_typeNAME
:
3807 ffesta_confirmed ();
3808 switch (ffesta_first_kw
)
3810 case FFESTR_firstEXTERNAL
:
3811 if (!ffesta_is_inhibited ())
3812 ffestc_R1207_start ();
3815 case FFESTR_firstINTRINSIC
:
3816 if (!ffesta_is_inhibited ())
3817 ffestc_R1208_start ();
3823 return (ffelexHandler
) ffestb_varlist5_ (t
);
3826 goto bad_1
; /* :::::::::::::::::::: */
3829 /* Here, we have at least one char after the first keyword and t is
3830 COMMA or EOS/SEMICOLON. Also we know that this form is valid for
3831 only the statements reaching here (specifically, INTENT won't reach
3834 if (!ffesrc_is_name_init (*p
))
3835 goto bad_i
; /* :::::::::::::::::::: */
3836 nt
= ffelex_token_name_from_names (ffesta_tokens
[0], i
, 0);
3837 if (!ffesta_is_inhibited ())
3839 switch (ffesta_first_kw
)
3841 case FFESTR_firstEXTERNAL
:
3842 ffestc_R1207_start ();
3845 case FFESTR_firstINTRINSIC
:
3846 ffestc_R1208_start ();
3853 next
= (ffelexHandler
) ffestb_varlist5_ (nt
);
3854 ffelex_token_kill (nt
);
3855 return (ffelexHandler
) (*next
) (t
);
3858 goto bad_0
; /* :::::::::::::::::::: */
3861 bad_0
: /* :::::::::::::::::::: */
3862 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, ffestb_args
.varlist
.badname
, ffesta_tokens
[0]);
3863 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
3865 bad_1
: /* :::::::::::::::::::: */
3866 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, ffestb_args
.varlist
.badname
, t
);
3867 return (ffelexHandler
) ffelex_swallow_tokens (t
,
3868 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
3870 bad_i
: /* :::::::::::::::::::: */
3871 ffesta_ffebad_1sp (FFEBAD_INVALID_STMT_FORM
, ffestb_args
.varlist
.badname
, ffesta_tokens
[0], i
, t
);
3872 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
3875 /* ffestb_varlist5_ -- Handles the list of variable names
3877 return ffestb_varlist5_; // to lexer
3881 static ffelexHandler
3882 ffestb_varlist5_ (ffelexToken t
)
3884 switch (ffelex_token_type (t
))
3886 case FFELEX_typeNAME
:
3887 ffesta_tokens
[1] = ffelex_token_use (t
);
3888 return (ffelexHandler
) ffestb_varlist6_
;
3891 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, ffestb_args
.varlist
.badname
, t
);
3895 if (!ffesta_is_inhibited ())
3897 switch (ffesta_first_kw
)
3899 case FFESTR_firstEXTERNAL
:
3900 ffestc_R1207_finish ();
3903 case FFESTR_firstINTRINSIC
:
3904 ffestc_R1208_finish ();
3911 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
3914 /* ffestb_varlist6_ -- (whatever) NAME
3916 return ffestb_varlist6_; // to lexer
3918 Handle COMMA or EOS/SEMICOLON. */
3920 static ffelexHandler
3921 ffestb_varlist6_ (ffelexToken t
)
3923 switch (ffelex_token_type (t
))
3925 case FFELEX_typeCOMMA
:
3926 if (!ffesta_is_inhibited ())
3928 switch (ffesta_first_kw
)
3930 case FFESTR_firstEXTERNAL
:
3931 ffestc_R1207_item (ffesta_tokens
[1]);
3934 case FFESTR_firstINTRINSIC
:
3935 ffestc_R1208_item (ffesta_tokens
[1]);
3942 ffelex_token_kill (ffesta_tokens
[1]);
3943 return (ffelexHandler
) ffestb_varlist5_
;
3945 case FFELEX_typeEOS
:
3946 case FFELEX_typeSEMICOLON
:
3947 if (!ffesta_is_inhibited ())
3949 switch (ffesta_first_kw
)
3951 case FFESTR_firstEXTERNAL
:
3952 ffestc_R1207_item (ffesta_tokens
[1]);
3953 ffestc_R1207_finish ();
3956 case FFESTR_firstINTRINSIC
:
3957 ffestc_R1208_item (ffesta_tokens
[1]);
3958 ffestc_R1208_finish ();
3965 ffelex_token_kill (ffesta_tokens
[1]);
3966 return (ffelexHandler
) ffesta_zero (t
);
3969 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, ffestb_args
.varlist
.badname
, t
);
3973 if (!ffesta_is_inhibited ())
3975 switch (ffesta_first_kw
)
3977 case FFESTR_firstEXTERNAL
:
3978 ffestc_R1207_finish ();
3981 case FFESTR_firstINTRINSIC
:
3982 ffestc_R1208_finish ();
3989 ffelex_token_kill (ffesta_tokens
[1]);
3990 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
3993 /* ffestb_R522 -- Parse the SAVE statement
3995 return ffestb_R522; // to lexer
3997 Make sure the statement has a valid form for the SAVE statement. If it
3998 does, implement the statement. */
4001 ffestb_R522 (ffelexToken t
)
4004 unsigned const char *p
;
4008 switch (ffelex_token_type (ffesta_tokens
[0]))
4010 case FFELEX_typeNAME
:
4011 if (ffesta_first_kw
!= FFESTR_firstSAVE
)
4012 goto bad_0
; /* :::::::::::::::::::: */
4013 switch (ffelex_token_type (t
))
4015 case FFELEX_typeCOMMA
:
4016 ffesta_confirmed (); /* Error, but clearly intended. */
4017 goto bad_1
; /* :::::::::::::::::::: */
4020 goto bad_1
; /* :::::::::::::::::::: */
4022 case FFELEX_typeEOS
:
4023 case FFELEX_typeSEMICOLON
:
4024 ffesta_confirmed ();
4025 if (!ffesta_is_inhibited ())
4027 return (ffelexHandler
) ffesta_zero (t
);
4029 case FFELEX_typeNAME
:
4030 case FFELEX_typeSLASH
:
4031 ffesta_confirmed ();
4032 if (!ffesta_is_inhibited ())
4033 ffestc_R522start ();
4034 return (ffelexHandler
) ffestb_R5221_ (t
);
4036 case FFELEX_typeCOLONCOLON
:
4037 ffesta_confirmed ();
4038 if (!ffesta_is_inhibited ())
4039 ffestc_R522start ();
4040 return (ffelexHandler
) ffestb_R5221_
;
4043 case FFELEX_typeNAMES
:
4044 if (ffesta_first_kw
!= FFESTR_firstSAVE
)
4045 goto bad_0
; /* :::::::::::::::::::: */
4046 p
= ffelex_token_text (ffesta_tokens
[0]) + (i
= FFESTR_firstlSAVE
);
4047 switch (ffelex_token_type (t
))
4050 goto bad_1
; /* :::::::::::::::::::: */
4052 case FFELEX_typeCOMMA
:
4053 ffesta_confirmed ();
4056 case FFELEX_typeEOS
:
4057 case FFELEX_typeSEMICOLON
:
4058 ffesta_confirmed ();
4061 if (!ffesta_is_inhibited ())
4063 return (ffelexHandler
) ffesta_zero (t
);
4065 case FFELEX_typeSLASH
:
4066 ffesta_confirmed ();
4068 goto bad_i
; /* :::::::::::::::::::: */
4069 if (!ffesta_is_inhibited ())
4070 ffestc_R522start ();
4071 return (ffelexHandler
) ffestb_R5221_ (t
);
4073 case FFELEX_typeCOLONCOLON
:
4074 ffesta_confirmed ();
4076 goto bad_i
; /* :::::::::::::::::::: */
4077 if (!ffesta_is_inhibited ())
4078 ffestc_R522start ();
4079 return (ffelexHandler
) ffestb_R5221_
;
4082 /* Here, we have at least one char after "SAVE" and t is COMMA or
4085 if (!ffesrc_is_name_init (*p
))
4086 goto bad_i
; /* :::::::::::::::::::: */
4087 nt
= ffelex_token_name_from_names (ffesta_tokens
[0], i
, 0);
4088 if (!ffesta_is_inhibited ())
4089 ffestc_R522start ();
4090 next
= (ffelexHandler
) ffestb_R5221_ (nt
);
4091 ffelex_token_kill (nt
);
4092 return (ffelexHandler
) (*next
) (t
);
4095 goto bad_0
; /* :::::::::::::::::::: */
4098 bad_0
: /* :::::::::::::::::::: */
4099 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "SAVE", ffesta_tokens
[0]);
4100 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
4102 bad_1
: /* :::::::::::::::::::: */
4103 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "SAVE", t
);
4104 return (ffelexHandler
) ffelex_swallow_tokens (t
,
4105 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
4107 bad_i
: /* :::::::::::::::::::: */
4108 ffesta_ffebad_1sp (FFEBAD_INVALID_STMT_FORM
, "SAVE", ffesta_tokens
[0], i
, t
);
4109 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
4112 /* ffestb_R5221_ -- "SAVE" [COLONCOLON]
4114 return ffestb_R5221_; // to lexer
4116 Handle NAME or SLASH. */
4118 static ffelexHandler
4119 ffestb_R5221_ (ffelexToken t
)
4121 switch (ffelex_token_type (t
))
4123 case FFELEX_typeNAME
:
4124 ffestb_local_
.R522
.is_cblock
= FALSE
;
4125 ffesta_tokens
[1] = ffelex_token_use (t
);
4126 return (ffelexHandler
) ffestb_R5224_
;
4128 case FFELEX_typeSLASH
:
4129 ffestb_local_
.R522
.is_cblock
= TRUE
;
4130 return (ffelexHandler
) ffestb_R5222_
;
4133 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "SAVE", t
);
4137 if (!ffesta_is_inhibited ())
4138 ffestc_R522finish ();
4139 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
4142 /* ffestb_R5222_ -- "SAVE" [COLONCOLON] SLASH
4144 return ffestb_R5222_; // to lexer
4148 static ffelexHandler
4149 ffestb_R5222_ (ffelexToken t
)
4151 switch (ffelex_token_type (t
))
4153 case FFELEX_typeNAME
:
4154 ffesta_tokens
[1] = ffelex_token_use (t
);
4155 return (ffelexHandler
) ffestb_R5223_
;
4158 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "SAVE", t
);
4162 if (!ffesta_is_inhibited ())
4163 ffestc_R522finish ();
4164 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
4167 /* ffestb_R5223_ -- "SAVE" [COLONCOLON] SLASH NAME
4169 return ffestb_R5223_; // to lexer
4173 static ffelexHandler
4174 ffestb_R5223_ (ffelexToken t
)
4176 switch (ffelex_token_type (t
))
4178 case FFELEX_typeSLASH
:
4179 return (ffelexHandler
) ffestb_R5224_
;
4182 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "SAVE", t
);
4186 if (!ffesta_is_inhibited ())
4187 ffestc_R522finish ();
4188 ffelex_token_kill (ffesta_tokens
[1]);
4189 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
4192 /* ffestb_R5224_ -- "SAVE" [COLONCOLON] R523
4194 return ffestb_R5224_; // to lexer
4196 Handle COMMA or EOS/SEMICOLON. */
4198 static ffelexHandler
4199 ffestb_R5224_ (ffelexToken t
)
4201 switch (ffelex_token_type (t
))
4203 case FFELEX_typeCOMMA
:
4204 if (!ffesta_is_inhibited ())
4206 if (ffestb_local_
.R522
.is_cblock
)
4207 ffestc_R522item_cblock (ffesta_tokens
[1]);
4209 ffestc_R522item_object (ffesta_tokens
[1]);
4211 ffelex_token_kill (ffesta_tokens
[1]);
4212 return (ffelexHandler
) ffestb_R5221_
;
4214 case FFELEX_typeEOS
:
4215 case FFELEX_typeSEMICOLON
:
4216 if (!ffesta_is_inhibited ())
4218 if (ffestb_local_
.R522
.is_cblock
)
4219 ffestc_R522item_cblock (ffesta_tokens
[1]);
4221 ffestc_R522item_object (ffesta_tokens
[1]);
4222 ffestc_R522finish ();
4224 ffelex_token_kill (ffesta_tokens
[1]);
4225 return (ffelexHandler
) ffesta_zero (t
);
4228 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "SAVE", t
);
4232 if (!ffesta_is_inhibited ())
4233 ffestc_R522finish ();
4234 ffelex_token_kill (ffesta_tokens
[1]);
4235 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
4238 /* ffestb_R528 -- Parse the DATA statement
4240 return ffestb_R528; // to lexer
4242 Make sure the statement has a valid form for the DATA statement. If it
4243 does, implement the statement. */
4246 ffestb_R528 (ffelexToken t
)
4248 unsigned const char *p
;
4253 switch (ffelex_token_type (ffesta_tokens
[0]))
4255 case FFELEX_typeNAME
:
4256 if (ffesta_first_kw
!= FFESTR_firstDATA
)
4257 goto bad_0
; /* :::::::::::::::::::: */
4258 switch (ffelex_token_type (t
))
4260 case FFELEX_typeCOMMA
:
4261 case FFELEX_typeEOS
:
4262 case FFELEX_typeSEMICOLON
:
4263 case FFELEX_typeSLASH
:
4264 case FFELEX_typeCOLONCOLON
:
4265 ffesta_confirmed (); /* Error, but clearly intended. */
4266 goto bad_1
; /* :::::::::::::::::::: */
4269 goto bad_1
; /* :::::::::::::::::::: */
4271 case FFELEX_typeNAME
:
4272 ffesta_confirmed ();
4275 case FFELEX_typeOPEN_PAREN
:
4278 ffestb_local_
.data
.started
= FALSE
;
4279 return (ffelexHandler
) (*((ffelexHandler
)
4280 ffeexpr_lhs (ffesta_output_pool
,
4281 FFEEXPR_contextDATA
,
4282 (ffeexprCallback
) ffestb_R5281_
)))
4285 case FFELEX_typeNAMES
:
4286 if (ffesta_first_kw
!= FFESTR_firstDATA
)
4287 goto bad_0
; /* :::::::::::::::::::: */
4288 p
= ffelex_token_text (ffesta_tokens
[0]) + (i
= FFESTR_firstlDATA
);
4289 switch (ffelex_token_type (t
))
4291 case FFELEX_typeEOS
:
4292 case FFELEX_typeSEMICOLON
:
4293 case FFELEX_typeCOLONCOLON
:
4294 ffesta_confirmed (); /* Error, but clearly intended. */
4295 goto bad_1
; /* :::::::::::::::::::: */
4298 goto bad_1
; /* :::::::::::::::::::: */
4300 case FFELEX_typeOPEN_PAREN
:
4303 ffestb_local_
.data
.started
= FALSE
;
4304 return (ffelexHandler
) (*((ffelexHandler
)
4305 ffeexpr_lhs (ffesta_output_pool
,
4306 FFEEXPR_contextDATA
,
4313 case FFELEX_typeCOMMA
:
4314 case FFELEX_typeSLASH
:
4315 ffesta_confirmed ();
4318 if (!ffesrc_is_name_init (*p
))
4319 goto bad_i
; /* :::::::::::::::::::: */
4320 ffestb_local_
.data
.started
= FALSE
;
4321 nt
= ffelex_token_name_from_names (ffesta_tokens
[0], i
, 0);
4322 next
= (ffelexHandler
) (*((ffelexHandler
)
4323 ffeexpr_lhs (ffesta_output_pool
,
4324 FFEEXPR_contextDATA
,
4325 (ffeexprCallback
) ffestb_R5281_
)))
4327 ffelex_token_kill (nt
);
4328 return (ffelexHandler
) (*next
) (t
);
4331 goto bad_0
; /* :::::::::::::::::::: */
4334 bad_0
: /* :::::::::::::::::::: */
4335 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "DATA", ffesta_tokens
[0]);
4336 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
4338 bad_1
: /* :::::::::::::::::::: */
4339 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "DATA", t
);
4340 return (ffelexHandler
) ffelex_swallow_tokens (t
,
4341 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
4343 bad_i
: /* :::::::::::::::::::: */
4344 ffesta_ffebad_1sp (FFEBAD_INVALID_STMT_FORM
, "DATA", ffesta_tokens
[0], i
, t
);
4345 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
4348 /* ffestb_R5281_ -- "DATA" expr-list
4350 (ffestb_R5281_) // to expression handler
4352 Handle COMMA or SLASH. */
4354 static ffelexHandler
4355 ffestb_R5281_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
4357 switch (ffelex_token_type (t
))
4359 case FFELEX_typeCOMMA
:
4360 ffesta_confirmed ();
4363 if (!ffesta_is_inhibited ())
4365 if (!ffestb_local_
.data
.started
)
4367 ffestc_R528_start ();
4368 ffestb_local_
.data
.started
= TRUE
;
4370 ffestc_R528_item_object (expr
, ft
);
4372 return (ffelexHandler
) ffeexpr_lhs (ffesta_output_pool
,
4373 FFEEXPR_contextDATA
,
4374 (ffeexprCallback
) ffestb_R5281_
);
4376 case FFELEX_typeSLASH
:
4377 ffesta_confirmed ();
4380 if (!ffesta_is_inhibited ())
4382 if (!ffestb_local_
.data
.started
)
4384 ffestc_R528_start ();
4385 ffestb_local_
.data
.started
= TRUE
;
4387 ffestc_R528_item_object (expr
, ft
);
4388 ffestc_R528_item_startvals ();
4390 return (ffelexHandler
) ffeexpr_rhs
4391 (ffesta_output_pool
, FFEEXPR_contextDATA
,
4392 (ffeexprCallback
) ffestb_R5282_
);
4395 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "DATA", t
);
4399 if (ffestb_local_
.data
.started
&& !ffesta_is_inhibited ())
4400 ffestc_R528_finish ();
4401 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
4404 /* ffestb_R5282_ -- "DATA" expr-list SLASH expr-list
4406 (ffestb_R5282_) // to expression handler
4408 Handle ASTERISK, COMMA, or SLASH. */
4410 static ffelexHandler
4411 ffestb_R5282_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
4413 switch (ffelex_token_type (t
))
4415 case FFELEX_typeCOMMA
:
4418 if (!ffesta_is_inhibited ())
4419 ffestc_R528_item_value (NULL
, NULL
, expr
, ft
);
4420 return (ffelexHandler
) ffeexpr_rhs
4421 (ffesta_output_pool
, FFEEXPR_contextDATA
,
4422 (ffeexprCallback
) ffestb_R5282_
);
4424 case FFELEX_typeASTERISK
:
4427 ffestb_local_
.data
.expr
= ffeexpr_convert (expr
, ft
, t
,
4428 FFEINFO_basictypeINTEGER
,
4429 FFEINFO_kindtypeINTEGER1
,
4431 FFETARGET_charactersizeNONE
,
4432 FFEEXPR_contextLET
);
4433 ffesta_tokens
[1] = ffelex_token_use (ft
);
4434 return (ffelexHandler
) ffeexpr_rhs
4435 (ffesta_output_pool
, FFEEXPR_contextDATA
,
4436 (ffeexprCallback
) ffestb_R5283_
);
4438 case FFELEX_typeSLASH
:
4441 if (!ffesta_is_inhibited ())
4443 ffestc_R528_item_value (NULL
, NULL
, expr
, ft
);
4444 ffestc_R528_item_endvals (t
);
4446 return (ffelexHandler
) ffestb_R5284_
;
4449 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "DATA", t
);
4453 if (!ffesta_is_inhibited ())
4455 ffestc_R528_item_endvals (t
);
4456 ffestc_R528_finish ();
4458 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
4461 /* ffestb_R5283_ -- "DATA" expr-list SLASH expr ASTERISK expr
4463 (ffestb_R5283_) // to expression handler
4465 Handle COMMA or SLASH. */
4467 static ffelexHandler
4468 ffestb_R5283_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
4470 switch (ffelex_token_type (t
))
4472 case FFELEX_typeCOMMA
:
4475 if (!ffesta_is_inhibited ())
4476 ffestc_R528_item_value (ffestb_local_
.data
.expr
, ffesta_tokens
[1],
4478 ffelex_token_kill (ffesta_tokens
[1]);
4479 return (ffelexHandler
) ffeexpr_rhs
4480 (ffesta_output_pool
, FFEEXPR_contextDATA
,
4481 (ffeexprCallback
) ffestb_R5282_
);
4483 case FFELEX_typeSLASH
:
4486 if (!ffesta_is_inhibited ())
4488 ffestc_R528_item_value (ffestb_local_
.data
.expr
, ffesta_tokens
[1],
4490 ffestc_R528_item_endvals (t
);
4492 ffelex_token_kill (ffesta_tokens
[1]);
4493 return (ffelexHandler
) ffestb_R5284_
;
4496 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "DATA", t
);
4500 if (!ffesta_is_inhibited ())
4502 ffestc_R528_item_endvals (t
);
4503 ffestc_R528_finish ();
4505 ffelex_token_kill (ffesta_tokens
[1]);
4506 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
4509 /* ffestb_R5284_ -- "DATA" expr-list SLASH expr-list SLASH
4511 return ffestb_R5284_; // to lexer
4513 Handle [COMMA] NAME or EOS/SEMICOLON. */
4515 static ffelexHandler
4516 ffestb_R5284_ (ffelexToken t
)
4518 switch (ffelex_token_type (t
))
4520 case FFELEX_typeCOMMA
:
4521 return (ffelexHandler
) ffeexpr_lhs (ffesta_output_pool
,
4522 FFEEXPR_contextDATA
,
4523 (ffeexprCallback
) ffestb_R5281_
);
4525 case FFELEX_typeNAME
:
4526 case FFELEX_typeOPEN_PAREN
:
4527 return (ffelexHandler
) (*((ffelexHandler
)
4528 ffeexpr_lhs (ffesta_output_pool
,
4529 FFEEXPR_contextDATA
,
4530 (ffeexprCallback
) ffestb_R5281_
)))
4533 case FFELEX_typeEOS
:
4534 case FFELEX_typeSEMICOLON
:
4535 if (!ffesta_is_inhibited ())
4536 ffestc_R528_finish ();
4537 return (ffelexHandler
) ffesta_zero (t
);
4540 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "DATA", t
);
4544 if (!ffesta_is_inhibited ())
4545 ffestc_R528_finish ();
4546 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
4549 /* ffestb_R537 -- Parse a PARAMETER statement
4551 return ffestb_R537; // to lexer
4553 Make sure the statement has a valid form for an PARAMETER statement.
4554 If it does, implement the statement. */
4557 ffestb_R537 (ffelexToken t
)
4559 switch (ffelex_token_type (ffesta_tokens
[0]))
4561 case FFELEX_typeNAME
:
4562 if (ffesta_first_kw
!= FFESTR_firstPARAMETER
)
4563 goto bad_0
; /* :::::::::::::::::::: */
4566 case FFELEX_typeNAMES
:
4567 if (ffesta_first_kw
!= FFESTR_firstPARAMETER
)
4568 goto bad_0
; /* :::::::::::::::::::: */
4569 if (ffelex_token_length (ffesta_tokens
[0]) != FFESTR_firstlPARAMETER
)
4570 goto bad_0
; /* :::::::::::::::::::: */
4574 goto bad_0
; /* :::::::::::::::::::: */
4577 switch (ffelex_token_type (t
))
4579 case FFELEX_typeOPEN_PAREN
:
4582 case FFELEX_typeEOS
:
4583 case FFELEX_typeSEMICOLON
:
4584 case FFELEX_typeCOMMA
:
4585 case FFELEX_typeCOLONCOLON
:
4586 ffesta_confirmed (); /* Error, but clearly intended. */
4587 goto bad_1
; /* :::::::::::::::::::: */
4590 goto bad_1
; /* :::::::::::::::::::: */
4593 ffestb_local_
.parameter
.started
= FALSE
;
4594 return (ffelexHandler
) ffeexpr_lhs (ffesta_output_pool
,
4595 FFEEXPR_contextPARAMETER
,
4596 (ffeexprCallback
) ffestb_R5371_
);
4598 bad_0
: /* :::::::::::::::::::: */
4599 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "PARAMETER", ffesta_tokens
[0]);
4600 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
4602 bad_1
: /* :::::::::::::::::::: */
4603 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "PARAMETER", t
);
4604 return (ffelexHandler
) ffelex_swallow_tokens (t
,
4605 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
4608 /* ffestb_R5371_ -- "PARAMETER" OPEN_PAREN expr
4610 (ffestb_R5371_) // to expression handler
4612 Make sure the next token is EQUALS. */
4614 static ffelexHandler
4615 ffestb_R5371_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
4617 ffestb_local_
.parameter
.expr
= expr
;
4619 switch (ffelex_token_type (t
))
4621 case FFELEX_typeEQUALS
:
4622 ffesta_confirmed ();
4625 ffesta_tokens
[1] = ffelex_token_use (ft
);
4626 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
4627 FFEEXPR_contextPARAMETER
, (ffeexprCallback
) ffestb_R5372_
);
4633 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "PARAMETER", t
);
4634 if (ffestb_local_
.parameter
.started
)
4635 ffestc_R537_finish ();
4636 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
4639 /* ffestb_R5372_ -- "PARAMETER" OPEN_PAREN expr EQUALS expr
4641 (ffestb_R5372_) // to expression handler
4643 Make sure the next token is COMMA or CLOSE_PAREN. */
4645 static ffelexHandler
4646 ffestb_R5372_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
4648 switch (ffelex_token_type (t
))
4650 case FFELEX_typeCOMMA
:
4653 if (!ffesta_is_inhibited ())
4655 if (!ffestb_local_
.parameter
.started
)
4657 ffestc_R537_start ();
4658 ffestb_local_
.parameter
.started
= TRUE
;
4660 ffestc_R537_item (ffestb_local_
.parameter
.expr
, ffesta_tokens
[1],
4663 ffelex_token_kill (ffesta_tokens
[1]);
4664 return (ffelexHandler
) ffeexpr_lhs (ffesta_output_pool
,
4665 FFEEXPR_contextPARAMETER
,
4666 (ffeexprCallback
) ffestb_R5371_
);
4668 case FFELEX_typeCLOSE_PAREN
:
4671 if (!ffesta_is_inhibited ())
4673 if (!ffestb_local_
.parameter
.started
)
4675 ffestc_R537_start ();
4676 ffestb_local_
.parameter
.started
= TRUE
;
4678 ffestc_R537_item (ffestb_local_
.parameter
.expr
, ffesta_tokens
[1],
4680 ffestc_R537_finish ();
4682 ffelex_token_kill (ffesta_tokens
[1]);
4683 return (ffelexHandler
) ffestb_R5373_
;
4689 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "PARAMETER", t
);
4690 if (ffestb_local_
.parameter
.started
)
4691 ffestc_R537_finish ();
4692 ffelex_token_kill (ffesta_tokens
[1]);
4693 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
4696 /* ffestb_R5373_ -- "PARAMETER" OPEN_PAREN expr EQUALS expr CLOSE_PAREN
4698 return ffestb_R5373_; // to lexer
4700 Make sure the next token is EOS or SEMICOLON, or generate an error. All
4701 cleanup has already been done, by the way. */
4703 static ffelexHandler
4704 ffestb_R5373_ (ffelexToken t
)
4706 switch (ffelex_token_type (t
))
4708 case FFELEX_typeEOS
:
4709 case FFELEX_typeSEMICOLON
:
4710 return (ffelexHandler
) ffesta_zero (t
);
4716 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "PARAMETER", t
);
4717 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
4720 /* ffestb_R542 -- Parse the NAMELIST statement
4722 return ffestb_R542; // to lexer
4724 Make sure the statement has a valid form for the NAMELIST statement. If it
4725 does, implement the statement. */
4728 ffestb_R542 (ffelexToken t
)
4733 switch (ffelex_token_type (ffesta_tokens
[0]))
4735 case FFELEX_typeNAME
:
4736 if (ffesta_first_kw
!= FFESTR_firstNAMELIST
)
4737 goto bad_0
; /* :::::::::::::::::::: */
4740 case FFELEX_typeNAMES
:
4741 if (ffesta_first_kw
!= FFESTR_firstNAMELIST
)
4742 goto bad_0
; /* :::::::::::::::::::: */
4743 p
= ffelex_token_text (ffesta_tokens
[0]) + (i
= FFESTR_firstlNAMELIST
);
4745 goto bad_i
; /* :::::::::::::::::::: */
4749 goto bad_0
; /* :::::::::::::::::::: */
4752 switch (ffelex_token_type (t
))
4754 case FFELEX_typeCOMMA
:
4755 case FFELEX_typeEOS
:
4756 case FFELEX_typeSEMICOLON
:
4757 case FFELEX_typeCOLONCOLON
:
4758 ffesta_confirmed (); /* Error, but clearly intended. */
4759 goto bad_1
; /* :::::::::::::::::::: */
4762 goto bad_1
; /* :::::::::::::::::::: */
4764 case FFELEX_typeSLASH
:
4768 ffesta_confirmed ();
4769 if (!ffesta_is_inhibited ())
4770 ffestc_R542_start ();
4771 return (ffelexHandler
) ffestb_R5421_
;
4773 bad_0
: /* :::::::::::::::::::: */
4774 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "NAMELIST", ffesta_tokens
[0]);
4775 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
4777 bad_1
: /* :::::::::::::::::::: */
4778 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "NAMELIST", t
);
4779 return (ffelexHandler
) ffelex_swallow_tokens (t
,
4780 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
4782 bad_i
: /* :::::::::::::::::::: */
4783 ffesta_ffebad_1sp (FFEBAD_INVALID_STMT_FORM
, "NAMELIST", ffesta_tokens
[0], i
, t
);
4784 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
4787 /* ffestb_R5421_ -- "NAMELIST" SLASH
4789 return ffestb_R5421_; // to lexer
4793 static ffelexHandler
4794 ffestb_R5421_ (ffelexToken t
)
4796 switch (ffelex_token_type (t
))
4798 case FFELEX_typeNAME
:
4799 if (!ffesta_is_inhibited ())
4800 ffestc_R542_item_nlist (t
);
4801 return (ffelexHandler
) ffestb_R5422_
;
4804 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "NAMELIST", t
);
4808 if (!ffesta_is_inhibited ())
4809 ffestc_R542_finish ();
4810 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
4813 /* ffestb_R5422_ -- "NAMELIST" SLASH NAME
4815 return ffestb_R5422_; // to lexer
4819 static ffelexHandler
4820 ffestb_R5422_ (ffelexToken t
)
4822 switch (ffelex_token_type (t
))
4824 case FFELEX_typeSLASH
:
4825 return (ffelexHandler
) ffestb_R5423_
;
4828 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "NAMELIST", t
);
4832 if (!ffesta_is_inhibited ())
4833 ffestc_R542_finish ();
4834 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
4837 /* ffestb_R5423_ -- "NAMELIST" SLASH NAME SLASH
4839 return ffestb_R5423_; // to lexer
4843 static ffelexHandler
4844 ffestb_R5423_ (ffelexToken t
)
4846 switch (ffelex_token_type (t
))
4848 case FFELEX_typeNAME
:
4849 if (!ffesta_is_inhibited ())
4850 ffestc_R542_item_nitem (t
);
4851 return (ffelexHandler
) ffestb_R5424_
;
4854 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "NAMELIST", t
);
4858 if (!ffesta_is_inhibited ())
4859 ffestc_R542_finish ();
4860 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
4863 /* ffestb_R5424_ -- "NAMELIST" SLASH NAME SLASH NAME
4865 return ffestb_R5424_; // to lexer
4867 Handle COMMA, EOS/SEMICOLON, or SLASH. */
4869 static ffelexHandler
4870 ffestb_R5424_ (ffelexToken t
)
4872 switch (ffelex_token_type (t
))
4874 case FFELEX_typeCOMMA
:
4875 return (ffelexHandler
) ffestb_R5425_
;
4877 case FFELEX_typeEOS
:
4878 case FFELEX_typeSEMICOLON
:
4879 if (!ffesta_is_inhibited ())
4880 ffestc_R542_finish ();
4881 return (ffelexHandler
) ffesta_zero (t
);
4883 case FFELEX_typeSLASH
:
4884 return (ffelexHandler
) ffestb_R5421_
;
4887 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "NAMELIST", t
);
4891 if (!ffesta_is_inhibited ())
4892 ffestc_R542_finish ();
4893 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
4896 /* ffestb_R5425_ -- "NAMELIST" SLASH NAME SLASH NAME COMMA
4898 return ffestb_R5425_; // to lexer
4900 Handle NAME or SLASH. */
4902 static ffelexHandler
4903 ffestb_R5425_ (ffelexToken t
)
4905 switch (ffelex_token_type (t
))
4907 case FFELEX_typeNAME
:
4908 if (!ffesta_is_inhibited ())
4909 ffestc_R542_item_nitem (t
);
4910 return (ffelexHandler
) ffestb_R5424_
;
4912 case FFELEX_typeSLASH
:
4913 return (ffelexHandler
) ffestb_R5421_
;
4916 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "NAMELIST", t
);
4920 if (!ffesta_is_inhibited ())
4921 ffestc_R542_finish ();
4922 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
4925 /* ffestb_R544 -- Parse an EQUIVALENCE statement
4927 return ffestb_R544; // to lexer
4929 Make sure the statement has a valid form for an EQUIVALENCE statement.
4930 If it does, implement the statement. */
4933 ffestb_R544 (ffelexToken t
)
4935 switch (ffelex_token_type (ffesta_tokens
[0]))
4937 case FFELEX_typeNAME
:
4938 if (ffesta_first_kw
!= FFESTR_firstEQUIVALENCE
)
4939 goto bad_0
; /* :::::::::::::::::::: */
4942 case FFELEX_typeNAMES
:
4943 if (ffesta_first_kw
!= FFESTR_firstEQUIVALENCE
)
4944 goto bad_0
; /* :::::::::::::::::::: */
4945 if (ffelex_token_length (ffesta_tokens
[0]) != FFESTR_firstlEQUIVALENCE
)
4946 goto bad_0
; /* :::::::::::::::::::: */
4950 goto bad_0
; /* :::::::::::::::::::: */
4953 switch (ffelex_token_type (t
))
4955 case FFELEX_typeOPEN_PAREN
:
4958 case FFELEX_typeEOS
:
4959 case FFELEX_typeSEMICOLON
:
4960 case FFELEX_typeCOMMA
:
4961 case FFELEX_typeCOLONCOLON
:
4962 ffesta_confirmed (); /* Error, but clearly intended. */
4963 goto bad_1
; /* :::::::::::::::::::: */
4966 goto bad_1
; /* :::::::::::::::::::: */
4969 ffestb_local_
.equivalence
.started
= FALSE
;
4970 return (ffelexHandler
) ffeexpr_lhs (ffesta_output_pool
,
4971 FFEEXPR_contextEQUIVALENCE
,
4972 (ffeexprCallback
) ffestb_R5441_
);
4974 bad_0
: /* :::::::::::::::::::: */
4975 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "EQUIVALENCE", ffesta_tokens
[0]);
4976 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
4978 bad_1
: /* :::::::::::::::::::: */
4979 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "EQUIVALENCE", t
);
4980 return (ffelexHandler
) ffelex_swallow_tokens (t
,
4981 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
4984 /* ffestb_R5441_ -- "EQUIVALENCE" OPEN_PAREN expr
4986 (ffestb_R5441_) // to expression handler
4988 Make sure the next token is COMMA. */
4990 static ffelexHandler
4991 ffestb_R5441_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
4993 switch (ffelex_token_type (t
))
4995 case FFELEX_typeCOMMA
:
4998 ffestb_local_
.equivalence
.exprs
= ffestt_exprlist_create ();
4999 ffestt_exprlist_append (ffestb_local_
.equivalence
.exprs
, expr
,
5000 ffelex_token_use (ft
));
5001 return (ffelexHandler
) ffeexpr_lhs (ffesta_output_pool
,
5002 FFEEXPR_contextEQUIVALENCE
,
5003 (ffeexprCallback
) ffestb_R5442_
);
5009 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "EQUIVALENCE", t
);
5010 if (ffestb_local_
.equivalence
.started
)
5011 ffestc_R544_finish ();
5012 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
5015 /* ffestb_R5442_ -- "EQUIVALENCE" OPEN_PAREN expr COMMA expr
5017 (ffestb_R5442_) // to expression handler
5019 Make sure the next token is COMMA or CLOSE_PAREN. For COMMA, we just
5020 append the expression to our list and continue; for CLOSE_PAREN, we
5021 append the expression and move to _3_. */
5023 static ffelexHandler
5024 ffestb_R5442_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
5026 switch (ffelex_token_type (t
))
5028 case FFELEX_typeCOMMA
:
5031 ffestt_exprlist_append (ffestb_local_
.equivalence
.exprs
, expr
,
5032 ffelex_token_use (ft
));
5033 return (ffelexHandler
) ffeexpr_lhs (ffesta_output_pool
,
5034 FFEEXPR_contextEQUIVALENCE
,
5035 (ffeexprCallback
) ffestb_R5442_
);
5037 case FFELEX_typeCLOSE_PAREN
:
5040 ffestt_exprlist_append (ffestb_local_
.equivalence
.exprs
, expr
,
5041 ffelex_token_use (ft
));
5042 return (ffelexHandler
) ffestb_R5443_
;
5048 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "EQUIVALENCE", t
);
5049 if (ffestb_local_
.equivalence
.started
)
5050 ffestc_R544_finish ();
5051 ffestt_exprlist_kill (ffestb_local_
.equivalence
.exprs
);
5052 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
5055 /* ffestb_R5443_ -- "EQUIVALENCE" OPEN_PAREN expr COMMA expr CLOSE_PAREN
5057 return ffestb_R5443_; // to lexer
5059 Make sure the next token is COMMA or EOS/SEMICOLON. */
5061 static ffelexHandler
5062 ffestb_R5443_ (ffelexToken t
)
5064 switch (ffelex_token_type (t
))
5066 case FFELEX_typeCOMMA
:
5067 ffesta_confirmed ();
5068 if (!ffesta_is_inhibited ())
5070 if (!ffestb_local_
.equivalence
.started
)
5072 ffestc_R544_start ();
5073 ffestb_local_
.equivalence
.started
= TRUE
;
5075 ffestc_R544_item (ffestb_local_
.equivalence
.exprs
);
5077 ffestt_exprlist_kill (ffestb_local_
.equivalence
.exprs
);
5078 return (ffelexHandler
) ffestb_R5444_
;
5080 case FFELEX_typeEOS
:
5081 case FFELEX_typeSEMICOLON
:
5082 ffesta_confirmed ();
5083 if (!ffesta_is_inhibited ())
5085 if (!ffestb_local_
.equivalence
.started
)
5087 ffestc_R544_start ();
5088 ffestb_local_
.equivalence
.started
= TRUE
;
5090 ffestc_R544_item (ffestb_local_
.equivalence
.exprs
);
5091 ffestc_R544_finish ();
5093 ffestt_exprlist_kill (ffestb_local_
.equivalence
.exprs
);
5094 return (ffelexHandler
) ffesta_zero (t
);
5100 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "EQUIVALENCE", t
);
5101 if (ffestb_local_
.equivalence
.started
)
5102 ffestc_R544_finish ();
5103 ffestt_exprlist_kill (ffestb_local_
.equivalence
.exprs
);
5104 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
5107 /* ffestb_R5444_ -- "EQUIVALENCE" OPEN_PAREN expr COMMA expr CLOSE_PAREN COMMA
5109 return ffestb_R5444_; // to lexer
5111 Make sure the next token is OPEN_PAREN, or generate an error. */
5113 static ffelexHandler
5114 ffestb_R5444_ (ffelexToken t
)
5116 switch (ffelex_token_type (t
))
5118 case FFELEX_typeOPEN_PAREN
:
5119 return (ffelexHandler
) ffeexpr_lhs (ffesta_output_pool
,
5120 FFEEXPR_contextEQUIVALENCE
,
5121 (ffeexprCallback
) ffestb_R5441_
);
5127 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "EQUIVALENCE", t
);
5128 if (ffestb_local_
.equivalence
.started
)
5129 ffestc_R544_finish ();
5130 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
5133 /* ffestb_R834 -- Parse the CYCLE statement
5135 return ffestb_R834; // to lexer
5137 Make sure the statement has a valid form for the CYCLE statement. If
5138 it does, implement the statement. */
5141 ffestb_R834 (ffelexToken t
)
5144 unsigned const char *p
;
5146 switch (ffelex_token_type (ffesta_tokens
[0]))
5148 case FFELEX_typeNAME
:
5149 if (ffesta_first_kw
!= FFESTR_firstCYCLE
)
5150 goto bad_0
; /* :::::::::::::::::::: */
5151 switch (ffelex_token_type (t
))
5153 case FFELEX_typeCOMMA
:
5154 case FFELEX_typeCOLONCOLON
:
5155 ffesta_confirmed (); /* Error, but clearly intended. */
5156 goto bad_1
; /* :::::::::::::::::::: */
5159 goto bad_1
; /* :::::::::::::::::::: */
5161 case FFELEX_typeNAME
:
5162 ffesta_confirmed ();
5163 ffesta_tokens
[1] = ffelex_token_use (t
);
5164 return (ffelexHandler
) ffestb_R8341_
;
5166 case FFELEX_typeEOS
:
5167 case FFELEX_typeSEMICOLON
:
5168 ffesta_confirmed ();
5169 ffesta_tokens
[1] = NULL
;
5170 return (ffelexHandler
) ffestb_R8341_ (t
);
5173 case FFELEX_typeNAMES
:
5174 if (ffesta_first_kw
!= FFESTR_firstCYCLE
)
5175 goto bad_0
; /* :::::::::::::::::::: */
5176 switch (ffelex_token_type (t
))
5179 goto bad_1
; /* :::::::::::::::::::: */
5181 case FFELEX_typeEOS
:
5182 case FFELEX_typeSEMICOLON
:
5185 ffesta_confirmed ();
5186 p
= ffelex_token_text (ffesta_tokens
[0]) + (i
= FFESTR_firstlCYCLE
);
5189 ffesta_tokens
[1] = NULL
;
5193 if (!ffesrc_is_name_init (*p
))
5194 goto bad_i
; /* :::::::::::::::::::: */
5196 = ffelex_token_name_from_names (ffesta_tokens
[0], i
, 0);
5198 return (ffelexHandler
) ffestb_R8341_ (t
);
5201 goto bad_0
; /* :::::::::::::::::::: */
5204 bad_0
: /* :::::::::::::::::::: */
5205 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "CYCLE", ffesta_tokens
[0]);
5206 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
5208 bad_1
: /* :::::::::::::::::::: */
5209 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "CYCLE", t
);
5210 return (ffelexHandler
) ffelex_swallow_tokens (t
,
5211 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
5213 bad_i
: /* :::::::::::::::::::: */
5214 ffesta_ffebad_1sp (FFEBAD_INVALID_STMT_FORM
, "CYCLE", ffesta_tokens
[0], i
, t
);
5215 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
5218 /* ffestb_R8341_ -- "CYCLE" [NAME]
5220 return ffestb_R8341_; // to lexer
5222 Make sure the next token is an EOS or SEMICOLON. */
5224 static ffelexHandler
5225 ffestb_R8341_ (ffelexToken t
)
5227 switch (ffelex_token_type (t
))
5229 case FFELEX_typeEOS
:
5230 case FFELEX_typeSEMICOLON
:
5231 ffesta_confirmed ();
5232 if (!ffesta_is_inhibited ())
5233 ffestc_R834 (ffesta_tokens
[1]);
5234 if (ffesta_tokens
[1] != NULL
)
5235 ffelex_token_kill (ffesta_tokens
[1]);
5236 return (ffelexHandler
) ffesta_zero (t
);
5239 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "CYCLE", t
);
5243 if (ffesta_tokens
[1] != NULL
)
5244 ffelex_token_kill (ffesta_tokens
[1]);
5245 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
5248 /* ffestb_R835 -- Parse the EXIT statement
5250 return ffestb_R835; // to lexer
5252 Make sure the statement has a valid form for the EXIT statement. If
5253 it does, implement the statement. */
5256 ffestb_R835 (ffelexToken t
)
5259 unsigned const char *p
;
5261 switch (ffelex_token_type (ffesta_tokens
[0]))
5263 case FFELEX_typeNAME
:
5264 if (ffesta_first_kw
!= FFESTR_firstEXIT
)
5265 goto bad_0
; /* :::::::::::::::::::: */
5266 switch (ffelex_token_type (t
))
5268 case FFELEX_typeCOMMA
:
5269 case FFELEX_typeCOLONCOLON
:
5270 ffesta_confirmed (); /* Error, but clearly intended. */
5271 goto bad_1
; /* :::::::::::::::::::: */
5274 goto bad_1
; /* :::::::::::::::::::: */
5276 case FFELEX_typeNAME
:
5277 ffesta_confirmed ();
5278 ffesta_tokens
[1] = ffelex_token_use (t
);
5279 return (ffelexHandler
) ffestb_R8351_
;
5281 case FFELEX_typeEOS
:
5282 case FFELEX_typeSEMICOLON
:
5283 ffesta_confirmed ();
5284 ffesta_tokens
[1] = NULL
;
5285 return (ffelexHandler
) ffestb_R8351_ (t
);
5288 case FFELEX_typeNAMES
:
5289 if (ffesta_first_kw
!= FFESTR_firstEXIT
)
5290 goto bad_0
; /* :::::::::::::::::::: */
5291 switch (ffelex_token_type (t
))
5294 goto bad_1
; /* :::::::::::::::::::: */
5296 case FFELEX_typeEOS
:
5297 case FFELEX_typeSEMICOLON
:
5300 ffesta_confirmed ();
5301 p
= ffelex_token_text (ffesta_tokens
[0]) + (i
= FFESTR_firstlEXIT
);
5304 ffesta_tokens
[1] = NULL
;
5308 if (!ffesrc_is_name_init (*p
))
5309 goto bad_i
; /* :::::::::::::::::::: */
5311 = ffelex_token_name_from_names (ffesta_tokens
[0], i
, 0);
5313 return (ffelexHandler
) ffestb_R8351_ (t
);
5316 goto bad_0
; /* :::::::::::::::::::: */
5319 bad_0
: /* :::::::::::::::::::: */
5320 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "EXIT", ffesta_tokens
[0]);
5321 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
5323 bad_1
: /* :::::::::::::::::::: */
5324 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "EXIT", t
);
5325 return (ffelexHandler
) ffelex_swallow_tokens (t
,
5326 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
5328 bad_i
: /* :::::::::::::::::::: */
5329 ffesta_ffebad_1sp (FFEBAD_INVALID_STMT_FORM
, "EXIT", ffesta_tokens
[0], i
, t
);
5330 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
5333 /* ffestb_R8351_ -- "EXIT" [NAME]
5335 return ffestb_R8351_; // to lexer
5337 Make sure the next token is an EOS or SEMICOLON. */
5339 static ffelexHandler
5340 ffestb_R8351_ (ffelexToken t
)
5342 switch (ffelex_token_type (t
))
5344 case FFELEX_typeEOS
:
5345 case FFELEX_typeSEMICOLON
:
5346 ffesta_confirmed ();
5347 if (!ffesta_is_inhibited ())
5348 ffestc_R835 (ffesta_tokens
[1]);
5349 if (ffesta_tokens
[1] != NULL
)
5350 ffelex_token_kill (ffesta_tokens
[1]);
5351 return (ffelexHandler
) ffesta_zero (t
);
5354 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "EXIT", t
);
5358 if (ffesta_tokens
[1] != NULL
)
5359 ffelex_token_kill (ffesta_tokens
[1]);
5360 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
5363 /* ffestb_R838 -- Parse the ASSIGN statement
5365 return ffestb_R838; // to lexer
5367 Make sure the statement has a valid form for the ASSIGN statement. If it
5368 does, implement the statement. */
5371 ffestb_R838 (ffelexToken t
)
5373 unsigned const char *p
;
5376 ffelexToken et
; /* First token in target. */
5378 switch (ffelex_token_type (ffesta_tokens
[0]))
5380 case FFELEX_typeNAME
:
5381 if (ffesta_first_kw
!= FFESTR_firstASSIGN
)
5382 goto bad_0
; /* :::::::::::::::::::: */
5383 switch (ffelex_token_type (t
))
5385 case FFELEX_typeEOS
:
5386 case FFELEX_typeSEMICOLON
:
5387 case FFELEX_typeCOMMA
:
5388 case FFELEX_typeCOLONCOLON
:
5389 ffesta_confirmed (); /* Error, but clearly intended. */
5390 goto bad_1
; /* :::::::::::::::::::: */
5393 goto bad_1
; /* :::::::::::::::::::: */
5395 case FFELEX_typeNUMBER
:
5398 ffesta_tokens
[1] = ffelex_token_use (t
);
5399 ffesta_confirmed ();
5400 return (ffelexHandler
) ffestb_R8381_
;
5402 case FFELEX_typeNAMES
:
5403 if (ffesta_first_kw
!= FFESTR_firstASSIGN
)
5404 goto bad_0
; /* :::::::::::::::::::: */
5406 switch (ffelex_token_type (t
))
5408 case FFELEX_typeEOS
:
5409 case FFELEX_typeSEMICOLON
:
5410 ffesta_confirmed ();
5412 case FFELEX_typePERCENT
:
5413 case FFELEX_typeOPEN_PAREN
:
5414 p
= ffelex_token_text (ffesta_tokens
[0]) + (i
= FFESTR_firstlASSIGN
);
5416 goto bad_i
; /* :::::::::::::::::::: */
5418 = ffelex_token_number_from_names (ffesta_tokens
[0], i
);
5419 p
+= ffelex_token_length (ffesta_tokens
[1]); /* Skip to "TO". */
5420 i
+= ffelex_token_length (ffesta_tokens
[1]);
5421 if (!ffesrc_char_match_init (*p
, 'T', 't') /* "TO". */
5422 || (++i
, !ffesrc_char_match_noninit (*++p
, 'O', 'o')))
5424 bad_i_1
: /* :::::::::::::::::::: */
5425 ffelex_token_kill (ffesta_tokens
[1]);
5426 goto bad_i
; /* :::::::::::::::::::: */
5429 if (!ffesrc_is_name_init (*p
))
5430 goto bad_i_1
; /* :::::::::::::::::::: */
5431 et
= ffelex_token_name_from_names (ffesta_tokens
[0], i
, 0);
5432 next
= (ffelexHandler
)
5434 ffeexpr_lhs (ffesta_output_pool
,
5435 FFEEXPR_contextASSIGN
,
5439 ffelex_token_kill (et
);
5440 return (ffelexHandler
) (*next
) (t
);
5442 case FFELEX_typeCOMMA
:
5443 case FFELEX_typeCOLONCOLON
:
5444 ffesta_confirmed (); /* Error, but clearly intended. */
5445 goto bad_1
; /* :::::::::::::::::::: */
5448 goto bad_1
; /* :::::::::::::::::::: */
5452 goto bad_0
; /* :::::::::::::::::::: */
5455 bad_0
: /* :::::::::::::::::::: */
5456 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "ASSIGN", ffesta_tokens
[0]);
5457 return (ffelexHandler
) ffelex_swallow_tokens (t
,
5458 (ffelexHandler
) ffesta_zero
); /* Invalid first token. */
5460 bad_1
: /* :::::::::::::::::::: */
5461 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "ASSIGN", t
);
5462 return (ffelexHandler
) ffelex_swallow_tokens (t
,
5463 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
5465 bad_i
: /* :::::::::::::::::::: */
5466 ffesta_ffebad_1sp (FFEBAD_INVALID_STMT_FORM
, "ASSIGN", ffesta_tokens
[0], i
, t
);
5467 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
5470 /* ffestb_R8381_ -- "ASSIGN" NUMBER
5472 return ffestb_R8381_; // to lexer
5474 Make sure the next token is "TO". */
5476 static ffelexHandler
5477 ffestb_R8381_ (ffelexToken t
)
5479 if ((ffelex_token_type (t
) == FFELEX_typeNAME
)
5480 && (ffesrc_strcmp_2c (ffe_case_match (), ffelex_token_text (t
), "TO", "to",
5483 return (ffelexHandler
) ffestb_R8382_
;
5486 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "ASSIGN", t
);
5487 if (ffelex_token_type (t
) == FFELEX_typeNAME
)
5488 return (ffelexHandler
) ffestb_R8382_ (t
); /* Maybe user forgot "TO". */
5490 ffelex_token_kill (ffesta_tokens
[1]);
5491 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
5494 /* ffestb_R8382_ -- "ASSIGN" NUMBER ("TO")
5496 return ffestb_R8382_; // to lexer
5498 Make sure the next token is a name, then pass it along to the expression
5499 evaluator as an LHS expression. The callback function is _3_. */
5501 static ffelexHandler
5502 ffestb_R8382_ (ffelexToken t
)
5504 if (ffelex_token_type (t
) == FFELEX_typeNAME
)
5506 return (ffelexHandler
)
5508 ffeexpr_lhs (ffesta_output_pool
, FFEEXPR_contextASSIGN
,
5509 (ffeexprCallback
) ffestb_R8383_
)))
5513 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "ASSIGN", t
);
5514 ffelex_token_kill (ffesta_tokens
[1]);
5515 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
5518 /* ffestb_R8383_ -- "ASSIGN" NUMBER ("TO") expression
5520 (ffestb_R8383_) // to expression handler
5522 Make sure the next token is an EOS or SEMICOLON. */
5524 static ffelexHandler
5525 ffestb_R8383_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
5527 switch (ffelex_token_type (t
))
5529 case FFELEX_typeEOS
:
5530 case FFELEX_typeSEMICOLON
:
5531 ffesta_confirmed ();
5534 if (!ffesta_is_inhibited ())
5535 ffestc_R838 (ffesta_tokens
[1], expr
, ft
);
5536 ffelex_token_kill (ffesta_tokens
[1]);
5537 return (ffelexHandler
) ffesta_zero (t
);
5540 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "ASSIGN", t
);
5544 ffelex_token_kill (ffesta_tokens
[1]);
5545 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
5548 /* ffestb_R840 -- Parse an arithmetic-IF statement
5550 return ffestb_R840; // to lexer
5552 Make sure the statement has a valid form for an arithmetic-IF statement.
5553 If it does, implement the statement. */
5556 ffestb_R840 (ffelexToken t
)
5558 switch (ffelex_token_type (ffesta_tokens
[0]))
5560 case FFELEX_typeNAME
:
5561 if (ffelex_token_length (ffesta_tokens
[0]) != FFESTR_firstlIF
)
5562 goto bad_0
; /* :::::::::::::::::::: */
5563 if (ffesta_first_kw
!= FFESTR_firstIF
)
5564 goto bad_0
; /* :::::::::::::::::::: */
5567 case FFELEX_typeNAMES
:
5568 if (ffesta_first_kw
!= FFESTR_firstIF
)
5569 goto bad_0
; /* :::::::::::::::::::: */
5573 goto bad_0
; /* :::::::::::::::::::: */
5576 switch (ffelex_token_type (t
))
5578 case FFELEX_typeOPEN_PAREN
:
5582 goto bad_1
; /* :::::::::::::::::::: */
5585 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
, FFEEXPR_contextARITHIF
,
5586 (ffeexprCallback
) ffestb_R8401_
);
5588 bad_0
: /* :::::::::::::::::::: */
5589 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "arithmetic-IF", ffesta_tokens
[0]);
5590 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
5592 bad_1
: /* :::::::::::::::::::: */
5593 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "arithmetic-IF", t
);
5594 return (ffelexHandler
) ffelex_swallow_tokens (t
,
5595 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
5598 /* ffestb_R8401_ -- "IF" OPEN_PAREN expr
5600 (ffestb_R8401_) // to expression handler
5602 Make sure the next token is CLOSE_PAREN. */
5604 static ffelexHandler
5605 ffestb_R8401_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
5607 ffestb_local_
.if_stmt
.expr
= expr
;
5609 switch (ffelex_token_type (t
))
5611 case FFELEX_typeCLOSE_PAREN
:
5614 ffesta_tokens
[1] = ffelex_token_use (ft
);
5615 ffelex_set_names (TRUE
); /* In case it's a logical IF instead. */
5616 return (ffelexHandler
) ffestb_R8402_
;
5622 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "arithmetic-IF", t
);
5623 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
5626 /* ffestb_R8402_ -- "IF" OPEN_PAREN expr CLOSE_PAREN
5628 return ffestb_R8402_; // to lexer
5630 Make sure the next token is NUMBER. */
5632 static ffelexHandler
5633 ffestb_R8402_ (ffelexToken t
)
5635 ffelex_set_names (FALSE
);
5637 switch (ffelex_token_type (t
))
5639 case FFELEX_typeNUMBER
:
5640 ffesta_confirmed ();
5641 ffesta_tokens
[2] = ffelex_token_use (t
);
5642 return (ffelexHandler
) ffestb_R8403_
;
5648 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "arithmetic-IF", t
);
5649 ffelex_token_kill (ffesta_tokens
[1]);
5650 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
5653 /* ffestb_R8403_ -- "IF" OPEN_PAREN expr CLOSE_PAREN NUMBER
5655 return ffestb_R8403_; // to lexer
5657 Make sure the next token is COMMA. */
5659 static ffelexHandler
5660 ffestb_R8403_ (ffelexToken t
)
5662 switch (ffelex_token_type (t
))
5664 case FFELEX_typeCOMMA
:
5665 return (ffelexHandler
) ffestb_R8404_
;
5671 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "arithmetic-IF", t
);
5672 ffelex_token_kill (ffesta_tokens
[1]);
5673 ffelex_token_kill (ffesta_tokens
[2]);
5674 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
5677 /* ffestb_R8404_ -- "IF" OPEN_PAREN expr CLOSE_PAREN NUMBER COMMA
5679 return ffestb_R8404_; // to lexer
5681 Make sure the next token is NUMBER. */
5683 static ffelexHandler
5684 ffestb_R8404_ (ffelexToken t
)
5686 switch (ffelex_token_type (t
))
5688 case FFELEX_typeNUMBER
:
5689 ffesta_tokens
[3] = ffelex_token_use (t
);
5690 return (ffelexHandler
) ffestb_R8405_
;
5696 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "arithmetic-IF", t
);
5697 ffelex_token_kill (ffesta_tokens
[1]);
5698 ffelex_token_kill (ffesta_tokens
[2]);
5699 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
5702 /* ffestb_R8405_ -- "IF" OPEN_PAREN expr CLOSE_PAREN NUMBER COMMA NUMBER
5704 return ffestb_R8405_; // to lexer
5706 Make sure the next token is COMMA. */
5708 static ffelexHandler
5709 ffestb_R8405_ (ffelexToken t
)
5711 switch (ffelex_token_type (t
))
5713 case FFELEX_typeCOMMA
:
5714 return (ffelexHandler
) ffestb_R8406_
;
5720 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "arithmetic-IF", t
);
5721 ffelex_token_kill (ffesta_tokens
[1]);
5722 ffelex_token_kill (ffesta_tokens
[2]);
5723 ffelex_token_kill (ffesta_tokens
[3]);
5724 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
5727 /* ffestb_R8406_ -- "IF" OPEN_PAREN expr CLOSE_PAREN NUMBER COMMA NUMBER COMMA
5729 return ffestb_R8406_; // to lexer
5731 Make sure the next token is NUMBER. */
5733 static ffelexHandler
5734 ffestb_R8406_ (ffelexToken t
)
5736 switch (ffelex_token_type (t
))
5738 case FFELEX_typeNUMBER
:
5739 ffesta_tokens
[4] = ffelex_token_use (t
);
5740 return (ffelexHandler
) ffestb_R8407_
;
5746 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "arithmetic-IF", t
);
5747 ffelex_token_kill (ffesta_tokens
[1]);
5748 ffelex_token_kill (ffesta_tokens
[2]);
5749 ffelex_token_kill (ffesta_tokens
[3]);
5750 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
5753 /* ffestb_R8407_ -- "IF" OPEN_PAREN expr CLOSE_PAREN NUMBER COMMA NUMBER COMMA
5756 return ffestb_R8407_; // to lexer
5758 Make sure the next token is EOS or SEMICOLON. */
5760 static ffelexHandler
5761 ffestb_R8407_ (ffelexToken t
)
5763 switch (ffelex_token_type (t
))
5765 case FFELEX_typeEOS
:
5766 case FFELEX_typeSEMICOLON
:
5767 if (!ffesta_is_inhibited ())
5768 ffestc_R840 (ffestb_local_
.if_stmt
.expr
, ffesta_tokens
[1],
5769 ffesta_tokens
[2], ffesta_tokens
[3], ffesta_tokens
[4]);
5770 ffelex_token_kill (ffesta_tokens
[1]);
5771 ffelex_token_kill (ffesta_tokens
[2]);
5772 ffelex_token_kill (ffesta_tokens
[3]);
5773 ffelex_token_kill (ffesta_tokens
[4]);
5774 return (ffelexHandler
) ffesta_zero (t
);
5780 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "arithmetic-IF", t
);
5781 ffelex_token_kill (ffesta_tokens
[1]);
5782 ffelex_token_kill (ffesta_tokens
[2]);
5783 ffelex_token_kill (ffesta_tokens
[3]);
5784 ffelex_token_kill (ffesta_tokens
[4]);
5785 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
5788 /* ffestb_R841 -- Parse the CONTINUE statement
5790 return ffestb_R841; // to lexer
5792 Make sure the statement has a valid form for the CONTINUE statement. If
5793 it does, implement the statement. */
5796 ffestb_R841 (ffelexToken t
)
5801 switch (ffelex_token_type (ffesta_tokens
[0]))
5803 case FFELEX_typeNAME
:
5804 if (ffesta_first_kw
!= FFESTR_firstCONTINUE
)
5805 goto bad_0
; /* :::::::::::::::::::: */
5808 case FFELEX_typeNAMES
:
5809 if (ffesta_first_kw
!= FFESTR_firstCONTINUE
)
5810 goto bad_0
; /* :::::::::::::::::::: */
5811 if (ffelex_token_length (ffesta_tokens
[0]) != FFESTR_firstlCONTINUE
)
5813 p
= ffelex_token_text (ffesta_tokens
[0]) + (i
= FFESTR_firstlCONTINUE
);
5814 goto bad_i
; /* :::::::::::::::::::: */
5819 goto bad_0
; /* :::::::::::::::::::: */
5822 switch (ffelex_token_type (t
))
5824 case FFELEX_typeEOS
:
5825 case FFELEX_typeSEMICOLON
:
5826 ffesta_confirmed ();
5827 if (!ffesta_is_inhibited ())
5829 return (ffelexHandler
) ffesta_zero (t
);
5831 case FFELEX_typeCOMMA
:
5832 case FFELEX_typeCOLONCOLON
:
5833 ffesta_confirmed (); /* Error, but clearly intended. */
5834 goto bad_1
; /* :::::::::::::::::::: */
5837 goto bad_1
; /* :::::::::::::::::::: */
5840 bad_0
: /* :::::::::::::::::::: */
5841 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "CONTINUE", ffesta_tokens
[0]);
5842 return (ffelexHandler
) ffelex_swallow_tokens (t
,
5843 (ffelexHandler
) ffesta_zero
); /* Invalid first token. */
5845 bad_1
: /* :::::::::::::::::::: */
5846 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "CONTINUE", t
);
5847 return (ffelexHandler
) ffelex_swallow_tokens (t
,
5848 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
5850 bad_i
: /* :::::::::::::::::::: */
5851 ffesta_ffebad_1sp (FFEBAD_INVALID_STMT_FORM
, "CONTINUE", ffesta_tokens
[0], i
, t
);
5852 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
5855 /* ffestb_R1102 -- Parse the PROGRAM statement
5857 return ffestb_R1102; // to lexer
5859 Make sure the statement has a valid form for the PROGRAM statement. If it
5860 does, implement the statement. */
5863 ffestb_R1102 (ffelexToken t
)
5866 unsigned const char *p
;
5868 switch (ffelex_token_type (ffesta_tokens
[0]))
5870 case FFELEX_typeNAME
:
5871 if (ffesta_first_kw
!= FFESTR_firstPROGRAM
)
5872 goto bad_0
; /* :::::::::::::::::::: */
5873 switch (ffelex_token_type (t
))
5875 case FFELEX_typeEOS
:
5876 case FFELEX_typeSEMICOLON
:
5877 case FFELEX_typeCOMMA
:
5878 case FFELEX_typeCOLONCOLON
:
5879 ffesta_confirmed (); /* Error, but clearly intended. */
5880 goto bad_1
; /* :::::::::::::::::::: */
5883 goto bad_1
; /* :::::::::::::::::::: */
5885 case FFELEX_typeNAME
:
5889 ffesta_confirmed ();
5890 ffesta_tokens
[1] = ffelex_token_use (t
);
5891 return (ffelexHandler
) ffestb_R11021_
;
5893 case FFELEX_typeNAMES
:
5894 if (ffesta_first_kw
!= FFESTR_firstPROGRAM
)
5895 goto bad_0
; /* :::::::::::::::::::: */
5896 switch (ffelex_token_type (t
))
5898 case FFELEX_typeCOMMA
:
5899 case FFELEX_typeCOLONCOLON
:
5900 ffesta_confirmed (); /* Error, but clearly intended. */
5901 goto bad_1
; /* :::::::::::::::::::: */
5904 goto bad_1
; /* :::::::::::::::::::: */
5906 case FFELEX_typeEOS
:
5907 case FFELEX_typeSEMICOLON
:
5910 ffesta_confirmed ();
5911 p
= ffelex_token_text (ffesta_tokens
[0]) + (i
= FFESTR_firstlPROGRAM
);
5912 if (!ffesrc_is_name_init (*p
))
5913 goto bad_i
; /* :::::::::::::::::::: */
5915 = ffelex_token_name_from_names (ffesta_tokens
[0], i
, 0);
5916 return (ffelexHandler
) ffestb_R11021_ (t
);
5919 goto bad_0
; /* :::::::::::::::::::: */
5922 bad_0
: /* :::::::::::::::::::: */
5923 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "PROGRAM", ffesta_tokens
[0]);
5924 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
5926 bad_1
: /* :::::::::::::::::::: */
5927 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "PROGRAM", t
);
5928 return (ffelexHandler
) ffelex_swallow_tokens (t
,
5929 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
5931 bad_i
: /* :::::::::::::::::::: */
5932 ffesta_ffebad_1sp (FFEBAD_INVALID_STMT_FORM
, "PROGRAM", ffesta_tokens
[0], i
, t
);
5933 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
5936 /* ffestb_R11021_ -- "PROGRAM" NAME
5938 return ffestb_R11021_; // to lexer
5940 Make sure the next token is an EOS or SEMICOLON. */
5942 static ffelexHandler
5943 ffestb_R11021_ (ffelexToken t
)
5945 switch (ffelex_token_type (t
))
5947 case FFELEX_typeEOS
:
5948 case FFELEX_typeSEMICOLON
:
5949 ffesta_confirmed ();
5950 if (!ffesta_is_inhibited ())
5951 ffestc_R1102 (ffesta_tokens
[1]);
5952 ffelex_token_kill (ffesta_tokens
[1]);
5953 return (ffelexHandler
) ffesta_zero (t
);
5956 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "PROGRAM", t
);
5960 ffelex_token_kill (ffesta_tokens
[1]);
5961 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
5964 /* ffestb_block -- Parse the BLOCK DATA statement
5966 return ffestb_block; // to lexer
5968 Make sure the statement has a valid form for the BLOCK DATA statement. If
5969 it does, implement the statement. */
5972 ffestb_block (ffelexToken t
)
5974 switch (ffelex_token_type (ffesta_tokens
[0]))
5976 case FFELEX_typeNAME
:
5977 if (ffesta_first_kw
!= FFESTR_firstBLOCK
)
5978 goto bad_0
; /* :::::::::::::::::::: */
5979 switch (ffelex_token_type (t
))
5982 goto bad_1
; /* :::::::::::::::::::: */
5984 case FFELEX_typeNAME
:
5985 if (ffesta_second_kw
!= FFESTR_secondDATA
)
5986 goto bad_1
; /* :::::::::::::::::::: */
5990 ffesta_confirmed ();
5991 return (ffelexHandler
) ffestb_R1111_1_
;
5994 goto bad_0
; /* :::::::::::::::::::: */
5997 bad_0
: /* :::::::::::::::::::: */
5998 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "BLOCK DATA", ffesta_tokens
[0]);
5999 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
6001 bad_1
: /* :::::::::::::::::::: */
6002 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "BLOCK DATA", t
);
6003 return (ffelexHandler
) ffelex_swallow_tokens (t
,
6004 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
6007 /* ffestb_blockdata -- Parse the BLOCKDATA statement
6009 return ffestb_blockdata; // to lexer
6011 Make sure the statement has a valid form for the BLOCKDATA statement. If
6012 it does, implement the statement. */
6015 ffestb_blockdata (ffelexToken t
)
6018 unsigned const char *p
;
6020 switch (ffelex_token_type (ffesta_tokens
[0]))
6022 case FFELEX_typeNAME
:
6023 if (ffesta_first_kw
!= FFESTR_firstBLOCKDATA
)
6024 goto bad_0
; /* :::::::::::::::::::: */
6025 switch (ffelex_token_type (t
))
6027 case FFELEX_typeCOMMA
:
6028 case FFELEX_typeCOLONCOLON
:
6029 ffesta_confirmed (); /* Error, but clearly intended. */
6030 goto bad_1
; /* :::::::::::::::::::: */
6033 goto bad_1
; /* :::::::::::::::::::: */
6035 case FFELEX_typeNAME
:
6036 ffesta_confirmed ();
6037 ffesta_tokens
[1] = ffelex_token_use (t
);
6038 return (ffelexHandler
) ffestb_R1111_2_
;
6040 case FFELEX_typeEOS
:
6041 case FFELEX_typeSEMICOLON
:
6042 ffesta_confirmed ();
6043 ffesta_tokens
[1] = NULL
;
6044 return (ffelexHandler
) ffestb_R1111_2_ (t
);
6047 case FFELEX_typeNAMES
:
6048 if (ffesta_first_kw
!= FFESTR_firstBLOCKDATA
)
6049 goto bad_0
; /* :::::::::::::::::::: */
6050 switch (ffelex_token_type (t
))
6053 goto bad_1
; /* :::::::::::::::::::: */
6055 case FFELEX_typeEOS
:
6056 case FFELEX_typeSEMICOLON
:
6059 ffesta_confirmed ();
6060 p
= ffelex_token_text (ffesta_tokens
[0]) + (i
= FFESTR_firstlBLOCKDATA
);
6063 ffesta_tokens
[1] = NULL
;
6067 if (!ffesrc_is_name_init (*p
))
6068 goto bad_i
; /* :::::::::::::::::::: */
6070 = ffelex_token_name_from_names (ffesta_tokens
[0], i
, 0);
6072 return (ffelexHandler
) ffestb_R1111_2_ (t
);
6075 goto bad_0
; /* :::::::::::::::::::: */
6078 bad_0
: /* :::::::::::::::::::: */
6079 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "BLOCK DATA", ffesta_tokens
[0]);
6080 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
6082 bad_1
: /* :::::::::::::::::::: */
6083 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "BLOCK DATA", t
);
6084 return (ffelexHandler
) ffelex_swallow_tokens (t
,
6085 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
6087 bad_i
: /* :::::::::::::::::::: */
6088 ffesta_ffebad_1sp (FFEBAD_INVALID_STMT_FORM
, "BLOCK DATA", ffesta_tokens
[0], i
, t
);
6089 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
6092 /* ffestb_R1111_1_ -- "BLOCK" "DATA"
6094 return ffestb_R1111_1_; // to lexer
6096 Make sure the next token is a NAME, EOS, or SEMICOLON token. */
6098 static ffelexHandler
6099 ffestb_R1111_1_ (ffelexToken t
)
6101 switch (ffelex_token_type (t
))
6103 case FFELEX_typeNAME
:
6104 ffesta_tokens
[1] = ffelex_token_use (t
);
6105 return (ffelexHandler
) ffestb_R1111_2_
;
6107 case FFELEX_typeEOS
:
6108 case FFELEX_typeSEMICOLON
:
6109 ffesta_tokens
[1] = NULL
;
6110 return (ffelexHandler
) ffestb_R1111_2_ (t
);
6113 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "BLOCK DATA", t
);
6117 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
6120 /* ffestb_R1111_2_ -- "BLOCK/DATA" NAME
6122 return ffestb_R1111_2_; // to lexer
6124 Make sure the next token is an EOS or SEMICOLON. */
6126 static ffelexHandler
6127 ffestb_R1111_2_ (ffelexToken t
)
6129 switch (ffelex_token_type (t
))
6131 case FFELEX_typeEOS
:
6132 case FFELEX_typeSEMICOLON
:
6133 ffesta_confirmed ();
6134 if (!ffesta_is_inhibited ())
6135 ffestc_R1111 (ffesta_tokens
[1]);
6136 if (ffesta_tokens
[1] != NULL
)
6137 ffelex_token_kill (ffesta_tokens
[1]);
6138 return (ffelexHandler
) ffesta_zero (t
);
6141 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "BLOCK DATA", t
);
6145 if (ffesta_tokens
[1] != NULL
)
6146 ffelex_token_kill (ffesta_tokens
[1]);
6147 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
6150 /* ffestb_R1212 -- Parse the CALL statement
6152 return ffestb_R1212; // to lexer
6154 Make sure the statement has a valid form for the CALL statement. If it
6155 does, implement the statement. */
6158 ffestb_R1212 (ffelexToken t
)
6161 unsigned const char *p
;
6165 switch (ffelex_token_type (ffesta_tokens
[0]))
6167 case FFELEX_typeNAME
:
6168 if (ffesta_first_kw
!= FFESTR_firstCALL
)
6169 goto bad_0
; /* :::::::::::::::::::: */
6170 switch (ffelex_token_type (t
))
6172 case FFELEX_typeEOS
:
6173 case FFELEX_typeSEMICOLON
:
6174 case FFELEX_typeCOMMA
:
6175 case FFELEX_typeCOLONCOLON
:
6176 ffesta_confirmed (); /* Error, but clearly intended. */
6177 goto bad_1
; /* :::::::::::::::::::: */
6180 goto bad_1
; /* :::::::::::::::::::: */
6182 case FFELEX_typeNAME
:
6185 ffesta_confirmed ();
6186 return (ffelexHandler
)
6188 ffeexpr_lhs (ffesta_output_pool
, FFEEXPR_contextSUBROUTINEREF
,
6189 (ffeexprCallback
) ffestb_R12121_
)))
6192 case FFELEX_typeNAMES
:
6193 if (ffesta_first_kw
!= FFESTR_firstCALL
)
6194 goto bad_0
; /* :::::::::::::::::::: */
6195 switch (ffelex_token_type (t
))
6197 case FFELEX_typeCOLONCOLON
:
6198 case FFELEX_typeCOMMA
:
6199 ffesta_confirmed (); /* Error, but clearly intended. */
6200 goto bad_1
; /* :::::::::::::::::::: */
6203 goto bad_1
; /* :::::::::::::::::::: */
6205 case FFELEX_typeOPEN_PAREN
:
6208 case FFELEX_typeEOS
:
6209 case FFELEX_typeSEMICOLON
:
6210 ffesta_confirmed ();
6213 p
= ffelex_token_text (ffesta_tokens
[0]) + (i
= FFESTR_firstlCALL
);
6214 if (!ffesrc_is_name_init (*p
))
6215 goto bad_i
; /* :::::::::::::::::::: */
6216 nt
= ffelex_token_name_from_names (ffesta_tokens
[0], i
, 0);
6217 next
= (ffelexHandler
)
6219 ffeexpr_lhs (ffesta_output_pool
, FFEEXPR_contextSUBROUTINEREF
,
6220 (ffeexprCallback
) ffestb_R12121_
)))
6222 ffelex_token_kill (nt
);
6223 return (ffelexHandler
) (*next
) (t
);
6226 goto bad_0
; /* :::::::::::::::::::: */
6229 bad_0
: /* :::::::::::::::::::: */
6230 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "CALL", ffesta_tokens
[0]);
6231 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
6233 bad_1
: /* :::::::::::::::::::: */
6234 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "CALL", t
);
6235 return (ffelexHandler
) ffelex_swallow_tokens (t
,
6236 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
6238 bad_i
: /* :::::::::::::::::::: */
6239 ffesta_ffebad_1sp (FFEBAD_INVALID_STMT_FORM
, "CALL", ffesta_tokens
[0], i
, t
);
6240 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
6243 /* ffestb_R12121_ -- "CALL" expr
6245 (ffestb_R12121_) // to expression handler
6247 Make sure the statement has a valid form for the CALL statement. If it
6248 does, implement the statement. */
6250 static ffelexHandler
6251 ffestb_R12121_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
6253 switch (ffelex_token_type (t
))
6255 case FFELEX_typeEOS
:
6256 case FFELEX_typeSEMICOLON
:
6257 ffesta_confirmed ();
6260 if (!ffesta_is_inhibited ())
6261 ffestc_R1212 (expr
, ft
);
6262 return (ffelexHandler
) ffesta_zero (t
);
6268 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "CALL", t
);
6269 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
6272 /* ffestb_R1227 -- Parse the RETURN statement
6274 return ffestb_R1227; // to lexer
6276 Make sure the statement has a valid form for the RETURN statement. If it
6277 does, implement the statement. */
6280 ffestb_R1227 (ffelexToken t
)
6284 switch (ffelex_token_type (ffesta_tokens
[0]))
6286 case FFELEX_typeNAME
:
6287 if (ffesta_first_kw
!= FFESTR_firstRETURN
)
6288 goto bad_0
; /* :::::::::::::::::::: */
6289 switch (ffelex_token_type (t
))
6291 case FFELEX_typeCOMMA
:
6292 case FFELEX_typeCOLONCOLON
:
6293 ffesta_confirmed (); /* Error, but clearly intended. */
6294 goto bad_1
; /* :::::::::::::::::::: */
6296 case FFELEX_typeEQUALS
:
6297 case FFELEX_typePOINTS
:
6298 case FFELEX_typeCOLON
:
6299 goto bad_1
; /* :::::::::::::::::::: */
6301 case FFELEX_typeEOS
:
6302 case FFELEX_typeSEMICOLON
:
6303 case FFELEX_typeNAME
:
6304 case FFELEX_typeNUMBER
:
6305 ffesta_confirmed ();
6312 return (ffelexHandler
) (*((ffelexHandler
)
6313 ffeexpr_rhs (ffesta_output_pool
, FFEEXPR_contextRETURN
,
6314 (ffeexprCallback
) ffestb_R12271_
)))
6317 case FFELEX_typeNAMES
:
6318 if (ffesta_first_kw
!= FFESTR_firstRETURN
)
6319 goto bad_0
; /* :::::::::::::::::::: */
6320 switch (ffelex_token_type (t
))
6322 case FFELEX_typeCOMMA
:
6323 case FFELEX_typeCOLONCOLON
:
6324 ffesta_confirmed (); /* Error, but clearly intended. */
6325 goto bad_1
; /* :::::::::::::::::::: */
6327 case FFELEX_typeEQUALS
:
6328 case FFELEX_typePOINTS
:
6329 case FFELEX_typeCOLON
:
6330 goto bad_1
; /* :::::::::::::::::::: */
6332 case FFELEX_typeEOS
:
6333 case FFELEX_typeSEMICOLON
:
6334 ffesta_confirmed ();
6340 next
= (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
6341 FFEEXPR_contextRETURN
, (ffeexprCallback
) ffestb_R12271_
);
6342 next
= (ffelexHandler
) ffelex_splice_tokens (next
, ffesta_tokens
[0],
6343 FFESTR_firstlRETURN
);
6345 return (ffelexHandler
) ffelex_swallow_tokens (t
,
6346 (ffelexHandler
) ffesta_zero
);
6347 return (ffelexHandler
) (*next
) (t
);
6350 goto bad_0
; /* :::::::::::::::::::: */
6353 bad_0
: /* :::::::::::::::::::: */
6354 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "RETURN", ffesta_tokens
[0]);
6355 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
6357 bad_1
: /* :::::::::::::::::::: */
6358 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "RETURN", t
);
6359 return (ffelexHandler
) ffelex_swallow_tokens (t
,
6360 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
6363 /* ffestb_R12271_ -- "RETURN" expr
6365 (ffestb_R12271_) // to expression handler
6367 Make sure the next token is an EOS or SEMICOLON. */
6369 static ffelexHandler
6370 ffestb_R12271_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
6372 switch (ffelex_token_type (t
))
6374 case FFELEX_typeEOS
:
6375 case FFELEX_typeSEMICOLON
:
6376 ffesta_confirmed ();
6377 if (!ffesta_is_inhibited ())
6378 ffestc_R1227 (expr
, ft
);
6379 return (ffelexHandler
) ffesta_zero (t
);
6382 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "RETURN", t
);
6386 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
6389 /* ffestb_construct -- Parse a construct name
6391 return ffestb_construct; // to lexer
6393 Make sure the statement can have a construct name (if-then-stmt, do-stmt,
6394 select-case-stmt). */
6397 ffestb_construct (ffelexToken t UNUSED
)
6399 /* This handler gets invoked only when token 0 is NAME/NAMES and token 1 is
6402 ffesta_confirmed ();
6403 ffelex_set_names (TRUE
);
6404 return (ffelexHandler
) ffestb_construct1_
;
6407 /* ffestb_construct1_ -- NAME COLON
6409 return ffestb_construct1_; // to lexer
6411 Make sure we've got a NAME that is DO, DOWHILE, IF, SELECT, or SELECTCASE. */
6413 static ffelexHandler
6414 ffestb_construct1_ (ffelexToken t
)
6416 ffelex_set_names (FALSE
);
6418 switch (ffelex_token_type (t
))
6420 case FFELEX_typeNAME
:
6421 ffesta_first_kw
= ffestr_first (t
);
6422 switch (ffesta_first_kw
)
6424 case FFESTR_firstIF
:
6425 ffestb_local_
.construct
.next
= (ffelexHandler
) ffestb_if
;
6428 case FFESTR_firstDO
:
6429 ffestb_local_
.construct
.next
= (ffelexHandler
) ffestb_do
;
6432 case FFESTR_firstDOWHILE
:
6433 ffestb_local_
.construct
.next
= (ffelexHandler
) ffestb_dowhile
;
6436 case FFESTR_firstSELECT
:
6437 case FFESTR_firstSELECTCASE
:
6438 ffestb_local_
.construct
.next
= (ffelexHandler
) ffestb_R809
;
6442 goto bad
; /* :::::::::::::::::::: */
6444 ffesta_construct_name
= ffesta_tokens
[0];
6445 ffesta_tokens
[0] = ffelex_token_use (t
);
6446 return (ffelexHandler
) ffestb_construct2_
;
6448 case FFELEX_typeNAMES
:
6449 ffesta_first_kw
= ffestr_first (t
);
6450 switch (ffesta_first_kw
)
6452 case FFESTR_firstIF
:
6453 if (ffelex_token_length (t
) != FFESTR_firstlIF
)
6454 goto bad
; /* :::::::::::::::::::: */
6455 ffestb_local_
.construct
.next
= (ffelexHandler
) ffestb_if
;
6458 case FFESTR_firstDO
:
6459 ffestb_local_
.construct
.next
= (ffelexHandler
) ffestb_do
;
6462 case FFESTR_firstDOWHILE
:
6463 if (ffelex_token_length (t
) != FFESTR_firstlDOWHILE
)
6464 goto bad
; /* :::::::::::::::::::: */
6465 ffestb_local_
.construct
.next
= (ffelexHandler
) ffestb_dowhile
;
6468 case FFESTR_firstSELECTCASE
:
6469 if (ffelex_token_length (t
) != FFESTR_firstlSELECTCASE
)
6470 goto bad
; /* :::::::::::::::::::: */
6471 ffestb_local_
.construct
.next
= (ffelexHandler
) ffestb_R809
;
6475 goto bad
; /* :::::::::::::::::::: */
6477 ffesta_construct_name
= ffesta_tokens
[0];
6478 ffesta_tokens
[0] = ffelex_token_use (t
);
6479 return (ffelexHandler
) ffestb_construct2_
;
6485 bad
: /* :::::::::::::::::::: */
6486 ffesta_ffebad_2st (FFEBAD_INVALID_STMT_FORM
, "CONSTRUCT",
6487 ffesta_tokens
[0], t
);
6488 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
6491 /* ffestb_construct2_ -- NAME COLON "DO/DOWHILE/IF/SELECT/SELECTCASE"
6493 return ffestb_construct2_; // to lexer
6495 This extra step is needed to set ffesta_second_kw if the second token
6496 (here) is a NAME, so DO and SELECT can continue to expect it. */
6498 static ffelexHandler
6499 ffestb_construct2_ (ffelexToken t
)
6501 if (ffelex_token_type (t
) == FFELEX_typeNAME
)
6502 ffesta_second_kw
= ffestr_second (t
);
6503 return (ffelexHandler
) (*ffestb_local_
.construct
.next
) (t
);
6506 /* ffestb_R809 -- Parse the SELECTCASE statement
6508 return ffestb_R809; // to lexer
6510 Make sure the statement has a valid form for the SELECTCASE statement.
6511 If it does, implement the statement. */
6514 ffestb_R809 (ffelexToken t
)
6519 switch (ffelex_token_type (ffesta_tokens
[0]))
6521 case FFELEX_typeNAME
:
6522 switch (ffesta_first_kw
)
6524 case FFESTR_firstSELECT
:
6525 if ((ffelex_token_type (t
) != FFELEX_typeNAME
)
6526 || (ffesta_second_kw
!= FFESTR_secondCASE
))
6527 goto bad_1
; /* :::::::::::::::::::: */
6528 ffesta_confirmed ();
6529 return (ffelexHandler
) ffestb_R8091_
;
6531 case FFESTR_firstSELECTCASE
:
6532 return (ffelexHandler
) ffestb_R8091_ (t
);
6535 goto bad_0
; /* :::::::::::::::::::: */
6538 case FFELEX_typeNAMES
:
6539 if (ffesta_first_kw
!= FFESTR_firstSELECTCASE
)
6540 goto bad_0
; /* :::::::::::::::::::: */
6541 switch (ffelex_token_type (t
))
6543 case FFELEX_typeCOMMA
:
6544 case FFELEX_typeEOS
:
6545 case FFELEX_typeSEMICOLON
:
6546 case FFELEX_typeCOLONCOLON
:
6547 ffesta_confirmed (); /* Error, but clearly intended. */
6548 goto bad_1
; /* :::::::::::::::::::: */
6551 goto bad_1
; /* :::::::::::::::::::: */
6553 case FFELEX_typeOPEN_PAREN
:
6556 p
= ffelex_token_text (ffesta_tokens
[0]) + (i
= FFESTR_firstlSELECTCASE
);
6558 goto bad_i
; /* :::::::::::::::::::: */
6559 return (ffelexHandler
) ffestb_R8091_ (t
);
6562 goto bad_0
; /* :::::::::::::::::::: */
6565 bad_0
: /* :::::::::::::::::::: */
6566 if (ffesta_construct_name
!= NULL
)
6568 ffelex_token_kill (ffesta_construct_name
);
6569 ffesta_construct_name
= NULL
;
6571 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "SELECT CASE", ffesta_tokens
[0]);
6572 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
6574 bad_1
: /* :::::::::::::::::::: */
6575 if (ffesta_construct_name
!= NULL
)
6577 ffelex_token_kill (ffesta_construct_name
);
6578 ffesta_construct_name
= NULL
;
6580 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "SELECT CASE", t
);
6581 return (ffelexHandler
) ffelex_swallow_tokens (t
,
6582 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
6584 bad_i
: /* :::::::::::::::::::: */
6585 if (ffesta_construct_name
!= NULL
)
6587 ffelex_token_kill (ffesta_construct_name
);
6588 ffesta_construct_name
= NULL
;
6590 ffesta_ffebad_1sp (FFEBAD_INVALID_STMT_FORM
, "SELECT CASE", ffesta_tokens
[0], i
, t
);
6591 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
6594 /* ffestb_R8091_ -- "SELECTCASE" or "SELECT" "CASE"
6596 return ffestb_R8091_; // to lexer
6598 Make sure the statement has a valid form for the SELECTCASE statement. If it
6599 does, implement the statement. */
6601 static ffelexHandler
6602 ffestb_R8091_ (ffelexToken t
)
6604 switch (ffelex_token_type (t
))
6606 case FFELEX_typeOPEN_PAREN
:
6607 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
6608 FFEEXPR_contextSELECTCASE
, (ffeexprCallback
) ffestb_R8092_
);
6610 case FFELEX_typeEOS
:
6611 case FFELEX_typeSEMICOLON
:
6612 case FFELEX_typeCOMMA
:
6613 case FFELEX_typeCOLONCOLON
:
6614 ffesta_confirmed (); /* Error, but clearly intended. */
6621 if (ffesta_construct_name
!= NULL
)
6623 ffelex_token_kill (ffesta_construct_name
);
6624 ffesta_construct_name
= NULL
;
6626 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "SELECT CASE", t
);
6627 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
6630 /* ffestb_R8092_ -- "SELECT/CASE" OPEN_PAREN expr
6632 (ffestb_R8092_) // to expression handler
6634 Make sure the statement has a valid form for the SELECTCASE statement. If it
6635 does, implement the statement. */
6637 static ffelexHandler
6638 ffestb_R8092_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
6640 switch (ffelex_token_type (t
))
6642 case FFELEX_typeCLOSE_PAREN
:
6645 ffesta_tokens
[1] = ffelex_token_use (ft
);
6646 ffestb_local_
.selectcase
.expr
= expr
;
6647 return (ffelexHandler
) ffestb_R8093_
;
6653 if (ffesta_construct_name
!= NULL
)
6655 ffelex_token_kill (ffesta_construct_name
);
6656 ffesta_construct_name
= NULL
;
6658 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "SELECT CASE", t
);
6659 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
6662 /* ffestb_R8093_ -- "SELECT/CASE" OPEN_PAREN expr CLOSE_PAREN
6664 return ffestb_R8093_; // to lexer
6666 Make sure the statement has a valid form for the SELECTCASE statement. If it
6667 does, implement the statement. */
6669 static ffelexHandler
6670 ffestb_R8093_ (ffelexToken t
)
6672 switch (ffelex_token_type (t
))
6674 case FFELEX_typeEOS
:
6675 case FFELEX_typeSEMICOLON
:
6676 ffesta_confirmed ();
6677 if (!ffesta_is_inhibited ())
6678 ffestc_R809 (ffesta_construct_name
, ffestb_local_
.selectcase
.expr
,
6680 ffelex_token_kill (ffesta_tokens
[1]);
6681 if (ffesta_construct_name
!= NULL
)
6683 ffelex_token_kill (ffesta_construct_name
);
6684 ffesta_construct_name
= NULL
;
6686 return ffesta_zero (t
);
6688 case FFELEX_typeCOMMA
:
6689 case FFELEX_typeCOLONCOLON
:
6690 ffesta_confirmed (); /* Error, but clearly intended. */
6697 ffelex_token_kill (ffesta_tokens
[1]);
6698 if (ffesta_construct_name
!= NULL
)
6700 ffelex_token_kill (ffesta_construct_name
);
6701 ffesta_construct_name
= NULL
;
6703 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "SELECT CASE", t
);
6704 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
6707 /* ffestb_R810 -- Parse the CASE statement
6709 return ffestb_R810; // to lexer
6711 Make sure the statement has a valid form for the CASE statement.
6712 If it does, implement the statement. */
6715 ffestb_R810 (ffelexToken t
)
6718 unsigned const char *p
;
6720 switch (ffelex_token_type (ffesta_tokens
[0]))
6722 case FFELEX_typeNAME
:
6723 if (ffesta_first_kw
!= FFESTR_firstCASE
)
6724 goto bad_0
; /* :::::::::::::::::::: */
6725 switch (ffelex_token_type (t
))
6727 case FFELEX_typeCOMMA
:
6728 case FFELEX_typeEOS
:
6729 case FFELEX_typeSEMICOLON
:
6730 case FFELEX_typeCOLONCOLON
:
6731 ffesta_confirmed (); /* Error, but clearly intended. */
6732 goto bad_1
; /* :::::::::::::::::::: */
6735 goto bad_1
; /* :::::::::::::::::::: */
6737 case FFELEX_typeNAME
:
6738 ffesta_confirmed ();
6739 if (ffesta_second_kw
!= FFESTR_secondDEFAULT
)
6740 goto bad_1
; /* :::::::::::::::::::: */
6741 ffestb_local_
.case_stmt
.cases
= NULL
;
6742 return (ffelexHandler
) ffestb_R8101_
;
6744 case FFELEX_typeOPEN_PAREN
:
6745 ffestb_local_
.case_stmt
.cases
= ffestt_caselist_create ();
6746 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
6747 FFEEXPR_contextCASE
, (ffeexprCallback
) ffestb_R8103_
);
6750 case FFELEX_typeNAMES
:
6751 switch (ffesta_first_kw
)
6753 case FFESTR_firstCASEDEFAULT
:
6754 switch (ffelex_token_type (t
))
6756 case FFELEX_typeCOMMA
:
6757 case FFELEX_typeCOLONCOLON
:
6758 ffesta_confirmed (); /* Error, but clearly intended. */
6759 goto bad_1
; /* :::::::::::::::::::: */
6762 goto bad_1
; /* :::::::::::::::::::: */
6764 case FFELEX_typeEOS
:
6765 case FFELEX_typeSEMICOLON
:
6766 ffesta_confirmed ();
6769 ffestb_local_
.case_stmt
.cases
= NULL
;
6770 p
= ffelex_token_text (ffesta_tokens
[0])
6771 + (i
= FFESTR_firstlCASEDEFAULT
);
6773 return (ffelexHandler
) ffestb_R8101_ (t
);
6774 if (!ffesrc_is_name_init (*p
))
6775 goto bad_i
; /* :::::::::::::::::::: */
6776 ffesta_tokens
[1] = ffelex_token_name_from_names (ffesta_tokens
[0], i
,
6778 return (ffelexHandler
) ffestb_R8102_ (t
);
6780 case FFESTR_firstCASE
:
6784 goto bad_0
; /* :::::::::::::::::::: */
6787 switch (ffelex_token_type (t
))
6789 case FFELEX_typeCOMMA
:
6790 case FFELEX_typeEOS
:
6791 case FFELEX_typeSEMICOLON
:
6792 case FFELEX_typeCOLONCOLON
:
6793 ffesta_confirmed (); /* Error, but clearly intended. */
6794 goto bad_1
; /* :::::::::::::::::::: */
6797 goto bad_1
; /* :::::::::::::::::::: */
6799 case FFELEX_typeOPEN_PAREN
:
6802 p
= ffelex_token_text (ffesta_tokens
[0]) + (i
= FFESTR_firstlCASE
);
6804 goto bad_i
; /* :::::::::::::::::::: */
6805 ffestb_local_
.case_stmt
.cases
= ffestt_caselist_create ();
6806 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
6807 FFEEXPR_contextCASE
, (ffeexprCallback
) ffestb_R8103_
);
6810 goto bad_0
; /* :::::::::::::::::::: */
6813 bad_0
: /* :::::::::::::::::::: */
6814 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "CASE", ffesta_tokens
[0]);
6815 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
6817 bad_1
: /* :::::::::::::::::::: */
6818 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "CASE", t
);
6819 return (ffelexHandler
) ffelex_swallow_tokens (t
,
6820 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
6822 bad_i
: /* :::::::::::::::::::: */
6823 ffesta_ffebad_1sp (FFEBAD_INVALID_STMT_FORM
, "CASE", ffesta_tokens
[0], i
, t
);
6824 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
6827 /* ffestb_R8101_ -- "CASE" case-selector
6829 return ffestb_R8101_; // to lexer
6831 Make sure the statement has a valid form for the CASE statement. If it
6832 does, implement the statement. */
6834 static ffelexHandler
6835 ffestb_R8101_ (ffelexToken t
)
6837 switch (ffelex_token_type (t
))
6839 case FFELEX_typeNAME
:
6840 ffesta_tokens
[1] = ffelex_token_use (t
);
6841 return (ffelexHandler
) ffestb_R8102_
;
6843 case FFELEX_typeEOS
:
6844 case FFELEX_typeSEMICOLON
:
6845 ffesta_tokens
[1] = NULL
;
6846 return (ffelexHandler
) ffestb_R8102_ (t
);
6848 case FFELEX_typeCOMMA
:
6849 case FFELEX_typeCOLONCOLON
:
6850 ffesta_confirmed (); /* Error, but clearly intended. */
6857 if (ffestb_local_
.case_stmt
.cases
!= NULL
)
6858 ffestt_caselist_kill (ffestb_local_
.case_stmt
.cases
);
6859 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "CASE", t
);
6860 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
6863 /* ffestb_R8102_ -- "CASE" case-selector [NAME]
6865 return ffestb_R8102_; // to lexer
6867 Make sure the statement has a valid form for the CASE statement. If it
6868 does, implement the statement. */
6870 static ffelexHandler
6871 ffestb_R8102_ (ffelexToken t
)
6873 switch (ffelex_token_type (t
))
6875 case FFELEX_typeEOS
:
6876 case FFELEX_typeSEMICOLON
:
6877 ffesta_confirmed ();
6878 if (!ffesta_is_inhibited ())
6879 ffestc_R810 (ffestb_local_
.case_stmt
.cases
, ffesta_tokens
[1]);
6880 if (ffestb_local_
.case_stmt
.cases
!= NULL
)
6881 ffestt_caselist_kill (ffestb_local_
.case_stmt
.cases
);
6882 if (ffesta_tokens
[1] != NULL
)
6883 ffelex_token_kill (ffesta_tokens
[1]);
6884 return (ffelexHandler
) ffesta_zero (t
);
6886 case FFELEX_typeCOMMA
:
6887 case FFELEX_typeCOLONCOLON
:
6888 ffesta_confirmed (); /* Error, but clearly intended. */
6895 if (ffestb_local_
.case_stmt
.cases
!= NULL
)
6896 ffestt_caselist_kill (ffestb_local_
.case_stmt
.cases
);
6897 if (ffesta_tokens
[1] != NULL
)
6898 ffelex_token_kill (ffesta_tokens
[1]);
6899 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "CASE", t
);
6900 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
6903 /* ffestb_R8103_ -- "CASE" OPEN_PAREN expr
6905 (ffestb_R8103_) // to expression handler
6907 Make sure the statement has a valid form for the CASE statement. If it
6908 does, implement the statement. */
6910 static ffelexHandler
6911 ffestb_R8103_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
6913 switch (ffelex_token_type (t
))
6915 case FFELEX_typeCLOSE_PAREN
:
6916 ffestt_caselist_append (ffestb_local_
.case_stmt
.cases
, FALSE
, expr
, NULL
,
6917 ffelex_token_use (ft
));
6918 return (ffelexHandler
) ffestb_R8101_
;
6920 case FFELEX_typeCOMMA
:
6921 ffestt_caselist_append (ffestb_local_
.case_stmt
.cases
, FALSE
, expr
, NULL
,
6922 ffelex_token_use (ft
));
6923 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
6924 FFEEXPR_contextCASE
, (ffeexprCallback
) ffestb_R8103_
);
6926 case FFELEX_typeCOLON
:
6927 ffestt_caselist_append (ffestb_local_
.case_stmt
.cases
, TRUE
, expr
, NULL
,
6928 ffelex_token_use (ft
)); /* NULL second expr for
6929 now, just plug in. */
6930 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
6931 FFEEXPR_contextCASE
, (ffeexprCallback
) ffestb_R8104_
);
6937 ffestt_caselist_kill (ffestb_local_
.case_stmt
.cases
);
6938 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "CASE", t
);
6939 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
6942 /* ffestb_R8104_ -- "CASE" OPEN_PAREN expr COLON expr
6944 (ffestb_R8104_) // to expression handler
6946 Make sure the statement has a valid form for the CASE statement. If it
6947 does, implement the statement. */
6949 static ffelexHandler
6950 ffestb_R8104_ (ffelexToken ft UNUSED
, ffebld expr
, ffelexToken t
)
6952 switch (ffelex_token_type (t
))
6954 case FFELEX_typeCLOSE_PAREN
:
6955 ffestb_local_
.case_stmt
.cases
->previous
->expr2
= expr
;
6956 return (ffelexHandler
) ffestb_R8101_
;
6958 case FFELEX_typeCOMMA
:
6959 ffestb_local_
.case_stmt
.cases
->previous
->expr2
= expr
;
6960 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
6961 FFEEXPR_contextCASE
, (ffeexprCallback
) ffestb_R8103_
);
6967 ffestt_caselist_kill (ffestb_local_
.case_stmt
.cases
);
6968 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "CASE", t
);
6969 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
6972 /* ffestb_R1001 -- Parse a FORMAT statement
6974 return ffestb_R1001; // to lexer
6976 Make sure the statement has a valid form for an FORMAT statement.
6977 If it does, implement the statement. */
6980 ffestb_R1001 (ffelexToken t
)
6984 switch (ffelex_token_type (ffesta_tokens
[0]))
6986 case FFELEX_typeNAME
:
6987 if (ffesta_first_kw
!= FFESTR_firstFORMAT
)
6988 goto bad_0
; /* :::::::::::::::::::: */
6991 case FFELEX_typeNAMES
:
6992 if (ffesta_first_kw
!= FFESTR_firstFORMAT
)
6993 goto bad_0
; /* :::::::::::::::::::: */
6994 if (ffelex_token_length (ffesta_tokens
[0]) != FFESTR_firstlFORMAT
)
6995 goto bad_0
; /* :::::::::::::::::::: */
6999 goto bad_0
; /* :::::::::::::::::::: */
7002 switch (ffelex_token_type (t
))
7004 case FFELEX_typeOPEN_PAREN
:
7005 ffestb_local_
.format
.complained
= FALSE
;
7006 ffestb_local_
.format
.f
= NULL
; /* No parent yet. */
7007 ffestb_local_
.format
.f
= ffestt_formatlist_create (NULL
,
7008 ffelex_token_use (t
));
7009 ffelex_set_names_pure (TRUE
); /* Have even free-form lexer give us
7011 return (ffelexHandler
) ffestb_R10011_
;
7013 case FFELEX_typeOPEN_ARRAY
:/* "(/". */
7014 ffesta_confirmed ();
7015 ffestb_local_
.format
.complained
= FALSE
;
7016 ffestb_local_
.format
.f
= ffestt_formatlist_create (NULL
,
7017 ffelex_token_use (t
));
7018 f
= ffestt_formatlist_append (ffestb_local_
.format
.f
);
7019 f
->type
= FFESTP_formattypeSLASH
;
7020 f
->t
= ffelex_token_use (t
);
7021 f
->u
.R1010
.val
.present
= FALSE
;
7022 f
->u
.R1010
.val
.rtexpr
= FALSE
;
7023 f
->u
.R1010
.val
.t
= NULL
;
7024 f
->u
.R1010
.val
.u
.unsigned_val
= 1;
7025 ffelex_set_names_pure (TRUE
); /* Have even free-form lexer give us
7027 return (ffelexHandler
) ffestb_R100112_
;
7029 case FFELEX_typeEOS
:
7030 case FFELEX_typeSEMICOLON
:
7031 case FFELEX_typeCOMMA
:
7032 case FFELEX_typeCOLONCOLON
:
7033 ffesta_confirmed (); /* Error, but clearly intended. */
7034 goto bad_1
; /* :::::::::::::::::::: */
7037 goto bad_1
; /* :::::::::::::::::::: */
7040 bad_0
: /* :::::::::::::::::::: */
7041 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "FORMAT", ffesta_tokens
[0]);
7042 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
7044 bad_1
: /* :::::::::::::::::::: */
7045 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "FORMAT", t
);
7046 return (ffelexHandler
) ffelex_swallow_tokens (t
,
7047 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
7050 /* ffestb_R10011_ -- "FORMAT" OPEN_PAREN expr
7052 return ffestb_R10011_; // to lexer
7054 For CLOSE_PAREN, wrap up the format list and if it is the top-level one,
7055 exit. For anything else, pass it to _2_. */
7057 static ffelexHandler
7058 ffestb_R10011_ (ffelexToken t
)
7062 switch (ffelex_token_type (t
))
7064 case FFELEX_typeCLOSE_PAREN
:
7068 return (ffelexHandler
) ffestb_R10012_ (t
);
7071 /* If we have a format we're working on, continue working on it. */
7073 f
= ffestb_local_
.format
.f
->u
.root
.parent
;
7077 ffestb_local_
.format
.f
= f
->next
;
7078 return (ffelexHandler
) ffestb_R100111_
;
7081 return (ffelexHandler
) ffestb_R100114_
;
7084 /* ffestb_R10012_ -- "FORMAT" OPEN_PAREN [format-item-list]
7086 return ffestb_R10012_; // to lexer
7088 The initial state for a format-item. Here, just handle the initial
7089 number, sign for number, or run-time expression. Also handle spurious
7090 comma, close-paren (indicating spurious comma), close-array (like
7091 close-paren but preceded by slash), and quoted strings. */
7093 static ffelexHandler
7094 ffestb_R10012_ (ffelexToken t
)
7096 unsigned long unsigned_val
;
7099 switch (ffelex_token_type (t
))
7101 case FFELEX_typeOPEN_ANGLE
:
7102 ffesta_confirmed ();
7103 ffestb_local_
.format
.pre
.t
= ffelex_token_use (t
);
7104 ffelex_set_names_pure (FALSE
);
7105 if (!ffesta_seen_first_exec
&& !ffestb_local_
.format
.complained
)
7107 ffestb_local_
.format
.complained
= TRUE
;
7108 ffebad_start (FFEBAD_FORMAT_EXPR_SPEC
);
7109 ffebad_here (0, ffelex_token_where_line (t
), ffelex_token_where_column (t
));
7112 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
7113 FFEEXPR_contextFORMAT
, (ffeexprCallback
) ffestb_R100115_
);
7115 case FFELEX_typeNUMBER
:
7116 ffestb_local_
.format
.sign
= FALSE
; /* No sign present. */
7117 ffestb_local_
.format
.pre
.present
= TRUE
;
7118 ffestb_local_
.format
.pre
.rtexpr
= FALSE
;
7119 ffestb_local_
.format
.pre
.t
= ffelex_token_use (t
);
7120 ffestb_local_
.format
.pre
.u
.unsigned_val
= unsigned_val
7121 = strtoul (ffelex_token_text (t
), NULL
, 10);
7122 ffelex_set_expecting_hollerith (unsigned_val
, '\0',
7123 ffelex_token_where_line (t
),
7124 ffelex_token_where_column (t
));
7125 return (ffelexHandler
) ffestb_R10014_
;
7127 case FFELEX_typePLUS
:
7128 ffestb_local_
.format
.sign
= TRUE
; /* Positive. */
7129 ffestb_local_
.format
.pre
.t
= ffelex_token_use (t
);
7130 return (ffelexHandler
) ffestb_R10013_
;
7132 case FFELEX_typeMINUS
:
7133 ffestb_local_
.format
.sign
= FALSE
; /* Negative. */
7134 ffestb_local_
.format
.pre
.t
= ffelex_token_use (t
);
7135 return (ffelexHandler
) ffestb_R10013_
;
7137 case FFELEX_typeCOLON
:
7138 case FFELEX_typeCOLONCOLON
:/* "::". */
7139 case FFELEX_typeSLASH
:
7140 case FFELEX_typeCONCAT
: /* "//". */
7141 case FFELEX_typeNAMES
:
7142 case FFELEX_typeDOLLAR
:
7143 case FFELEX_typeOPEN_PAREN
:
7144 case FFELEX_typeOPEN_ARRAY
:/* "(/". */
7145 ffestb_local_
.format
.sign
= FALSE
; /* No sign present. */
7146 ffestb_local_
.format
.pre
.present
= FALSE
;
7147 ffestb_local_
.format
.pre
.rtexpr
= FALSE
;
7148 ffestb_local_
.format
.pre
.t
= NULL
;
7149 ffestb_local_
.format
.pre
.u
.unsigned_val
= 1;
7150 return (ffelexHandler
) ffestb_R10014_ (t
);
7152 case FFELEX_typeCOMMA
:
7153 ffebad_start (FFEBAD_FORMAT_EXTRA_COMMA
);
7154 ffebad_here (0, ffelex_token_where_line (t
), ffelex_token_where_column (t
));
7156 return (ffelexHandler
) ffestb_R10012_
;
7158 case FFELEX_typeCLOSE_PAREN
:
7159 ffebad_start (FFEBAD_FORMAT_EXTRA_COMMA
);
7160 ffebad_here (0, ffelex_token_where_line (t
), ffelex_token_where_column (t
));
7162 f
= ffestb_local_
.format
.f
->u
.root
.parent
;
7164 return (ffelexHandler
) ffestb_R100114_
;
7165 ffestb_local_
.format
.f
= f
->next
;
7166 return (ffelexHandler
) ffestb_R100111_
;
7168 case FFELEX_typeCLOSE_ARRAY
: /* "/)". */
7169 f
= ffestt_formatlist_append (ffestb_local_
.format
.f
);
7170 f
->type
= FFESTP_formattypeSLASH
;
7171 f
->t
= ffelex_token_use (t
);
7172 f
->u
.R1010
.val
.present
= FALSE
;
7173 f
->u
.R1010
.val
.rtexpr
= FALSE
;
7174 f
->u
.R1010
.val
.t
= NULL
;
7175 f
->u
.R1010
.val
.u
.unsigned_val
= 1;
7176 f
= ffestb_local_
.format
.f
->u
.root
.parent
;
7178 return (ffelexHandler
) ffestb_R100114_
;
7179 ffestb_local_
.format
.f
= f
->next
;
7180 return (ffelexHandler
) ffestb_R100111_
;
7182 case FFELEX_typeEOS
:
7183 case FFELEX_typeSEMICOLON
:
7184 ffesta_confirmed ();
7185 ffesta_ffebad_1t (FFEBAD_FORMAT_MISSING_PAREN
, t
);
7186 for (f
= ffestb_local_
.format
.f
;
7187 f
->u
.root
.parent
!= NULL
;
7188 f
= f
->u
.root
.parent
->next
)
7190 ffestb_local_
.format
.f
= f
;
7191 return (ffelexHandler
) ffestb_R100114_ (t
);
7193 case FFELEX_typeQUOTE
:
7195 break; /* Error, probably something like FORMAT("17)
7197 ffelex_set_expecting_hollerith (-1, '\"',
7198 ffelex_token_where_line (t
),
7199 ffelex_token_where_column (t
)); /* Don't have to unset
7201 return (ffelexHandler
) ffestb_R100113_
;
7203 case FFELEX_typeAPOSTROPHE
:
7204 #if 0 /* No apparent need for this, and not killed
7206 ffesta_tokens
[1] = ffelex_token_use (t
);
7208 ffelex_set_expecting_hollerith (-1, '\'',
7209 ffelex_token_where_line (t
),
7210 ffelex_token_where_column (t
)); /* Don't have to unset
7212 return (ffelexHandler
) ffestb_R100113_
;
7218 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "FORMAT", t
);
7219 ffestt_formatlist_kill (ffestb_local_
.format
.f
);
7220 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
7223 /* ffestb_R10013_ -- "FORMAT" OPEN_PAREN [format-item-list] PLUS/MINUS
7225 return ffestb_R10013_; // to lexer
7227 Expect a NUMBER or complain about and then ignore the PLUS/MINUS. */
7229 static ffelexHandler
7230 ffestb_R10013_ (ffelexToken t
)
7232 unsigned long unsigned_val
;
7234 switch (ffelex_token_type (t
))
7236 case FFELEX_typeNUMBER
:
7237 ffestb_local_
.format
.pre
.present
= TRUE
;
7238 ffestb_local_
.format
.pre
.rtexpr
= FALSE
;
7239 unsigned_val
= strtoul (ffelex_token_text (t
), NULL
, 10);
7240 ffestb_local_
.format
.pre
.u
.signed_val
= ffestb_local_
.format
.sign
7241 ? unsigned_val
: -unsigned_val
;
7242 ffestb_local_
.format
.sign
= TRUE
; /* Sign present. */
7243 return (ffelexHandler
) ffestb_R10014_
;
7246 ffebad_start (FFEBAD_FORMAT_SPURIOUS_SIGN
);
7247 ffebad_here (0, ffelex_token_where_line (ffestb_local_
.format
.pre
.t
),
7248 ffelex_token_where_column (ffestb_local_
.format
.pre
.t
));
7250 ffelex_token_kill (ffestb_local_
.format
.pre
.t
);
7251 return (ffelexHandler
) ffestb_R10012_ (t
);
7255 /* ffestb_R10014_ -- "FORMAT" OPEN_PAREN [format-item-list] [[+/-] NUMBER]
7257 return ffestb_R10014_; // to lexer
7259 Here is where we expect to see the actual NAMES, COLON, SLASH, OPEN_PAREN,
7260 OPEN_ARRAY, COLONCOLON, CONCAT, DOLLAR, or HOLLERITH that identifies what
7261 kind of format-item we're dealing with. But if we see a NUMBER instead, it
7262 means free-form spaces number like "5 6 X", so scale the current number
7263 accordingly and reenter this state. (I really wouldn't be surprised if
7264 they change this spacing rule in the F90 spec so that you can't embed
7265 spaces within numbers or within keywords like BN in a free-source-form
7268 static ffelexHandler
7269 ffestb_R10014_ (ffelexToken t
)
7276 ffelex_set_expecting_hollerith (0, '\0',
7277 ffewhere_line_unknown (),
7278 ffewhere_column_unknown ());
7280 switch (ffelex_token_type (t
))
7282 case FFELEX_typeHOLLERITH
:
7283 f
= ffestt_formatlist_append (ffestb_local_
.format
.f
);
7284 f
->type
= FFESTP_formattypeR1016
;
7285 f
->t
= ffelex_token_use (t
);
7286 ffelex_token_kill (ffestb_local_
.format
.pre
.t
); /* It WAS present! */
7287 return (ffelexHandler
) ffestb_R100111_
;
7289 case FFELEX_typeNUMBER
:
7290 assert (ffestb_local_
.format
.pre
.present
);
7291 ffesta_confirmed ();
7292 if (ffestb_local_
.format
.pre
.rtexpr
)
7294 ffebad_start (FFEBAD_FORMAT_SPURIOUS_NUMBER
);
7295 ffebad_here (0, ffelex_token_where_line (t
), ffelex_token_where_column (t
));
7297 return (ffelexHandler
) ffestb_R10014_
;
7299 if (ffestb_local_
.format
.sign
)
7301 for (i
= ffelex_token_length (t
) + 1; i
> 0; --i
)
7302 ffestb_local_
.format
.pre
.u
.signed_val
*= 10;
7303 ffestb_local_
.format
.pre
.u
.signed_val
+= strtoul (ffelex_token_text (t
),
7308 for (i
= ffelex_token_length (t
) + 1; i
> 0; --i
)
7309 ffestb_local_
.format
.pre
.u
.unsigned_val
*= 10;
7310 ffestb_local_
.format
.pre
.u
.unsigned_val
+= strtoul (ffelex_token_text (t
),
7312 ffelex_set_expecting_hollerith (ffestb_local_
.format
.pre
.u
.unsigned_val
,
7314 ffelex_token_where_line (t
),
7315 ffelex_token_where_column (t
));
7317 return (ffelexHandler
) ffestb_R10014_
;
7319 case FFELEX_typeCOLONCOLON
: /* "::". */
7320 if (ffestb_local_
.format
.pre
.present
)
7322 ffesta_ffebad_1t (FFEBAD_FORMAT_BAD_COLON_SPEC
,
7323 ffestb_local_
.format
.pre
.t
);
7324 ffelex_token_kill (ffestb_local_
.format
.pre
.t
);
7325 ffestb_local_
.format
.pre
.present
= FALSE
;
7329 f
= ffestt_formatlist_append (ffestb_local_
.format
.f
);
7330 f
->type
= FFESTP_formattypeCOLON
;
7331 f
->t
= ffelex_token_use (t
);
7332 f
->u
.R1010
.val
.present
= FALSE
;
7333 f
->u
.R1010
.val
.rtexpr
= FALSE
;
7334 f
->u
.R1010
.val
.t
= NULL
;
7335 f
->u
.R1010
.val
.u
.unsigned_val
= 1;
7337 f
= ffestt_formatlist_append (ffestb_local_
.format
.f
);
7338 f
->type
= FFESTP_formattypeCOLON
;
7339 f
->t
= ffelex_token_use (t
);
7340 f
->u
.R1010
.val
.present
= FALSE
;
7341 f
->u
.R1010
.val
.rtexpr
= FALSE
;
7342 f
->u
.R1010
.val
.t
= NULL
;
7343 f
->u
.R1010
.val
.u
.unsigned_val
= 1;
7344 return (ffelexHandler
) ffestb_R100112_
;
7346 case FFELEX_typeCOLON
:
7347 if (ffestb_local_
.format
.pre
.present
)
7349 ffesta_ffebad_1t (FFEBAD_FORMAT_BAD_COLON_SPEC
,
7350 ffestb_local_
.format
.pre
.t
);
7351 ffelex_token_kill (ffestb_local_
.format
.pre
.t
);
7352 return (ffelexHandler
) ffestb_R100112_
;
7354 f
= ffestt_formatlist_append (ffestb_local_
.format
.f
);
7355 f
->type
= FFESTP_formattypeCOLON
;
7356 f
->t
= ffelex_token_use (t
);
7357 f
->u
.R1010
.val
.present
= FALSE
;
7358 f
->u
.R1010
.val
.rtexpr
= FALSE
;
7359 f
->u
.R1010
.val
.t
= NULL
;
7360 f
->u
.R1010
.val
.u
.unsigned_val
= 1;
7361 return (ffelexHandler
) ffestb_R100112_
;
7363 case FFELEX_typeCONCAT
: /* "//". */
7364 if (ffestb_local_
.format
.sign
)
7366 ffebad_start (FFEBAD_FORMAT_SPURIOUS_SIGN
);
7367 ffebad_here (0, ffelex_token_where_line (ffestb_local_
.format
.pre
.t
),
7368 ffelex_token_where_column (ffestb_local_
.format
.pre
.t
));
7370 ffestb_local_
.format
.pre
.u
.unsigned_val
7371 = (ffestb_local_
.format
.pre
.u
.signed_val
< 0)
7372 ? -ffestb_local_
.format
.pre
.u
.signed_val
7373 : ffestb_local_
.format
.pre
.u
.signed_val
;
7375 f
= ffestt_formatlist_append (ffestb_local_
.format
.f
);
7376 f
->type
= FFESTP_formattypeSLASH
;
7377 f
->t
= ffelex_token_use (t
);
7378 f
->u
.R1010
.val
= ffestb_local_
.format
.pre
;
7379 ffestb_local_
.format
.pre
.present
= FALSE
;
7380 ffestb_local_
.format
.pre
.rtexpr
= FALSE
;
7381 ffestb_local_
.format
.pre
.t
= NULL
;
7382 ffestb_local_
.format
.pre
.u
.unsigned_val
= 1;
7383 f
= ffestt_formatlist_append (ffestb_local_
.format
.f
);
7384 f
->type
= FFESTP_formattypeSLASH
;
7385 f
->t
= ffelex_token_use (t
);
7386 f
->u
.R1010
.val
= ffestb_local_
.format
.pre
;
7387 return (ffelexHandler
) ffestb_R100112_
;
7389 case FFELEX_typeSLASH
:
7390 if (ffestb_local_
.format
.sign
)
7392 ffebad_start (FFEBAD_FORMAT_SPURIOUS_SIGN
);
7393 ffebad_here (0, ffelex_token_where_line (ffestb_local_
.format
.pre
.t
),
7394 ffelex_token_where_column (ffestb_local_
.format
.pre
.t
));
7396 ffestb_local_
.format
.pre
.u
.unsigned_val
7397 = (ffestb_local_
.format
.pre
.u
.signed_val
< 0)
7398 ? -ffestb_local_
.format
.pre
.u
.signed_val
7399 : ffestb_local_
.format
.pre
.u
.signed_val
;
7401 f
= ffestt_formatlist_append (ffestb_local_
.format
.f
);
7402 f
->type
= FFESTP_formattypeSLASH
;
7403 f
->t
= ffelex_token_use (t
);
7404 f
->u
.R1010
.val
= ffestb_local_
.format
.pre
;
7405 return (ffelexHandler
) ffestb_R100112_
;
7407 case FFELEX_typeOPEN_PAREN
:
7408 if (ffestb_local_
.format
.sign
)
7410 ffebad_start (FFEBAD_FORMAT_SPURIOUS_SIGN
);
7411 ffebad_here (0, ffelex_token_where_line (ffestb_local_
.format
.pre
.t
),
7412 ffelex_token_where_column (ffestb_local_
.format
.pre
.t
));
7414 ffestb_local_
.format
.pre
.u
.unsigned_val
7415 = (ffestb_local_
.format
.pre
.u
.signed_val
< 0)
7416 ? -ffestb_local_
.format
.pre
.u
.signed_val
7417 : ffestb_local_
.format
.pre
.u
.signed_val
;
7419 f
= ffestt_formatlist_append (ffestb_local_
.format
.f
);
7420 f
->type
= FFESTP_formattypeFORMAT
;
7421 f
->t
= ffelex_token_use (t
);
7422 f
->u
.R1003D
.R1004
= ffestb_local_
.format
.pre
;
7423 f
->u
.R1003D
.format
= ffestb_local_
.format
.f
7424 = ffestt_formatlist_create (f
, ffelex_token_use (t
));
7425 return (ffelexHandler
) ffestb_R10011_
;
7427 case FFELEX_typeOPEN_ARRAY
:/* "(/". */
7428 if (ffestb_local_
.format
.sign
)
7430 ffebad_start (FFEBAD_FORMAT_SPURIOUS_SIGN
);
7431 ffebad_here (0, ffelex_token_where_line (ffestb_local_
.format
.pre
.t
),
7432 ffelex_token_where_column (ffestb_local_
.format
.pre
.t
));
7434 ffestb_local_
.format
.pre
.u
.unsigned_val
7435 = (ffestb_local_
.format
.pre
.u
.signed_val
< 0)
7436 ? -ffestb_local_
.format
.pre
.u
.signed_val
7437 : ffestb_local_
.format
.pre
.u
.signed_val
;
7439 f
= ffestt_formatlist_append (ffestb_local_
.format
.f
);
7440 f
->type
= FFESTP_formattypeFORMAT
;
7441 f
->t
= ffelex_token_use (t
);
7442 f
->u
.R1003D
.R1004
= ffestb_local_
.format
.pre
;
7443 f
->u
.R1003D
.format
= ffestb_local_
.format
.f
7444 = ffestt_formatlist_create (f
, ffelex_token_use (t
));
7445 f
= ffestt_formatlist_append (ffestb_local_
.format
.f
);
7446 f
->type
= FFESTP_formattypeSLASH
;
7447 f
->t
= ffelex_token_use (t
);
7448 f
->u
.R1010
.val
.present
= FALSE
;
7449 f
->u
.R1010
.val
.rtexpr
= FALSE
;
7450 f
->u
.R1010
.val
.t
= NULL
;
7451 f
->u
.R1010
.val
.u
.unsigned_val
= 1;
7452 return (ffelexHandler
) ffestb_R100112_
;
7454 case FFELEX_typeCLOSE_ARRAY
: /* "/)". */
7455 f
= ffestt_formatlist_append (ffestb_local_
.format
.f
);
7456 f
->type
= FFESTP_formattypeSLASH
;
7457 f
->t
= ffelex_token_use (t
);
7458 f
->u
.R1010
.val
= ffestb_local_
.format
.pre
;
7459 f
= ffestb_local_
.format
.f
->u
.root
.parent
;
7461 return (ffelexHandler
) ffestb_R100114_
;
7462 ffestb_local_
.format
.f
= f
->next
;
7463 return (ffelexHandler
) ffestb_R100111_
;
7465 case FFELEX_typeQUOTE
:
7467 break; /* A totally bad character in a VXT FORMAT. */
7468 ffebad_start (FFEBAD_FORMAT_SPURIOUS_NUMBER
);
7469 ffebad_here (0, ffelex_token_where_line (ffestb_local_
.format
.pre
.t
),
7470 ffelex_token_where_column (ffestb_local_
.format
.pre
.t
));
7472 ffelex_token_kill (ffestb_local_
.format
.pre
.t
);
7473 ffesta_confirmed ();
7474 #if 0 /* No apparent need for this, and not killed
7476 ffesta_tokens
[1] = ffelex_token_use (t
);
7478 ffelex_set_expecting_hollerith (-1, '\"',
7479 ffelex_token_where_line (t
),
7480 ffelex_token_where_column (t
)); /* Don't have to unset
7482 return (ffelexHandler
) ffestb_R100113_
;
7484 case FFELEX_typeAPOSTROPHE
:
7485 ffesta_confirmed ();
7486 ffebad_start (FFEBAD_FORMAT_SPURIOUS_NUMBER
);
7487 ffebad_here (0, ffelex_token_where_line (ffestb_local_
.format
.pre
.t
),
7488 ffelex_token_where_column (ffestb_local_
.format
.pre
.t
));
7490 ffelex_token_kill (ffestb_local_
.format
.pre
.t
);
7491 #if 0 /* No apparent need for this, and not killed
7493 ffesta_tokens
[1] = ffelex_token_use (t
);
7495 ffelex_set_expecting_hollerith (-1, '\'', ffelex_token_where_line (t
),
7496 ffelex_token_where_column (t
)); /* Don't have to unset
7498 return (ffelexHandler
) ffestb_R100113_
;
7500 case FFELEX_typeEOS
:
7501 case FFELEX_typeSEMICOLON
:
7502 ffesta_confirmed ();
7503 ffesta_ffebad_1t (FFEBAD_FORMAT_MISSING_PAREN
, t
);
7504 for (f
= ffestb_local_
.format
.f
;
7505 f
->u
.root
.parent
!= NULL
;
7506 f
= f
->u
.root
.parent
->next
)
7508 ffestb_local_
.format
.f
= f
;
7509 ffelex_token_kill (ffestb_local_
.format
.pre
.t
);
7510 return (ffelexHandler
) ffestb_R100114_ (t
);
7512 case FFELEX_typeDOLLAR
:
7513 ffestb_local_
.format
.t
= ffelex_token_use (t
);
7514 if (ffestb_local_
.format
.pre
.present
)
7515 ffesta_confirmed (); /* Number preceding this invalid elsewhere. */
7516 ffestb_local_
.format
.current
= FFESTP_formattypeDOLLAR
;
7517 return (ffelexHandler
) ffestb_R10015_
;
7519 case FFELEX_typeNAMES
:
7520 kw
= ffestr_format (t
);
7521 ffestb_local_
.format
.t
= ffelex_token_use (t
);
7524 case FFESTR_formatI
:
7525 if (ffestb_local_
.format
.pre
.present
)
7526 ffesta_confirmed ();/* Number preceding this invalid elsewhere. */
7527 ffestb_local_
.format
.current
= FFESTP_formattypeI
;
7528 i
= FFESTR_formatlI
;
7531 case FFESTR_formatB
:
7532 if (ffestb_local_
.format
.pre
.present
)
7533 ffesta_confirmed ();/* Number preceding this invalid elsewhere. */
7534 ffestb_local_
.format
.current
= FFESTP_formattypeB
;
7535 i
= FFESTR_formatlB
;
7538 case FFESTR_formatO
:
7539 if (ffestb_local_
.format
.pre
.present
)
7540 ffesta_confirmed ();/* Number preceding this invalid elsewhere. */
7541 ffestb_local_
.format
.current
= FFESTP_formattypeO
;
7542 i
= FFESTR_formatlO
;
7545 case FFESTR_formatZ
:
7546 if (ffestb_local_
.format
.pre
.present
)
7547 ffesta_confirmed ();/* Number preceding this invalid elsewhere. */
7548 ffestb_local_
.format
.current
= FFESTP_formattypeZ
;
7549 i
= FFESTR_formatlZ
;
7552 case FFESTR_formatF
:
7553 if (ffestb_local_
.format
.pre
.present
)
7554 ffesta_confirmed ();/* Number preceding this invalid elsewhere. */
7555 ffestb_local_
.format
.current
= FFESTP_formattypeF
;
7556 i
= FFESTR_formatlF
;
7559 case FFESTR_formatE
:
7560 ffestb_local_
.format
.current
= FFESTP_formattypeE
;
7561 i
= FFESTR_formatlE
;
7564 case FFESTR_formatEN
:
7565 if (ffestb_local_
.format
.pre
.present
)
7566 ffesta_confirmed ();/* Number preceding this invalid elsewhere. */
7567 ffestb_local_
.format
.current
= FFESTP_formattypeEN
;
7568 i
= FFESTR_formatlEN
;
7571 case FFESTR_formatG
:
7572 if (ffestb_local_
.format
.pre
.present
)
7573 ffesta_confirmed ();/* Number preceding this invalid elsewhere. */
7574 ffestb_local_
.format
.current
= FFESTP_formattypeG
;
7575 i
= FFESTR_formatlG
;
7578 case FFESTR_formatL
:
7579 if (ffestb_local_
.format
.pre
.present
)
7580 ffesta_confirmed ();/* Number preceding this invalid elsewhere. */
7581 ffestb_local_
.format
.current
= FFESTP_formattypeL
;
7582 i
= FFESTR_formatlL
;
7585 case FFESTR_formatA
:
7586 if (ffestb_local_
.format
.pre
.present
)
7587 ffesta_confirmed ();/* Number preceding this invalid elsewhere. */
7588 ffestb_local_
.format
.current
= FFESTP_formattypeA
;
7589 i
= FFESTR_formatlA
;
7592 case FFESTR_formatD
:
7593 ffestb_local_
.format
.current
= FFESTP_formattypeD
;
7594 i
= FFESTR_formatlD
;
7597 case FFESTR_formatQ
:
7598 ffestb_local_
.format
.current
= FFESTP_formattypeQ
;
7599 i
= FFESTR_formatlQ
;
7602 case FFESTR_formatDOLLAR
:
7603 if (ffestb_local_
.format
.pre
.present
)
7604 ffesta_confirmed ();/* Number preceding this invalid elsewhere. */
7605 ffestb_local_
.format
.current
= FFESTP_formattypeDOLLAR
;
7606 i
= FFESTR_formatlDOLLAR
;
7609 case FFESTR_formatP
:
7610 if (ffestb_local_
.format
.pre
.present
)
7611 ffesta_confirmed ();/* Number preceding this invalid elsewhere. */
7612 ffestb_local_
.format
.current
= FFESTP_formattypeP
;
7613 i
= FFESTR_formatlP
;
7616 case FFESTR_formatT
:
7617 if (ffestb_local_
.format
.pre
.present
)
7618 ffesta_confirmed ();/* Number preceding this invalid elsewhere. */
7619 ffestb_local_
.format
.current
= FFESTP_formattypeT
;
7620 i
= FFESTR_formatlT
;
7623 case FFESTR_formatTL
:
7624 if (ffestb_local_
.format
.pre
.present
)
7625 ffesta_confirmed ();/* Number preceding this invalid elsewhere. */
7626 ffestb_local_
.format
.current
= FFESTP_formattypeTL
;
7627 i
= FFESTR_formatlTL
;
7630 case FFESTR_formatTR
:
7631 if (ffestb_local_
.format
.pre
.present
)
7632 ffesta_confirmed ();/* Number preceding this invalid elsewhere. */
7633 ffestb_local_
.format
.current
= FFESTP_formattypeTR
;
7634 i
= FFESTR_formatlTR
;
7637 case FFESTR_formatX
:
7638 if (ffestb_local_
.format
.pre
.present
)
7639 ffesta_confirmed ();/* Number preceding this invalid elsewhere. */
7640 ffestb_local_
.format
.current
= FFESTP_formattypeX
;
7641 i
= FFESTR_formatlX
;
7644 case FFESTR_formatS
:
7645 if (ffestb_local_
.format
.pre
.present
)
7646 ffesta_confirmed ();/* Number preceding this invalid elsewhere. */
7647 ffestb_local_
.format
.current
= FFESTP_formattypeS
;
7648 i
= FFESTR_formatlS
;
7651 case FFESTR_formatSP
:
7652 if (ffestb_local_
.format
.pre
.present
)
7653 ffesta_confirmed ();/* Number preceding this invalid elsewhere. */
7654 ffestb_local_
.format
.current
= FFESTP_formattypeSP
;
7655 i
= FFESTR_formatlSP
;
7658 case FFESTR_formatSS
:
7659 if (ffestb_local_
.format
.pre
.present
)
7660 ffesta_confirmed ();/* Number preceding this invalid elsewhere. */
7661 ffestb_local_
.format
.current
= FFESTP_formattypeSS
;
7662 i
= FFESTR_formatlSS
;
7665 case FFESTR_formatBN
:
7666 if (ffestb_local_
.format
.pre
.present
)
7667 ffesta_confirmed ();/* Number preceding this invalid elsewhere. */
7668 ffestb_local_
.format
.current
= FFESTP_formattypeBN
;
7669 i
= FFESTR_formatlBN
;
7672 case FFESTR_formatBZ
:
7673 if (ffestb_local_
.format
.pre
.present
)
7674 ffesta_confirmed ();/* Number preceding this invalid elsewhere. */
7675 ffestb_local_
.format
.current
= FFESTP_formattypeBZ
;
7676 i
= FFESTR_formatlBZ
;
7679 case FFESTR_formatH
: /* Error, either "H" or "<expr>H". */
7680 if (ffestb_local_
.format
.pre
.present
)
7681 ffesta_confirmed ();/* Number preceding this invalid elsewhere. */
7682 ffestb_local_
.format
.current
= FFESTP_formattypeH
;
7683 i
= FFESTR_formatlH
;
7686 case FFESTR_formatPD
:
7687 if (ffestb_local_
.format
.pre
.present
)
7688 ffesta_confirmed ();/* Number preceding this invalid elsewhere. */
7689 ffestb_subr_R1001_append_p_ ();
7690 ffestb_local_
.format
.t
= ffelex_token_name_from_names (t
,
7691 FFESTR_formatlP
, 1);
7692 ffestb_local_
.format
.sign
= FALSE
;
7693 ffestb_local_
.format
.pre
.present
= FALSE
;
7694 ffestb_local_
.format
.pre
.rtexpr
= FALSE
;
7695 ffestb_local_
.format
.pre
.t
= NULL
;
7696 ffestb_local_
.format
.pre
.u
.unsigned_val
= 1;
7697 ffestb_local_
.format
.current
= FFESTP_formattypeD
;
7698 i
= FFESTR_formatlPD
;
7701 case FFESTR_formatPE
:
7702 if (ffestb_local_
.format
.pre
.present
)
7703 ffesta_confirmed ();/* Number preceding this invalid elsewhere. */
7704 ffestb_subr_R1001_append_p_ ();
7705 ffestb_local_
.format
.t
= ffelex_token_name_from_names (t
,
7706 FFESTR_formatlP
, 1);
7707 ffestb_local_
.format
.sign
= FALSE
;
7708 ffestb_local_
.format
.pre
.present
= FALSE
;
7709 ffestb_local_
.format
.pre
.rtexpr
= FALSE
;
7710 ffestb_local_
.format
.pre
.t
= NULL
;
7711 ffestb_local_
.format
.pre
.u
.unsigned_val
= 1;
7712 ffestb_local_
.format
.current
= FFESTP_formattypeE
;
7713 i
= FFESTR_formatlPE
;
7716 case FFESTR_formatPEN
:
7717 if (ffestb_local_
.format
.pre
.present
)
7718 ffesta_confirmed ();/* Number preceding this invalid elsewhere. */
7719 ffestb_subr_R1001_append_p_ ();
7720 ffestb_local_
.format
.t
= ffelex_token_name_from_names (t
,
7721 FFESTR_formatlP
, 1);
7722 ffestb_local_
.format
.sign
= FALSE
;
7723 ffestb_local_
.format
.pre
.present
= FALSE
;
7724 ffestb_local_
.format
.pre
.rtexpr
= FALSE
;
7725 ffestb_local_
.format
.pre
.t
= NULL
;
7726 ffestb_local_
.format
.pre
.u
.unsigned_val
= 1;
7727 ffestb_local_
.format
.current
= FFESTP_formattypeEN
;
7728 i
= FFESTR_formatlPEN
;
7731 case FFESTR_formatPF
:
7732 if (ffestb_local_
.format
.pre
.present
)
7733 ffesta_confirmed ();/* Number preceding this invalid elsewhere. */
7734 ffestb_subr_R1001_append_p_ ();
7735 ffestb_local_
.format
.t
= ffelex_token_name_from_names (t
,
7736 FFESTR_formatlP
, 1);
7737 ffestb_local_
.format
.sign
= FALSE
;
7738 ffestb_local_
.format
.pre
.present
= FALSE
;
7739 ffestb_local_
.format
.pre
.rtexpr
= FALSE
;
7740 ffestb_local_
.format
.pre
.t
= NULL
;
7741 ffestb_local_
.format
.pre
.u
.unsigned_val
= 1;
7742 ffestb_local_
.format
.current
= FFESTP_formattypeF
;
7743 i
= FFESTR_formatlPF
;
7746 case FFESTR_formatPG
:
7747 if (ffestb_local_
.format
.pre
.present
)
7748 ffesta_confirmed ();/* Number preceding this invalid elsewhere. */
7749 ffestb_subr_R1001_append_p_ ();
7750 ffestb_local_
.format
.t
= ffelex_token_name_from_names (t
,
7751 FFESTR_formatlP
, 1);
7752 ffestb_local_
.format
.sign
= FALSE
;
7753 ffestb_local_
.format
.pre
.present
= FALSE
;
7754 ffestb_local_
.format
.pre
.rtexpr
= FALSE
;
7755 ffestb_local_
.format
.pre
.t
= NULL
;
7756 ffestb_local_
.format
.pre
.u
.unsigned_val
= 1;
7757 ffestb_local_
.format
.current
= FFESTP_formattypeG
;
7758 i
= FFESTR_formatlPG
;
7762 if (ffestb_local_
.format
.pre
.present
)
7763 ffesta_confirmed ();/* Number preceding this invalid elsewhere. */
7764 ffestb_local_
.format
.current
= FFESTP_formattypeNone
;
7765 p
= strpbrk (ffelex_token_text (t
), "0123456789");
7767 i
= ffelex_token_length (t
);
7769 i
= p
- ffelex_token_text (t
);
7772 p
= ffelex_token_text (t
) + i
;
7774 return (ffelexHandler
) ffestb_R10015_
;
7777 if (ffestb_local_
.format
.current
== FFESTP_formattypeH
)
7778 p
= strpbrk (p
, "0123456789");
7782 ffestb_local_
.format
.current
= FFESTP_formattypeNone
;
7785 return (ffelexHandler
) ffestb_R10015_
;
7786 i
= p
- ffelex_token_text (t
); /* Collect digits. */
7788 ffestb_local_
.format
.post
.present
= TRUE
;
7789 ffestb_local_
.format
.post
.rtexpr
= FALSE
;
7790 ffestb_local_
.format
.post
.t
= ffelex_token_number_from_names (t
, i
);
7791 ffestb_local_
.format
.post
.u
.unsigned_val
7792 = strtoul (ffelex_token_text (ffestb_local_
.format
.post
.t
), NULL
, 10);
7793 p
+= ffelex_token_length (ffestb_local_
.format
.post
.t
);
7794 i
+= ffelex_token_length (ffestb_local_
.format
.post
.t
);
7796 return (ffelexHandler
) ffestb_R10016_
;
7797 if ((kw
!= FFESTR_formatP
) ||
7798 !ffelex_is_firstnamechar ((unsigned char)*p
))
7800 if (ffestb_local_
.format
.current
!= FFESTP_formattypeH
)
7801 ffesta_ffebad_1p (FFEBAD_FORMAT_TEXT_IN_NUMBER
, t
, i
, NULL
);
7802 return (ffelexHandler
) ffestb_R10016_
;
7805 /* Here we have [number]P[number][text]. Treat as
7806 [number]P,[number][text]. */
7808 ffestb_subr_R1001_append_p_ ();
7809 t
= ffestb_local_
.format
.t
= ffelex_token_names_from_names (t
, i
, 0);
7810 ffestb_local_
.format
.sign
= FALSE
;
7811 ffestb_local_
.format
.pre
= ffestb_local_
.format
.post
;
7812 kw
= ffestr_format (t
);
7814 { /* Only a few possibilities here. */
7815 case FFESTR_formatD
:
7816 ffestb_local_
.format
.current
= FFESTP_formattypeD
;
7817 i
= FFESTR_formatlD
;
7820 case FFESTR_formatE
:
7821 ffestb_local_
.format
.current
= FFESTP_formattypeE
;
7822 i
= FFESTR_formatlE
;
7825 case FFESTR_formatEN
:
7826 ffestb_local_
.format
.current
= FFESTP_formattypeEN
;
7827 i
= FFESTR_formatlEN
;
7830 case FFESTR_formatF
:
7831 ffestb_local_
.format
.current
= FFESTP_formattypeF
;
7832 i
= FFESTR_formatlF
;
7835 case FFESTR_formatG
:
7836 ffestb_local_
.format
.current
= FFESTP_formattypeG
;
7837 i
= FFESTR_formatlG
;
7841 ffebad_start (FFEBAD_FORMAT_P_NOCOMMA
);
7842 ffebad_here (0, ffelex_token_where_line (t
), ffelex_token_where_column (t
));
7844 ffestb_local_
.format
.current
= FFESTP_formattypeNone
;
7845 p
= strpbrk (ffelex_token_text (t
), "0123456789");
7847 i
= ffelex_token_length (t
);
7849 i
= p
- ffelex_token_text (t
);
7851 p
= ffelex_token_text (t
) + i
;
7853 return (ffelexHandler
) ffestb_R10015_
;
7856 ffestb_local_
.format
.current
= FFESTP_formattypeNone
;
7857 p
= strpbrk (p
, "0123456789");
7859 return (ffelexHandler
) ffestb_R10015_
;
7860 i
= p
- ffelex_token_text (t
); /* Collect digits anyway. */
7862 ffestb_local_
.format
.post
.present
= TRUE
;
7863 ffestb_local_
.format
.post
.rtexpr
= FALSE
;
7864 ffestb_local_
.format
.post
.t
= ffelex_token_number_from_names (t
, i
);
7865 ffestb_local_
.format
.post
.u
.unsigned_val
7866 = strtoul (ffelex_token_text (ffestb_local_
.format
.post
.t
), NULL
, 10);
7867 p
+= ffelex_token_length (ffestb_local_
.format
.post
.t
);
7868 i
+= ffelex_token_length (ffestb_local_
.format
.post
.t
);
7870 return (ffelexHandler
) ffestb_R10016_
;
7871 ffesta_ffebad_1p (FFEBAD_FORMAT_TEXT_IN_NUMBER
, t
, i
, NULL
);
7872 return (ffelexHandler
) ffestb_R10016_
;
7878 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "FORMAT", t
);
7879 if (ffestb_local_
.format
.pre
.present
)
7880 ffelex_token_kill (ffestb_local_
.format
.pre
.t
);
7881 ffestt_formatlist_kill (ffestb_local_
.format
.f
);
7882 return (ffelexHandler
) ffelex_swallow_tokens (t
,
7883 (ffelexHandler
) ffesta_zero
);
7886 /* ffestb_R10015_ -- [[+/-] NUMBER] NAMES
7888 return ffestb_R10015_; // to lexer
7890 Here we've gotten at least the initial mnemonic for the edit descriptor.
7891 We expect either a NUMBER, for the post-mnemonic value, a NAMES, for
7892 further clarification (in free-form only, sigh) of the mnemonic, or
7893 anything else. In all cases we go to _6_, with the difference that for
7894 NUMBER and NAMES we send the next token rather than the current token. */
7896 static ffelexHandler
7897 ffestb_R10015_ (ffelexToken t
)
7899 bool split_pea
; /* New NAMES requires splitting kP from new
7905 switch (ffelex_token_type (t
))
7907 case FFELEX_typeOPEN_ANGLE
:
7908 ffesta_confirmed ();
7909 ffestb_local_
.format
.post
.t
= ffelex_token_use (t
);
7910 ffelex_set_names_pure (FALSE
);
7911 if (!ffesta_seen_first_exec
&& !ffestb_local_
.format
.complained
)
7913 ffestb_local_
.format
.complained
= TRUE
;
7914 ffebad_start (FFEBAD_FORMAT_EXPR_SPEC
);
7915 ffebad_here (0, ffelex_token_where_line (t
), ffelex_token_where_column (t
));
7918 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
7919 FFEEXPR_contextFORMAT
, (ffeexprCallback
) ffestb_R100116_
);
7921 case FFELEX_typeNUMBER
:
7922 ffestb_local_
.format
.post
.present
= TRUE
;
7923 ffestb_local_
.format
.post
.rtexpr
= FALSE
;
7924 ffestb_local_
.format
.post
.t
= ffelex_token_use (t
);
7925 ffestb_local_
.format
.post
.u
.unsigned_val
7926 = strtoul (ffelex_token_text (t
), NULL
, 10);
7927 return (ffelexHandler
) ffestb_R10016_
;
7929 case FFELEX_typeNAMES
:
7930 ffesta_confirmed (); /* NAMES " " NAMES invalid elsewhere in
7932 kw
= ffestr_format (t
);
7933 switch (ffestb_local_
.format
.current
)
7935 case FFESTP_formattypeP
:
7939 case FFESTP_formattypeH
: /* An error, maintain this indicator. */
7940 kw
= FFESTR_formatNone
;
7951 case FFESTR_formatF
:
7952 switch (ffestb_local_
.format
.current
)
7954 case FFESTP_formattypeP
:
7955 ffestb_local_
.format
.current
= FFESTP_formattypeF
;
7959 ffestb_local_
.format
.current
= FFESTP_formattypeNone
;
7962 i
= FFESTR_formatlF
;
7965 case FFESTR_formatE
:
7966 switch (ffestb_local_
.format
.current
)
7968 case FFESTP_formattypeP
:
7969 ffestb_local_
.format
.current
= FFESTP_formattypeE
;
7973 ffestb_local_
.format
.current
= FFESTP_formattypeNone
;
7976 i
= FFESTR_formatlE
;
7979 case FFESTR_formatEN
:
7980 switch (ffestb_local_
.format
.current
)
7982 case FFESTP_formattypeP
:
7983 ffestb_local_
.format
.current
= FFESTP_formattypeEN
;
7987 ffestb_local_
.format
.current
= FFESTP_formattypeNone
;
7990 i
= FFESTR_formatlEN
;
7993 case FFESTR_formatG
:
7994 switch (ffestb_local_
.format
.current
)
7996 case FFESTP_formattypeP
:
7997 ffestb_local_
.format
.current
= FFESTP_formattypeG
;
8001 ffestb_local_
.format
.current
= FFESTP_formattypeNone
;
8004 i
= FFESTR_formatlG
;
8007 case FFESTR_formatL
:
8008 switch (ffestb_local_
.format
.current
)
8010 case FFESTP_formattypeT
:
8011 ffestb_local_
.format
.current
= FFESTP_formattypeTL
;
8015 ffestb_local_
.format
.current
= FFESTP_formattypeNone
;
8018 i
= FFESTR_formatlL
;
8021 case FFESTR_formatD
:
8022 switch (ffestb_local_
.format
.current
)
8024 case FFESTP_formattypeP
:
8025 ffestb_local_
.format
.current
= FFESTP_formattypeD
;
8029 ffestb_local_
.format
.current
= FFESTP_formattypeNone
;
8032 i
= FFESTR_formatlD
;
8035 case FFESTR_formatS
:
8036 switch (ffestb_local_
.format
.current
)
8038 case FFESTP_formattypeS
:
8039 ffestb_local_
.format
.current
= FFESTP_formattypeSS
;
8043 ffestb_local_
.format
.current
= FFESTP_formattypeNone
;
8046 i
= FFESTR_formatlS
;
8049 case FFESTR_formatP
:
8050 switch (ffestb_local_
.format
.current
)
8052 case FFESTP_formattypeS
:
8053 ffestb_local_
.format
.current
= FFESTP_formattypeSP
;
8057 ffestb_local_
.format
.current
= FFESTP_formattypeNone
;
8060 i
= FFESTR_formatlP
;
8063 case FFESTR_formatR
:
8064 switch (ffestb_local_
.format
.current
)
8066 case FFESTP_formattypeT
:
8067 ffestb_local_
.format
.current
= FFESTP_formattypeTR
;
8071 ffestb_local_
.format
.current
= FFESTP_formattypeNone
;
8074 i
= FFESTR_formatlR
;
8077 case FFESTR_formatZ
:
8078 switch (ffestb_local_
.format
.current
)
8080 case FFESTP_formattypeB
:
8081 ffestb_local_
.format
.current
= FFESTP_formattypeBZ
;
8085 ffestb_local_
.format
.current
= FFESTP_formattypeNone
;
8088 i
= FFESTR_formatlZ
;
8091 case FFESTR_formatN
:
8092 switch (ffestb_local_
.format
.current
)
8094 case FFESTP_formattypeE
:
8095 ffestb_local_
.format
.current
= FFESTP_formattypeEN
;
8098 case FFESTP_formattypeB
:
8099 ffestb_local_
.format
.current
= FFESTP_formattypeBN
;
8103 ffestb_local_
.format
.current
= FFESTP_formattypeNone
;
8106 i
= FFESTR_formatlN
;
8110 if (ffestb_local_
.format
.current
!= FFESTP_formattypeH
)
8111 ffestb_local_
.format
.current
= FFESTP_formattypeNone
;
8112 split_pea
= FALSE
; /* Go ahead and let the P be in the party. */
8113 p
= strpbrk (ffelex_token_text (t
), "0123456789");
8115 i
= ffelex_token_length (t
);
8117 i
= p
- ffelex_token_text (t
);
8122 ffestb_subr_R1001_append_p_ ();
8123 ffestb_local_
.format
.t
= ffelex_token_use (t
);
8124 ffestb_local_
.format
.sign
= FALSE
;
8125 ffestb_local_
.format
.pre
.present
= FALSE
;
8126 ffestb_local_
.format
.pre
.rtexpr
= FALSE
;
8127 ffestb_local_
.format
.pre
.t
= NULL
;
8128 ffestb_local_
.format
.pre
.u
.unsigned_val
= 1;
8131 p
= ffelex_token_text (t
) + i
;
8133 return (ffelexHandler
) ffestb_R10015_
;
8136 ffestb_local_
.format
.current
= FFESTP_formattypeNone
;
8137 p
= strpbrk (p
, "0123456789");
8139 return (ffelexHandler
) ffestb_R10015_
;
8140 i
= p
- ffelex_token_text (t
); /* Collect digits anyway. */
8142 ffestb_local_
.format
.post
.present
= TRUE
;
8143 ffestb_local_
.format
.post
.rtexpr
= FALSE
;
8144 ffestb_local_
.format
.post
.t
= ffelex_token_number_from_names (t
, i
);
8145 ffestb_local_
.format
.post
.u
.unsigned_val
8146 = strtoul (ffelex_token_text (ffestb_local_
.format
.post
.t
), NULL
, 10);
8147 p
+= ffelex_token_length (ffestb_local_
.format
.post
.t
);
8148 i
+= ffelex_token_length (ffestb_local_
.format
.post
.t
);
8150 return (ffelexHandler
) ffestb_R10016_
;
8151 ffesta_ffebad_1p (FFEBAD_FORMAT_TEXT_IN_NUMBER
, t
, i
, NULL
);
8152 return (ffelexHandler
) ffestb_R10016_
;
8155 ffestb_local_
.format
.post
.present
= FALSE
;
8156 ffestb_local_
.format
.post
.rtexpr
= FALSE
;
8157 ffestb_local_
.format
.post
.t
= NULL
;
8158 ffestb_local_
.format
.post
.u
.unsigned_val
= 1;
8159 return (ffelexHandler
) ffestb_R10016_ (t
);
8163 /* ffestb_R10016_ -- [[+/-] NUMBER] NAMES NUMBER
8165 return ffestb_R10016_; // to lexer
8167 Expect a PERIOD here. Maybe find a NUMBER to append to the current
8168 number, in which case return to this state. Maybe find a NAMES to switch
8169 from a kP descriptor to a new descriptor (else the NAMES is spurious),
8170 in which case generator the P item and go to state _4_. Anything
8171 else, pass token on to state _8_. */
8173 static ffelexHandler
8174 ffestb_R10016_ (ffelexToken t
)
8178 switch (ffelex_token_type (t
))
8180 case FFELEX_typePERIOD
:
8181 return (ffelexHandler
) ffestb_R10017_
;
8183 case FFELEX_typeNUMBER
:
8184 assert (ffestb_local_
.format
.post
.present
);
8185 ffesta_confirmed ();
8186 if (ffestb_local_
.format
.post
.rtexpr
)
8188 ffebad_start (FFEBAD_FORMAT_SPURIOUS_NUMBER
);
8189 ffebad_here (0, ffelex_token_where_line (t
), ffelex_token_where_column (t
));
8191 return (ffelexHandler
) ffestb_R10016_
;
8193 for (i
= ffelex_token_length (t
) + 1; i
> 0; --i
)
8194 ffestb_local_
.format
.post
.u
.unsigned_val
*= 10;
8195 ffestb_local_
.format
.post
.u
.unsigned_val
+= strtoul (ffelex_token_text (t
),
8197 return (ffelexHandler
) ffestb_R10016_
;
8199 case FFELEX_typeNAMES
:
8200 ffesta_confirmed (); /* NUMBER " " NAMES invalid elsewhere. */
8201 if (ffestb_local_
.format
.current
!= FFESTP_formattypeP
)
8203 ffesta_ffebad_1t (FFEBAD_FORMAT_TEXT_IN_NUMBER
, t
);
8204 return (ffelexHandler
) ffestb_R10016_
;
8206 ffestb_subr_R1001_append_p_ ();
8207 ffestb_local_
.format
.sign
= FALSE
;
8208 ffestb_local_
.format
.pre
= ffestb_local_
.format
.post
;
8209 return (ffelexHandler
) ffestb_R10014_ (t
);
8212 ffestb_local_
.format
.dot
.present
= FALSE
;
8213 ffestb_local_
.format
.dot
.rtexpr
= FALSE
;
8214 ffestb_local_
.format
.dot
.t
= NULL
;
8215 ffestb_local_
.format
.dot
.u
.unsigned_val
= 1;
8216 return (ffelexHandler
) ffestb_R10018_ (t
);
8220 /* ffestb_R10017_ -- [[+/-] NUMBER] NAMES NUMBER PERIOD
8222 return ffestb_R10017_; // to lexer
8224 Here we've gotten the period following the edit descriptor.
8225 We expect either a NUMBER, for the dot value, or something else, which
8226 probably means we're not even close to being in a real FORMAT statement. */
8228 static ffelexHandler
8229 ffestb_R10017_ (ffelexToken t
)
8231 switch (ffelex_token_type (t
))
8233 case FFELEX_typeOPEN_ANGLE
:
8234 ffestb_local_
.format
.dot
.t
= ffelex_token_use (t
);
8235 ffelex_set_names_pure (FALSE
);
8236 if (!ffesta_seen_first_exec
&& !ffestb_local_
.format
.complained
)
8238 ffestb_local_
.format
.complained
= TRUE
;
8239 ffebad_start (FFEBAD_FORMAT_EXPR_SPEC
);
8240 ffebad_here (0, ffelex_token_where_line (t
), ffelex_token_where_column (t
));
8243 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
8244 FFEEXPR_contextFORMAT
, (ffeexprCallback
) ffestb_R100117_
);
8246 case FFELEX_typeNUMBER
:
8247 ffestb_local_
.format
.dot
.present
= TRUE
;
8248 ffestb_local_
.format
.dot
.rtexpr
= FALSE
;
8249 ffestb_local_
.format
.dot
.t
= ffelex_token_use (t
);
8250 ffestb_local_
.format
.dot
.u
.unsigned_val
8251 = strtoul (ffelex_token_text (t
), NULL
, 10);
8252 return (ffelexHandler
) ffestb_R10018_
;
8255 ffelex_token_kill (ffestb_local_
.format
.t
);
8256 if (ffestb_local_
.format
.pre
.present
)
8257 ffelex_token_kill (ffestb_local_
.format
.pre
.t
);
8258 if (ffestb_local_
.format
.post
.present
)
8259 ffelex_token_kill (ffestb_local_
.format
.post
.t
);
8260 ffesta_ffebad_1t (FFEBAD_FORMAT_MISSING_DOT
, t
);
8261 ffestt_formatlist_kill (ffestb_local_
.format
.f
);
8262 return (ffelexHandler
) ffelex_swallow_tokens (t
,
8263 (ffelexHandler
) ffesta_zero
);
8267 /* ffestb_R10018_ -- [[+/-] NUMBER] NAMES NUMBER PERIOD NUMBER
8269 return ffestb_R10018_; // to lexer
8271 Expect a NAMES here, which must begin with "E" to be valid. Maybe find a
8272 NUMBER to append to the current number, in which case return to this state.
8273 Anything else, pass token on to state _10_. */
8275 static ffelexHandler
8276 ffestb_R10018_ (ffelexToken t
)
8281 switch (ffelex_token_type (t
))
8283 case FFELEX_typeNUMBER
:
8284 assert (ffestb_local_
.format
.dot
.present
);
8285 ffesta_confirmed ();
8286 if (ffestb_local_
.format
.dot
.rtexpr
)
8288 ffebad_start (FFEBAD_FORMAT_SPURIOUS_NUMBER
);
8289 ffebad_here (0, ffelex_token_where_line (t
), ffelex_token_where_column (t
));
8291 return (ffelexHandler
) ffestb_R10018_
;
8293 for (i
= ffelex_token_length (t
) + 1; i
> 0; --i
)
8294 ffestb_local_
.format
.dot
.u
.unsigned_val
*= 10;
8295 ffestb_local_
.format
.dot
.u
.unsigned_val
+= strtoul (ffelex_token_text (t
),
8297 return (ffelexHandler
) ffestb_R10018_
;
8299 case FFELEX_typeNAMES
:
8300 if (!ffesrc_char_match_init (*(p
= ffelex_token_text (t
)), 'E', 'e'))
8302 ffesta_ffebad_1t (FFEBAD_FORMAT_TEXT_IN_NUMBER
, t
);
8303 return (ffelexHandler
) ffestb_R10018_
;
8306 return (ffelexHandler
) ffestb_R10019_
; /* Go get NUMBER. */
8310 ffesta_ffebad_1p (FFEBAD_FORMAT_TEXT_IN_NUMBER
, t
, 1, NULL
);
8311 return (ffelexHandler
) ffestb_R10018_
;
8313 ffestb_local_
.format
.exp
.present
= TRUE
;
8314 ffestb_local_
.format
.exp
.rtexpr
= FALSE
;
8315 ffestb_local_
.format
.exp
.t
= ffelex_token_number_from_names (t
, i
);
8316 ffestb_local_
.format
.exp
.u
.unsigned_val
8317 = strtoul (ffelex_token_text (ffestb_local_
.format
.exp
.t
), NULL
, 10);
8318 p
+= ffelex_token_length (ffestb_local_
.format
.exp
.t
);
8319 i
+= ffelex_token_length (ffestb_local_
.format
.exp
.t
);
8321 return (ffelexHandler
) ffestb_R100110_
;
8322 ffesta_ffebad_1p (FFEBAD_FORMAT_TEXT_IN_NUMBER
, t
, i
, NULL
);
8323 return (ffelexHandler
) ffestb_R100110_
;
8326 ffestb_local_
.format
.exp
.present
= FALSE
;
8327 ffestb_local_
.format
.exp
.rtexpr
= FALSE
;
8328 ffestb_local_
.format
.exp
.t
= NULL
;
8329 ffestb_local_
.format
.exp
.u
.unsigned_val
= 1;
8330 return (ffelexHandler
) ffestb_R100110_ (t
);
8334 /* ffestb_R10019_ -- [[+/-] NUMBER] NAMES NUMBER PERIOD NUMBER "E"
8336 return ffestb_R10019_; // to lexer
8338 Here we've gotten the "E" following the edit descriptor.
8339 We expect either a NUMBER, for the exponent value, or something else. */
8341 static ffelexHandler
8342 ffestb_R10019_ (ffelexToken t
)
8344 switch (ffelex_token_type (t
))
8346 case FFELEX_typeOPEN_ANGLE
:
8347 ffestb_local_
.format
.exp
.t
= ffelex_token_use (t
);
8348 ffelex_set_names_pure (FALSE
);
8349 if (!ffesta_seen_first_exec
&& !ffestb_local_
.format
.complained
)
8351 ffestb_local_
.format
.complained
= TRUE
;
8352 ffebad_start (FFEBAD_FORMAT_EXPR_SPEC
);
8353 ffebad_here (0, ffelex_token_where_line (t
), ffelex_token_where_column (t
));
8356 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
8357 FFEEXPR_contextFORMAT
, (ffeexprCallback
) ffestb_R100118_
);
8359 case FFELEX_typeNUMBER
:
8360 ffestb_local_
.format
.exp
.present
= TRUE
;
8361 ffestb_local_
.format
.exp
.rtexpr
= FALSE
;
8362 ffestb_local_
.format
.exp
.t
= ffelex_token_use (t
);
8363 ffestb_local_
.format
.exp
.u
.unsigned_val
8364 = strtoul (ffelex_token_text (t
), NULL
, 10);
8365 return (ffelexHandler
) ffestb_R100110_
;
8368 ffelex_token_kill (ffestb_local_
.format
.t
);
8369 if (ffestb_local_
.format
.pre
.present
)
8370 ffelex_token_kill (ffestb_local_
.format
.pre
.t
);
8371 if (ffestb_local_
.format
.post
.present
)
8372 ffelex_token_kill (ffestb_local_
.format
.post
.t
);
8373 if (ffestb_local_
.format
.dot
.present
)
8374 ffelex_token_kill (ffestb_local_
.format
.dot
.t
);
8375 ffesta_ffebad_1t (FFEBAD_FORMAT_MISSING_EXP
, t
);
8376 ffestt_formatlist_kill (ffestb_local_
.format
.f
);
8377 return (ffelexHandler
) ffelex_swallow_tokens (t
,
8378 (ffelexHandler
) ffesta_zero
);
8382 /* ffestb_R100110_ -- [[+/-] NUMBER] NAMES NUMBER [PERIOD NUMBER ["E" NUMBER]]
8384 return ffestb_R100110_; // to lexer
8386 Maybe find a NUMBER to append to the current number, in which case return
8387 to this state. Anything else, handle current descriptor, then pass token
8388 on to state _10_. */
8390 static ffelexHandler
8391 ffestb_R100110_ (ffelexToken t
)
8408 switch (ffelex_token_type (t
))
8410 case FFELEX_typeNUMBER
:
8411 assert (ffestb_local_
.format
.exp
.present
);
8412 ffesta_confirmed ();
8413 if (ffestb_local_
.format
.exp
.rtexpr
)
8415 ffebad_start (FFEBAD_FORMAT_SPURIOUS_NUMBER
);
8416 ffebad_here (0, ffelex_token_where_line (t
), ffelex_token_where_column (t
));
8418 return (ffelexHandler
) ffestb_R100110_
;
8420 for (i
= ffelex_token_length (t
) + 1; i
> 0; --i
)
8421 ffestb_local_
.format
.exp
.u
.unsigned_val
*= 10;
8422 ffestb_local_
.format
.exp
.u
.unsigned_val
+= strtoul (ffelex_token_text (t
),
8424 return (ffelexHandler
) ffestb_R100110_
;
8427 if (ffestb_local_
.format
.sign
8428 && (ffestb_local_
.format
.current
!= FFESTP_formattypeP
)
8429 && (ffestb_local_
.format
.current
!= FFESTP_formattypeH
))
8431 ffebad_start (FFEBAD_FORMAT_SPURIOUS_SIGN
);
8432 ffebad_here (0, ffelex_token_where_line (ffestb_local_
.format
.pre
.t
),
8433 ffelex_token_where_column (ffestb_local_
.format
.pre
.t
));
8435 ffestb_local_
.format
.pre
.u
.unsigned_val
8436 = (ffestb_local_
.format
.pre
.u
.signed_val
< 0)
8437 ? -ffestb_local_
.format
.pre
.u
.signed_val
8438 : ffestb_local_
.format
.pre
.u
.signed_val
;
8440 switch (ffestb_local_
.format
.current
)
8442 case FFESTP_formattypeI
:
8443 err
= FFEBAD_FORMAT_BAD_I_SPEC
;
8451 case FFESTP_formattypeB
:
8452 err
= FFEBAD_FORMAT_BAD_B_SPEC
;
8460 case FFESTP_formattypeO
:
8461 err
= FFEBAD_FORMAT_BAD_O_SPEC
;
8469 case FFESTP_formattypeZ
:
8470 err
= FFEBAD_FORMAT_BAD_Z_SPEC
;
8478 case FFESTP_formattypeF
:
8479 err
= FFEBAD_FORMAT_BAD_F_SPEC
;
8487 case FFESTP_formattypeE
:
8488 err
= FFEBAD_FORMAT_BAD_E_SPEC
;
8496 case FFESTP_formattypeEN
:
8497 err
= FFEBAD_FORMAT_BAD_EN_SPEC
;
8505 case FFESTP_formattypeG
:
8506 err
= FFEBAD_FORMAT_BAD_G_SPEC
;
8514 case FFESTP_formattypeL
:
8515 err
= FFEBAD_FORMAT_BAD_L_SPEC
;
8523 case FFESTP_formattypeA
:
8524 err
= FFEBAD_FORMAT_BAD_A_SPEC
;
8532 case FFESTP_formattypeD
:
8533 err
= FFEBAD_FORMAT_BAD_D_SPEC
;
8541 case FFESTP_formattypeQ
:
8542 err
= FFEBAD_FORMAT_BAD_Q_SPEC
;
8550 case FFESTP_formattypeDOLLAR
:
8551 err
= FFEBAD_FORMAT_BAD_DOLLAR_SPEC
;
8559 case FFESTP_formattypeP
:
8560 err
= FFEBAD_FORMAT_BAD_P_SPEC
;
8568 case FFESTP_formattypeT
:
8569 err
= FFEBAD_FORMAT_BAD_T_SPEC
;
8577 case FFESTP_formattypeTL
:
8578 err
= FFEBAD_FORMAT_BAD_TL_SPEC
;
8586 case FFESTP_formattypeTR
:
8587 err
= FFEBAD_FORMAT_BAD_TR_SPEC
;
8595 case FFESTP_formattypeX
:
8596 err
= FFEBAD_FORMAT_BAD_X_SPEC
;
8597 pre
= ffe_is_pedantic() ? required
: optional
;
8604 case FFESTP_formattypeS
:
8605 err
= FFEBAD_FORMAT_BAD_S_SPEC
;
8613 case FFESTP_formattypeSP
:
8614 err
= FFEBAD_FORMAT_BAD_SP_SPEC
;
8622 case FFESTP_formattypeSS
:
8623 err
= FFEBAD_FORMAT_BAD_SS_SPEC
;
8631 case FFESTP_formattypeBN
:
8632 err
= FFEBAD_FORMAT_BAD_BN_SPEC
;
8640 case FFESTP_formattypeBZ
:
8641 err
= FFEBAD_FORMAT_BAD_BZ_SPEC
;
8649 case FFESTP_formattypeH
: /* Definitely an error, make sure of
8651 err
= FFEBAD_FORMAT_BAD_H_SPEC
;
8652 pre
= ffestb_local_
.format
.pre
.present
? disallowed
: required
;
8659 case FFESTP_formattypeNone
:
8660 ffesta_ffebad_1t (FFEBAD_FORMAT_BAD_SPEC
,
8661 ffestb_local_
.format
.t
);
8663 clean_up_to_11_
: /* :::::::::::::::::::: */
8665 ffelex_token_kill (ffestb_local_
.format
.t
);
8666 if (ffestb_local_
.format
.pre
.present
)
8667 ffelex_token_kill (ffestb_local_
.format
.pre
.t
);
8668 if (ffestb_local_
.format
.post
.present
)
8669 ffelex_token_kill (ffestb_local_
.format
.post
.t
);
8670 if (ffestb_local_
.format
.dot
.present
)
8671 ffelex_token_kill (ffestb_local_
.format
.dot
.t
);
8672 if (ffestb_local_
.format
.exp
.present
)
8673 ffelex_token_kill (ffestb_local_
.format
.exp
.t
);
8674 return (ffelexHandler
) ffestb_R100111_ (t
);
8677 assert ("bad format item" == NULL
);
8678 err
= FFEBAD_FORMAT_BAD_H_SPEC
;
8686 if (((pre
== disallowed
) && ffestb_local_
.format
.pre
.present
)
8687 || ((pre
== required
) && !ffestb_local_
.format
.pre
.present
))
8689 ffesta_ffebad_1t (err
, (pre
== required
)
8690 ? ffestb_local_
.format
.t
: ffestb_local_
.format
.pre
.t
);
8691 goto clean_up_to_11_
; /* :::::::::::::::::::: */
8693 if (((post
== disallowed
) && ffestb_local_
.format
.post
.present
)
8694 || ((post
== required
) && !ffestb_local_
.format
.post
.present
))
8696 ffesta_ffebad_1t (err
, (post
== required
)
8697 ? ffestb_local_
.format
.t
: ffestb_local_
.format
.post
.t
);
8698 goto clean_up_to_11_
; /* :::::::::::::::::::: */
8700 if (((dot
== disallowed
) && ffestb_local_
.format
.dot
.present
)
8701 || ((dot
== required
) && !ffestb_local_
.format
.dot
.present
))
8703 ffesta_ffebad_1t (err
, (dot
== required
)
8704 ? ffestb_local_
.format
.t
: ffestb_local_
.format
.dot
.t
);
8705 goto clean_up_to_11_
; /* :::::::::::::::::::: */
8707 if (((exp
== disallowed
) && ffestb_local_
.format
.exp
.present
)
8708 || ((exp
== required
) && !ffestb_local_
.format
.exp
.present
))
8710 ffesta_ffebad_1t (err
, (exp
== required
)
8711 ? ffestb_local_
.format
.t
: ffestb_local_
.format
.exp
.t
);
8712 goto clean_up_to_11_
; /* :::::::::::::::::::: */
8714 f
= ffestt_formatlist_append (ffestb_local_
.format
.f
);
8715 f
->type
= ffestb_local_
.format
.current
;
8716 f
->t
= ffestb_local_
.format
.t
;
8719 f
->u
.R1005
.R1004
= ffestb_local_
.format
.pre
;
8720 f
->u
.R1005
.R1006
= ffestb_local_
.format
.post
;
8721 f
->u
.R1005
.R1007_or_R1008
= ffestb_local_
.format
.dot
;
8722 f
->u
.R1005
.R1009
= ffestb_local_
.format
.exp
;
8725 /* Must be R1010. */
8727 if (pre
== disallowed
)
8728 f
->u
.R1010
.val
= ffestb_local_
.format
.post
;
8730 f
->u
.R1010
.val
= ffestb_local_
.format
.pre
;
8732 return (ffelexHandler
) ffestb_R100111_ (t
);
8736 /* ffestb_R100111_ -- edit-descriptor
8738 return ffestb_R100111_; // to lexer
8740 Expect a COMMA, CLOSE_PAREN, CLOSE_ARRAY, COLON, COLONCOLON, SLASH, or
8741 CONCAT, or complain about missing comma. */
8743 static ffelexHandler
8744 ffestb_R100111_ (ffelexToken t
)
8748 switch (ffelex_token_type (t
))
8750 case FFELEX_typeCOMMA
:
8751 return (ffelexHandler
) ffestb_R10012_
;
8753 case FFELEX_typeCOLON
:
8754 case FFELEX_typeCOLONCOLON
:
8755 case FFELEX_typeSLASH
:
8756 case FFELEX_typeCONCAT
:
8757 return (ffelexHandler
) ffestb_R10012_ (t
);
8759 case FFELEX_typeCLOSE_PAREN
:
8760 f
= ffestb_local_
.format
.f
->u
.root
.parent
;
8762 return (ffelexHandler
) ffestb_R100114_
;
8763 ffestb_local_
.format
.f
= f
->next
;
8764 return (ffelexHandler
) ffestb_R100111_
;
8766 case FFELEX_typeCLOSE_ARRAY
: /* "/)". */
8767 f
= ffestt_formatlist_append (ffestb_local_
.format
.f
);
8768 f
->type
= FFESTP_formattypeSLASH
;
8769 f
->t
= ffelex_token_use (t
);
8770 f
->u
.R1010
.val
.present
= FALSE
;
8771 f
->u
.R1010
.val
.rtexpr
= FALSE
;
8772 f
->u
.R1010
.val
.t
= NULL
;
8773 f
->u
.R1010
.val
.u
.unsigned_val
= 1;
8774 f
= ffestb_local_
.format
.f
->u
.root
.parent
;
8776 return (ffelexHandler
) ffestb_R100114_
;
8777 ffestb_local_
.format
.f
= f
->next
;
8778 return (ffelexHandler
) ffestb_R100111_
;
8780 case FFELEX_typeOPEN_ANGLE
:
8781 case FFELEX_typeDOLLAR
:
8782 case FFELEX_typeNUMBER
:
8783 case FFELEX_typeOPEN_PAREN
:
8784 case FFELEX_typeOPEN_ARRAY
:
8785 case FFELEX_typeQUOTE
:
8786 case FFELEX_typeAPOSTROPHE
:
8787 case FFELEX_typeNAMES
:
8788 ffesta_ffebad_1t (FFEBAD_FORMAT_MISSING_COMMA
, t
);
8789 return (ffelexHandler
) ffestb_R10012_ (t
);
8791 case FFELEX_typeEOS
:
8792 case FFELEX_typeSEMICOLON
:
8793 ffesta_confirmed ();
8794 ffesta_ffebad_1t (FFEBAD_FORMAT_MISSING_PAREN
, t
);
8795 for (f
= ffestb_local_
.format
.f
;
8796 f
->u
.root
.parent
!= NULL
;
8797 f
= f
->u
.root
.parent
->next
)
8799 ffestb_local_
.format
.f
= f
;
8800 return (ffelexHandler
) ffestb_R100114_ (t
);
8803 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "FORMAT", t
);
8804 ffestt_formatlist_kill (ffestb_local_
.format
.f
);
8805 return (ffelexHandler
) ffelex_swallow_tokens (t
,
8806 (ffelexHandler
) ffesta_zero
);
8810 /* ffestb_R100112_ -- COLON, COLONCOLON, SLASH, OPEN_ARRAY, or CONCAT
8812 return ffestb_R100112_; // to lexer
8814 Like _11_ except the COMMA is optional. */
8816 static ffelexHandler
8817 ffestb_R100112_ (ffelexToken t
)
8821 switch (ffelex_token_type (t
))
8823 case FFELEX_typeCOMMA
:
8824 return (ffelexHandler
) ffestb_R10012_
;
8826 case FFELEX_typeCOLON
:
8827 case FFELEX_typeCOLONCOLON
:
8828 case FFELEX_typeSLASH
:
8829 case FFELEX_typeCONCAT
:
8830 case FFELEX_typeOPEN_ANGLE
:
8831 case FFELEX_typeNAMES
:
8832 case FFELEX_typeDOLLAR
:
8833 case FFELEX_typeNUMBER
:
8834 case FFELEX_typeOPEN_PAREN
:
8835 case FFELEX_typeOPEN_ARRAY
:
8836 case FFELEX_typeQUOTE
:
8837 case FFELEX_typeAPOSTROPHE
:
8838 case FFELEX_typePLUS
:
8839 case FFELEX_typeMINUS
:
8840 return (ffelexHandler
) ffestb_R10012_ (t
);
8842 case FFELEX_typeCLOSE_PAREN
:
8843 f
= ffestb_local_
.format
.f
->u
.root
.parent
;
8845 return (ffelexHandler
) ffestb_R100114_
;
8846 ffestb_local_
.format
.f
= f
->next
;
8847 return (ffelexHandler
) ffestb_R100111_
;
8849 case FFELEX_typeCLOSE_ARRAY
: /* "/)". */
8850 f
= ffestt_formatlist_append (ffestb_local_
.format
.f
);
8851 f
->type
= FFESTP_formattypeSLASH
;
8852 f
->t
= ffelex_token_use (t
);
8853 f
->u
.R1010
.val
.present
= FALSE
;
8854 f
->u
.R1010
.val
.rtexpr
= FALSE
;
8855 f
->u
.R1010
.val
.t
= NULL
;
8856 f
->u
.R1010
.val
.u
.unsigned_val
= 1;
8857 f
= ffestb_local_
.format
.f
->u
.root
.parent
;
8859 return (ffelexHandler
) ffestb_R100114_
;
8860 ffestb_local_
.format
.f
= f
->next
;
8861 return (ffelexHandler
) ffestb_R100111_
;
8863 case FFELEX_typeEOS
:
8864 case FFELEX_typeSEMICOLON
:
8865 ffesta_confirmed ();
8866 ffesta_ffebad_1t (FFEBAD_FORMAT_MISSING_PAREN
, t
);
8867 for (f
= ffestb_local_
.format
.f
;
8868 f
->u
.root
.parent
!= NULL
;
8869 f
= f
->u
.root
.parent
->next
)
8871 ffestb_local_
.format
.f
= f
;
8872 return (ffelexHandler
) ffestb_R100114_ (t
);
8875 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "FORMAT", t
);
8876 ffestt_formatlist_kill (ffestb_local_
.format
.f
);
8877 return (ffelexHandler
) ffelex_swallow_tokens (t
,
8878 (ffelexHandler
) ffesta_zero
);
8882 /* ffestb_R100113_ -- Handle CHARACTER token.
8884 return ffestb_R100113_; // to lexer
8886 Append the format item to the list, go to _11_. */
8888 static ffelexHandler
8889 ffestb_R100113_ (ffelexToken t
)
8893 assert (ffelex_token_type (t
) == FFELEX_typeCHARACTER
);
8895 if (ffe_is_pedantic_not_90 () && (ffelex_token_length (t
) == 0))
8897 ffebad_start (FFEBAD_NULL_CHAR_CONST
);
8898 ffebad_here (0, ffelex_token_where_line (t
),
8899 ffelex_token_where_column (t
));
8903 f
= ffestt_formatlist_append (ffestb_local_
.format
.f
);
8904 f
->type
= FFESTP_formattypeR1016
;
8905 f
->t
= ffelex_token_use (t
);
8906 return (ffelexHandler
) ffestb_R100111_
;
8909 /* ffestb_R100114_ -- "FORMAT" OPEN_PAREN format-item-list CLOSE_PAREN
8911 return ffestb_R100114_; // to lexer
8913 Handle EOS/SEMICOLON or something else. */
8915 static ffelexHandler
8916 ffestb_R100114_ (ffelexToken t
)
8918 ffelex_set_names_pure (FALSE
);
8920 switch (ffelex_token_type (t
))
8922 case FFELEX_typeEOS
:
8923 case FFELEX_typeSEMICOLON
:
8924 ffesta_confirmed ();
8925 if (!ffesta_is_inhibited () && !ffestb_local_
.format
.complained
)
8926 ffestc_R1001 (ffestb_local_
.format
.f
);
8927 ffestt_formatlist_kill (ffestb_local_
.format
.f
);
8928 return (ffelexHandler
) ffesta_zero (t
);
8931 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "FORMAT", t
);
8932 ffestt_formatlist_kill (ffestb_local_
.format
.f
);
8933 return (ffelexHandler
) ffelex_swallow_tokens (t
,
8934 (ffelexHandler
) ffesta_zero
);
8938 /* ffestb_R100115_ -- OPEN_ANGLE expr
8940 (ffestb_R100115_) // to expression handler
8942 Handle expression prior to the edit descriptor. */
8944 static ffelexHandler
8945 ffestb_R100115_ (ffelexToken ft UNUSED
, ffebld expr
, ffelexToken t
)
8947 switch (ffelex_token_type (t
))
8949 case FFELEX_typeCLOSE_ANGLE
:
8950 ffestb_local_
.format
.pre
.present
= TRUE
;
8951 ffestb_local_
.format
.pre
.rtexpr
= TRUE
;
8952 ffestb_local_
.format
.pre
.u
.expr
= expr
;
8953 ffelex_set_names_pure (TRUE
);
8954 return (ffelexHandler
) ffestb_R10014_
;
8957 ffelex_token_kill (ffestb_local_
.format
.pre
.t
);
8958 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "FORMAT", t
);
8959 ffestt_formatlist_kill (ffestb_local_
.format
.f
);
8960 return (ffelexHandler
) ffelex_swallow_tokens (t
,
8961 (ffelexHandler
) ffesta_zero
);
8965 /* ffestb_R100116_ -- "[n]X" OPEN_ANGLE expr
8967 (ffestb_R100116_) // to expression handler
8969 Handle expression after the edit descriptor. */
8971 static ffelexHandler
8972 ffestb_R100116_ (ffelexToken ft UNUSED
, ffebld expr
, ffelexToken t
)
8974 switch (ffelex_token_type (t
))
8976 case FFELEX_typeCLOSE_ANGLE
:
8977 ffestb_local_
.format
.post
.present
= TRUE
;
8978 ffestb_local_
.format
.post
.rtexpr
= TRUE
;
8979 ffestb_local_
.format
.post
.u
.expr
= expr
;
8980 ffelex_set_names_pure (TRUE
);
8981 return (ffelexHandler
) ffestb_R10016_
;
8984 ffelex_token_kill (ffestb_local_
.format
.t
);
8985 ffelex_token_kill (ffestb_local_
.format
.post
.t
);
8986 if (ffestb_local_
.format
.pre
.present
)
8987 ffelex_token_kill (ffestb_local_
.format
.pre
.t
);
8988 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "FORMAT", t
);
8989 ffestt_formatlist_kill (ffestb_local_
.format
.f
);
8990 return (ffelexHandler
) ffelex_swallow_tokens (t
,
8991 (ffelexHandler
) ffesta_zero
);
8995 /* ffestb_R100117_ -- "[n]X[n]." OPEN_ANGLE expr
8997 (ffestb_R100117_) // to expression handler
8999 Handle expression after the PERIOD. */
9001 static ffelexHandler
9002 ffestb_R100117_ (ffelexToken ft UNUSED
, ffebld expr
, ffelexToken t
)
9004 switch (ffelex_token_type (t
))
9006 case FFELEX_typeCLOSE_ANGLE
:
9007 ffestb_local_
.format
.dot
.present
= TRUE
;
9008 ffestb_local_
.format
.dot
.rtexpr
= TRUE
;
9009 ffestb_local_
.format
.dot
.u
.expr
= expr
;
9010 ffelex_set_names_pure (TRUE
);
9011 return (ffelexHandler
) ffestb_R10018_
;
9014 ffelex_token_kill (ffestb_local_
.format
.t
);
9015 ffelex_token_kill (ffestb_local_
.format
.dot
.t
);
9016 if (ffestb_local_
.format
.pre
.present
)
9017 ffelex_token_kill (ffestb_local_
.format
.pre
.t
);
9018 if (ffestb_local_
.format
.post
.present
)
9019 ffelex_token_kill (ffestb_local_
.format
.post
.t
);
9020 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "FORMAT", t
);
9021 ffestt_formatlist_kill (ffestb_local_
.format
.f
);
9022 return (ffelexHandler
) ffelex_swallow_tokens (t
,
9023 (ffelexHandler
) ffesta_zero
);
9027 /* ffestb_R100118_ -- "[n]X[n].[n]E" OPEN_ANGLE expr
9029 (ffestb_R100118_) // to expression handler
9031 Handle expression after the "E". */
9033 static ffelexHandler
9034 ffestb_R100118_ (ffelexToken ft UNUSED
, ffebld expr
, ffelexToken t
)
9036 switch (ffelex_token_type (t
))
9038 case FFELEX_typeCLOSE_ANGLE
:
9039 ffestb_local_
.format
.exp
.present
= TRUE
;
9040 ffestb_local_
.format
.exp
.rtexpr
= TRUE
;
9041 ffestb_local_
.format
.exp
.u
.expr
= expr
;
9042 ffelex_set_names_pure (TRUE
);
9043 return (ffelexHandler
) ffestb_R100110_
;
9046 ffelex_token_kill (ffestb_local_
.format
.t
);
9047 ffelex_token_kill (ffestb_local_
.format
.exp
.t
);
9048 if (ffestb_local_
.format
.pre
.present
)
9049 ffelex_token_kill (ffestb_local_
.format
.pre
.t
);
9050 if (ffestb_local_
.format
.post
.present
)
9051 ffelex_token_kill (ffestb_local_
.format
.post
.t
);
9052 if (ffestb_local_
.format
.dot
.present
)
9053 ffelex_token_kill (ffestb_local_
.format
.dot
.t
);
9054 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "FORMAT", t
);
9055 ffestt_formatlist_kill (ffestb_local_
.format
.f
);
9056 return (ffelexHandler
) ffelex_swallow_tokens (t
,
9057 (ffelexHandler
) ffesta_zero
);
9061 /* ffestb_S3P4 -- Parse the INCLUDE line
9063 return ffestb_S3P4; // to lexer
9065 Make sure the statement has a valid form for the INCLUDE line. If it
9066 does, implement the statement. */
9069 ffestb_S3P4 (ffelexToken t
)
9077 switch (ffelex_token_type (ffesta_tokens
[0]))
9079 case FFELEX_typeNAME
:
9080 if (ffesta_first_kw
!= FFESTR_firstINCLUDE
)
9081 goto bad_0
; /* :::::::::::::::::::: */
9082 switch (ffelex_token_type (t
))
9084 case FFELEX_typeNUMBER
:
9085 case FFELEX_typeAPOSTROPHE
:
9086 case FFELEX_typeQUOTE
:
9090 goto bad_1
; /* :::::::::::::::::::: */
9092 ffesta_confirmed ();
9093 return (ffelexHandler
) (*((ffelexHandler
)
9094 ffeexpr_rhs (ffesta_output_pool
, FFEEXPR_contextINCLUDE
,
9095 (ffeexprCallback
) ffestb_S3P41_
)))
9098 case FFELEX_typeNAMES
:
9099 if (ffesta_first_kw
!= FFESTR_firstINCLUDE
)
9100 goto bad_0
; /* :::::::::::::::::::: */
9101 p
= ffelex_token_text (ffesta_tokens
[0]) + (i
= FFESTR_firstlINCLUDE
);
9102 switch (ffelex_token_type (t
))
9105 goto bad_1
; /* :::::::::::::::::::: */
9107 case FFELEX_typeAPOSTROPHE
:
9108 case FFELEX_typeQUOTE
:
9111 ffesta_confirmed ();
9113 return (ffelexHandler
) (*((ffelexHandler
)
9114 ffeexpr_rhs (ffesta_output_pool
, FFEEXPR_contextINCLUDE
,
9115 (ffeexprCallback
) ffestb_S3P41_
)))
9118 goto bad_i
; /* :::::::::::::::::::: */
9119 nt
= ffelex_token_number_from_names (ffesta_tokens
[0], i
);
9120 p
+= ffelex_token_length (nt
);
9121 i
+= ffelex_token_length (nt
);
9122 if ((*p
!= '_') || (++i
, *++p
!= '\0'))
9124 ffelex_token_kill (nt
);
9125 goto bad_i
; /* :::::::::::::::::::: */
9127 ut
= ffelex_token_uscore_from_names (ffesta_tokens
[0], i
- 1);
9128 next
= (ffelexHandler
) (*((ffelexHandler
) ffeexpr_rhs
9129 (ffesta_output_pool
, FFEEXPR_contextINCLUDE
,
9130 (ffeexprCallback
) ffestb_S3P41_
)))
9132 ffelex_token_kill (nt
);
9133 next
= (ffelexHandler
) (*next
) (ut
);
9134 ffelex_token_kill (ut
);
9135 return (ffelexHandler
) (*next
) (t
);
9138 goto bad_0
; /* :::::::::::::::::::: */
9141 bad_0
: /* :::::::::::::::::::: */
9142 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "INCLUDE", ffesta_tokens
[0]);
9143 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
9145 bad_1
: /* :::::::::::::::::::: */
9146 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "INCLUDE", t
);
9147 return (ffelexHandler
) ffelex_swallow_tokens (t
,
9148 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
9150 bad_i
: /* :::::::::::::::::::: */
9151 ffesta_ffebad_1sp (FFEBAD_INVALID_STMT_FORM
, "INCLUDE", ffesta_tokens
[0], i
, t
);
9152 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
9155 /* ffestb_S3P41_ -- "INCLUDE" [NUMBER "_"] expr
9157 (ffestb_S3P41_) // to expression handler
9159 Make sure the next token is an EOS, but not a SEMICOLON. */
9161 static ffelexHandler
9162 ffestb_S3P41_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
9164 switch (ffelex_token_type (t
))
9166 case FFELEX_typeEOS
:
9167 case FFELEX_typeSEMICOLON
:
9170 if (!ffesta_is_inhibited ())
9172 if (ffe_is_pedantic ()
9173 && ((ffelex_token_type (t
) == FFELEX_typeSEMICOLON
)
9174 || ffesta_line_has_semicolons
))
9176 /* xgettext:no-c-format */
9177 ffebad_start_msg ("INCLUDE at %0 not the only statement on the source line", FFEBAD_severityWARNING
);
9178 ffebad_here (0, ffelex_token_where_line (ffesta_tokens
[0]),
9179 ffelex_token_where_column (ffesta_tokens
[0]));
9182 ffestc_S3P4 (expr
, ft
);
9184 return (ffelexHandler
) ffesta_zero (t
);
9187 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "INCLUDE", t
);
9191 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
9194 /* ffestb_V014 -- Parse the VOLATILE statement
9196 return ffestb_V014; // to lexer
9198 Make sure the statement has a valid form for the VOLATILE statement. If it
9199 does, implement the statement. */
9202 ffestb_V014 (ffelexToken t
)
9205 unsigned const char *p
;
9209 switch (ffelex_token_type (ffesta_tokens
[0]))
9211 case FFELEX_typeNAME
:
9212 if (ffesta_first_kw
!= FFESTR_firstVOLATILE
)
9213 goto bad_0
; /* :::::::::::::::::::: */
9214 switch (ffelex_token_type (t
))
9216 case FFELEX_typeEOS
:
9217 case FFELEX_typeSEMICOLON
:
9218 case FFELEX_typeCOMMA
:
9219 ffesta_confirmed (); /* Error, but clearly intended. */
9220 goto bad_1
; /* :::::::::::::::::::: */
9223 goto bad_1
; /* :::::::::::::::::::: */
9225 case FFELEX_typeNAME
:
9226 case FFELEX_typeSLASH
:
9227 ffesta_confirmed ();
9228 if (!ffesta_is_inhibited ())
9229 ffestc_V014_start ();
9230 return (ffelexHandler
) ffestb_V0141_ (t
);
9232 case FFELEX_typeCOLONCOLON
:
9233 ffesta_confirmed ();
9234 if (!ffesta_is_inhibited ())
9235 ffestc_V014_start ();
9236 return (ffelexHandler
) ffestb_V0141_
;
9239 case FFELEX_typeNAMES
:
9240 if (ffesta_first_kw
!= FFESTR_firstVOLATILE
)
9241 goto bad_0
; /* :::::::::::::::::::: */
9242 p
= ffelex_token_text (ffesta_tokens
[0]) + (i
= FFESTR_firstlVOLATILE
);
9243 switch (ffelex_token_type (t
))
9246 goto bad_1
; /* :::::::::::::::::::: */
9248 case FFELEX_typeCOMMA
:
9249 case FFELEX_typeEOS
:
9250 case FFELEX_typeSEMICOLON
:
9251 ffesta_confirmed ();
9254 case FFELEX_typeSLASH
:
9255 ffesta_confirmed ();
9257 goto bad_i
; /* :::::::::::::::::::: */
9258 if (!ffesta_is_inhibited ())
9259 ffestc_V014_start ();
9260 return (ffelexHandler
) ffestb_V0141_ (t
);
9262 case FFELEX_typeCOLONCOLON
:
9263 ffesta_confirmed ();
9265 goto bad_i
; /* :::::::::::::::::::: */
9266 if (!ffesta_is_inhibited ())
9267 ffestc_V014_start ();
9268 return (ffelexHandler
) ffestb_V0141_
;
9271 /* Here, we have at least one char after "VOLATILE" and t is COMMA or
9274 if (!ffesrc_is_name_init (*p
))
9275 goto bad_i
; /* :::::::::::::::::::: */
9276 nt
= ffelex_token_name_from_names (ffesta_tokens
[0], i
, 0);
9277 if (!ffesta_is_inhibited ())
9278 ffestc_V014_start ();
9279 next
= (ffelexHandler
) ffestb_V0141_ (nt
);
9280 ffelex_token_kill (nt
);
9281 return (ffelexHandler
) (*next
) (t
);
9284 goto bad_0
; /* :::::::::::::::::::: */
9287 bad_0
: /* :::::::::::::::::::: */
9288 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "VOLATILE", ffesta_tokens
[0]);
9289 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
9291 bad_1
: /* :::::::::::::::::::: */
9292 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "VOLATILE", t
);
9293 return (ffelexHandler
) ffelex_swallow_tokens (t
,
9294 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
9296 bad_i
: /* :::::::::::::::::::: */
9297 ffesta_ffebad_1sp (FFEBAD_INVALID_STMT_FORM
, "VOLATILE", ffesta_tokens
[0], i
, t
);
9298 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
9301 /* ffestb_V0141_ -- "VOLATILE" [COLONCOLON]
9303 return ffestb_V0141_; // to lexer
9305 Handle NAME or SLASH. */
9307 static ffelexHandler
9308 ffestb_V0141_ (ffelexToken t
)
9310 switch (ffelex_token_type (t
))
9312 case FFELEX_typeNAME
:
9313 ffestb_local_
.V014
.is_cblock
= FALSE
;
9314 ffesta_tokens
[1] = ffelex_token_use (t
);
9315 return (ffelexHandler
) ffestb_V0144_
;
9317 case FFELEX_typeSLASH
:
9318 ffestb_local_
.V014
.is_cblock
= TRUE
;
9319 return (ffelexHandler
) ffestb_V0142_
;
9322 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "VOLATILE", t
);
9326 if (!ffesta_is_inhibited ())
9327 ffestc_V014_finish ();
9328 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
9331 /* ffestb_V0142_ -- "VOLATILE" [COLONCOLON] SLASH
9333 return ffestb_V0142_; // to lexer
9337 static ffelexHandler
9338 ffestb_V0142_ (ffelexToken t
)
9340 switch (ffelex_token_type (t
))
9342 case FFELEX_typeNAME
:
9343 ffesta_tokens
[1] = ffelex_token_use (t
);
9344 return (ffelexHandler
) ffestb_V0143_
;
9347 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "VOLATILE", t
);
9351 if (!ffesta_is_inhibited ())
9352 ffestc_V014_finish ();
9353 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
9356 /* ffestb_V0143_ -- "VOLATILE" [COLONCOLON] SLASH NAME
9358 return ffestb_V0143_; // to lexer
9362 static ffelexHandler
9363 ffestb_V0143_ (ffelexToken t
)
9365 switch (ffelex_token_type (t
))
9367 case FFELEX_typeSLASH
:
9368 return (ffelexHandler
) ffestb_V0144_
;
9371 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "VOLATILE", t
);
9375 if (!ffesta_is_inhibited ())
9376 ffestc_V014_finish ();
9377 ffelex_token_kill (ffesta_tokens
[1]);
9378 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
9381 /* ffestb_V0144_ -- "VOLATILE" [COLONCOLON] R523
9383 return ffestb_V0144_; // to lexer
9385 Handle COMMA or EOS/SEMICOLON. */
9387 static ffelexHandler
9388 ffestb_V0144_ (ffelexToken t
)
9390 switch (ffelex_token_type (t
))
9392 case FFELEX_typeCOMMA
:
9393 if (!ffesta_is_inhibited ())
9395 if (ffestb_local_
.V014
.is_cblock
)
9396 ffestc_V014_item_cblock (ffesta_tokens
[1]);
9398 ffestc_V014_item_object (ffesta_tokens
[1]);
9400 ffelex_token_kill (ffesta_tokens
[1]);
9401 return (ffelexHandler
) ffestb_V0141_
;
9403 case FFELEX_typeEOS
:
9404 case FFELEX_typeSEMICOLON
:
9405 if (!ffesta_is_inhibited ())
9407 if (ffestb_local_
.V014
.is_cblock
)
9408 ffestc_V014_item_cblock (ffesta_tokens
[1]);
9410 ffestc_V014_item_object (ffesta_tokens
[1]);
9411 ffestc_V014_finish ();
9413 ffelex_token_kill (ffesta_tokens
[1]);
9414 return (ffelexHandler
) ffesta_zero (t
);
9417 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "VOLATILE", t
);
9421 if (!ffesta_is_inhibited ())
9422 ffestc_V014_finish ();
9423 ffelex_token_kill (ffesta_tokens
[1]);
9424 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
9427 /* ffestb_subr_kill_easy_ -- Kill I/O statement data structure
9429 ffestb_subr_kill_easy_();
9431 Kills all tokens in the I/O data structure. Assumes that they are
9432 overlaid with each other (union) in ffest_private.h and the typing
9433 and structure references assume (though not necessarily dangerous if
9434 FALSE) that INQUIRE has the most file elements. */
9436 #if FFESTB_KILL_EASY_
9438 ffestb_subr_kill_easy_ (ffestpInquireIx max
)
9442 for (ix
= 0; ix
< max
; ++ix
)
9444 if (ffestp_file
.inquire
.inquire_spec
[ix
].kw_or_val_present
)
9446 if (ffestp_file
.inquire
.inquire_spec
[ix
].kw_present
)
9447 ffelex_token_kill (ffestp_file
.inquire
.inquire_spec
[ix
].kw
);
9448 if (ffestp_file
.inquire
.inquire_spec
[ix
].value_present
)
9449 ffelex_token_kill (ffestp_file
.inquire
.inquire_spec
[ix
].value
);
9455 /* ffestb_subr_kill_accept_ -- Kill ACCEPT statement data structure
9457 ffestb_subr_kill_accept_();
9459 Kills all tokens in the ACCEPT data structure. */
9461 #if !FFESTB_KILL_EASY_
9463 ffestb_subr_kill_accept_ (void)
9467 for (ix
= 0; ix
< FFESTP_acceptix
; ++ix
)
9469 if (ffestp_file
.accept
.accept_spec
[ix
].kw_or_val_present
)
9471 if (ffestp_file
.accept
.accept_spec
[ix
].kw_present
)
9472 ffelex_token_kill (ffestp_file
.accept
.accept_spec
[ix
].kw
);
9473 if (ffestp_file
.accept
.accept_spec
[ix
].value_present
)
9474 ffelex_token_kill (ffestp_file
.accept
.accept_spec
[ix
].value
);
9480 /* ffestb_subr_kill_beru_ -- Kill BACKSPACE/ENDFILE/REWIND/UNLOCK statement
9483 ffestb_subr_kill_beru_();
9485 Kills all tokens in the BACKSPACE/ENDFILE/REWIND/UNLOCK data structure. */
9487 #if !FFESTB_KILL_EASY_
9489 ffestb_subr_kill_beru_ (void)
9493 for (ix
= 0; ix
< FFESTP_beruix
; ++ix
)
9495 if (ffestp_file
.beru
.beru_spec
[ix
].kw_or_val_present
)
9497 if (ffestp_file
.beru
.beru_spec
[ix
].kw_present
)
9498 ffelex_token_kill (ffestp_file
.beru
.beru_spec
[ix
].kw
);
9499 if (ffestp_file
.beru
.beru_spec
[ix
].value_present
)
9500 ffelex_token_kill (ffestp_file
.beru
.beru_spec
[ix
].value
);
9506 /* ffestb_subr_kill_close_ -- Kill CLOSE statement data structure
9508 ffestb_subr_kill_close_();
9510 Kills all tokens in the CLOSE data structure. */
9512 #if !FFESTB_KILL_EASY_
9514 ffestb_subr_kill_close_ (void)
9518 for (ix
= 0; ix
< FFESTP_closeix
; ++ix
)
9520 if (ffestp_file
.close
.close_spec
[ix
].kw_or_val_present
)
9522 if (ffestp_file
.close
.close_spec
[ix
].kw_present
)
9523 ffelex_token_kill (ffestp_file
.close
.close_spec
[ix
].kw
);
9524 if (ffestp_file
.close
.close_spec
[ix
].value_present
)
9525 ffelex_token_kill (ffestp_file
.close
.close_spec
[ix
].value
);
9531 /* ffestb_subr_kill_delete_ -- Kill DELETE statement data structure
9533 ffestb_subr_kill_delete_();
9535 Kills all tokens in the DELETE data structure. */
9537 #if !FFESTB_KILL_EASY_
9539 ffestb_subr_kill_delete_ (void)
9543 for (ix
= 0; ix
< FFESTP_deleteix
; ++ix
)
9545 if (ffestp_file
.delete.delete_spec
[ix
].kw_or_val_present
)
9547 if (ffestp_file
.delete.delete_spec
[ix
].kw_present
)
9548 ffelex_token_kill (ffestp_file
.delete.delete_spec
[ix
].kw
);
9549 if (ffestp_file
.delete.delete_spec
[ix
].value_present
)
9550 ffelex_token_kill (ffestp_file
.delete.delete_spec
[ix
].value
);
9556 /* ffestb_subr_kill_inquire_ -- Kill INQUIRE statement data structure
9558 ffestb_subr_kill_inquire_();
9560 Kills all tokens in the INQUIRE data structure. */
9562 #if !FFESTB_KILL_EASY_
9564 ffestb_subr_kill_inquire_ (void)
9568 for (ix
= 0; ix
< FFESTP_inquireix
; ++ix
)
9570 if (ffestp_file
.inquire
.inquire_spec
[ix
].kw_or_val_present
)
9572 if (ffestp_file
.inquire
.inquire_spec
[ix
].kw_present
)
9573 ffelex_token_kill (ffestp_file
.inquire
.inquire_spec
[ix
].kw
);
9574 if (ffestp_file
.inquire
.inquire_spec
[ix
].value_present
)
9575 ffelex_token_kill (ffestp_file
.inquire
.inquire_spec
[ix
].value
);
9581 /* ffestb_subr_kill_open_ -- Kill OPEN statement data structure
9583 ffestb_subr_kill_open_();
9585 Kills all tokens in the OPEN data structure. */
9587 #if !FFESTB_KILL_EASY_
9589 ffestb_subr_kill_open_ (void)
9593 for (ix
= 0; ix
< FFESTP_openix
; ++ix
)
9595 if (ffestp_file
.open
.open_spec
[ix
].kw_or_val_present
)
9597 if (ffestp_file
.open
.open_spec
[ix
].kw_present
)
9598 ffelex_token_kill (ffestp_file
.open
.open_spec
[ix
].kw
);
9599 if (ffestp_file
.open
.open_spec
[ix
].value_present
)
9600 ffelex_token_kill (ffestp_file
.open
.open_spec
[ix
].value
);
9606 /* ffestb_subr_kill_print_ -- Kill PRINT statement data structure
9608 ffestb_subr_kill_print_();
9610 Kills all tokens in the PRINT data structure. */
9612 #if !FFESTB_KILL_EASY_
9614 ffestb_subr_kill_print_ (void)
9618 for (ix
= 0; ix
< FFESTP_printix
; ++ix
)
9620 if (ffestp_file
.print
.print_spec
[ix
].kw_or_val_present
)
9622 if (ffestp_file
.print
.print_spec
[ix
].kw_present
)
9623 ffelex_token_kill (ffestp_file
.print
.print_spec
[ix
].kw
);
9624 if (ffestp_file
.print
.print_spec
[ix
].value_present
)
9625 ffelex_token_kill (ffestp_file
.print
.print_spec
[ix
].value
);
9631 /* ffestb_subr_kill_read_ -- Kill READ statement data structure
9633 ffestb_subr_kill_read_();
9635 Kills all tokens in the READ data structure. */
9637 #if !FFESTB_KILL_EASY_
9639 ffestb_subr_kill_read_ (void)
9643 for (ix
= 0; ix
< FFESTP_readix
; ++ix
)
9645 if (ffestp_file
.read
.read_spec
[ix
].kw_or_val_present
)
9647 if (ffestp_file
.read
.read_spec
[ix
].kw_present
)
9648 ffelex_token_kill (ffestp_file
.read
.read_spec
[ix
].kw
);
9649 if (ffestp_file
.read
.read_spec
[ix
].value_present
)
9650 ffelex_token_kill (ffestp_file
.read
.read_spec
[ix
].value
);
9656 /* ffestb_subr_kill_rewrite_ -- Kill REWRITE statement data structure
9658 ffestb_subr_kill_rewrite_();
9660 Kills all tokens in the REWRITE data structure. */
9662 #if !FFESTB_KILL_EASY_
9664 ffestb_subr_kill_rewrite_ (void)
9668 for (ix
= 0; ix
< FFESTP_rewriteix
; ++ix
)
9670 if (ffestp_file
.rewrite
.rewrite_spec
[ix
].kw_or_val_present
)
9672 if (ffestp_file
.rewrite
.rewrite_spec
[ix
].kw_present
)
9673 ffelex_token_kill (ffestp_file
.rewrite
.rewrite_spec
[ix
].kw
);
9674 if (ffestp_file
.rewrite
.rewrite_spec
[ix
].value_present
)
9675 ffelex_token_kill (ffestp_file
.rewrite
.rewrite_spec
[ix
].value
);
9681 /* ffestb_subr_kill_type_ -- Kill TYPE statement data structure
9683 ffestb_subr_kill_type_();
9685 Kills all tokens in the TYPE data structure. */
9687 #if !FFESTB_KILL_EASY_
9689 ffestb_subr_kill_type_ (void)
9693 for (ix
= 0; ix
< FFESTP_typeix
; ++ix
)
9695 if (ffestp_file
.type
.type_spec
[ix
].kw_or_val_present
)
9697 if (ffestp_file
.type
.type_spec
[ix
].kw_present
)
9698 ffelex_token_kill (ffestp_file
.type
.type_spec
[ix
].kw
);
9699 if (ffestp_file
.type
.type_spec
[ix
].value_present
)
9700 ffelex_token_kill (ffestp_file
.type
.type_spec
[ix
].value
);
9706 /* ffestb_subr_kill_write_ -- Kill WRITE statement data structure
9708 ffestb_subr_kill_write_();
9710 Kills all tokens in the WRITE data structure. */
9712 #if !FFESTB_KILL_EASY_
9714 ffestb_subr_kill_write_ (void)
9718 for (ix
= 0; ix
< FFESTP_writeix
; ++ix
)
9720 if (ffestp_file
.write
.write_spec
[ix
].kw_or_val_present
)
9722 if (ffestp_file
.write
.write_spec
[ix
].kw_present
)
9723 ffelex_token_kill (ffestp_file
.write
.write_spec
[ix
].kw
);
9724 if (ffestp_file
.write
.write_spec
[ix
].value_present
)
9725 ffelex_token_kill (ffestp_file
.write
.write_spec
[ix
].value
);
9731 /* ffestb_beru -- Parse the BACKSPACE/ENDFILE/REWIND/UNLOCK statement
9733 return ffestb_beru; // to lexer
9735 Make sure the statement has a valid form for the BACKSPACE/ENDFILE/REWIND/
9736 UNLOCK statement. If it does, implement the statement. */
9739 ffestb_beru (ffelexToken t
)
9744 switch (ffelex_token_type (ffesta_tokens
[0]))
9746 case FFELEX_typeNAME
:
9747 switch (ffelex_token_type (t
))
9749 case FFELEX_typeCOMMA
:
9750 case FFELEX_typeCOLONCOLON
:
9751 case FFELEX_typeEOS
:
9752 case FFELEX_typeSEMICOLON
:
9753 ffesta_confirmed (); /* Error, but clearly intended. */
9754 goto bad_1
; /* :::::::::::::::::::: */
9756 case FFELEX_typeEQUALS
:
9757 case FFELEX_typePOINTS
:
9758 case FFELEX_typeCOLON
:
9759 goto bad_1
; /* :::::::::::::::::::: */
9761 case FFELEX_typeNAME
:
9762 case FFELEX_typeNUMBER
:
9763 ffesta_confirmed ();
9766 case FFELEX_typeOPEN_PAREN
:
9767 for (ix
= 0; ix
< FFESTP_beruix
; ++ix
)
9768 ffestp_file
.beru
.beru_spec
[ix
].kw_or_val_present
= FALSE
;
9769 ffesta_tokens
[1] = ffelex_token_use (t
);
9770 return (ffelexHandler
) ffestb_beru2_
;
9776 for (ix
= 0; ix
< FFESTP_beruix
; ++ix
)
9777 ffestp_file
.beru
.beru_spec
[ix
].kw_or_val_present
= FALSE
;
9778 return (ffelexHandler
) (*((ffelexHandler
)
9779 ffeexpr_rhs (ffesta_output_pool
,
9780 FFEEXPR_contextFILENUM
,
9781 (ffeexprCallback
) ffestb_beru1_
)))
9784 case FFELEX_typeNAMES
:
9785 switch (ffelex_token_type (t
))
9787 case FFELEX_typeCOMMA
:
9788 case FFELEX_typeCOLONCOLON
:
9789 ffesta_confirmed (); /* Error, but clearly intended. */
9790 goto bad_1
; /* :::::::::::::::::::: */
9792 case FFELEX_typeEQUALS
:
9793 case FFELEX_typePOINTS
:
9794 case FFELEX_typeCOLON
:
9795 goto bad_1
; /* :::::::::::::::::::: */
9797 case FFELEX_typeEOS
:
9798 case FFELEX_typeSEMICOLON
:
9799 ffesta_confirmed ();
9802 case FFELEX_typeOPEN_PAREN
:
9803 if (ffelex_token_length (ffesta_tokens
[0])
9804 != ffestb_args
.beru
.len
)
9807 for (ix
= 0; ix
< FFESTP_beruix
; ++ix
)
9808 ffestp_file
.beru
.beru_spec
[ix
].kw_or_val_present
= FALSE
;
9809 ffesta_tokens
[1] = ffelex_token_use (t
);
9810 return (ffelexHandler
) ffestb_beru2_
;
9815 for (ix
= 0; ix
< FFESTP_beruix
; ++ix
)
9816 ffestp_file
.beru
.beru_spec
[ix
].kw_or_val_present
= FALSE
;
9817 next
= (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
9818 FFEEXPR_contextFILENUM
, (ffeexprCallback
) ffestb_beru1_
);
9819 next
= (ffelexHandler
) ffelex_splice_tokens (next
, ffesta_tokens
[0],
9820 ffestb_args
.beru
.len
);
9822 return (ffelexHandler
) ffelex_swallow_tokens (t
,
9823 (ffelexHandler
) ffesta_zero
);
9824 return (ffelexHandler
) (*next
) (t
);
9827 goto bad_0
; /* :::::::::::::::::::: */
9830 bad_0
: /* :::::::::::::::::::: */
9831 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, ffestb_args
.beru
.badname
, ffesta_tokens
[0]);
9832 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
9834 bad_1
: /* :::::::::::::::::::: */
9835 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, ffestb_args
.beru
.badname
, t
);
9836 return (ffelexHandler
) ffelex_swallow_tokens (t
,
9837 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
9840 /* ffestb_beru1_ -- "BACKSPACE/ENDFILE/REWIND/UNLOCK" expr
9842 (ffestb_beru1_) // to expression handler
9844 Make sure the next token is an EOS or SEMICOLON. */
9846 static ffelexHandler
9847 ffestb_beru1_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
9849 switch (ffelex_token_type (t
))
9851 case FFELEX_typeEOS
:
9852 case FFELEX_typeSEMICOLON
:
9855 ffesta_confirmed ();
9856 ffestp_file
.beru
.beru_spec
[FFESTP_beruixUNIT
].kw_or_val_present
9858 ffestp_file
.beru
.beru_spec
[FFESTP_beruixUNIT
].kw_present
= FALSE
;
9859 ffestp_file
.beru
.beru_spec
[FFESTP_beruixUNIT
].value_present
= TRUE
;
9860 ffestp_file
.beru
.beru_spec
[FFESTP_beruixUNIT
].value_is_label
9862 ffestp_file
.beru
.beru_spec
[FFESTP_beruixUNIT
].value
9863 = ffelex_token_use (ft
);
9864 ffestp_file
.beru
.beru_spec
[FFESTP_beruixUNIT
].u
.expr
= expr
;
9865 if (!ffesta_is_inhibited ())
9867 switch (ffesta_first_kw
)
9869 case FFESTR_firstBACKSPACE
:
9873 case FFESTR_firstENDFILE
:
9874 case FFESTR_firstEND
:
9878 case FFESTR_firstREWIND
:
9886 ffestb_subr_kill_beru_ ();
9887 return (ffelexHandler
) ffesta_zero (t
);
9893 ffestb_subr_kill_beru_ ();
9894 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, ffestb_args
.beru
.badname
, t
);
9895 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
9898 /* ffestb_beru2_ -- "BACKSPACE/ENDFILE/REWIND/UNLOCK" OPEN_PAREN
9900 return ffestb_beru2_; // to lexer
9902 Handle expr construct (not NAME=expr construct) here. */
9904 static ffelexHandler
9905 ffestb_beru2_ (ffelexToken t
)
9910 switch (ffelex_token_type (t
))
9912 case FFELEX_typeNAME
:
9913 ffesta_tokens
[2] = ffelex_token_use (t
);
9914 return (ffelexHandler
) ffestb_beru3_
;
9917 nt
= ffesta_tokens
[1];
9918 next
= (ffelexHandler
) (*((ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
9919 FFEEXPR_contextFILENUMAMBIG
, (ffeexprCallback
) ffestb_beru4_
)))
9921 ffelex_token_kill (nt
);
9922 return (ffelexHandler
) (*next
) (t
);
9926 /* ffestb_beru3_ -- "BACKSPACE/ENDFILE/REWIND/UNLOCK" OPEN_PAREN NAME
9928 return ffestb_beru3_; // to lexer
9930 If EQUALS here, go to states that handle it. Else, send NAME and this
9931 token thru expression handler. */
9933 static ffelexHandler
9934 ffestb_beru3_ (ffelexToken t
)
9940 switch (ffelex_token_type (t
))
9942 case FFELEX_typeEQUALS
:
9943 ffelex_token_kill (ffesta_tokens
[1]);
9944 nt
= ffesta_tokens
[2];
9945 next
= (ffelexHandler
) ffestb_beru5_ (nt
);
9946 ffelex_token_kill (nt
);
9947 return (ffelexHandler
) (*next
) (t
);
9950 nt
= ffesta_tokens
[1];
9951 ot
= ffesta_tokens
[2];
9952 next
= (ffelexHandler
) (*((ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
9953 FFEEXPR_contextFILENUMAMBIG
, (ffeexprCallback
) ffestb_beru4_
)))
9955 ffelex_token_kill (nt
);
9956 next
= (ffelexHandler
) (*next
) (ot
);
9957 ffelex_token_kill (ot
);
9958 return (ffelexHandler
) (*next
) (t
);
9962 /* ffestb_beru4_ -- "BACKSPACE/ENDFILE/REWIND/UNLOCK" OPEN_PAREN expr [CLOSE_PAREN]
9964 (ffestb_beru4_) // to expression handler
9966 Handle COMMA or EOS/SEMICOLON here.
9969 Now using new mechanism whereby expr comes back as opITEM if the
9970 expr is considered part (or all) of an I/O control list (and should
9971 be stripped of its outer opITEM node) or not if it is considered
9972 a plain unit number that happens to have been enclosed in parens.
9974 No longer expecting close-paren here because of constructs like
9975 BACKSPACE (5)+2, so now expecting either COMMA because it was a
9976 construct like BACKSPACE (5+2,... or EOS/SEMICOLON because it is like
9977 the former construct. Ah, the vagaries of Fortran. */
9979 static ffelexHandler
9980 ffestb_beru4_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
9984 switch (ffelex_token_type (t
))
9986 case FFELEX_typeCOMMA
:
9987 case FFELEX_typeEOS
:
9988 case FFELEX_typeSEMICOLON
:
9989 case FFELEX_typeCLOSE_PAREN
:
9992 if (ffebld_op (expr
) == FFEBLD_opITEM
)
9995 expr
= ffebld_head (expr
);
9999 ffestp_file
.beru
.beru_spec
[FFESTP_beruixUNIT
].kw_or_val_present
10001 ffestp_file
.beru
.beru_spec
[FFESTP_beruixUNIT
].kw_present
= FALSE
;
10002 ffestp_file
.beru
.beru_spec
[FFESTP_beruixUNIT
].value_present
= TRUE
;
10003 ffestp_file
.beru
.beru_spec
[FFESTP_beruixUNIT
].value_is_label
10005 ffestp_file
.beru
.beru_spec
[FFESTP_beruixUNIT
].value
10006 = ffelex_token_use (ft
);
10007 ffestp_file
.beru
.beru_spec
[FFESTP_beruixUNIT
].u
.expr
= expr
;
10009 return (ffelexHandler
) ffestb_beru9_ (t
);
10010 return (ffelexHandler
) ffestb_beru10_ (t
);
10016 ffestb_subr_kill_beru_ ();
10017 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, ffestb_args
.beru
.badname
, t
);
10018 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
10021 /* ffestb_beru5_ -- "BACKSPACE/ENDFILE/REWIND/UNLOCK" OPEN_PAREN [external-file-unit
10024 return ffestb_beru5_; // to lexer
10026 Handle expr construct (not NAME=expr construct) here. */
10028 static ffelexHandler
10029 ffestb_beru5_ (ffelexToken t
)
10033 ffestb_local_
.beru
.label
= FALSE
;
10035 switch (ffelex_token_type (t
))
10037 case FFELEX_typeNAME
:
10038 kw
= ffestr_genio (t
);
10041 case FFESTR_genioERR
:
10042 ffestb_local_
.beru
.ix
= FFESTP_beruixERR
;
10043 ffestb_local_
.beru
.label
= TRUE
;
10046 case FFESTR_genioIOSTAT
:
10047 ffestb_local_
.beru
.ix
= FFESTP_beruixIOSTAT
;
10048 ffestb_local_
.beru
.left
= TRUE
;
10049 ffestb_local_
.beru
.context
= FFEEXPR_contextFILEINT
;
10052 case FFESTR_genioUNIT
:
10053 ffestb_local_
.beru
.ix
= FFESTP_beruixUNIT
;
10054 ffestb_local_
.beru
.left
= FALSE
;
10055 ffestb_local_
.beru
.context
= FFEEXPR_contextFILENUM
;
10059 goto bad
; /* :::::::::::::::::::: */
10061 if (ffestp_file
.beru
.beru_spec
[ffestb_local_
.beru
.ix
]
10062 .kw_or_val_present
)
10063 break; /* Can't specify a keyword twice! */
10064 ffestp_file
.beru
.beru_spec
[ffestb_local_
.beru
.ix
]
10065 .kw_or_val_present
= TRUE
;
10066 ffestp_file
.beru
.beru_spec
[ffestb_local_
.beru
.ix
]
10067 .kw_present
= TRUE
;
10068 ffestp_file
.beru
.beru_spec
[ffestb_local_
.beru
.ix
]
10069 .value_present
= FALSE
;
10070 ffestp_file
.beru
.beru_spec
[ffestb_local_
.beru
.ix
].value_is_label
10071 = ffestb_local_
.beru
.label
;
10072 ffestp_file
.beru
.beru_spec
[ffestb_local_
.beru
.ix
].kw
10073 = ffelex_token_use (t
);
10074 return (ffelexHandler
) ffestb_beru6_
;
10080 bad
: /* :::::::::::::::::::: */
10081 ffestb_subr_kill_beru_ ();
10082 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, ffestb_args
.beru
.badname
, t
);
10083 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
10086 /* ffestb_beru6_ -- "BACKSPACE/ENDFILE/REWIND/UNLOCK" OPEN_PAREN [external-file-unit
10089 return ffestb_beru6_; // to lexer
10091 Make sure EQUALS here, send next token to expression handler. */
10093 static ffelexHandler
10094 ffestb_beru6_ (ffelexToken t
)
10097 switch (ffelex_token_type (t
))
10099 case FFELEX_typeEQUALS
:
10100 ffesta_confirmed ();
10101 if (ffestb_local_
.beru
.label
)
10102 return (ffelexHandler
) ffestb_beru8_
;
10103 if (ffestb_local_
.beru
.left
)
10104 return (ffelexHandler
) ffeexpr_lhs (ffesta_output_pool
,
10105 ffestb_local_
.beru
.context
,
10106 (ffeexprCallback
) ffestb_beru7_
);
10107 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
10108 ffestb_local_
.beru
.context
,
10109 (ffeexprCallback
) ffestb_beru7_
);
10115 ffestb_subr_kill_beru_ ();
10116 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, ffestb_args
.beru
.badname
, t
);
10117 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
10120 /* ffestb_beru7_ -- "BACKSPACE/ENDFILE/REWIND/UNLOCK" OPEN_PAREN ... NAME EQUALS expr
10122 (ffestb_beru7_) // to expression handler
10124 Handle COMMA or CLOSE_PAREN here. */
10126 static ffelexHandler
10127 ffestb_beru7_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
10129 switch (ffelex_token_type (t
))
10131 case FFELEX_typeCOMMA
:
10132 case FFELEX_typeCLOSE_PAREN
:
10135 ffestp_file
.beru
.beru_spec
[ffestb_local_
.beru
.ix
].value_present
10137 ffestp_file
.beru
.beru_spec
[ffestb_local_
.beru
.ix
].value
10138 = ffelex_token_use (ft
);
10139 ffestp_file
.beru
.beru_spec
[ffestb_local_
.beru
.ix
].u
.expr
= expr
;
10140 if (ffelex_token_type (t
) == FFELEX_typeCOMMA
)
10141 return (ffelexHandler
) ffestb_beru5_
;
10142 return (ffelexHandler
) ffestb_beru10_
;
10148 ffestb_subr_kill_beru_ ();
10149 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, ffestb_args
.beru
.badname
, t
);
10150 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
10153 /* ffestb_beru8_ -- "BACKSPACE/ENDFILE/REWIND/UNLOCK" OPEN_PAREN ... NAME EQUALS
10155 return ffestb_beru8_; // to lexer
10157 Handle NUMBER for label here. */
10159 static ffelexHandler
10160 ffestb_beru8_ (ffelexToken t
)
10162 switch (ffelex_token_type (t
))
10164 case FFELEX_typeNUMBER
:
10165 ffestp_file
.beru
.beru_spec
[ffestb_local_
.beru
.ix
].value_present
10167 ffestp_file
.beru
.beru_spec
[ffestb_local_
.beru
.ix
].value
10168 = ffelex_token_use (t
);
10169 return (ffelexHandler
) ffestb_beru9_
;
10175 ffestb_subr_kill_beru_ ();
10176 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, ffestb_args
.beru
.badname
, t
);
10177 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
10180 /* ffestb_beru9_ -- "BACKSPACE/ENDFILE/REWIND/UNLOCK" OPEN_PAREN ... NAME EQUALS
10183 return ffestb_beru9_; // to lexer
10185 Handle COMMA or CLOSE_PAREN here. */
10187 static ffelexHandler
10188 ffestb_beru9_ (ffelexToken t
)
10190 switch (ffelex_token_type (t
))
10192 case FFELEX_typeCOMMA
:
10193 return (ffelexHandler
) ffestb_beru5_
;
10195 case FFELEX_typeCLOSE_PAREN
:
10196 return (ffelexHandler
) ffestb_beru10_
;
10202 ffestb_subr_kill_beru_ ();
10203 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, ffestb_args
.beru
.badname
, t
);
10204 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
10207 /* ffestb_beru10_ -- "BACKSPACE/ENDFILE/REWIND/UNLOCK" OPEN_PAREN ... CLOSE_PAREN
10209 return ffestb_beru10_; // to lexer
10211 Handle EOS or SEMICOLON here. */
10213 static ffelexHandler
10214 ffestb_beru10_ (ffelexToken t
)
10216 switch (ffelex_token_type (t
))
10218 case FFELEX_typeEOS
:
10219 case FFELEX_typeSEMICOLON
:
10220 ffesta_confirmed ();
10221 if (!ffesta_is_inhibited ())
10223 switch (ffesta_first_kw
)
10225 case FFESTR_firstBACKSPACE
:
10229 case FFESTR_firstENDFILE
:
10230 case FFESTR_firstEND
:
10234 case FFESTR_firstREWIND
:
10242 ffestb_subr_kill_beru_ ();
10243 return (ffelexHandler
) ffesta_zero (t
);
10249 ffestb_subr_kill_beru_ ();
10250 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, ffestb_args
.beru
.badname
, t
);
10251 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
10254 /* ffestb_R904 -- Parse an OPEN statement
10256 return ffestb_R904; // to lexer
10258 Make sure the statement has a valid form for an OPEN statement.
10259 If it does, implement the statement. */
10262 ffestb_R904 (ffelexToken t
)
10266 switch (ffelex_token_type (ffesta_tokens
[0]))
10268 case FFELEX_typeNAME
:
10269 if (ffesta_first_kw
!= FFESTR_firstOPEN
)
10270 goto bad_0
; /* :::::::::::::::::::: */
10273 case FFELEX_typeNAMES
:
10274 if (ffesta_first_kw
!= FFESTR_firstOPEN
)
10275 goto bad_0
; /* :::::::::::::::::::: */
10276 if (ffelex_token_length (ffesta_tokens
[0]) != FFESTR_firstlOPEN
)
10277 goto bad_0
; /* :::::::::::::::::::: */
10281 goto bad_0
; /* :::::::::::::::::::: */
10284 switch (ffelex_token_type (t
))
10286 case FFELEX_typeOPEN_PAREN
:
10289 case FFELEX_typeEOS
:
10290 case FFELEX_typeSEMICOLON
:
10291 case FFELEX_typeCOMMA
:
10292 case FFELEX_typeCOLONCOLON
:
10293 ffesta_confirmed (); /* Error, but clearly intended. */
10294 goto bad_1
; /* :::::::::::::::::::: */
10297 goto bad_1
; /* :::::::::::::::::::: */
10300 for (ix
= 0; ix
< FFESTP_openix
; ++ix
)
10301 ffestp_file
.open
.open_spec
[ix
].kw_or_val_present
= FALSE
;
10303 return (ffelexHandler
) ffestb_R9041_
;
10305 bad_0
: /* :::::::::::::::::::: */
10306 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "OPEN", ffesta_tokens
[0]);
10307 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
10309 bad_1
: /* :::::::::::::::::::: */
10310 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "OPEN", t
);
10311 return (ffelexHandler
) ffelex_swallow_tokens (t
,
10312 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
10315 /* ffestb_R9041_ -- "OPEN" OPEN_PAREN
10317 return ffestb_R9041_; // to lexer
10319 Handle expr construct (not NAME=expr construct) here. */
10321 static ffelexHandler
10322 ffestb_R9041_ (ffelexToken t
)
10324 switch (ffelex_token_type (t
))
10326 case FFELEX_typeNAME
:
10327 ffesta_tokens
[1] = ffelex_token_use (t
);
10328 return (ffelexHandler
) ffestb_R9042_
;
10331 return (ffelexHandler
) (*((ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
10332 FFEEXPR_contextFILENUM
, (ffeexprCallback
) ffestb_R9043_
)))
10337 /* ffestb_R9042_ -- "OPEN" OPEN_PAREN NAME
10339 return ffestb_R9042_; // to lexer
10341 If EQUALS here, go to states that handle it. Else, send NAME and this
10342 token thru expression handler. */
10344 static ffelexHandler
10345 ffestb_R9042_ (ffelexToken t
)
10347 ffelexHandler next
;
10350 switch (ffelex_token_type (t
))
10352 case FFELEX_typeEQUALS
:
10353 nt
= ffesta_tokens
[1];
10354 next
= (ffelexHandler
) ffestb_R9044_ (nt
);
10355 ffelex_token_kill (nt
);
10356 return (ffelexHandler
) (*next
) (t
);
10359 next
= (ffelexHandler
) (*((ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
10360 FFEEXPR_contextFILENUM
, (ffeexprCallback
) ffestb_R9043_
)))
10361 (ffesta_tokens
[1]);
10362 ffelex_token_kill (ffesta_tokens
[1]);
10363 return (ffelexHandler
) (*next
) (t
);
10367 /* ffestb_R9043_ -- "OPEN" OPEN_PAREN expr
10369 (ffestb_R9043_) // to expression handler
10371 Handle COMMA or CLOSE_PAREN here. */
10373 static ffelexHandler
10374 ffestb_R9043_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
10376 switch (ffelex_token_type (t
))
10378 case FFELEX_typeCOMMA
:
10379 case FFELEX_typeCLOSE_PAREN
:
10382 ffestp_file
.open
.open_spec
[FFESTP_openixUNIT
].kw_or_val_present
10384 ffestp_file
.open
.open_spec
[FFESTP_openixUNIT
].kw_present
= FALSE
;
10385 ffestp_file
.open
.open_spec
[FFESTP_openixUNIT
].value_present
= TRUE
;
10386 ffestp_file
.open
.open_spec
[FFESTP_openixUNIT
].value_is_label
10388 ffestp_file
.open
.open_spec
[FFESTP_openixUNIT
].value
10389 = ffelex_token_use (ft
);
10390 ffestp_file
.open
.open_spec
[FFESTP_openixUNIT
].u
.expr
= expr
;
10391 if (ffelex_token_type (t
) == FFELEX_typeCOMMA
)
10392 return (ffelexHandler
) ffestb_R9044_
;
10393 return (ffelexHandler
) ffestb_R9049_
;
10399 ffestb_subr_kill_open_ ();
10400 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "OPEN", t
);
10401 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
10404 /* ffestb_R9044_ -- "OPEN" OPEN_PAREN [external-file-unit COMMA]
10406 return ffestb_R9044_; // to lexer
10408 Handle expr construct (not NAME=expr construct) here. */
10410 static ffelexHandler
10411 ffestb_R9044_ (ffelexToken t
)
10415 ffestb_local_
.open
.label
= FALSE
;
10417 switch (ffelex_token_type (t
))
10419 case FFELEX_typeNAME
:
10420 kw
= ffestr_open (t
);
10423 case FFESTR_openACCESS
:
10424 ffestb_local_
.open
.ix
= FFESTP_openixACCESS
;
10425 ffestb_local_
.open
.left
= FALSE
;
10426 ffestb_local_
.open
.context
= FFEEXPR_contextFILEDFCHAR
;
10429 case FFESTR_openACTION
:
10430 ffestb_local_
.open
.ix
= FFESTP_openixACTION
;
10431 ffestb_local_
.open
.left
= FALSE
;
10432 ffestb_local_
.open
.context
= FFEEXPR_contextFILEDFCHAR
;
10435 case FFESTR_openASSOCIATEVARIABLE
:
10436 ffestb_local_
.open
.ix
= FFESTP_openixASSOCIATEVARIABLE
;
10437 ffestb_local_
.open
.left
= TRUE
;
10438 ffestb_local_
.open
.context
= FFEEXPR_contextFILEASSOC
;
10441 case FFESTR_openBLANK
:
10442 ffestb_local_
.open
.ix
= FFESTP_openixBLANK
;
10443 ffestb_local_
.open
.left
= FALSE
;
10444 ffestb_local_
.open
.context
= FFEEXPR_contextFILEDFCHAR
;
10447 case FFESTR_openBLOCKSIZE
:
10448 ffestb_local_
.open
.ix
= FFESTP_openixBLOCKSIZE
;
10449 ffestb_local_
.open
.left
= FALSE
;
10450 ffestb_local_
.open
.context
= FFEEXPR_contextFILENUM
;
10453 case FFESTR_openBUFFERCOUNT
:
10454 ffestb_local_
.open
.ix
= FFESTP_openixBUFFERCOUNT
;
10455 ffestb_local_
.open
.left
= FALSE
;
10456 ffestb_local_
.open
.context
= FFEEXPR_contextFILENUM
;
10459 case FFESTR_openCARRIAGECONTROL
:
10460 ffestb_local_
.open
.ix
= FFESTP_openixCARRIAGECONTROL
;
10461 ffestb_local_
.open
.left
= FALSE
;
10462 ffestb_local_
.open
.context
= FFEEXPR_contextFILECHAR
;
10465 case FFESTR_openDEFAULTFILE
:
10466 ffestb_local_
.open
.ix
= FFESTP_openixDEFAULTFILE
;
10467 ffestb_local_
.open
.left
= FALSE
;
10468 ffestb_local_
.open
.context
= FFEEXPR_contextFILECHAR
;
10471 case FFESTR_openDELIM
:
10472 ffestb_local_
.open
.ix
= FFESTP_openixDELIM
;
10473 ffestb_local_
.open
.left
= FALSE
;
10474 ffestb_local_
.open
.context
= FFEEXPR_contextFILEDFCHAR
;
10477 case FFESTR_openDISP
:
10478 case FFESTR_openDISPOSE
:
10479 ffestb_local_
.open
.ix
= FFESTP_openixDISPOSE
;
10480 ffestb_local_
.open
.left
= FALSE
;
10481 ffestb_local_
.open
.context
= FFEEXPR_contextFILECHAR
;
10484 case FFESTR_openERR
:
10485 ffestb_local_
.open
.ix
= FFESTP_openixERR
;
10486 ffestb_local_
.open
.label
= TRUE
;
10489 case FFESTR_openEXTENDSIZE
:
10490 ffestb_local_
.open
.ix
= FFESTP_openixEXTENDSIZE
;
10491 ffestb_local_
.open
.left
= FALSE
;
10492 ffestb_local_
.open
.context
= FFEEXPR_contextFILENUM
;
10495 case FFESTR_openFILE
:
10496 case FFESTR_openNAME
:
10497 ffestb_local_
.open
.ix
= FFESTP_openixFILE
;
10498 ffestb_local_
.open
.left
= FALSE
;
10499 ffestb_local_
.open
.context
= FFEEXPR_contextFILECHAR
;
10502 case FFESTR_openFORM
:
10503 ffestb_local_
.open
.ix
= FFESTP_openixFORM
;
10504 ffestb_local_
.open
.left
= FALSE
;
10505 ffestb_local_
.open
.context
= FFEEXPR_contextFILEDFCHAR
;
10508 case FFESTR_openINITIALSIZE
:
10509 ffestb_local_
.open
.ix
= FFESTP_openixINITIALSIZE
;
10510 ffestb_local_
.open
.left
= FALSE
;
10511 ffestb_local_
.open
.context
= FFEEXPR_contextFILENUM
;
10514 case FFESTR_openIOSTAT
:
10515 ffestb_local_
.open
.ix
= FFESTP_openixIOSTAT
;
10516 ffestb_local_
.open
.left
= TRUE
;
10517 ffestb_local_
.open
.context
= FFEEXPR_contextFILEINT
;
10520 #if 0 /* Haven't added support for expression
10521 context yet (though easy). */
10522 case FFESTR_openKEY
:
10523 ffestb_local_
.open
.ix
= FFESTP_openixKEY
;
10524 ffestb_local_
.open
.left
= FALSE
;
10525 ffestb_local_
.open
.context
= FFEEXPR_contextFILEKEY
;
10529 case FFESTR_openMAXREC
:
10530 ffestb_local_
.open
.ix
= FFESTP_openixMAXREC
;
10531 ffestb_local_
.open
.left
= FALSE
;
10532 ffestb_local_
.open
.context
= FFEEXPR_contextFILENUM
;
10535 case FFESTR_openNOSPANBLOCKS
:
10536 if (ffestp_file
.open
.open_spec
[FFESTP_openixNOSPANBLOCKS
]
10537 .kw_or_val_present
)
10538 goto bad
; /* :::::::::::::::::::: */
10539 ffestp_file
.open
.open_spec
[FFESTP_openixNOSPANBLOCKS
]
10540 .kw_or_val_present
= TRUE
;
10541 ffestp_file
.open
.open_spec
[FFESTP_openixNOSPANBLOCKS
]
10542 .kw_present
= TRUE
;
10543 ffestp_file
.open
.open_spec
[FFESTP_openixNOSPANBLOCKS
]
10544 .value_present
= FALSE
;
10545 ffestp_file
.open
.open_spec
[FFESTP_openixNOSPANBLOCKS
].kw
10546 = ffelex_token_use (t
);
10547 return (ffelexHandler
) ffestb_R9048_
;
10549 case FFESTR_openORGANIZATION
:
10550 ffestb_local_
.open
.ix
= FFESTP_openixORGANIZATION
;
10551 ffestb_local_
.open
.left
= FALSE
;
10552 ffestb_local_
.open
.context
= FFEEXPR_contextFILECHAR
;
10555 case FFESTR_openPAD
:
10556 ffestb_local_
.open
.ix
= FFESTP_openixPAD
;
10557 ffestb_local_
.open
.left
= FALSE
;
10558 ffestb_local_
.open
.context
= FFEEXPR_contextFILEDFCHAR
;
10561 case FFESTR_openPOSITION
:
10562 ffestb_local_
.open
.ix
= FFESTP_openixPOSITION
;
10563 ffestb_local_
.open
.left
= FALSE
;
10564 ffestb_local_
.open
.context
= FFEEXPR_contextFILEDFCHAR
;
10567 case FFESTR_openREADONLY
:
10568 if (ffestp_file
.open
.open_spec
[FFESTP_openixREADONLY
]
10569 .kw_or_val_present
)
10570 goto bad
; /* :::::::::::::::::::: */
10571 ffestp_file
.open
.open_spec
[FFESTP_openixREADONLY
]
10572 .kw_or_val_present
= TRUE
;
10573 ffestp_file
.open
.open_spec
[FFESTP_openixREADONLY
]
10574 .kw_present
= TRUE
;
10575 ffestp_file
.open
.open_spec
[FFESTP_openixREADONLY
]
10576 .value_present
= FALSE
;
10577 ffestp_file
.open
.open_spec
[FFESTP_openixREADONLY
].kw
10578 = ffelex_token_use (t
);
10579 return (ffelexHandler
) ffestb_R9048_
;
10581 case FFESTR_openRECL
:
10582 case FFESTR_openRECORDSIZE
:
10583 ffestb_local_
.open
.ix
= FFESTP_openixRECL
;
10584 ffestb_local_
.open
.left
= FALSE
;
10585 ffestb_local_
.open
.context
= FFEEXPR_contextFILENUM
;
10588 case FFESTR_openRECORDTYPE
:
10589 ffestb_local_
.open
.ix
= FFESTP_openixRECORDTYPE
;
10590 ffestb_local_
.open
.left
= FALSE
;
10591 ffestb_local_
.open
.context
= FFEEXPR_contextFILECHAR
;
10594 case FFESTR_openSHARED
:
10595 if (ffestp_file
.open
.open_spec
[FFESTP_openixSHARED
]
10596 .kw_or_val_present
)
10597 goto bad
; /* :::::::::::::::::::: */
10598 ffestp_file
.open
.open_spec
[FFESTP_openixSHARED
]
10599 .kw_or_val_present
= TRUE
;
10600 ffestp_file
.open
.open_spec
[FFESTP_openixSHARED
]
10601 .kw_present
= TRUE
;
10602 ffestp_file
.open
.open_spec
[FFESTP_openixSHARED
]
10603 .value_present
= FALSE
;
10604 ffestp_file
.open
.open_spec
[FFESTP_openixSHARED
].kw
10605 = ffelex_token_use (t
);
10606 return (ffelexHandler
) ffestb_R9048_
;
10608 case FFESTR_openSTATUS
:
10609 case FFESTR_openTYPE
:
10610 ffestb_local_
.open
.ix
= FFESTP_openixSTATUS
;
10611 ffestb_local_
.open
.left
= FALSE
;
10612 ffestb_local_
.open
.context
= FFEEXPR_contextFILEDFCHAR
;
10615 case FFESTR_openUNIT
:
10616 ffestb_local_
.open
.ix
= FFESTP_openixUNIT
;
10617 ffestb_local_
.open
.left
= FALSE
;
10618 ffestb_local_
.open
.context
= FFEEXPR_contextFILENUM
;
10621 case FFESTR_openUSEROPEN
:
10622 ffestb_local_
.open
.ix
= FFESTP_openixUSEROPEN
;
10623 ffestb_local_
.open
.left
= TRUE
;
10624 ffestb_local_
.open
.context
= FFEEXPR_contextFILEEXTFUNC
;
10628 goto bad
; /* :::::::::::::::::::: */
10630 if (ffestp_file
.open
.open_spec
[ffestb_local_
.open
.ix
]
10631 .kw_or_val_present
)
10632 break; /* Can't specify a keyword twice! */
10633 ffestp_file
.open
.open_spec
[ffestb_local_
.open
.ix
]
10634 .kw_or_val_present
= TRUE
;
10635 ffestp_file
.open
.open_spec
[ffestb_local_
.open
.ix
]
10636 .kw_present
= TRUE
;
10637 ffestp_file
.open
.open_spec
[ffestb_local_
.open
.ix
]
10638 .value_present
= FALSE
;
10639 ffestp_file
.open
.open_spec
[ffestb_local_
.open
.ix
].value_is_label
10640 = ffestb_local_
.open
.label
;
10641 ffestp_file
.open
.open_spec
[ffestb_local_
.open
.ix
].kw
10642 = ffelex_token_use (t
);
10643 return (ffelexHandler
) ffestb_R9045_
;
10649 bad
: /* :::::::::::::::::::: */
10650 ffestb_subr_kill_open_ ();
10651 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "OPEN", t
);
10652 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
10655 /* ffestb_R9045_ -- "OPEN" OPEN_PAREN [external-file-unit COMMA] NAME
10657 return ffestb_R9045_; // to lexer
10659 Make sure EQUALS here, send next token to expression handler. */
10661 static ffelexHandler
10662 ffestb_R9045_ (ffelexToken t
)
10664 switch (ffelex_token_type (t
))
10666 case FFELEX_typeEQUALS
:
10667 ffesta_confirmed ();
10668 if (ffestb_local_
.open
.label
)
10669 return (ffelexHandler
) ffestb_R9047_
;
10670 if (ffestb_local_
.open
.left
)
10671 return (ffelexHandler
) ffeexpr_lhs (ffesta_output_pool
,
10672 ffestb_local_
.open
.context
,
10673 (ffeexprCallback
) ffestb_R9046_
);
10674 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
10675 ffestb_local_
.open
.context
,
10676 (ffeexprCallback
) ffestb_R9046_
);
10682 ffestb_subr_kill_open_ ();
10683 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "OPEN", t
);
10684 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
10687 /* ffestb_R9046_ -- "OPEN" OPEN_PAREN ... NAME EQUALS expr
10689 (ffestb_R9046_) // to expression handler
10691 Handle COMMA or CLOSE_PAREN here. */
10693 static ffelexHandler
10694 ffestb_R9046_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
10696 switch (ffelex_token_type (t
))
10698 case FFELEX_typeCOMMA
:
10699 case FFELEX_typeCLOSE_PAREN
:
10702 ffestp_file
.open
.open_spec
[ffestb_local_
.open
.ix
].value_present
10704 ffestp_file
.open
.open_spec
[ffestb_local_
.open
.ix
].value
10705 = ffelex_token_use (ft
);
10706 ffestp_file
.open
.open_spec
[ffestb_local_
.open
.ix
].u
.expr
= expr
;
10707 if (ffelex_token_type (t
) == FFELEX_typeCOMMA
)
10708 return (ffelexHandler
) ffestb_R9044_
;
10709 return (ffelexHandler
) ffestb_R9049_
;
10715 ffestb_subr_kill_open_ ();
10716 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "OPEN", t
);
10717 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
10720 /* ffestb_R9047_ -- "OPEN" OPEN_PAREN ... NAME EQUALS
10722 return ffestb_R9047_; // to lexer
10724 Handle NUMBER for label here. */
10726 static ffelexHandler
10727 ffestb_R9047_ (ffelexToken t
)
10729 switch (ffelex_token_type (t
))
10731 case FFELEX_typeNUMBER
:
10732 ffestp_file
.open
.open_spec
[ffestb_local_
.open
.ix
].value_present
10734 ffestp_file
.open
.open_spec
[ffestb_local_
.open
.ix
].value
10735 = ffelex_token_use (t
);
10736 return (ffelexHandler
) ffestb_R9048_
;
10742 ffestb_subr_kill_open_ ();
10743 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "OPEN", t
);
10744 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
10747 /* ffestb_R9048_ -- "OPEN" OPEN_PAREN ... NAME EQUALS NUMBER
10749 return ffestb_R9048_; // to lexer
10751 Handle COMMA or CLOSE_PAREN here. */
10753 static ffelexHandler
10754 ffestb_R9048_ (ffelexToken t
)
10756 switch (ffelex_token_type (t
))
10758 case FFELEX_typeCOMMA
:
10759 return (ffelexHandler
) ffestb_R9044_
;
10761 case FFELEX_typeCLOSE_PAREN
:
10762 return (ffelexHandler
) ffestb_R9049_
;
10768 ffestb_subr_kill_open_ ();
10769 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "OPEN", t
);
10770 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
10773 /* ffestb_R9049_ -- "OPEN" OPEN_PAREN ... CLOSE_PAREN
10775 return ffestb_R9049_; // to lexer
10777 Handle EOS or SEMICOLON here. */
10779 static ffelexHandler
10780 ffestb_R9049_ (ffelexToken t
)
10782 switch (ffelex_token_type (t
))
10784 case FFELEX_typeEOS
:
10785 case FFELEX_typeSEMICOLON
:
10786 ffesta_confirmed ();
10787 if (!ffesta_is_inhibited ())
10789 ffestb_subr_kill_open_ ();
10790 return (ffelexHandler
) ffesta_zero (t
);
10796 ffestb_subr_kill_open_ ();
10797 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "OPEN", t
);
10798 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
10801 /* ffestb_R907 -- Parse a CLOSE statement
10803 return ffestb_R907; // to lexer
10805 Make sure the statement has a valid form for a CLOSE statement.
10806 If it does, implement the statement. */
10809 ffestb_R907 (ffelexToken t
)
10813 switch (ffelex_token_type (ffesta_tokens
[0]))
10815 case FFELEX_typeNAME
:
10816 if (ffesta_first_kw
!= FFESTR_firstCLOSE
)
10817 goto bad_0
; /* :::::::::::::::::::: */
10820 case FFELEX_typeNAMES
:
10821 if (ffesta_first_kw
!= FFESTR_firstCLOSE
)
10822 goto bad_0
; /* :::::::::::::::::::: */
10823 if (ffelex_token_length (ffesta_tokens
[0]) != FFESTR_firstlCLOSE
)
10824 goto bad_0
; /* :::::::::::::::::::: */
10828 goto bad_0
; /* :::::::::::::::::::: */
10831 switch (ffelex_token_type (t
))
10833 case FFELEX_typeOPEN_PAREN
:
10836 case FFELEX_typeEOS
:
10837 case FFELEX_typeSEMICOLON
:
10838 case FFELEX_typeCOMMA
:
10839 case FFELEX_typeCOLONCOLON
:
10840 ffesta_confirmed (); /* Error, but clearly intended. */
10841 goto bad_1
; /* :::::::::::::::::::: */
10844 goto bad_1
; /* :::::::::::::::::::: */
10847 for (ix
= 0; ix
< FFESTP_closeix
; ++ix
)
10848 ffestp_file
.close
.close_spec
[ix
].kw_or_val_present
= FALSE
;
10850 return (ffelexHandler
) ffestb_R9071_
;
10852 bad_0
: /* :::::::::::::::::::: */
10853 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "CLOSE", ffesta_tokens
[0]);
10854 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
10856 bad_1
: /* :::::::::::::::::::: */
10857 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "CLOSE", t
);
10858 return (ffelexHandler
) ffelex_swallow_tokens (t
,
10859 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
10862 /* ffestb_R9071_ -- "CLOSE" OPEN_PAREN
10864 return ffestb_R9071_; // to lexer
10866 Handle expr construct (not NAME=expr construct) here. */
10868 static ffelexHandler
10869 ffestb_R9071_ (ffelexToken t
)
10871 switch (ffelex_token_type (t
))
10873 case FFELEX_typeNAME
:
10874 ffesta_tokens
[1] = ffelex_token_use (t
);
10875 return (ffelexHandler
) ffestb_R9072_
;
10878 return (ffelexHandler
) (*((ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
10879 FFEEXPR_contextFILENUM
, (ffeexprCallback
) ffestb_R9073_
)))
10884 /* ffestb_R9072_ -- "CLOSE" OPEN_PAREN NAME
10886 return ffestb_R9072_; // to lexer
10888 If EQUALS here, go to states that handle it. Else, send NAME and this
10889 token thru expression handler. */
10891 static ffelexHandler
10892 ffestb_R9072_ (ffelexToken t
)
10894 ffelexHandler next
;
10897 switch (ffelex_token_type (t
))
10899 case FFELEX_typeEQUALS
:
10900 nt
= ffesta_tokens
[1];
10901 next
= (ffelexHandler
) ffestb_R9074_ (nt
);
10902 ffelex_token_kill (nt
);
10903 return (ffelexHandler
) (*next
) (t
);
10906 next
= (ffelexHandler
) (*((ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
10907 FFEEXPR_contextFILENUM
, (ffeexprCallback
) ffestb_R9073_
)))
10908 (ffesta_tokens
[1]);
10909 ffelex_token_kill (ffesta_tokens
[1]);
10910 return (ffelexHandler
) (*next
) (t
);
10914 /* ffestb_R9073_ -- "CLOSE" OPEN_PAREN expr
10916 (ffestb_R9073_) // to expression handler
10918 Handle COMMA or CLOSE_PAREN here. */
10920 static ffelexHandler
10921 ffestb_R9073_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
10923 switch (ffelex_token_type (t
))
10925 case FFELEX_typeCOMMA
:
10926 case FFELEX_typeCLOSE_PAREN
:
10929 ffestp_file
.close
.close_spec
[FFESTP_closeixUNIT
].kw_or_val_present
10931 ffestp_file
.close
.close_spec
[FFESTP_closeixUNIT
].kw_present
= FALSE
;
10932 ffestp_file
.close
.close_spec
[FFESTP_closeixUNIT
].value_present
= TRUE
;
10933 ffestp_file
.close
.close_spec
[FFESTP_closeixUNIT
].value_is_label
10935 ffestp_file
.close
.close_spec
[FFESTP_closeixUNIT
].value
10936 = ffelex_token_use (ft
);
10937 ffestp_file
.close
.close_spec
[FFESTP_closeixUNIT
].u
.expr
= expr
;
10938 if (ffelex_token_type (t
) == FFELEX_typeCOMMA
)
10939 return (ffelexHandler
) ffestb_R9074_
;
10940 return (ffelexHandler
) ffestb_R9079_
;
10946 ffestb_subr_kill_close_ ();
10947 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "CLOSE", t
);
10948 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
10951 /* ffestb_R9074_ -- "CLOSE" OPEN_PAREN [external-file-unit COMMA]
10953 return ffestb_R9074_; // to lexer
10955 Handle expr construct (not NAME=expr construct) here. */
10957 static ffelexHandler
10958 ffestb_R9074_ (ffelexToken t
)
10962 ffestb_local_
.close
.label
= FALSE
;
10964 switch (ffelex_token_type (t
))
10966 case FFELEX_typeNAME
:
10967 kw
= ffestr_genio (t
);
10970 case FFESTR_genioERR
:
10971 ffestb_local_
.close
.ix
= FFESTP_closeixERR
;
10972 ffestb_local_
.close
.label
= TRUE
;
10975 case FFESTR_genioIOSTAT
:
10976 ffestb_local_
.close
.ix
= FFESTP_closeixIOSTAT
;
10977 ffestb_local_
.close
.left
= TRUE
;
10978 ffestb_local_
.close
.context
= FFEEXPR_contextFILEINT
;
10981 case FFESTR_genioSTATUS
:
10982 case FFESTR_genioDISP
:
10983 case FFESTR_genioDISPOSE
:
10984 ffestb_local_
.close
.ix
= FFESTP_closeixSTATUS
;
10985 ffestb_local_
.close
.left
= FALSE
;
10986 ffestb_local_
.close
.context
= FFEEXPR_contextFILEDFCHAR
;
10989 case FFESTR_genioUNIT
:
10990 ffestb_local_
.close
.ix
= FFESTP_closeixUNIT
;
10991 ffestb_local_
.close
.left
= FALSE
;
10992 ffestb_local_
.close
.context
= FFEEXPR_contextFILENUM
;
10996 goto bad
; /* :::::::::::::::::::: */
10998 if (ffestp_file
.close
.close_spec
[ffestb_local_
.close
.ix
]
10999 .kw_or_val_present
)
11000 break; /* Can't specify a keyword twice! */
11001 ffestp_file
.close
.close_spec
[ffestb_local_
.close
.ix
]
11002 .kw_or_val_present
= TRUE
;
11003 ffestp_file
.close
.close_spec
[ffestb_local_
.close
.ix
]
11004 .kw_present
= TRUE
;
11005 ffestp_file
.close
.close_spec
[ffestb_local_
.close
.ix
]
11006 .value_present
= FALSE
;
11007 ffestp_file
.close
.close_spec
[ffestb_local_
.close
.ix
].value_is_label
11008 = ffestb_local_
.close
.label
;
11009 ffestp_file
.close
.close_spec
[ffestb_local_
.close
.ix
].kw
11010 = ffelex_token_use (t
);
11011 return (ffelexHandler
) ffestb_R9075_
;
11017 bad
: /* :::::::::::::::::::: */
11018 ffestb_subr_kill_close_ ();
11019 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "CLOSE", t
);
11020 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
11023 /* ffestb_R9075_ -- "CLOSE" OPEN_PAREN [external-file-unit COMMA] NAME
11025 return ffestb_R9075_; // to lexer
11027 Make sure EQUALS here, send next token to expression handler. */
11029 static ffelexHandler
11030 ffestb_R9075_ (ffelexToken t
)
11032 switch (ffelex_token_type (t
))
11034 case FFELEX_typeEQUALS
:
11035 ffesta_confirmed ();
11036 if (ffestb_local_
.close
.label
)
11037 return (ffelexHandler
) ffestb_R9077_
;
11038 if (ffestb_local_
.close
.left
)
11039 return (ffelexHandler
) ffeexpr_lhs (ffesta_output_pool
,
11040 ffestb_local_
.close
.context
,
11041 (ffeexprCallback
) ffestb_R9076_
);
11042 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
11043 ffestb_local_
.close
.context
,
11044 (ffeexprCallback
) ffestb_R9076_
);
11050 ffestb_subr_kill_close_ ();
11051 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "CLOSE", t
);
11052 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
11055 /* ffestb_R9076_ -- "CLOSE" OPEN_PAREN ... NAME EQUALS expr
11057 (ffestb_R9076_) // to expression handler
11059 Handle COMMA or CLOSE_PAREN here. */
11061 static ffelexHandler
11062 ffestb_R9076_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
11064 switch (ffelex_token_type (t
))
11066 case FFELEX_typeCOMMA
:
11067 case FFELEX_typeCLOSE_PAREN
:
11070 ffestp_file
.close
.close_spec
[ffestb_local_
.close
.ix
].value_present
11072 ffestp_file
.close
.close_spec
[ffestb_local_
.close
.ix
].value
11073 = ffelex_token_use (ft
);
11074 ffestp_file
.close
.close_spec
[ffestb_local_
.close
.ix
].u
.expr
= expr
;
11075 if (ffelex_token_type (t
) == FFELEX_typeCOMMA
)
11076 return (ffelexHandler
) ffestb_R9074_
;
11077 return (ffelexHandler
) ffestb_R9079_
;
11083 ffestb_subr_kill_close_ ();
11084 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "CLOSE", t
);
11085 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
11088 /* ffestb_R9077_ -- "CLOSE" OPEN_PAREN ... NAME EQUALS
11090 return ffestb_R9077_; // to lexer
11092 Handle NUMBER for label here. */
11094 static ffelexHandler
11095 ffestb_R9077_ (ffelexToken t
)
11097 switch (ffelex_token_type (t
))
11099 case FFELEX_typeNUMBER
:
11100 ffestp_file
.close
.close_spec
[ffestb_local_
.close
.ix
].value_present
11102 ffestp_file
.close
.close_spec
[ffestb_local_
.close
.ix
].value
11103 = ffelex_token_use (t
);
11104 return (ffelexHandler
) ffestb_R9078_
;
11110 ffestb_subr_kill_close_ ();
11111 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "CLOSE", t
);
11112 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
11115 /* ffestb_R9078_ -- "CLOSE" OPEN_PAREN ... NAME EQUALS NUMBER
11117 return ffestb_R9078_; // to lexer
11119 Handle COMMA or CLOSE_PAREN here. */
11121 static ffelexHandler
11122 ffestb_R9078_ (ffelexToken t
)
11124 switch (ffelex_token_type (t
))
11126 case FFELEX_typeCOMMA
:
11127 return (ffelexHandler
) ffestb_R9074_
;
11129 case FFELEX_typeCLOSE_PAREN
:
11130 return (ffelexHandler
) ffestb_R9079_
;
11136 ffestb_subr_kill_close_ ();
11137 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "CLOSE", t
);
11138 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
11141 /* ffestb_R9079_ -- "CLOSE" OPEN_PAREN ... CLOSE_PAREN
11143 return ffestb_R9079_; // to lexer
11145 Handle EOS or SEMICOLON here. */
11147 static ffelexHandler
11148 ffestb_R9079_ (ffelexToken t
)
11150 switch (ffelex_token_type (t
))
11152 case FFELEX_typeEOS
:
11153 case FFELEX_typeSEMICOLON
:
11154 ffesta_confirmed ();
11155 if (!ffesta_is_inhibited ())
11157 ffestb_subr_kill_close_ ();
11158 return (ffelexHandler
) ffesta_zero (t
);
11164 ffestb_subr_kill_close_ ();
11165 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "CLOSE", t
);
11166 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
11169 /* ffestb_R909 -- Parse the READ statement
11171 return ffestb_R909; // to lexer
11173 Make sure the statement has a valid form for the READ
11174 statement. If it does, implement the statement. */
11177 ffestb_R909 (ffelexToken t
)
11179 ffelexHandler next
;
11182 switch (ffelex_token_type (ffesta_tokens
[0]))
11184 case FFELEX_typeNAME
:
11185 if (ffesta_first_kw
!= FFESTR_firstREAD
)
11186 goto bad_0
; /* :::::::::::::::::::: */
11187 switch (ffelex_token_type (t
))
11189 case FFELEX_typeCOMMA
:
11190 case FFELEX_typeCOLONCOLON
:
11191 case FFELEX_typeEOS
:
11192 case FFELEX_typeSEMICOLON
:
11193 ffesta_confirmed (); /* Error, but clearly intended. */
11194 goto bad_1
; /* :::::::::::::::::::: */
11196 case FFELEX_typeEQUALS
:
11197 case FFELEX_typePOINTS
:
11198 case FFELEX_typeCOLON
:
11199 goto bad_1
; /* :::::::::::::::::::: */
11201 case FFELEX_typeNAME
:
11202 case FFELEX_typeNUMBER
:
11203 ffesta_confirmed ();
11206 case FFELEX_typeOPEN_PAREN
:
11207 for (ix
= 0; ix
< FFESTP_readix
; ++ix
)
11208 ffestp_file
.read
.read_spec
[ix
].kw_or_val_present
= FALSE
;
11209 ffesta_tokens
[1] = ffelex_token_use (t
);
11210 return (ffelexHandler
) ffestb_R9092_
;
11216 for (ix
= 0; ix
< FFESTP_readix
; ++ix
)
11217 ffestp_file
.read
.read_spec
[ix
].kw_or_val_present
= FALSE
;
11218 return (ffelexHandler
) (*((ffelexHandler
)
11219 ffeexpr_rhs (ffesta_output_pool
,
11220 FFEEXPR_contextFILEFORMATNML
, (ffeexprCallback
) ffestb_R9091_
)))
11223 case FFELEX_typeNAMES
:
11224 if (ffesta_first_kw
!= FFESTR_firstREAD
)
11225 goto bad_0
; /* :::::::::::::::::::: */
11226 switch (ffelex_token_type (t
))
11228 case FFELEX_typeEOS
:
11229 case FFELEX_typeSEMICOLON
:
11230 case FFELEX_typeCOMMA
:
11231 ffesta_confirmed ();
11232 if (ffelex_token_length (ffesta_tokens
[0]) != FFESTR_firstlREAD
)
11234 goto bad_1
; /* :::::::::::::::::::: */
11236 case FFELEX_typeCOLONCOLON
:
11237 ffesta_confirmed (); /* Error, but clearly intended. */
11238 goto bad_1
; /* :::::::::::::::::::: */
11240 case FFELEX_typeEQUALS
:
11241 case FFELEX_typePOINTS
:
11242 case FFELEX_typeCOLON
:
11243 goto bad_1
; /* :::::::::::::::::::: */
11245 case FFELEX_typeOPEN_PAREN
:
11246 if (ffelex_token_length (ffesta_tokens
[0]) != FFESTR_firstlREAD
)
11249 for (ix
= 0; ix
< FFESTP_readix
; ++ix
)
11250 ffestp_file
.read
.read_spec
[ix
].kw_or_val_present
= FALSE
;
11251 ffesta_tokens
[1] = ffelex_token_use (t
);
11252 return (ffelexHandler
) ffestb_R9092_
;
11257 for (ix
= 0; ix
< FFESTP_readix
; ++ix
)
11258 ffestp_file
.read
.read_spec
[ix
].kw_or_val_present
= FALSE
;
11259 next
= (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
11260 FFEEXPR_contextFILEFORMATNML
, (ffeexprCallback
) ffestb_R9091_
);
11261 next
= (ffelexHandler
) ffelex_splice_tokens (next
, ffesta_tokens
[0],
11262 FFESTR_firstlREAD
);
11264 return (ffelexHandler
) ffelex_swallow_tokens (t
,
11265 (ffelexHandler
) ffesta_zero
);
11266 return (ffelexHandler
) (*next
) (t
);
11269 goto bad_0
; /* :::::::::::::::::::: */
11272 bad_0
: /* :::::::::::::::::::: */
11273 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "READ", ffesta_tokens
[0]);
11274 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
11276 bad_1
: /* :::::::::::::::::::: */
11277 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "READ", t
);
11278 return (ffelexHandler
) ffelex_swallow_tokens (t
,
11279 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
11282 /* ffestb_R9091_ -- "READ" expr
11284 (ffestb_R9091_) // to expression handler
11286 Make sure the next token is a COMMA or EOS/SEMICOLON. */
11288 static ffelexHandler
11289 ffestb_R9091_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
11291 switch (ffelex_token_type (t
))
11293 case FFELEX_typeEOS
:
11294 case FFELEX_typeSEMICOLON
:
11295 case FFELEX_typeCOMMA
:
11296 ffesta_confirmed ();
11297 ffestp_file
.read
.read_spec
[FFESTP_readixFORMAT
].kw_or_val_present
11299 ffestp_file
.read
.read_spec
[FFESTP_readixFORMAT
].kw_present
= FALSE
;
11300 ffestp_file
.read
.read_spec
[FFESTP_readixFORMAT
].value_present
= TRUE
;
11301 ffestp_file
.read
.read_spec
[FFESTP_readixFORMAT
].value_is_label
11303 ffestp_file
.read
.read_spec
[FFESTP_readixFORMAT
].value
11304 = ffelex_token_use (ft
);
11305 ffestp_file
.read
.read_spec
[FFESTP_readixFORMAT
].u
.expr
= expr
;
11306 if (!ffesta_is_inhibited ())
11307 ffestc_R909_start (TRUE
);
11308 ffestb_subr_kill_read_ ();
11309 if (ffelex_token_type (t
) == FFELEX_typeCOMMA
)
11310 return (ffelexHandler
) ffeexpr_lhs (ffesta_output_pool
,
11311 ffestc_context_iolist (),
11312 (ffeexprCallback
) ffestb_R90915_
);
11313 if (!ffesta_is_inhibited ())
11314 ffestc_R909_finish ();
11315 return (ffelexHandler
) ffesta_zero (t
);
11321 ffestb_subr_kill_read_ ();
11322 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "READ", t
);
11323 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
11326 /* ffestb_R9092_ -- "READ" OPEN_PAREN
11328 return ffestb_R9092_; // to lexer
11330 Handle expr construct (not NAME=expr construct) here. */
11332 static ffelexHandler
11333 ffestb_R9092_ (ffelexToken t
)
11336 ffelexHandler next
;
11338 switch (ffelex_token_type (t
))
11340 case FFELEX_typeNAME
:
11341 ffesta_tokens
[2] = ffelex_token_use (t
);
11342 return (ffelexHandler
) ffestb_R9093_
;
11345 nt
= ffesta_tokens
[1];
11346 next
= (ffelexHandler
) (*((ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
11347 FFEEXPR_contextFILEUNITAMBIG
, (ffeexprCallback
) ffestb_R9094_
)))
11349 ffelex_token_kill (nt
);
11350 return (ffelexHandler
) (*next
) (t
);
11354 /* ffestb_R9093_ -- "READ" OPEN_PAREN NAME
11356 return ffestb_R9093_; // to lexer
11358 If EQUALS here, go to states that handle it. Else, send NAME and this
11359 token thru expression handler. */
11361 static ffelexHandler
11362 ffestb_R9093_ (ffelexToken t
)
11364 ffelexHandler next
;
11368 switch (ffelex_token_type (t
))
11370 case FFELEX_typeEQUALS
:
11371 ffelex_token_kill (ffesta_tokens
[1]);
11372 nt
= ffesta_tokens
[2];
11373 next
= (ffelexHandler
) ffestb_R9098_ (nt
);
11374 ffelex_token_kill (nt
);
11375 return (ffelexHandler
) (*next
) (t
);
11378 nt
= ffesta_tokens
[1];
11379 ot
= ffesta_tokens
[2];
11380 next
= (ffelexHandler
) (*((ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
11381 FFEEXPR_contextFILEUNITAMBIG
, (ffeexprCallback
) ffestb_R9094_
)))
11383 ffelex_token_kill (nt
);
11384 next
= (ffelexHandler
) (*next
) (ot
);
11385 ffelex_token_kill (ot
);
11386 return (ffelexHandler
) (*next
) (t
);
11390 /* ffestb_R9094_ -- "READ" OPEN_PAREN expr [CLOSE_PAREN]
11392 (ffestb_R9094_) // to expression handler
11394 Handle COMMA or EOS/SEMICOLON here.
11397 Use new ffeexpr mechanism whereby the expr is encased in an opITEM if
11398 ffeexpr decided it was an item in a control list (hence a unit
11399 specifier), or a format specifier otherwise. */
11401 static ffelexHandler
11402 ffestb_R9094_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
11405 goto bad
; /* :::::::::::::::::::: */
11407 if (ffebld_op (expr
) != FFEBLD_opITEM
)
11409 switch (ffelex_token_type (t
))
11411 case FFELEX_typeCOMMA
:
11412 case FFELEX_typeEOS
:
11413 case FFELEX_typeSEMICOLON
:
11414 ffesta_confirmed ();
11415 ffestp_file
.read
.read_spec
[FFESTP_readixFORMAT
].kw_or_val_present
11417 ffestp_file
.read
.read_spec
[FFESTP_readixFORMAT
].kw_present
= FALSE
;
11418 ffestp_file
.read
.read_spec
[FFESTP_readixFORMAT
].value_present
= TRUE
;
11419 ffestp_file
.read
.read_spec
[FFESTP_readixFORMAT
].value_is_label
11421 ffestp_file
.read
.read_spec
[FFESTP_readixFORMAT
].value
11422 = ffelex_token_use (ft
);
11423 ffestp_file
.read
.read_spec
[FFESTP_readixFORMAT
].u
.expr
= expr
;
11424 if (!ffesta_is_inhibited ())
11425 ffestc_R909_start (TRUE
);
11426 ffestb_subr_kill_read_ ();
11427 if (ffelex_token_type (t
) == FFELEX_typeCOMMA
)
11428 return (ffelexHandler
)
11429 ffeexpr_lhs (ffesta_output_pool
,
11430 ffestc_context_iolist (),
11431 (ffeexprCallback
) ffestb_R90915_
);
11432 if (!ffesta_is_inhibited ())
11433 ffestc_R909_finish ();
11434 return (ffelexHandler
) ffesta_zero (t
);
11437 goto bad
; /* :::::::::::::::::::: */
11441 expr
= ffebld_head (expr
);
11444 goto bad
; /* :::::::::::::::::::: */
11446 switch (ffelex_token_type (t
))
11448 case FFELEX_typeCOMMA
:
11449 case FFELEX_typeCLOSE_PAREN
:
11450 ffestp_file
.read
.read_spec
[FFESTP_readixUNIT
].kw_or_val_present
11452 ffestp_file
.read
.read_spec
[FFESTP_readixUNIT
].kw_present
= FALSE
;
11453 ffestp_file
.read
.read_spec
[FFESTP_readixUNIT
].value_present
= TRUE
;
11454 ffestp_file
.read
.read_spec
[FFESTP_readixUNIT
].value_is_label
11456 ffestp_file
.read
.read_spec
[FFESTP_readixUNIT
].value
11457 = ffelex_token_use (ft
);
11458 ffestp_file
.read
.read_spec
[FFESTP_readixUNIT
].u
.expr
= expr
;
11459 if (ffelex_token_type (t
) == FFELEX_typeCOMMA
)
11460 return (ffelexHandler
) ffestb_R9095_
;
11461 return (ffelexHandler
) ffestb_R90913_
;
11467 bad
: /* :::::::::::::::::::: */
11468 ffestb_subr_kill_read_ ();
11469 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "READ", t
);
11470 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
11473 /* ffestb_R9095_ -- "READ" OPEN_PAREN expr COMMA
11475 return ffestb_R9095_; // to lexer
11477 Handle expr construct (not NAME=expr construct) here. */
11479 static ffelexHandler
11480 ffestb_R9095_ (ffelexToken t
)
11482 switch (ffelex_token_type (t
))
11484 case FFELEX_typeNAME
:
11485 ffesta_tokens
[1] = ffelex_token_use (t
);
11486 return (ffelexHandler
) ffestb_R9096_
;
11489 return (ffelexHandler
) (*((ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
11490 FFEEXPR_contextFILEFORMATNML
, (ffeexprCallback
) ffestb_R9097_
)))
11495 /* ffestb_R9096_ -- "READ" OPEN_PAREN expr COMMA NAME
11497 return ffestb_R9096_; // to lexer
11499 If EQUALS here, go to states that handle it. Else, send NAME and this
11500 token thru expression handler. */
11502 static ffelexHandler
11503 ffestb_R9096_ (ffelexToken t
)
11505 ffelexHandler next
;
11508 switch (ffelex_token_type (t
))
11510 case FFELEX_typeEQUALS
:
11511 nt
= ffesta_tokens
[1];
11512 next
= (ffelexHandler
) ffestb_R9098_ (nt
);
11513 ffelex_token_kill (nt
);
11514 return (ffelexHandler
) (*next
) (t
);
11517 nt
= ffesta_tokens
[1];
11518 next
= (ffelexHandler
) (*((ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
11519 FFEEXPR_contextFILEFORMATNML
, (ffeexprCallback
) ffestb_R9097_
)))
11521 ffelex_token_kill (nt
);
11522 return (ffelexHandler
) (*next
) (t
);
11526 /* ffestb_R9097_ -- "READ" OPEN_PAREN expr COMMA expr
11528 (ffestb_R9097_) // to expression handler
11530 Handle COMMA or CLOSE_PAREN here. */
11532 static ffelexHandler
11533 ffestb_R9097_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
11535 switch (ffelex_token_type (t
))
11537 case FFELEX_typeCOMMA
:
11538 case FFELEX_typeCLOSE_PAREN
:
11539 ffestp_file
.read
.read_spec
[FFESTP_readixFORMAT
].kw_or_val_present
11541 ffestp_file
.read
.read_spec
[FFESTP_readixFORMAT
].kw_present
= FALSE
;
11542 ffestp_file
.read
.read_spec
[FFESTP_readixFORMAT
].value_present
= TRUE
;
11543 ffestp_file
.read
.read_spec
[FFESTP_readixFORMAT
].value_is_label
11545 ffestp_file
.read
.read_spec
[FFESTP_readixFORMAT
].value
11546 = ffelex_token_use (ft
);
11547 ffestp_file
.read
.read_spec
[FFESTP_readixFORMAT
].u
.expr
= expr
;
11548 if (ffelex_token_type (t
) == FFELEX_typeCOMMA
)
11549 return (ffelexHandler
) ffestb_R9098_
;
11550 return (ffelexHandler
) ffestb_R90913_
;
11556 ffestb_subr_kill_read_ ();
11557 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "READ", t
);
11558 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
11561 /* ffestb_R9098_ -- "READ" OPEN_PAREN [external-file-unit COMMA [format
11564 return ffestb_R9098_; // to lexer
11566 Handle expr construct (not NAME=expr construct) here. */
11568 static ffelexHandler
11569 ffestb_R9098_ (ffelexToken t
)
11573 ffestb_local_
.read
.label
= FALSE
;
11575 switch (ffelex_token_type (t
))
11577 case FFELEX_typeNAME
:
11578 kw
= ffestr_genio (t
);
11581 case FFESTR_genioADVANCE
:
11582 ffestb_local_
.read
.ix
= FFESTP_readixADVANCE
;
11583 ffestb_local_
.read
.left
= FALSE
;
11584 ffestb_local_
.read
.context
= FFEEXPR_contextFILEDFCHAR
;
11587 case FFESTR_genioEOR
:
11588 ffestb_local_
.read
.ix
= FFESTP_readixEOR
;
11589 ffestb_local_
.read
.label
= TRUE
;
11592 case FFESTR_genioERR
:
11593 ffestb_local_
.read
.ix
= FFESTP_readixERR
;
11594 ffestb_local_
.read
.label
= TRUE
;
11597 case FFESTR_genioEND
:
11598 ffestb_local_
.read
.ix
= FFESTP_readixEND
;
11599 ffestb_local_
.read
.label
= TRUE
;
11602 case FFESTR_genioFMT
:
11603 ffestb_local_
.read
.ix
= FFESTP_readixFORMAT
;
11604 ffestb_local_
.read
.left
= FALSE
;
11605 ffestb_local_
.read
.context
= FFEEXPR_contextFILEFORMAT
;
11608 case FFESTR_genioIOSTAT
:
11609 ffestb_local_
.read
.ix
= FFESTP_readixIOSTAT
;
11610 ffestb_local_
.read
.left
= TRUE
;
11611 ffestb_local_
.read
.context
= FFEEXPR_contextFILEINT
;
11614 case FFESTR_genioKEY
:
11615 case FFESTR_genioKEYEQ
:
11616 ffestb_local_
.read
.ix
= FFESTP_readixKEYEQ
;
11617 ffestb_local_
.read
.left
= FALSE
;
11618 ffestb_local_
.read
.context
= FFEEXPR_contextFILENUMCHAR
;
11621 case FFESTR_genioKEYGE
:
11622 ffestb_local_
.read
.ix
= FFESTP_readixKEYGE
;
11623 ffestb_local_
.read
.left
= FALSE
;
11624 ffestb_local_
.read
.context
= FFEEXPR_contextFILENUMCHAR
;
11627 case FFESTR_genioKEYGT
:
11628 ffestb_local_
.read
.ix
= FFESTP_readixKEYGT
;
11629 ffestb_local_
.read
.left
= FALSE
;
11630 ffestb_local_
.read
.context
= FFEEXPR_contextFILENUMCHAR
;
11633 case FFESTR_genioKEYID
:
11634 ffestb_local_
.read
.ix
= FFESTP_readixKEYID
;
11635 ffestb_local_
.read
.left
= FALSE
;
11636 ffestb_local_
.read
.context
= FFEEXPR_contextFILENUM
;
11639 case FFESTR_genioNML
:
11640 ffestb_local_
.read
.ix
= FFESTP_readixFORMAT
;
11641 ffestb_local_
.read
.left
= TRUE
;
11642 ffestb_local_
.read
.context
= FFEEXPR_contextFILENAMELIST
;
11645 case FFESTR_genioNULLS
:
11646 ffestb_local_
.read
.ix
= FFESTP_readixNULLS
;
11647 ffestb_local_
.read
.left
= TRUE
;
11648 ffestb_local_
.read
.context
= FFEEXPR_contextFILEINT
;
11651 case FFESTR_genioREC
:
11652 ffestb_local_
.read
.ix
= FFESTP_readixREC
;
11653 ffestb_local_
.read
.left
= FALSE
;
11654 ffestb_local_
.read
.context
= FFEEXPR_contextFILENUM
;
11657 case FFESTR_genioSIZE
:
11658 ffestb_local_
.read
.ix
= FFESTP_readixSIZE
;
11659 ffestb_local_
.read
.left
= TRUE
;
11660 ffestb_local_
.read
.context
= FFEEXPR_contextFILEINT
;
11663 case FFESTR_genioUNIT
:
11664 ffestb_local_
.read
.ix
= FFESTP_readixUNIT
;
11665 ffestb_local_
.read
.left
= FALSE
;
11666 ffestb_local_
.read
.context
= FFEEXPR_contextFILEUNIT
;
11670 goto bad
; /* :::::::::::::::::::: */
11672 if (ffestp_file
.read
.read_spec
[ffestb_local_
.read
.ix
]
11673 .kw_or_val_present
)
11674 break; /* Can't specify a keyword twice! */
11675 ffestp_file
.read
.read_spec
[ffestb_local_
.read
.ix
]
11676 .kw_or_val_present
= TRUE
;
11677 ffestp_file
.read
.read_spec
[ffestb_local_
.read
.ix
]
11678 .kw_present
= TRUE
;
11679 ffestp_file
.read
.read_spec
[ffestb_local_
.read
.ix
]
11680 .value_present
= FALSE
;
11681 ffestp_file
.read
.read_spec
[ffestb_local_
.read
.ix
].value_is_label
11682 = ffestb_local_
.read
.label
;
11683 ffestp_file
.read
.read_spec
[ffestb_local_
.read
.ix
].kw
11684 = ffelex_token_use (t
);
11685 return (ffelexHandler
) ffestb_R9099_
;
11691 bad
: /* :::::::::::::::::::: */
11692 ffestb_subr_kill_read_ ();
11693 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "READ", t
);
11694 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
11697 /* ffestb_R9099_ -- "READ" OPEN_PAREN [external-file-unit COMMA [format
11700 return ffestb_R9099_; // to lexer
11702 Make sure EQUALS here, send next token to expression handler. */
11704 static ffelexHandler
11705 ffestb_R9099_ (ffelexToken t
)
11707 switch (ffelex_token_type (t
))
11709 case FFELEX_typeEQUALS
:
11710 ffesta_confirmed ();
11711 if (ffestb_local_
.read
.label
)
11712 return (ffelexHandler
) ffestb_R90911_
;
11713 if (ffestb_local_
.read
.left
)
11714 return (ffelexHandler
)
11715 ffeexpr_lhs (ffesta_output_pool
,
11716 ffestb_local_
.read
.context
,
11717 (ffeexprCallback
) ffestb_R90910_
);
11718 return (ffelexHandler
)
11719 ffeexpr_rhs (ffesta_output_pool
,
11720 ffestb_local_
.read
.context
,
11721 (ffeexprCallback
) ffestb_R90910_
);
11727 ffestb_subr_kill_read_ ();
11728 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "READ", t
);
11729 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
11732 /* ffestb_R90910_ -- "READ" OPEN_PAREN ... NAME EQUALS expr
11734 (ffestb_R90910_) // to expression handler
11736 Handle COMMA or CLOSE_PAREN here. */
11738 static ffelexHandler
11739 ffestb_R90910_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
11741 switch (ffelex_token_type (t
))
11743 case FFELEX_typeCOMMA
:
11744 case FFELEX_typeCLOSE_PAREN
:
11747 if (ffestb_local_
.read
.context
== FFEEXPR_contextFILEFORMAT
)
11748 ffestp_file
.read
.read_spec
[ffestb_local_
.read
.ix
]
11749 .value_is_label
= TRUE
;
11753 ffestp_file
.read
.read_spec
[ffestb_local_
.read
.ix
].value_present
11755 ffestp_file
.read
.read_spec
[ffestb_local_
.read
.ix
].value
11756 = ffelex_token_use (ft
);
11757 ffestp_file
.read
.read_spec
[ffestb_local_
.read
.ix
].u
.expr
= expr
;
11758 if (ffelex_token_type (t
) == FFELEX_typeCOMMA
)
11759 return (ffelexHandler
) ffestb_R9098_
;
11760 return (ffelexHandler
) ffestb_R90913_
;
11766 ffestb_subr_kill_read_ ();
11767 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "READ", t
);
11768 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
11771 /* ffestb_R90911_ -- "READ" OPEN_PAREN ... NAME EQUALS
11773 return ffestb_R90911_; // to lexer
11775 Handle NUMBER for label here. */
11777 static ffelexHandler
11778 ffestb_R90911_ (ffelexToken t
)
11780 switch (ffelex_token_type (t
))
11782 case FFELEX_typeNUMBER
:
11783 ffestp_file
.read
.read_spec
[ffestb_local_
.read
.ix
].value_present
11785 ffestp_file
.read
.read_spec
[ffestb_local_
.read
.ix
].value
11786 = ffelex_token_use (t
);
11787 return (ffelexHandler
) ffestb_R90912_
;
11793 ffestb_subr_kill_read_ ();
11794 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "READ", t
);
11795 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
11798 /* ffestb_R90912_ -- "READ" OPEN_PAREN ... NAME EQUALS NUMBER
11800 return ffestb_R90912_; // to lexer
11802 Handle COMMA or CLOSE_PAREN here. */
11804 static ffelexHandler
11805 ffestb_R90912_ (ffelexToken t
)
11807 switch (ffelex_token_type (t
))
11809 case FFELEX_typeCOMMA
:
11810 return (ffelexHandler
) ffestb_R9098_
;
11812 case FFELEX_typeCLOSE_PAREN
:
11813 return (ffelexHandler
) ffestb_R90913_
;
11819 ffestb_subr_kill_read_ ();
11820 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "READ", t
);
11821 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
11824 /* ffestb_R90913_ -- "READ" OPEN_PAREN ... CLOSE_PAREN
11826 return ffestb_R90913_; // to lexer
11828 Handle EOS or SEMICOLON here.
11831 Fix to allow implied-DO construct here (OPEN_PAREN) -- actually,
11832 don't presume knowledge of what an initial token in an lhs context
11833 is going to be, let ffeexpr_lhs handle that as much as possible. */
11835 static ffelexHandler
11836 ffestb_R90913_ (ffelexToken t
)
11838 switch (ffelex_token_type (t
))
11840 case FFELEX_typeEOS
:
11841 case FFELEX_typeSEMICOLON
:
11842 ffesta_confirmed ();
11843 if (!ffesta_is_inhibited ())
11845 ffestc_R909_start (FALSE
);
11846 ffestc_R909_finish ();
11848 ffestb_subr_kill_read_ ();
11849 return (ffelexHandler
) ffesta_zero (t
);
11852 ffesta_confirmed ();
11853 /* Fall through. */
11854 case FFELEX_typeOPEN_PAREN
: /* Could still be assignment!! */
11858 /* If token isn't NAME or OPEN_PAREN, ffeexpr_lhs will ultimately whine
11859 about it, so leave it up to that code. */
11861 /* EXTENSION: Allow an optional preceding COMMA here if not pedantic. (f2c
11862 provides this extension, as do other compilers, supposedly.) */
11864 if (!ffe_is_pedantic () && (ffelex_token_type (t
) == FFELEX_typeCOMMA
))
11865 return (ffelexHandler
)
11866 ffeexpr_lhs (ffesta_output_pool
,
11867 ffestc_context_iolist (),
11868 (ffeexprCallback
) ffestb_R90914_
);
11870 return (ffelexHandler
) (*((ffelexHandler
)
11871 ffeexpr_lhs (ffesta_output_pool
,
11872 ffestc_context_iolist (),
11873 (ffeexprCallback
) ffestb_R90914_
)))
11877 /* ffestb_R90914_ -- "READ(...)" expr
11879 (ffestb_R90914_) // to expression handler
11881 Handle COMMA or EOS/SEMICOLON here. */
11883 static ffelexHandler
11884 ffestb_R90914_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
11886 switch (ffelex_token_type (t
))
11888 case FFELEX_typeCOMMA
:
11892 ffesta_confirmed ();
11893 if (!ffesta_is_inhibited ())
11894 ffestc_R909_start (FALSE
);
11895 ffestb_subr_kill_read_ ();
11897 if (!ffesta_is_inhibited ())
11898 ffestc_R909_item (expr
, ft
);
11899 return (ffelexHandler
) ffeexpr_lhs (ffesta_output_pool
,
11900 ffestc_context_iolist (),
11901 (ffeexprCallback
) ffestb_R90915_
);
11903 case FFELEX_typeEOS
:
11904 case FFELEX_typeSEMICOLON
:
11908 ffesta_confirmed ();
11909 if (!ffesta_is_inhibited ())
11910 ffestc_R909_start (FALSE
);
11911 ffestb_subr_kill_read_ ();
11913 if (!ffesta_is_inhibited ())
11915 ffestc_R909_item (expr
, ft
);
11916 ffestc_R909_finish ();
11918 return (ffelexHandler
) ffesta_zero (t
);
11924 ffestb_subr_kill_read_ ();
11925 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "READ", t
);
11926 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
11929 /* ffestb_R90915_ -- "READ(...)" expr COMMA expr
11931 (ffestb_R90915_) // to expression handler
11933 Handle COMMA or EOS/SEMICOLON here. */
11935 static ffelexHandler
11936 ffestb_R90915_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
11938 switch (ffelex_token_type (t
))
11940 case FFELEX_typeCOMMA
:
11943 if (!ffesta_is_inhibited ())
11944 ffestc_R909_item (expr
, ft
);
11945 return (ffelexHandler
) ffeexpr_lhs (ffesta_output_pool
,
11946 ffestc_context_iolist (),
11947 (ffeexprCallback
) ffestb_R90915_
);
11949 case FFELEX_typeEOS
:
11950 case FFELEX_typeSEMICOLON
:
11953 if (!ffesta_is_inhibited ())
11955 ffestc_R909_item (expr
, ft
);
11956 ffestc_R909_finish ();
11958 return (ffelexHandler
) ffesta_zero (t
);
11964 if (!ffesta_is_inhibited ())
11965 ffestc_R909_finish ();
11966 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "READ", t
);
11967 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
11970 /* ffestb_R910 -- Parse the WRITE statement
11972 return ffestb_R910; // to lexer
11974 Make sure the statement has a valid form for the WRITE
11975 statement. If it does, implement the statement. */
11978 ffestb_R910 (ffelexToken t
)
11982 switch (ffelex_token_type (ffesta_tokens
[0]))
11984 case FFELEX_typeNAME
:
11985 if (ffesta_first_kw
!= FFESTR_firstWRITE
)
11986 goto bad_0
; /* :::::::::::::::::::: */
11987 switch (ffelex_token_type (t
))
11989 case FFELEX_typeCOMMA
:
11990 case FFELEX_typeCOLONCOLON
:
11991 case FFELEX_typeEOS
:
11992 case FFELEX_typeSEMICOLON
:
11993 case FFELEX_typeNAME
:
11994 case FFELEX_typeNUMBER
:
11995 ffesta_confirmed (); /* Error, but clearly intended. */
11996 goto bad_1
; /* :::::::::::::::::::: */
11999 goto bad_1
; /* :::::::::::::::::::: */
12001 case FFELEX_typeOPEN_PAREN
:
12002 for (ix
= 0; ix
< FFESTP_writeix
; ++ix
)
12003 ffestp_file
.write
.write_spec
[ix
].kw_or_val_present
= FALSE
;
12004 return (ffelexHandler
) ffestb_R9101_
;
12007 case FFELEX_typeNAMES
:
12008 if (ffesta_first_kw
!= FFESTR_firstWRITE
)
12009 goto bad_0
; /* :::::::::::::::::::: */
12010 switch (ffelex_token_type (t
))
12012 case FFELEX_typeEOS
:
12013 case FFELEX_typeSEMICOLON
:
12014 case FFELEX_typeCOMMA
:
12015 case FFELEX_typeCOLONCOLON
:
12016 ffesta_confirmed (); /* Error, but clearly intended. */
12017 goto bad_1
; /* :::::::::::::::::::: */
12020 goto bad_1
; /* :::::::::::::::::::: */
12022 case FFELEX_typeOPEN_PAREN
:
12023 if (ffelex_token_length (ffesta_tokens
[0]) != FFESTR_firstlWRITE
)
12024 goto bad_0
; /* :::::::::::::::::::: */
12026 for (ix
= 0; ix
< FFESTP_writeix
; ++ix
)
12027 ffestp_file
.write
.write_spec
[ix
].kw_or_val_present
= FALSE
;
12028 return (ffelexHandler
) ffestb_R9101_
;
12032 goto bad_0
; /* :::::::::::::::::::: */
12035 bad_0
: /* :::::::::::::::::::: */
12036 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "WRITE", ffesta_tokens
[0]);
12037 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
12039 bad_1
: /* :::::::::::::::::::: */
12040 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "WRITE", t
);
12041 return (ffelexHandler
) ffelex_swallow_tokens (t
,
12042 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
12045 /* ffestb_R9101_ -- "WRITE" OPEN_PAREN
12047 return ffestb_R9101_; // to lexer
12049 Handle expr construct (not NAME=expr construct) here. */
12051 static ffelexHandler
12052 ffestb_R9101_ (ffelexToken t
)
12054 switch (ffelex_token_type (t
))
12056 case FFELEX_typeNAME
:
12057 ffesta_tokens
[1] = ffelex_token_use (t
);
12058 return (ffelexHandler
) ffestb_R9102_
;
12061 return (ffelexHandler
) (*((ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
12062 FFEEXPR_contextFILEUNIT
, (ffeexprCallback
) ffestb_R9103_
)))
12067 /* ffestb_R9102_ -- "WRITE" OPEN_PAREN NAME
12069 return ffestb_R9102_; // to lexer
12071 If EQUALS here, go to states that handle it. Else, send NAME and this
12072 token thru expression handler. */
12074 static ffelexHandler
12075 ffestb_R9102_ (ffelexToken t
)
12077 ffelexHandler next
;
12080 switch (ffelex_token_type (t
))
12082 case FFELEX_typeEQUALS
:
12083 nt
= ffesta_tokens
[1];
12084 next
= (ffelexHandler
) ffestb_R9107_ (nt
);
12085 ffelex_token_kill (nt
);
12086 return (ffelexHandler
) (*next
) (t
);
12089 nt
= ffesta_tokens
[1];
12090 next
= (ffelexHandler
) (*((ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
12091 FFEEXPR_contextFILEUNIT
, (ffeexprCallback
) ffestb_R9103_
)))
12093 ffelex_token_kill (nt
);
12094 return (ffelexHandler
) (*next
) (t
);
12098 /* ffestb_R9103_ -- "WRITE" OPEN_PAREN expr [CLOSE_PAREN]
12100 (ffestb_R9103_) // to expression handler
12102 Handle COMMA or EOS/SEMICOLON here. */
12104 static ffelexHandler
12105 ffestb_R9103_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
12107 switch (ffelex_token_type (t
))
12109 case FFELEX_typeCOMMA
:
12110 case FFELEX_typeCLOSE_PAREN
:
12113 ffestp_file
.write
.write_spec
[FFESTP_writeixUNIT
].kw_or_val_present
12115 ffestp_file
.write
.write_spec
[FFESTP_writeixUNIT
].kw_present
= FALSE
;
12116 ffestp_file
.write
.write_spec
[FFESTP_writeixUNIT
].value_present
= TRUE
;
12117 ffestp_file
.write
.write_spec
[FFESTP_writeixUNIT
].value_is_label
12119 ffestp_file
.write
.write_spec
[FFESTP_writeixUNIT
].value
12120 = ffelex_token_use (ft
);
12121 ffestp_file
.write
.write_spec
[FFESTP_writeixUNIT
].u
.expr
= expr
;
12122 if (ffelex_token_type (t
) == FFELEX_typeCOMMA
)
12123 return (ffelexHandler
) ffestb_R9104_
;
12124 return (ffelexHandler
) ffestb_R91012_
;
12130 ffestb_subr_kill_write_ ();
12131 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "WRITE", t
);
12132 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
12135 /* ffestb_R9104_ -- "WRITE" OPEN_PAREN expr COMMA
12137 return ffestb_R9104_; // to lexer
12139 Handle expr construct (not NAME=expr construct) here. */
12141 static ffelexHandler
12142 ffestb_R9104_ (ffelexToken t
)
12144 switch (ffelex_token_type (t
))
12146 case FFELEX_typeNAME
:
12147 ffesta_tokens
[1] = ffelex_token_use (t
);
12148 return (ffelexHandler
) ffestb_R9105_
;
12151 return (ffelexHandler
) (*((ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
12152 FFEEXPR_contextFILEFORMATNML
, (ffeexprCallback
) ffestb_R9106_
)))
12157 /* ffestb_R9105_ -- "WRITE" OPEN_PAREN expr COMMA NAME
12159 return ffestb_R9105_; // to lexer
12161 If EQUALS here, go to states that handle it. Else, send NAME and this
12162 token thru expression handler. */
12164 static ffelexHandler
12165 ffestb_R9105_ (ffelexToken t
)
12167 ffelexHandler next
;
12170 switch (ffelex_token_type (t
))
12172 case FFELEX_typeEQUALS
:
12173 nt
= ffesta_tokens
[1];
12174 next
= (ffelexHandler
) ffestb_R9107_ (nt
);
12175 ffelex_token_kill (nt
);
12176 return (ffelexHandler
) (*next
) (t
);
12179 nt
= ffesta_tokens
[1];
12180 next
= (ffelexHandler
) (*((ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
12181 FFEEXPR_contextFILEFORMATNML
, (ffeexprCallback
) ffestb_R9106_
)))
12183 ffelex_token_kill (nt
);
12184 return (ffelexHandler
) (*next
) (t
);
12188 /* ffestb_R9106_ -- "WRITE" OPEN_PAREN expr COMMA expr
12190 (ffestb_R9106_) // to expression handler
12192 Handle COMMA or CLOSE_PAREN here. */
12194 static ffelexHandler
12195 ffestb_R9106_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
12197 switch (ffelex_token_type (t
))
12199 case FFELEX_typeCOMMA
:
12200 case FFELEX_typeCLOSE_PAREN
:
12201 ffestp_file
.write
.write_spec
[FFESTP_writeixFORMAT
].kw_or_val_present
12203 ffestp_file
.write
.write_spec
[FFESTP_writeixFORMAT
].kw_present
= FALSE
;
12204 ffestp_file
.write
.write_spec
[FFESTP_writeixFORMAT
].value_present
= TRUE
;
12205 ffestp_file
.write
.write_spec
[FFESTP_writeixFORMAT
].value_is_label
12207 ffestp_file
.write
.write_spec
[FFESTP_writeixFORMAT
].value
12208 = ffelex_token_use (ft
);
12209 ffestp_file
.write
.write_spec
[FFESTP_writeixFORMAT
].u
.expr
= expr
;
12210 if (ffelex_token_type (t
) == FFELEX_typeCOMMA
)
12211 return (ffelexHandler
) ffestb_R9107_
;
12212 return (ffelexHandler
) ffestb_R91012_
;
12218 ffestb_subr_kill_write_ ();
12219 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "WRITE", t
);
12220 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
12223 /* ffestb_R9107_ -- "WRITE" OPEN_PAREN [external-file-unit COMMA [format
12226 return ffestb_R9107_; // to lexer
12228 Handle expr construct (not NAME=expr construct) here. */
12230 static ffelexHandler
12231 ffestb_R9107_ (ffelexToken t
)
12235 ffestb_local_
.write
.label
= FALSE
;
12237 switch (ffelex_token_type (t
))
12239 case FFELEX_typeNAME
:
12240 kw
= ffestr_genio (t
);
12243 case FFESTR_genioADVANCE
:
12244 ffestb_local_
.write
.ix
= FFESTP_writeixADVANCE
;
12245 ffestb_local_
.write
.left
= FALSE
;
12246 ffestb_local_
.write
.context
= FFEEXPR_contextFILEDFCHAR
;
12249 case FFESTR_genioEOR
:
12250 ffestb_local_
.write
.ix
= FFESTP_writeixEOR
;
12251 ffestb_local_
.write
.label
= TRUE
;
12254 case FFESTR_genioERR
:
12255 ffestb_local_
.write
.ix
= FFESTP_writeixERR
;
12256 ffestb_local_
.write
.label
= TRUE
;
12259 case FFESTR_genioFMT
:
12260 ffestb_local_
.write
.ix
= FFESTP_writeixFORMAT
;
12261 ffestb_local_
.write
.left
= FALSE
;
12262 ffestb_local_
.write
.context
= FFEEXPR_contextFILEFORMAT
;
12265 case FFESTR_genioIOSTAT
:
12266 ffestb_local_
.write
.ix
= FFESTP_writeixIOSTAT
;
12267 ffestb_local_
.write
.left
= TRUE
;
12268 ffestb_local_
.write
.context
= FFEEXPR_contextFILEINT
;
12271 case FFESTR_genioNML
:
12272 ffestb_local_
.write
.ix
= FFESTP_writeixFORMAT
;
12273 ffestb_local_
.write
.left
= TRUE
;
12274 ffestb_local_
.write
.context
= FFEEXPR_contextFILENAMELIST
;
12277 case FFESTR_genioREC
:
12278 ffestb_local_
.write
.ix
= FFESTP_writeixREC
;
12279 ffestb_local_
.write
.left
= FALSE
;
12280 ffestb_local_
.write
.context
= FFEEXPR_contextFILENUM
;
12283 case FFESTR_genioUNIT
:
12284 ffestb_local_
.write
.ix
= FFESTP_writeixUNIT
;
12285 ffestb_local_
.write
.left
= FALSE
;
12286 ffestb_local_
.write
.context
= FFEEXPR_contextFILEUNIT
;
12290 goto bad
; /* :::::::::::::::::::: */
12292 if (ffestp_file
.write
.write_spec
[ffestb_local_
.write
.ix
]
12293 .kw_or_val_present
)
12294 break; /* Can't specify a keyword twice! */
12295 ffestp_file
.write
.write_spec
[ffestb_local_
.write
.ix
]
12296 .kw_or_val_present
= TRUE
;
12297 ffestp_file
.write
.write_spec
[ffestb_local_
.write
.ix
]
12298 .kw_present
= TRUE
;
12299 ffestp_file
.write
.write_spec
[ffestb_local_
.write
.ix
]
12300 .value_present
= FALSE
;
12301 ffestp_file
.write
.write_spec
[ffestb_local_
.write
.ix
].value_is_label
12302 = ffestb_local_
.write
.label
;
12303 ffestp_file
.write
.write_spec
[ffestb_local_
.write
.ix
].kw
12304 = ffelex_token_use (t
);
12305 return (ffelexHandler
) ffestb_R9108_
;
12311 bad
: /* :::::::::::::::::::: */
12312 ffestb_subr_kill_write_ ();
12313 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "WRITE", t
);
12314 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
12317 /* ffestb_R9108_ -- "WRITE" OPEN_PAREN [external-file-unit COMMA [format
12320 return ffestb_R9108_; // to lexer
12322 Make sure EQUALS here, send next token to expression handler. */
12324 static ffelexHandler
12325 ffestb_R9108_ (ffelexToken t
)
12327 switch (ffelex_token_type (t
))
12329 case FFELEX_typeEQUALS
:
12330 ffesta_confirmed ();
12331 if (ffestb_local_
.write
.label
)
12332 return (ffelexHandler
) ffestb_R91010_
;
12333 if (ffestb_local_
.write
.left
)
12334 return (ffelexHandler
) ffeexpr_lhs (ffesta_output_pool
,
12335 ffestb_local_
.write
.context
,
12336 (ffeexprCallback
) ffestb_R9109_
);
12337 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
12338 ffestb_local_
.write
.context
,
12339 (ffeexprCallback
) ffestb_R9109_
);
12345 ffestb_subr_kill_write_ ();
12346 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "WRITE", t
);
12347 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
12350 /* ffestb_R9109_ -- "WRITE" OPEN_PAREN ... NAME EQUALS expr
12352 (ffestb_R9109_) // to expression handler
12354 Handle COMMA or CLOSE_PAREN here. */
12356 static ffelexHandler
12357 ffestb_R9109_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
12359 switch (ffelex_token_type (t
))
12361 case FFELEX_typeCOMMA
:
12362 case FFELEX_typeCLOSE_PAREN
:
12365 if (ffestb_local_
.write
.context
== FFEEXPR_contextFILEFORMAT
)
12366 ffestp_file
.write
.write_spec
[ffestb_local_
.write
.ix
]
12367 .value_is_label
= TRUE
;
12371 ffestp_file
.write
.write_spec
[ffestb_local_
.write
.ix
].value_present
12373 ffestp_file
.write
.write_spec
[ffestb_local_
.write
.ix
].value
12374 = ffelex_token_use (ft
);
12375 ffestp_file
.write
.write_spec
[ffestb_local_
.write
.ix
].u
.expr
= expr
;
12376 if (ffelex_token_type (t
) == FFELEX_typeCOMMA
)
12377 return (ffelexHandler
) ffestb_R9107_
;
12378 return (ffelexHandler
) ffestb_R91012_
;
12384 ffestb_subr_kill_write_ ();
12385 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "WRITE", t
);
12386 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
12389 /* ffestb_R91010_ -- "WRITE" OPEN_PAREN ... NAME EQUALS
12391 return ffestb_R91010_; // to lexer
12393 Handle NUMBER for label here. */
12395 static ffelexHandler
12396 ffestb_R91010_ (ffelexToken t
)
12398 switch (ffelex_token_type (t
))
12400 case FFELEX_typeNUMBER
:
12401 ffestp_file
.write
.write_spec
[ffestb_local_
.write
.ix
].value_present
12403 ffestp_file
.write
.write_spec
[ffestb_local_
.write
.ix
].value
12404 = ffelex_token_use (t
);
12405 return (ffelexHandler
) ffestb_R91011_
;
12411 ffestb_subr_kill_write_ ();
12412 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "WRITE", t
);
12413 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
12416 /* ffestb_R91011_ -- "WRITE" OPEN_PAREN ... NAME EQUALS NUMBER
12418 return ffestb_R91011_; // to lexer
12420 Handle COMMA or CLOSE_PAREN here. */
12422 static ffelexHandler
12423 ffestb_R91011_ (ffelexToken t
)
12425 switch (ffelex_token_type (t
))
12427 case FFELEX_typeCOMMA
:
12428 return (ffelexHandler
) ffestb_R9107_
;
12430 case FFELEX_typeCLOSE_PAREN
:
12431 return (ffelexHandler
) ffestb_R91012_
;
12437 ffestb_subr_kill_write_ ();
12438 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "WRITE", t
);
12439 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
12442 /* ffestb_R91012_ -- "WRITE" OPEN_PAREN ... CLOSE_PAREN
12444 return ffestb_R91012_; // to lexer
12446 Handle EOS or SEMICOLON here. */
12448 static ffelexHandler
12449 ffestb_R91012_ (ffelexToken t
)
12451 switch (ffelex_token_type (t
))
12453 case FFELEX_typeEOS
:
12454 case FFELEX_typeSEMICOLON
:
12455 ffesta_confirmed ();
12456 if (!ffesta_is_inhibited ())
12458 ffestc_R910_start ();
12459 ffestc_R910_finish ();
12461 ffestb_subr_kill_write_ ();
12462 return (ffelexHandler
) ffesta_zero (t
);
12465 ffesta_confirmed ();
12466 /* Fall through. */
12467 case FFELEX_typeOPEN_PAREN
: /* Could still be assignment!! */
12469 /* EXTENSION: Allow an optional preceding COMMA here if not pedantic.
12470 (f2c provides this extension, as do other compilers, supposedly.) */
12472 if (!ffe_is_pedantic () && (ffelex_token_type (t
) == FFELEX_typeCOMMA
))
12473 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
12474 ffestc_context_iolist (), (ffeexprCallback
) ffestb_R91013_
);
12476 return (ffelexHandler
) (*((ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
12477 ffestc_context_iolist (), (ffeexprCallback
) ffestb_R91013_
)))
12480 case FFELEX_typeEQUALS
:
12481 case FFELEX_typePOINTS
:
12485 ffestb_subr_kill_write_ ();
12486 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "WRITE", t
);
12487 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
12490 /* ffestb_R91013_ -- "WRITE(...)" expr
12492 (ffestb_R91013_) // to expression handler
12494 Handle COMMA or EOS/SEMICOLON here. */
12496 static ffelexHandler
12497 ffestb_R91013_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
12499 switch (ffelex_token_type (t
))
12501 case FFELEX_typeCOMMA
:
12505 ffesta_confirmed ();
12506 if (!ffesta_is_inhibited ())
12507 ffestc_R910_start ();
12508 ffestb_subr_kill_write_ ();
12510 if (!ffesta_is_inhibited ())
12511 ffestc_R910_item (expr
, ft
);
12512 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
12513 ffestc_context_iolist (), (ffeexprCallback
) ffestb_R91014_
);
12515 case FFELEX_typeEOS
:
12516 case FFELEX_typeSEMICOLON
:
12520 ffesta_confirmed ();
12521 if (!ffesta_is_inhibited ())
12522 ffestc_R910_start ();
12523 ffestb_subr_kill_write_ ();
12525 if (!ffesta_is_inhibited ())
12527 ffestc_R910_item (expr
, ft
);
12528 ffestc_R910_finish ();
12530 return (ffelexHandler
) ffesta_zero (t
);
12536 ffestb_subr_kill_write_ ();
12537 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "WRITE", t
);
12538 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
12541 /* ffestb_R91014_ -- "WRITE(...)" expr COMMA expr
12543 (ffestb_R91014_) // to expression handler
12545 Handle COMMA or EOS/SEMICOLON here. */
12547 static ffelexHandler
12548 ffestb_R91014_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
12550 switch (ffelex_token_type (t
))
12552 case FFELEX_typeCOMMA
:
12555 if (!ffesta_is_inhibited ())
12556 ffestc_R910_item (expr
, ft
);
12557 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
12558 ffestc_context_iolist (), (ffeexprCallback
) ffestb_R91014_
);
12560 case FFELEX_typeEOS
:
12561 case FFELEX_typeSEMICOLON
:
12564 if (!ffesta_is_inhibited ())
12566 ffestc_R910_item (expr
, ft
);
12567 ffestc_R910_finish ();
12569 return (ffelexHandler
) ffesta_zero (t
);
12575 if (!ffesta_is_inhibited ())
12576 ffestc_R910_finish ();
12577 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "WRITE", t
);
12578 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
12581 /* ffestb_R911 -- Parse the PRINT statement
12583 return ffestb_R911; // to lexer
12585 Make sure the statement has a valid form for the PRINT
12586 statement. If it does, implement the statement. */
12589 ffestb_R911 (ffelexToken t
)
12591 ffelexHandler next
;
12594 switch (ffelex_token_type (ffesta_tokens
[0]))
12596 case FFELEX_typeNAME
:
12597 if (ffesta_first_kw
!= FFESTR_firstPRINT
)
12598 goto bad_0
; /* :::::::::::::::::::: */
12599 switch (ffelex_token_type (t
))
12601 case FFELEX_typeCOMMA
:
12602 case FFELEX_typeCOLONCOLON
:
12603 case FFELEX_typeEOS
:
12604 case FFELEX_typeSEMICOLON
:
12605 ffesta_confirmed (); /* Error, but clearly intended. */
12606 goto bad_1
; /* :::::::::::::::::::: */
12608 case FFELEX_typeEQUALS
:
12609 case FFELEX_typePOINTS
:
12610 case FFELEX_typeCOLON
:
12611 goto bad_1
; /* :::::::::::::::::::: */
12613 case FFELEX_typeNAME
:
12614 case FFELEX_typeNUMBER
:
12615 ffesta_confirmed ();
12622 for (ix
= 0; ix
< FFESTP_printix
; ++ix
)
12623 ffestp_file
.print
.print_spec
[ix
].kw_or_val_present
= FALSE
;
12624 return (ffelexHandler
) (*((ffelexHandler
)
12625 ffeexpr_rhs (ffesta_output_pool
,
12626 FFEEXPR_contextFILEFORMATNML
, (ffeexprCallback
) ffestb_R9111_
)))
12629 case FFELEX_typeNAMES
:
12630 if (ffesta_first_kw
!= FFESTR_firstPRINT
)
12631 goto bad_0
; /* :::::::::::::::::::: */
12632 switch (ffelex_token_type (t
))
12634 case FFELEX_typeEOS
:
12635 case FFELEX_typeSEMICOLON
:
12636 case FFELEX_typeCOMMA
:
12637 ffesta_confirmed ();
12638 if (ffelex_token_length (ffesta_tokens
[0]) != FFESTR_firstlPRINT
)
12640 goto bad_1
; /* :::::::::::::::::::: */
12642 case FFELEX_typeCOLONCOLON
:
12643 ffesta_confirmed (); /* Error, but clearly intended. */
12644 goto bad_1
; /* :::::::::::::::::::: */
12646 case FFELEX_typeEQUALS
:
12647 case FFELEX_typePOINTS
:
12648 case FFELEX_typeCOLON
:
12649 goto bad_1
; /* :::::::::::::::::::: */
12654 for (ix
= 0; ix
< FFESTP_printix
; ++ix
)
12655 ffestp_file
.print
.print_spec
[ix
].kw_or_val_present
= FALSE
;
12656 next
= (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
12657 FFEEXPR_contextFILEFORMATNML
, (ffeexprCallback
) ffestb_R9111_
);
12658 next
= (ffelexHandler
) ffelex_splice_tokens (next
, ffesta_tokens
[0],
12659 FFESTR_firstlPRINT
);
12661 return (ffelexHandler
) ffelex_swallow_tokens (t
,
12662 (ffelexHandler
) ffesta_zero
);
12663 return (ffelexHandler
) (*next
) (t
);
12666 goto bad_0
; /* :::::::::::::::::::: */
12669 bad_0
: /* :::::::::::::::::::: */
12670 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "PRINT", ffesta_tokens
[0]);
12671 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
12673 bad_1
: /* :::::::::::::::::::: */
12674 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "PRINT", t
);
12675 return (ffelexHandler
) ffelex_swallow_tokens (t
,
12676 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
12679 /* ffestb_R9111_ -- "PRINT" expr
12681 (ffestb_R9111_) // to expression handler
12683 Make sure the next token is a COMMA or EOS/SEMICOLON. */
12685 static ffelexHandler
12686 ffestb_R9111_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
12688 switch (ffelex_token_type (t
))
12690 case FFELEX_typeEOS
:
12691 case FFELEX_typeSEMICOLON
:
12692 case FFELEX_typeCOMMA
:
12693 ffesta_confirmed ();
12694 ffestp_file
.print
.print_spec
[FFESTP_printixFORMAT
].kw_or_val_present
12696 ffestp_file
.print
.print_spec
[FFESTP_printixFORMAT
].kw_present
= FALSE
;
12697 ffestp_file
.print
.print_spec
[FFESTP_printixFORMAT
].value_present
= TRUE
;
12698 ffestp_file
.print
.print_spec
[FFESTP_printixFORMAT
].value_is_label
12700 ffestp_file
.print
.print_spec
[FFESTP_printixFORMAT
].value
12701 = ffelex_token_use (ft
);
12702 ffestp_file
.print
.print_spec
[FFESTP_printixFORMAT
].u
.expr
= expr
;
12703 if (!ffesta_is_inhibited ())
12704 ffestc_R911_start ();
12705 ffestb_subr_kill_print_ ();
12706 if (ffelex_token_type (t
) == FFELEX_typeCOMMA
)
12707 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
12708 FFEEXPR_contextIOLIST
, (ffeexprCallback
) ffestb_R9112_
);
12709 if (!ffesta_is_inhibited ())
12710 ffestc_R911_finish ();
12711 return (ffelexHandler
) ffesta_zero (t
);
12717 ffestb_subr_kill_print_ ();
12718 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "PRINT", t
);
12719 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
12722 /* ffestb_R9112_ -- "PRINT" expr COMMA expr
12724 (ffestb_R9112_) // to expression handler
12726 Handle COMMA or EOS/SEMICOLON here. */
12728 static ffelexHandler
12729 ffestb_R9112_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
12731 switch (ffelex_token_type (t
))
12733 case FFELEX_typeCOMMA
:
12736 if (!ffesta_is_inhibited ())
12737 ffestc_R911_item (expr
, ft
);
12738 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
12739 FFEEXPR_contextIOLIST
, (ffeexprCallback
) ffestb_R9112_
);
12741 case FFELEX_typeEOS
:
12742 case FFELEX_typeSEMICOLON
:
12745 if (!ffesta_is_inhibited ())
12747 ffestc_R911_item (expr
, ft
);
12748 ffestc_R911_finish ();
12750 return (ffelexHandler
) ffesta_zero (t
);
12756 if (!ffesta_is_inhibited ())
12757 ffestc_R911_finish ();
12758 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "PRINT", t
);
12759 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
12762 /* ffestb_R923 -- Parse an INQUIRE statement
12764 return ffestb_R923; // to lexer
12766 Make sure the statement has a valid form for an INQUIRE statement.
12767 If it does, implement the statement. */
12770 ffestb_R923 (ffelexToken t
)
12772 ffestpInquireIx ix
;
12774 switch (ffelex_token_type (ffesta_tokens
[0]))
12776 case FFELEX_typeNAME
:
12777 if (ffesta_first_kw
!= FFESTR_firstINQUIRE
)
12778 goto bad_0
; /* :::::::::::::::::::: */
12781 case FFELEX_typeNAMES
:
12782 if (ffesta_first_kw
!= FFESTR_firstINQUIRE
)
12783 goto bad_0
; /* :::::::::::::::::::: */
12784 if (ffelex_token_length (ffesta_tokens
[0]) != FFESTR_firstlINQUIRE
)
12785 goto bad_0
; /* :::::::::::::::::::: */
12789 goto bad_0
; /* :::::::::::::::::::: */
12792 switch (ffelex_token_type (t
))
12794 case FFELEX_typeOPEN_PAREN
:
12797 case FFELEX_typeEOS
:
12798 case FFELEX_typeSEMICOLON
:
12799 case FFELEX_typeCOMMA
:
12800 case FFELEX_typeCOLONCOLON
:
12801 ffesta_confirmed (); /* Error, but clearly intended. */
12802 goto bad_1
; /* :::::::::::::::::::: */
12805 goto bad_1
; /* :::::::::::::::::::: */
12808 for (ix
= 0; ix
< FFESTP_inquireix
; ++ix
)
12809 ffestp_file
.inquire
.inquire_spec
[ix
].kw_or_val_present
= FALSE
;
12811 ffestb_local_
.inquire
.may_be_iolength
= TRUE
;
12812 return (ffelexHandler
) ffestb_R9231_
;
12814 bad_0
: /* :::::::::::::::::::: */
12815 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "INQUIRE", ffesta_tokens
[0]);
12816 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
12818 bad_1
: /* :::::::::::::::::::: */
12819 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "INQUIRE", t
);
12820 return (ffelexHandler
) ffelex_swallow_tokens (t
,
12821 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
12824 /* ffestb_R9231_ -- "INQUIRE" OPEN_PAREN
12826 return ffestb_R9231_; // to lexer
12828 Handle expr construct (not NAME=expr construct) here. */
12830 static ffelexHandler
12831 ffestb_R9231_ (ffelexToken t
)
12833 switch (ffelex_token_type (t
))
12835 case FFELEX_typeNAME
:
12836 ffesta_tokens
[1] = ffelex_token_use (t
);
12837 return (ffelexHandler
) ffestb_R9232_
;
12840 ffestb_local_
.inquire
.may_be_iolength
= FALSE
;
12841 return (ffelexHandler
) (*((ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
12842 FFEEXPR_contextFILENUM
, (ffeexprCallback
) ffestb_R9233_
)))
12847 /* ffestb_R9232_ -- "INQUIRE" OPEN_PAREN NAME
12849 return ffestb_R9232_; // to lexer
12851 If EQUALS here, go to states that handle it. Else, send NAME and this
12852 token thru expression handler. */
12854 static ffelexHandler
12855 ffestb_R9232_ (ffelexToken t
)
12857 ffelexHandler next
;
12860 switch (ffelex_token_type (t
))
12862 case FFELEX_typeEQUALS
:
12863 nt
= ffesta_tokens
[1];
12864 next
= (ffelexHandler
) ffestb_R9234_ (nt
);
12865 ffelex_token_kill (nt
);
12866 return (ffelexHandler
) (*next
) (t
);
12869 ffestb_local_
.inquire
.may_be_iolength
= FALSE
;
12870 next
= (ffelexHandler
) (*((ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
12871 FFEEXPR_contextFILENUM
, (ffeexprCallback
) ffestb_R9233_
)))
12872 (ffesta_tokens
[1]);
12873 ffelex_token_kill (ffesta_tokens
[1]);
12874 return (ffelexHandler
) (*next
) (t
);
12878 /* ffestb_R9233_ -- "INQUIRE" OPEN_PAREN expr
12880 (ffestb_R9233_) // to expression handler
12882 Handle COMMA or CLOSE_PAREN here. */
12884 static ffelexHandler
12885 ffestb_R9233_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
12887 switch (ffelex_token_type (t
))
12889 case FFELEX_typeCOMMA
:
12890 case FFELEX_typeCLOSE_PAREN
:
12893 ffestp_file
.inquire
.inquire_spec
[FFESTP_inquireixUNIT
].kw_or_val_present
12895 ffestp_file
.inquire
.inquire_spec
[FFESTP_inquireixUNIT
].kw_present
= FALSE
;
12896 ffestp_file
.inquire
.inquire_spec
[FFESTP_inquireixUNIT
].value_present
= TRUE
;
12897 ffestp_file
.inquire
.inquire_spec
[FFESTP_inquireixUNIT
].value_is_label
12899 ffestp_file
.inquire
.inquire_spec
[FFESTP_inquireixUNIT
].value
12900 = ffelex_token_use (ft
);
12901 ffestp_file
.inquire
.inquire_spec
[FFESTP_inquireixUNIT
].u
.expr
= expr
;
12902 if (ffelex_token_type (t
) == FFELEX_typeCOMMA
)
12903 return (ffelexHandler
) ffestb_R9234_
;
12904 return (ffelexHandler
) ffestb_R9239_
;
12910 ffestb_subr_kill_inquire_ ();
12911 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "INQUIRE", t
);
12912 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
12915 /* ffestb_R9234_ -- "INQUIRE" OPEN_PAREN [external-file-unit COMMA]
12917 return ffestb_R9234_; // to lexer
12919 Handle expr construct (not NAME=expr construct) here. */
12921 static ffelexHandler
12922 ffestb_R9234_ (ffelexToken t
)
12926 ffestb_local_
.inquire
.label
= FALSE
;
12928 switch (ffelex_token_type (t
))
12930 case FFELEX_typeNAME
:
12931 kw
= ffestr_inquire (t
);
12932 if (kw
!= FFESTR_inquireIOLENGTH
)
12933 ffestb_local_
.inquire
.may_be_iolength
= FALSE
;
12936 case FFESTR_inquireACCESS
:
12937 ffestb_local_
.inquire
.ix
= FFESTP_inquireixACCESS
;
12938 ffestb_local_
.inquire
.left
= TRUE
;
12939 ffestb_local_
.inquire
.context
= FFEEXPR_contextFILEDFCHAR
;
12942 case FFESTR_inquireACTION
:
12943 ffestb_local_
.inquire
.ix
= FFESTP_inquireixACTION
;
12944 ffestb_local_
.inquire
.left
= TRUE
;
12945 ffestb_local_
.inquire
.context
= FFEEXPR_contextFILEDFCHAR
;
12948 case FFESTR_inquireBLANK
:
12949 ffestb_local_
.inquire
.ix
= FFESTP_inquireixBLANK
;
12950 ffestb_local_
.inquire
.left
= TRUE
;
12951 ffestb_local_
.inquire
.context
= FFEEXPR_contextFILEDFCHAR
;
12954 case FFESTR_inquireCARRIAGECONTROL
:
12955 ffestb_local_
.inquire
.ix
= FFESTP_inquireixCARRIAGECONTROL
;
12956 ffestb_local_
.inquire
.left
= TRUE
;
12957 ffestb_local_
.inquire
.context
= FFEEXPR_contextFILECHAR
;
12960 case FFESTR_inquireDEFAULTFILE
:
12961 ffestb_local_
.inquire
.ix
= FFESTP_inquireixDEFAULTFILE
;
12962 ffestb_local_
.inquire
.left
= FALSE
;
12963 ffestb_local_
.inquire
.context
= FFEEXPR_contextFILECHAR
;
12966 case FFESTR_inquireDELIM
:
12967 ffestb_local_
.inquire
.ix
= FFESTP_inquireixDELIM
;
12968 ffestb_local_
.inquire
.left
= TRUE
;
12969 ffestb_local_
.inquire
.context
= FFEEXPR_contextFILEDFCHAR
;
12972 case FFESTR_inquireDIRECT
:
12973 ffestb_local_
.inquire
.ix
= FFESTP_inquireixDIRECT
;
12974 ffestb_local_
.inquire
.left
= TRUE
;
12975 ffestb_local_
.inquire
.context
= FFEEXPR_contextFILEDFCHAR
;
12978 case FFESTR_inquireERR
:
12979 ffestb_local_
.inquire
.ix
= FFESTP_inquireixERR
;
12980 ffestb_local_
.inquire
.label
= TRUE
;
12983 case FFESTR_inquireEXIST
:
12984 ffestb_local_
.inquire
.ix
= FFESTP_inquireixEXIST
;
12985 ffestb_local_
.inquire
.left
= TRUE
;
12986 ffestb_local_
.inquire
.context
= FFEEXPR_contextFILELOG
;
12989 case FFESTR_inquireFILE
:
12990 ffestb_local_
.inquire
.ix
= FFESTP_inquireixFILE
;
12991 ffestb_local_
.inquire
.left
= FALSE
;
12992 ffestb_local_
.inquire
.context
= FFEEXPR_contextFILECHAR
;
12995 case FFESTR_inquireFORM
:
12996 ffestb_local_
.inquire
.ix
= FFESTP_inquireixFORM
;
12997 ffestb_local_
.inquire
.left
= TRUE
;
12998 ffestb_local_
.inquire
.context
= FFEEXPR_contextFILEDFCHAR
;
13001 case FFESTR_inquireFORMATTED
:
13002 ffestb_local_
.inquire
.ix
= FFESTP_inquireixFORMATTED
;
13003 ffestb_local_
.inquire
.left
= TRUE
;
13004 ffestb_local_
.inquire
.context
= FFEEXPR_contextFILEDFCHAR
;
13007 case FFESTR_inquireIOLENGTH
:
13008 if (!ffestb_local_
.inquire
.may_be_iolength
)
13009 goto bad
; /* :::::::::::::::::::: */
13010 ffestb_local_
.inquire
.ix
= FFESTP_inquireixIOLENGTH
;
13011 ffestb_local_
.inquire
.left
= TRUE
;
13012 ffestb_local_
.inquire
.context
= FFEEXPR_contextFILEINT
;
13015 case FFESTR_inquireIOSTAT
:
13016 ffestb_local_
.inquire
.ix
= FFESTP_inquireixIOSTAT
;
13017 ffestb_local_
.inquire
.left
= TRUE
;
13018 ffestb_local_
.inquire
.context
= FFEEXPR_contextFILEINT
;
13021 case FFESTR_inquireKEYED
:
13022 ffestb_local_
.inquire
.ix
= FFESTP_inquireixKEYED
;
13023 ffestb_local_
.inquire
.left
= TRUE
;
13024 ffestb_local_
.inquire
.context
= FFEEXPR_contextFILECHAR
;
13027 case FFESTR_inquireNAME
:
13028 ffestb_local_
.inquire
.ix
= FFESTP_inquireixNAME
;
13029 ffestb_local_
.inquire
.left
= TRUE
;
13030 ffestb_local_
.inquire
.context
= FFEEXPR_contextFILECHAR
;
13033 case FFESTR_inquireNAMED
:
13034 ffestb_local_
.inquire
.ix
= FFESTP_inquireixNAMED
;
13035 ffestb_local_
.inquire
.left
= TRUE
;
13036 ffestb_local_
.inquire
.context
= FFEEXPR_contextFILELOG
;
13039 case FFESTR_inquireNEXTREC
:
13040 ffestb_local_
.inquire
.ix
= FFESTP_inquireixNEXTREC
;
13041 ffestb_local_
.inquire
.left
= TRUE
;
13042 ffestb_local_
.inquire
.context
= FFEEXPR_contextFILEDFINT
;
13045 case FFESTR_inquireNUMBER
:
13046 ffestb_local_
.inquire
.ix
= FFESTP_inquireixNUMBER
;
13047 ffestb_local_
.inquire
.left
= TRUE
;
13048 ffestb_local_
.inquire
.context
= FFEEXPR_contextFILEINT
;
13051 case FFESTR_inquireOPENED
:
13052 ffestb_local_
.inquire
.ix
= FFESTP_inquireixOPENED
;
13053 ffestb_local_
.inquire
.left
= TRUE
;
13054 ffestb_local_
.inquire
.context
= FFEEXPR_contextFILELOG
;
13057 case FFESTR_inquireORGANIZATION
:
13058 ffestb_local_
.inquire
.ix
= FFESTP_inquireixORGANIZATION
;
13059 ffestb_local_
.inquire
.left
= TRUE
;
13060 ffestb_local_
.inquire
.context
= FFEEXPR_contextFILECHAR
;
13063 case FFESTR_inquirePAD
:
13064 ffestb_local_
.inquire
.ix
= FFESTP_inquireixPAD
;
13065 ffestb_local_
.inquire
.left
= TRUE
;
13066 ffestb_local_
.inquire
.context
= FFEEXPR_contextFILEDFCHAR
;
13069 case FFESTR_inquirePOSITION
:
13070 ffestb_local_
.inquire
.ix
= FFESTP_inquireixPOSITION
;
13071 ffestb_local_
.inquire
.left
= TRUE
;
13072 ffestb_local_
.inquire
.context
= FFEEXPR_contextFILEDFCHAR
;
13075 case FFESTR_inquireREAD
:
13076 ffestb_local_
.inquire
.ix
= FFESTP_inquireixREAD
;
13077 ffestb_local_
.inquire
.left
= TRUE
;
13078 ffestb_local_
.inquire
.context
= FFEEXPR_contextFILEDFCHAR
;
13081 case FFESTR_inquireREADWRITE
:
13082 ffestb_local_
.inquire
.ix
= FFESTP_inquireixREADWRITE
;
13083 ffestb_local_
.inquire
.left
= TRUE
;
13084 ffestb_local_
.inquire
.context
= FFEEXPR_contextFILEDFCHAR
;
13087 case FFESTR_inquireRECL
:
13088 ffestb_local_
.inquire
.ix
= FFESTP_inquireixRECL
;
13089 ffestb_local_
.inquire
.left
= TRUE
;
13090 ffestb_local_
.inquire
.context
= FFEEXPR_contextFILEINT
;
13093 case FFESTR_inquireRECORDTYPE
:
13094 ffestb_local_
.inquire
.ix
= FFESTP_inquireixRECORDTYPE
;
13095 ffestb_local_
.inquire
.left
= TRUE
;
13096 ffestb_local_
.inquire
.context
= FFEEXPR_contextFILECHAR
;
13099 case FFESTR_inquireSEQUENTIAL
:
13100 ffestb_local_
.inquire
.ix
= FFESTP_inquireixSEQUENTIAL
;
13101 ffestb_local_
.inquire
.left
= TRUE
;
13102 ffestb_local_
.inquire
.context
= FFEEXPR_contextFILEDFCHAR
;
13105 case FFESTR_inquireUNFORMATTED
:
13106 ffestb_local_
.inquire
.ix
= FFESTP_inquireixUNFORMATTED
;
13107 ffestb_local_
.inquire
.left
= TRUE
;
13108 ffestb_local_
.inquire
.context
= FFEEXPR_contextFILEDFCHAR
;
13111 case FFESTR_inquireUNIT
:
13112 ffestb_local_
.inquire
.ix
= FFESTP_inquireixUNIT
;
13113 ffestb_local_
.inquire
.left
= FALSE
;
13114 ffestb_local_
.inquire
.context
= FFEEXPR_contextFILENUM
;
13118 goto bad
; /* :::::::::::::::::::: */
13120 if (ffestp_file
.inquire
.inquire_spec
[ffestb_local_
.inquire
.ix
]
13121 .kw_or_val_present
)
13122 break; /* Can't specify a keyword twice! */
13123 ffestp_file
.inquire
.inquire_spec
[ffestb_local_
.inquire
.ix
]
13124 .kw_or_val_present
= TRUE
;
13125 ffestp_file
.inquire
.inquire_spec
[ffestb_local_
.inquire
.ix
]
13126 .kw_present
= TRUE
;
13127 ffestp_file
.inquire
.inquire_spec
[ffestb_local_
.inquire
.ix
]
13128 .value_present
= FALSE
;
13129 ffestp_file
.inquire
.inquire_spec
[ffestb_local_
.inquire
.ix
].value_is_label
13130 = ffestb_local_
.inquire
.label
;
13131 ffestp_file
.inquire
.inquire_spec
[ffestb_local_
.inquire
.ix
].kw
13132 = ffelex_token_use (t
);
13133 return (ffelexHandler
) ffestb_R9235_
;
13139 bad
: /* :::::::::::::::::::: */
13140 ffestb_subr_kill_inquire_ ();
13141 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "INQUIRE", t
);
13142 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
13145 /* ffestb_R9235_ -- "INQUIRE" OPEN_PAREN [external-file-unit COMMA] NAME
13147 return ffestb_R9235_; // to lexer
13149 Make sure EQUALS here, send next token to expression handler. */
13151 static ffelexHandler
13152 ffestb_R9235_ (ffelexToken t
)
13154 switch (ffelex_token_type (t
))
13156 case FFELEX_typeEQUALS
:
13157 ffesta_confirmed ();
13158 if (ffestb_local_
.inquire
.label
)
13159 return (ffelexHandler
) ffestb_R9237_
;
13160 if (ffestb_local_
.inquire
.left
)
13161 return (ffelexHandler
) ffeexpr_lhs (ffesta_output_pool
,
13162 ffestb_local_
.inquire
.context
,
13163 (ffeexprCallback
) ffestb_R9236_
);
13164 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
13165 ffestb_local_
.inquire
.context
,
13166 (ffeexprCallback
) ffestb_R9236_
);
13172 ffestb_subr_kill_inquire_ ();
13173 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "INQUIRE", t
);
13174 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
13177 /* ffestb_R9236_ -- "INQUIRE" OPEN_PAREN ... NAME EQUALS expr
13179 (ffestb_R9236_) // to expression handler
13181 Handle COMMA or CLOSE_PAREN here. */
13183 static ffelexHandler
13184 ffestb_R9236_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
13186 switch (ffelex_token_type (t
))
13188 case FFELEX_typeCOMMA
:
13189 if (ffestb_local_
.inquire
.ix
== FFESTP_inquireixIOLENGTH
)
13190 break; /* IOLENGTH=expr must be followed by
13192 /* Fall through. */
13193 case FFELEX_typeCLOSE_PAREN
:
13196 ffestp_file
.inquire
.inquire_spec
[ffestb_local_
.inquire
.ix
].value_present
13198 ffestp_file
.inquire
.inquire_spec
[ffestb_local_
.inquire
.ix
].value
13199 = ffelex_token_use (ft
);
13200 ffestp_file
.inquire
.inquire_spec
[ffestb_local_
.inquire
.ix
].u
.expr
= expr
;
13201 if (ffelex_token_type (t
) == FFELEX_typeCOMMA
)
13202 return (ffelexHandler
) ffestb_R9234_
;
13203 if (ffestb_local_
.inquire
.ix
== FFESTP_inquireixIOLENGTH
)
13204 return (ffelexHandler
) ffestb_R92310_
;
13205 return (ffelexHandler
) ffestb_R9239_
;
13211 ffestb_subr_kill_inquire_ ();
13212 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "INQUIRE", t
);
13213 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
13216 /* ffestb_R9237_ -- "INQUIRE" OPEN_PAREN ... NAME EQUALS
13218 return ffestb_R9237_; // to lexer
13220 Handle NUMBER for label here. */
13222 static ffelexHandler
13223 ffestb_R9237_ (ffelexToken t
)
13225 switch (ffelex_token_type (t
))
13227 case FFELEX_typeNUMBER
:
13228 ffestp_file
.inquire
.inquire_spec
[ffestb_local_
.inquire
.ix
].value_present
13230 ffestp_file
.inquire
.inquire_spec
[ffestb_local_
.inquire
.ix
].value
13231 = ffelex_token_use (t
);
13232 return (ffelexHandler
) ffestb_R9238_
;
13238 ffestb_subr_kill_inquire_ ();
13239 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "INQUIRE", t
);
13240 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
13243 /* ffestb_R9238_ -- "INQUIRE" OPEN_PAREN ... NAME EQUALS NUMBER
13245 return ffestb_R9238_; // to lexer
13247 Handle COMMA or CLOSE_PAREN here. */
13249 static ffelexHandler
13250 ffestb_R9238_ (ffelexToken t
)
13252 switch (ffelex_token_type (t
))
13254 case FFELEX_typeCOMMA
:
13255 return (ffelexHandler
) ffestb_R9234_
;
13257 case FFELEX_typeCLOSE_PAREN
:
13258 return (ffelexHandler
) ffestb_R9239_
;
13264 ffestb_subr_kill_inquire_ ();
13265 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "INQUIRE", t
);
13266 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
13269 /* ffestb_R9239_ -- "INQUIRE" OPEN_PAREN ... CLOSE_PAREN
13271 return ffestb_R9239_; // to lexer
13273 Handle EOS or SEMICOLON here. */
13275 static ffelexHandler
13276 ffestb_R9239_ (ffelexToken t
)
13278 switch (ffelex_token_type (t
))
13280 case FFELEX_typeEOS
:
13281 case FFELEX_typeSEMICOLON
:
13282 ffesta_confirmed ();
13283 if (!ffesta_is_inhibited ())
13285 ffestb_subr_kill_inquire_ ();
13286 return (ffelexHandler
) ffesta_zero (t
);
13292 ffestb_subr_kill_inquire_ ();
13293 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "INQUIRE", t
);
13294 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
13297 /* ffestb_R92310_ -- "INQUIRE(IOLENGTH=expr)"
13299 return ffestb_R92310_; // to lexer
13301 Make sure EOS or SEMICOLON not here; begin R923B processing and expect
13304 static ffelexHandler
13305 ffestb_R92310_ (ffelexToken t
)
13307 switch (ffelex_token_type (t
))
13309 case FFELEX_typeEOS
:
13310 case FFELEX_typeSEMICOLON
:
13314 ffesta_confirmed ();
13315 if (!ffesta_is_inhibited ())
13316 ffestc_R923B_start ();
13317 ffestb_subr_kill_inquire_ ();
13318 return (ffelexHandler
) (*((ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
13319 FFEEXPR_contextIOLIST
, (ffeexprCallback
) ffestb_R92311_
)))
13323 ffestb_subr_kill_inquire_ ();
13324 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "INQUIRE", t
);
13325 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
13328 /* ffestb_R92311_ -- "INQUIRE(IOLENGTH=expr)" expr
13330 (ffestb_R92311_) // to expression handler
13332 Handle COMMA or EOS/SEMICOLON here. */
13334 static ffelexHandler
13335 ffestb_R92311_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
13337 switch (ffelex_token_type (t
))
13339 case FFELEX_typeCOMMA
:
13342 if (!ffesta_is_inhibited ())
13343 ffestc_R923B_item (expr
, ft
);
13344 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
13345 FFEEXPR_contextIOLIST
, (ffeexprCallback
) ffestb_R92311_
);
13347 case FFELEX_typeEOS
:
13348 case FFELEX_typeSEMICOLON
:
13351 if (!ffesta_is_inhibited ())
13353 ffestc_R923B_item (expr
, ft
);
13354 ffestc_R923B_finish ();
13356 return (ffelexHandler
) ffesta_zero (t
);
13362 if (!ffesta_is_inhibited ())
13363 ffestc_R923B_finish ();
13364 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "INQUIRE", t
);
13365 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
13368 /* ffestb_V020 -- Parse the TYPE statement
13370 return ffestb_V020; // to lexer
13372 Make sure the statement has a valid form for the TYPE
13373 statement. If it does, implement the statement. */
13376 ffestb_V020 (ffelexToken t
)
13380 ffelexHandler next
;
13383 switch (ffelex_token_type (ffesta_tokens
[0]))
13385 case FFELEX_typeNAME
:
13386 if (ffesta_first_kw
!= FFESTR_firstTYPE
)
13387 goto bad_0
; /* :::::::::::::::::::: */
13388 switch (ffelex_token_type (t
))
13390 case FFELEX_typeCOLONCOLON
:
13391 case FFELEX_typeEOS
:
13392 case FFELEX_typeSEMICOLON
:
13393 ffesta_confirmed (); /* Error, but clearly intended. */
13394 goto bad_1
; /* :::::::::::::::::::: */
13396 case FFELEX_typeEQUALS
:
13397 case FFELEX_typePOINTS
:
13398 case FFELEX_typeCOLON
:
13399 case FFELEX_typeCOMMA
: /* Because "TYPE,PUBLIC::A" is ambiguous with
13401 goto bad_1
; /* :::::::::::::::::::: */
13403 case FFELEX_typeNUMBER
:
13404 ffesta_confirmed ();
13407 case FFELEX_typeNAME
: /* Because TYPE A is ambiguous with '90. */
13412 for (ix
= 0; ix
< FFESTP_typeix
; ++ix
)
13413 ffestp_file
.type
.type_spec
[ix
].kw_or_val_present
= FALSE
;
13414 return (ffelexHandler
) (*((ffelexHandler
)
13415 ffeexpr_rhs (ffesta_output_pool
,
13416 FFEEXPR_contextFILEFORMATNML
, (ffeexprCallback
) ffestb_V0201_
)))
13419 case FFELEX_typeNAMES
:
13420 if (ffesta_first_kw
!= FFESTR_firstTYPE
)
13421 goto bad_0
; /* :::::::::::::::::::: */
13422 switch (ffelex_token_type (t
))
13424 case FFELEX_typeEOS
:
13425 case FFELEX_typeSEMICOLON
:
13426 case FFELEX_typeCOMMA
:
13427 if (ffelex_token_length (ffesta_tokens
[0]) != FFESTR_firstlTYPE
)
13429 goto bad_1
; /* :::::::::::::::::::: */
13431 case FFELEX_typeCOLONCOLON
:
13432 ffesta_confirmed (); /* Error, but clearly intended. */
13433 goto bad_1
; /* :::::::::::::::::::: */
13435 case FFELEX_typeOPEN_PAREN
:
13436 if (ffelex_token_length (ffesta_tokens
[0]) == FFESTR_firstlTYPE
)
13437 break; /* Else might be assignment/stmtfuncdef. */
13438 goto bad_1
; /* :::::::::::::::::::: */
13440 case FFELEX_typeEQUALS
:
13441 case FFELEX_typePOINTS
:
13442 case FFELEX_typeCOLON
:
13443 goto bad_1
; /* :::::::::::::::::::: */
13448 p
= ffelex_token_text (ffesta_tokens
[0]) + (i
= FFESTR_firstlTYPE
);
13450 ffesta_confirmed (); /* Else might be '90 TYPE statement. */
13451 for (ix
= 0; ix
< FFESTP_typeix
; ++ix
)
13452 ffestp_file
.type
.type_spec
[ix
].kw_or_val_present
= FALSE
;
13453 next
= (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
13454 FFEEXPR_contextFILEFORMATNML
, (ffeexprCallback
) ffestb_V0201_
);
13455 next
= (ffelexHandler
) ffelex_splice_tokens (next
, ffesta_tokens
[0],
13456 FFESTR_firstlTYPE
);
13458 return (ffelexHandler
) ffelex_swallow_tokens (t
,
13459 (ffelexHandler
) ffesta_zero
);
13460 return (ffelexHandler
) (*next
) (t
);
13463 goto bad_0
; /* :::::::::::::::::::: */
13466 bad_0
: /* :::::::::::::::::::: */
13467 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "TYPE I/O", ffesta_tokens
[0]);
13468 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
13470 bad_1
: /* :::::::::::::::::::: */
13471 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "TYPE I/O", t
);
13472 return (ffelexHandler
) ffelex_swallow_tokens (t
,
13473 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
13476 /* ffestb_V0201_ -- "TYPE" expr
13478 (ffestb_V0201_) // to expression handler
13480 Make sure the next token is a COMMA or EOS/SEMICOLON. */
13482 static ffelexHandler
13483 ffestb_V0201_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
13487 switch (ffelex_token_type (t
))
13489 case FFELEX_typeEOS
:
13490 case FFELEX_typeSEMICOLON
:
13491 if (!ffe_is_vxt () && (expr
!= NULL
)
13492 && (ffebld_op (expr
) == FFEBLD_opSYMTER
))
13495 /* Fall through. */
13496 case FFELEX_typeCOMMA
:
13497 if (!ffe_is_vxt () && comma
&& (expr
!= NULL
)
13498 && (ffebld_op (expr
) == FFEBLD_opPAREN
)
13499 && (ffebld_op (ffebld_left (expr
)) == FFEBLD_opSYMTER
))
13501 ffesta_confirmed ();
13502 ffestp_file
.type
.type_spec
[FFESTP_typeixFORMAT
].kw_or_val_present
13504 ffestp_file
.type
.type_spec
[FFESTP_typeixFORMAT
].kw_present
= FALSE
;
13505 ffestp_file
.type
.type_spec
[FFESTP_typeixFORMAT
].value_present
= TRUE
;
13506 ffestp_file
.type
.type_spec
[FFESTP_typeixFORMAT
].value_is_label
13508 ffestp_file
.type
.type_spec
[FFESTP_typeixFORMAT
].value
13509 = ffelex_token_use (ft
);
13510 ffestp_file
.type
.type_spec
[FFESTP_typeixFORMAT
].u
.expr
= expr
;
13511 if (!ffesta_is_inhibited ())
13512 ffestc_V020_start ();
13513 ffestb_subr_kill_type_ ();
13514 if (ffelex_token_type (t
) == FFELEX_typeCOMMA
)
13515 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
13516 FFEEXPR_contextIOLIST
, (ffeexprCallback
) ffestb_V0202_
);
13517 if (!ffesta_is_inhibited ())
13518 ffestc_V020_finish ();
13519 return (ffelexHandler
) ffesta_zero (t
);
13525 ffestb_subr_kill_type_ ();
13526 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "TYPE I/O", t
);
13527 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
13530 /* ffestb_V0202_ -- "TYPE" expr COMMA expr
13532 (ffestb_V0202_) // to expression handler
13534 Handle COMMA or EOS/SEMICOLON here. */
13536 static ffelexHandler
13537 ffestb_V0202_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
13539 switch (ffelex_token_type (t
))
13541 case FFELEX_typeCOMMA
:
13544 if (!ffesta_is_inhibited ())
13545 ffestc_V020_item (expr
, ft
);
13546 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
13547 FFEEXPR_contextIOLIST
, (ffeexprCallback
) ffestb_V0202_
);
13549 case FFELEX_typeEOS
:
13550 case FFELEX_typeSEMICOLON
:
13553 if (!ffesta_is_inhibited ())
13555 ffestc_V020_item (expr
, ft
);
13556 ffestc_V020_finish ();
13558 return (ffelexHandler
) ffesta_zero (t
);
13564 if (!ffesta_is_inhibited ())
13565 ffestc_V020_finish ();
13566 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "TYPE I/O", t
);
13567 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
13570 /* ffestb_dummy -- Parse an ENTRY/FUNCTION/SUBROUTINE statement
13572 return ffestb_dummy; // to lexer
13574 Make sure the statement has a valid form for an ENTRY/FUNCTION/SUBROUTINE
13575 statement. If it does, implement the statement. */
13578 ffestb_dummy (ffelexToken t
)
13581 unsigned const char *p
;
13583 switch (ffelex_token_type (ffesta_tokens
[0]))
13585 case FFELEX_typeNAME
:
13586 switch (ffelex_token_type (t
))
13588 case FFELEX_typeEOS
:
13589 case FFELEX_typeSEMICOLON
:
13590 case FFELEX_typeCOMMA
:
13591 case FFELEX_typeCOLONCOLON
:
13592 ffesta_confirmed (); /* Error, but clearly intended. */
13593 goto bad_1
; /* :::::::::::::::::::: */
13596 goto bad_1
; /* :::::::::::::::::::: */
13598 case FFELEX_typeNAME
:
13602 ffesta_confirmed ();
13603 ffesta_tokens
[1] = ffelex_token_use (t
);
13604 ffestb_local_
.decl
.recursive
= NULL
;
13605 ffestb_local_
.dummy
.badname
= ffestb_args
.dummy
.badname
;
13606 ffestb_local_
.dummy
.is_subr
= ffestb_args
.dummy
.is_subr
;
13607 ffestb_local_
.dummy
.first_kw
= ffesta_first_kw
;
13608 return (ffelexHandler
) ffestb_dummy1_
;
13610 case FFELEX_typeNAMES
:
13611 switch (ffelex_token_type (t
))
13613 case FFELEX_typeCOMMA
:
13614 case FFELEX_typeCOLONCOLON
:
13615 ffesta_confirmed (); /* Error, but clearly intended. */
13616 goto bad_1
; /* :::::::::::::::::::: */
13619 goto bad_1
; /* :::::::::::::::::::: */
13621 case FFELEX_typeEOS
:
13622 case FFELEX_typeSEMICOLON
:
13623 ffesta_confirmed ();
13626 case FFELEX_typeOPEN_PAREN
:
13629 p
= ffelex_token_text (ffesta_tokens
[0]) + (i
= ffestb_args
.dummy
.len
);
13630 if (!ffesrc_is_name_init (*p
))
13631 goto bad_i
; /* :::::::::::::::::::: */
13633 = ffelex_token_name_from_names (ffesta_tokens
[0], i
, 0);
13634 ffestb_local_
.decl
.recursive
= NULL
;
13635 ffestb_local_
.dummy
.badname
= ffestb_args
.dummy
.badname
;
13636 ffestb_local_
.dummy
.is_subr
= ffestb_args
.dummy
.is_subr
;
13637 ffestb_local_
.dummy
.first_kw
= ffesta_first_kw
;
13638 return (ffelexHandler
) ffestb_dummy1_ (t
);
13641 goto bad_0
; /* :::::::::::::::::::: */
13644 bad_0
: /* :::::::::::::::::::: */
13645 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, ffestb_args
.dummy
.badname
, ffesta_tokens
[0]);
13646 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
13648 bad_1
: /* :::::::::::::::::::: */
13649 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, ffestb_args
.dummy
.badname
, t
);
13650 return (ffelexHandler
) ffelex_swallow_tokens (t
,
13651 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
13653 bad_i
: /* :::::::::::::::::::: */
13654 ffesta_ffebad_1sp (FFEBAD_INVALID_STMT_FORM
, ffestb_args
.dummy
.badname
, ffesta_tokens
[0], i
, t
);
13655 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
13658 /* ffestb_dummy1_ -- "ENTRY/FUNCTION/SUBROUTINE" NAME
13660 return ffestb_dummy1_; // to lexer
13662 Make sure the next token is an EOS, SEMICOLON, or OPEN_PAREN. In the
13663 former case, just implement a null arg list, else get the arg list and
13666 static ffelexHandler
13667 ffestb_dummy1_ (ffelexToken t
)
13669 switch (ffelex_token_type (t
))
13671 case FFELEX_typeEOS
:
13672 case FFELEX_typeSEMICOLON
:
13673 if (ffestb_local_
.dummy
.first_kw
== FFESTR_firstFUNCTION
)
13675 ffesta_confirmed (); /* Later, not if typename w/o RECURSIVE. */
13676 break; /* Produce an error message, need that open
13679 ffesta_confirmed ();
13680 if (!ffesta_is_inhibited ())
13681 { /* Pretend as though we got a truly NULL
13683 ffestb_subrargs_
.name_list
.args
= NULL
;
13684 ffestb_subrargs_
.name_list
.ok
= TRUE
;
13685 ffestb_subrargs_
.name_list
.close_paren
= ffelex_token_use (t
);
13686 return (ffelexHandler
) ffestb_dummy2_ (t
);
13688 if (ffestb_local_
.decl
.recursive
!= NULL
)
13689 ffelex_token_kill (ffestb_local_
.decl
.recursive
);
13690 ffelex_token_kill (ffesta_tokens
[1]);
13691 return (ffelexHandler
) ffesta_zero (t
);
13693 case FFELEX_typeOPEN_PAREN
:
13694 ffestb_subrargs_
.name_list
.args
= ffestt_tokenlist_create ();
13695 ffestb_subrargs_
.name_list
.handler
= (ffelexHandler
) ffestb_dummy2_
;
13696 ffestb_subrargs_
.name_list
.is_subr
= ffestb_local_
.dummy
.is_subr
;
13697 ffestb_subrargs_
.name_list
.names
= FALSE
;
13698 return (ffelexHandler
) ffestb_subr_name_list_
;
13704 if (ffestb_local_
.decl
.recursive
!= NULL
)
13705 ffelex_token_kill (ffestb_local_
.decl
.recursive
);
13706 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, ffestb_local_
.dummy
.badname
, t
);
13707 ffelex_token_kill (ffesta_tokens
[1]);
13708 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
13711 /* ffestb_dummy2_ -- <dummy-keyword> NAME OPEN_PAREN arg-list CLOSE_PAREN
13713 return ffestb_dummy2_; // to lexer
13715 Make sure the statement has a valid form for a dummy-def statement. If it
13716 does, implement the statement. */
13718 static ffelexHandler
13719 ffestb_dummy2_ (ffelexToken t
)
13721 if (!ffestb_subrargs_
.name_list
.ok
)
13722 goto bad
; /* :::::::::::::::::::: */
13724 switch (ffelex_token_type (t
))
13726 case FFELEX_typeEOS
:
13727 case FFELEX_typeSEMICOLON
:
13728 ffesta_confirmed ();
13729 if (!ffesta_is_inhibited ())
13731 switch (ffestb_local_
.dummy
.first_kw
)
13733 case FFESTR_firstFUNCTION
:
13734 ffestc_R1219 (ffesta_tokens
[1], ffestb_subrargs_
.name_list
.args
,
13735 ffestb_subrargs_
.name_list
.close_paren
, FFESTP_typeNone
,
13736 NULL
, NULL
, NULL
, NULL
, ffestb_local_
.decl
.recursive
, NULL
);
13739 case FFESTR_firstSUBROUTINE
:
13740 ffestc_R1223 (ffesta_tokens
[1], ffestb_subrargs_
.name_list
.args
,
13741 ffestb_subrargs_
.name_list
.close_paren
,
13742 ffestb_local_
.decl
.recursive
);
13745 case FFESTR_firstENTRY
:
13746 ffestc_R1226 (ffesta_tokens
[1], ffestb_subrargs_
.name_list
.args
,
13747 ffestb_subrargs_
.name_list
.close_paren
);
13754 ffelex_token_kill (ffesta_tokens
[1]);
13755 if (ffestb_local_
.decl
.recursive
!= NULL
)
13756 ffelex_token_kill (ffestb_local_
.decl
.recursive
);
13757 ffelex_token_kill (ffestb_subrargs_
.name_list
.close_paren
);
13758 if (ffestb_subrargs_
.name_list
.args
!= NULL
)
13759 ffestt_tokenlist_kill (ffestb_subrargs_
.name_list
.args
);
13760 return (ffelexHandler
) ffesta_zero (t
);
13762 case FFELEX_typeNAME
:
13763 ffesta_confirmed ();
13764 if ((ffestb_local_
.dummy
.first_kw
!= FFESTR_firstFUNCTION
)
13765 || (ffestr_other (t
) != FFESTR_otherRESULT
))
13767 ffestb_local_
.decl
.type
= FFESTP_typeNone
;
13768 ffestb_local_
.decl
.kind
= NULL
;
13769 ffestb_local_
.decl
.kindt
= NULL
;
13770 ffestb_local_
.decl
.len
= NULL
;
13771 ffestb_local_
.decl
.lent
= NULL
;
13772 return (ffelexHandler
) ffestb_decl_funcname_6_
;
13778 bad
: /* :::::::::::::::::::: */
13779 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, ffestb_local_
.dummy
.badname
, t
);
13780 ffelex_token_kill (ffesta_tokens
[1]);
13781 if (ffestb_local_
.decl
.recursive
!= NULL
)
13782 ffelex_token_kill (ffestb_local_
.decl
.recursive
);
13783 ffelex_token_kill (ffestb_subrargs_
.name_list
.close_paren
);
13784 if (ffestb_subrargs_
.name_list
.args
!= NULL
)
13785 ffestt_tokenlist_kill (ffestb_subrargs_
.name_list
.args
);
13786 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
13789 /* ffestb_R524 -- Parse the DIMENSION statement
13791 return ffestb_R524; // to lexer
13793 Make sure the statement has a valid form for the DIMENSION statement. If
13794 it does, implement the statement. */
13797 ffestb_R524 (ffelexToken t
)
13800 unsigned const char *p
;
13802 ffelexHandler next
;
13804 switch (ffelex_token_type (ffesta_tokens
[0]))
13806 case FFELEX_typeNAME
:
13807 switch (ffelex_token_type (t
))
13809 case FFELEX_typeCOMMA
:
13810 case FFELEX_typeCOLONCOLON
:
13811 case FFELEX_typeEOS
:
13812 case FFELEX_typeSEMICOLON
:
13813 ffesta_confirmed (); /* Error, but clearly intended. */
13814 goto bad_1
; /* :::::::::::::::::::: */
13817 goto bad_1
; /* :::::::::::::::::::: */
13819 case FFELEX_typeNAME
:
13820 ffesta_confirmed ();
13821 if (!ffesta_is_inhibited ())
13822 ffestc_R524_start (ffesta_first_kw
== FFESTR_firstVIRTUAL
);
13823 ffestb_local_
.dimension
.started
= TRUE
;
13824 return (ffelexHandler
) ffestb_R5241_ (t
);
13827 case FFELEX_typeNAMES
:
13828 p
= ffelex_token_text (ffesta_tokens
[0]) + (i
= ffestb_args
.R524
.len
);
13829 switch (ffelex_token_type (t
))
13832 goto bad_1
; /* :::::::::::::::::::: */
13834 case FFELEX_typeEOS
:
13835 case FFELEX_typeSEMICOLON
:
13836 case FFELEX_typeCOMMA
:
13837 case FFELEX_typeCOLONCOLON
:
13838 ffesta_confirmed ();
13839 goto bad_1
; /* :::::::::::::::::::: */
13841 case FFELEX_typeOPEN_PAREN
:
13845 /* Here, we have at least one char after "DIMENSION" and t is
13848 if (!ffesrc_is_name_init (*p
))
13849 goto bad_i
; /* :::::::::::::::::::: */
13850 nt
= ffelex_token_name_from_names (ffesta_tokens
[0], i
, 0);
13851 ffestb_local_
.dimension
.started
= FALSE
;
13852 next
= (ffelexHandler
) ffestb_R5241_ (nt
);
13853 ffelex_token_kill (nt
);
13854 return (ffelexHandler
) (*next
) (t
);
13857 goto bad_0
; /* :::::::::::::::::::: */
13860 bad_0
: /* :::::::::::::::::::: */
13861 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, ffestb_args
.R524
.badname
, ffesta_tokens
[0]);
13862 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
13864 bad_1
: /* :::::::::::::::::::: */
13865 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, ffestb_args
.R524
.badname
, t
);
13866 return (ffelexHandler
) ffelex_swallow_tokens (t
,
13867 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
13869 bad_i
: /* :::::::::::::::::::: */
13870 ffesta_ffebad_1sp (FFEBAD_INVALID_STMT_FORM
, ffestb_args
.R524
.badname
, ffesta_tokens
[0], i
, t
);
13871 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
13874 /* ffestb_R5241_ -- "DIMENSION"
13876 return ffestb_R5241_; // to lexer
13880 static ffelexHandler
13881 ffestb_R5241_ (ffelexToken t
)
13883 switch (ffelex_token_type (t
))
13885 case FFELEX_typeNAME
:
13886 ffesta_tokens
[1] = ffelex_token_use (t
);
13887 return (ffelexHandler
) ffestb_R5242_
;
13890 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, ffestb_args
.R524
.badname
, t
);
13894 if (!ffesta_is_inhibited ())
13895 ffestc_R524_finish ();
13896 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
13899 /* ffestb_R5242_ -- "DIMENSION" ... NAME
13901 return ffestb_R5242_; // to lexer
13903 Handle OPEN_PAREN. */
13905 static ffelexHandler
13906 ffestb_R5242_ (ffelexToken t
)
13908 switch (ffelex_token_type (t
))
13910 case FFELEX_typeOPEN_PAREN
:
13911 ffestb_subrargs_
.dim_list
.dims
= ffestt_dimlist_create ();
13912 ffestb_subrargs_
.dim_list
.handler
= (ffelexHandler
) ffestb_R5243_
;
13913 ffestb_subrargs_
.dim_list
.pool
= ffesta_output_pool
;
13914 ffestb_subrargs_
.dim_list
.ctx
= ffesta_is_entry_valid
13915 ? FFEEXPR_contextDIMLIST
: FFEEXPR_contextDIMLISTCOMMON
;
13916 #ifdef FFECOM_dimensionsMAX
13917 ffestb_subrargs_
.dim_list
.ndims
= 0;
13919 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
13920 ffestb_subrargs_
.dim_list
.ctx
,
13921 (ffeexprCallback
) ffestb_subr_dimlist_
);
13924 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, ffestb_args
.R524
.badname
, t
);
13928 if (!ffesta_is_inhibited ())
13929 ffestc_R524_finish ();
13930 ffelex_token_kill (ffesta_tokens
[1]);
13931 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
13934 /* ffestb_R5243_ -- "DIMENSION" ... NAME OPEN_PAREN dimlist CLOSE_PAREN
13936 return ffestb_R5243_; // to lexer
13938 Handle COMMA or EOS/SEMICOLON. */
13940 static ffelexHandler
13941 ffestb_R5243_ (ffelexToken t
)
13943 if (!ffestb_subrargs_
.dim_list
.ok
)
13944 goto bad
; /* :::::::::::::::::::: */
13946 switch (ffelex_token_type (t
))
13948 case FFELEX_typeCOMMA
:
13949 ffesta_confirmed ();
13950 if (!ffesta_is_inhibited ())
13952 if (!ffestb_local_
.dimension
.started
)
13954 ffestc_R524_start (ffesta_first_kw
== FFESTR_firstVIRTUAL
);
13955 ffestb_local_
.dimension
.started
= TRUE
;
13957 ffestc_R524_item (ffesta_tokens
[1],
13958 ffestb_subrargs_
.dim_list
.dims
);
13960 ffelex_token_kill (ffesta_tokens
[1]);
13961 ffestt_dimlist_kill (ffestb_subrargs_
.dim_list
.dims
);
13962 return (ffelexHandler
) ffestb_R5244_
;
13964 case FFELEX_typeEOS
:
13965 case FFELEX_typeSEMICOLON
:
13966 ffesta_confirmed ();
13967 if (!ffesta_is_inhibited ())
13969 if (!ffestb_local_
.dimension
.started
)
13971 ffestc_R524_start (ffesta_first_kw
== FFESTR_firstVIRTUAL
);
13972 ffestb_local_
.dimension
.started
= TRUE
;
13974 ffestc_R524_item (ffesta_tokens
[1],
13975 ffestb_subrargs_
.dim_list
.dims
);
13976 ffestc_R524_finish ();
13978 ffelex_token_kill (ffesta_tokens
[1]);
13979 ffestt_dimlist_kill (ffestb_subrargs_
.dim_list
.dims
);
13980 return (ffelexHandler
) ffesta_zero (t
);
13986 bad
: /* :::::::::::::::::::: */
13987 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, ffestb_args
.R524
.badname
, t
);
13988 if (ffestb_local_
.dimension
.started
&& !ffesta_is_inhibited ())
13989 ffestc_R524_finish ();
13990 ffestt_dimlist_kill (ffestb_subrargs_
.dim_list
.dims
);
13991 ffelex_token_kill (ffesta_tokens
[1]);
13992 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
13995 /* ffestb_R5244_ -- "DIMENSION" ... COMMA
13997 return ffestb_R5244_; // to lexer
13999 Make sure we don't have EOS or SEMICOLON. */
14001 static ffelexHandler
14002 ffestb_R5244_ (ffelexToken t
)
14004 switch (ffelex_token_type (t
))
14006 case FFELEX_typeEOS
:
14007 case FFELEX_typeSEMICOLON
:
14008 if (!ffesta_is_inhibited ())
14009 ffestc_R524_finish ();
14010 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, ffestb_args
.R524
.badname
, t
);
14011 return (ffelexHandler
) ffesta_zero (t
);
14014 return (ffelexHandler
) ffestb_R5241_ (t
);
14018 /* ffestb_R547 -- Parse the COMMON statement
14020 return ffestb_R547; // to lexer
14022 Make sure the statement has a valid form for the COMMON statement. If it
14023 does, implement the statement. */
14026 ffestb_R547 (ffelexToken t
)
14029 unsigned const char *p
;
14031 ffelexHandler next
;
14033 switch (ffelex_token_type (ffesta_tokens
[0]))
14035 case FFELEX_typeNAME
:
14036 if (ffesta_first_kw
!= FFESTR_firstCOMMON
)
14037 goto bad_0
; /* :::::::::::::::::::: */
14038 switch (ffelex_token_type (t
))
14040 case FFELEX_typeCOMMA
:
14041 case FFELEX_typeCOLONCOLON
:
14042 case FFELEX_typeEOS
:
14043 case FFELEX_typeSEMICOLON
:
14044 ffesta_confirmed (); /* Error, but clearly intended. */
14045 goto bad_1
; /* :::::::::::::::::::: */
14048 goto bad_1
; /* :::::::::::::::::::: */
14050 case FFELEX_typeNAME
:
14051 case FFELEX_typeSLASH
:
14052 case FFELEX_typeCONCAT
:
14053 ffesta_confirmed ();
14054 if (!ffesta_is_inhibited ())
14055 ffestc_R547_start ();
14056 ffestb_local_
.common
.started
= TRUE
;
14057 return (ffelexHandler
) ffestb_R5471_ (t
);
14060 case FFELEX_typeNAMES
:
14061 if (ffesta_first_kw
!= FFESTR_firstCOMMON
)
14062 goto bad_0
; /* :::::::::::::::::::: */
14063 p
= ffelex_token_text (ffesta_tokens
[0]) + (i
= FFESTR_firstlCOMMON
);
14064 switch (ffelex_token_type (t
))
14067 goto bad_1
; /* :::::::::::::::::::: */
14069 case FFELEX_typeEOS
:
14070 case FFELEX_typeSEMICOLON
:
14071 case FFELEX_typeCOMMA
:
14072 case FFELEX_typeCOLONCOLON
:
14073 ffesta_confirmed ();
14076 case FFELEX_typeSLASH
:
14077 case FFELEX_typeCONCAT
:
14078 ffesta_confirmed ();
14081 if (!ffesta_is_inhibited ())
14082 ffestc_R547_start ();
14083 ffestb_local_
.common
.started
= TRUE
;
14084 return (ffelexHandler
) ffestb_R5471_ (t
);
14086 case FFELEX_typeOPEN_PAREN
:
14090 /* Here, we have at least one char after "COMMON" and t is COMMA,
14091 EOS/SEMICOLON, OPEN_PAREN, SLASH, or CONCAT. */
14093 if (!ffesrc_is_name_init (*p
))
14094 goto bad_i
; /* :::::::::::::::::::: */
14095 nt
= ffelex_token_name_from_names (ffesta_tokens
[0], i
, 0);
14096 if (ffelex_token_type (t
) == FFELEX_typeOPEN_PAREN
)
14097 ffestb_local_
.common
.started
= FALSE
;
14100 if (!ffesta_is_inhibited ())
14101 ffestc_R547_start ();
14102 ffestb_local_
.common
.started
= TRUE
;
14104 next
= (ffelexHandler
) ffestb_R5471_ (nt
);
14105 ffelex_token_kill (nt
);
14106 return (ffelexHandler
) (*next
) (t
);
14109 goto bad_0
; /* :::::::::::::::::::: */
14112 bad_0
: /* :::::::::::::::::::: */
14113 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "COMMON", ffesta_tokens
[0]);
14114 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
14116 bad_1
: /* :::::::::::::::::::: */
14117 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "COMMON", t
);
14118 return (ffelexHandler
) ffelex_swallow_tokens (t
,
14119 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
14121 bad_i
: /* :::::::::::::::::::: */
14122 ffesta_ffebad_1sp (FFEBAD_INVALID_STMT_FORM
, "COMMON", ffesta_tokens
[0], i
, t
);
14123 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
14126 /* ffestb_R5471_ -- "COMMON"
14128 return ffestb_R5471_; // to lexer
14130 Handle NAME, SLASH, or CONCAT. */
14132 static ffelexHandler
14133 ffestb_R5471_ (ffelexToken t
)
14135 switch (ffelex_token_type (t
))
14137 case FFELEX_typeNAME
:
14138 return (ffelexHandler
) ffestb_R5474_ (t
);
14140 case FFELEX_typeSLASH
:
14141 return (ffelexHandler
) ffestb_R5472_
;
14143 case FFELEX_typeCONCAT
:
14144 if (!ffesta_is_inhibited ())
14145 ffestc_R547_item_cblock (NULL
);
14146 return (ffelexHandler
) ffestb_R5474_
;
14149 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "COMMON", t
);
14153 if (!ffesta_is_inhibited ())
14154 ffestc_R547_finish ();
14155 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
14158 /* ffestb_R5472_ -- "COMMON" SLASH
14160 return ffestb_R5472_; // to lexer
14164 static ffelexHandler
14165 ffestb_R5472_ (ffelexToken t
)
14167 switch (ffelex_token_type (t
))
14169 case FFELEX_typeNAME
:
14170 ffesta_tokens
[1] = ffelex_token_use (t
);
14171 return (ffelexHandler
) ffestb_R5473_
;
14173 case FFELEX_typeSLASH
:
14174 if (!ffesta_is_inhibited ())
14175 ffestc_R547_item_cblock (NULL
);
14176 return (ffelexHandler
) ffestb_R5474_
;
14179 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "COMMON", t
);
14183 if (!ffesta_is_inhibited ())
14184 ffestc_R547_finish ();
14185 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
14188 /* ffestb_R5473_ -- "COMMON" SLASH NAME
14190 return ffestb_R5473_; // to lexer
14194 static ffelexHandler
14195 ffestb_R5473_ (ffelexToken t
)
14197 switch (ffelex_token_type (t
))
14199 case FFELEX_typeSLASH
:
14200 if (!ffesta_is_inhibited ())
14201 ffestc_R547_item_cblock (ffesta_tokens
[1]);
14202 ffelex_token_kill (ffesta_tokens
[1]);
14203 return (ffelexHandler
) ffestb_R5474_
;
14206 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "COMMON", t
);
14210 if (!ffesta_is_inhibited ())
14211 ffestc_R547_finish ();
14212 ffelex_token_kill (ffesta_tokens
[1]);
14213 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
14216 /* ffestb_R5474_ -- "COMMON" [SLASH NAME SLASH] or "COMMON" CONCAT
14218 return ffestb_R5474_; // to lexer
14222 static ffelexHandler
14223 ffestb_R5474_ (ffelexToken t
)
14225 switch (ffelex_token_type (t
))
14227 case FFELEX_typeNAME
:
14228 ffesta_tokens
[1] = ffelex_token_use (t
);
14229 return (ffelexHandler
) ffestb_R5475_
;
14232 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "COMMON", t
);
14236 if (!ffesta_is_inhibited ())
14237 ffestc_R547_finish ();
14238 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
14241 /* ffestb_R5475_ -- "COMMON" ... NAME
14243 return ffestb_R5475_; // to lexer
14245 Handle OPEN_PAREN. */
14247 static ffelexHandler
14248 ffestb_R5475_ (ffelexToken t
)
14250 switch (ffelex_token_type (t
))
14252 case FFELEX_typeOPEN_PAREN
:
14253 ffestb_subrargs_
.dim_list
.dims
= ffestt_dimlist_create ();
14254 ffestb_subrargs_
.dim_list
.handler
= (ffelexHandler
) ffestb_R5476_
;
14255 ffestb_subrargs_
.dim_list
.pool
= ffesta_output_pool
;
14256 ffestb_subrargs_
.dim_list
.ctx
= FFEEXPR_contextDIMLISTCOMMON
;
14257 #ifdef FFECOM_dimensionsMAX
14258 ffestb_subrargs_
.dim_list
.ndims
= 0;
14260 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
14261 FFEEXPR_contextDIMLISTCOMMON
, (ffeexprCallback
) ffestb_subr_dimlist_
);
14263 case FFELEX_typeCOMMA
:
14264 if (!ffesta_is_inhibited ())
14265 ffestc_R547_item_object (ffesta_tokens
[1], NULL
);
14266 ffelex_token_kill (ffesta_tokens
[1]);
14267 return (ffelexHandler
) ffestb_R5477_
;
14269 case FFELEX_typeSLASH
:
14270 case FFELEX_typeCONCAT
:
14271 if (!ffesta_is_inhibited ())
14272 ffestc_R547_item_object (ffesta_tokens
[1], NULL
);
14273 ffelex_token_kill (ffesta_tokens
[1]);
14274 return (ffelexHandler
) ffestb_R5471_ (t
);
14276 case FFELEX_typeEOS
:
14277 case FFELEX_typeSEMICOLON
:
14278 if (!ffesta_is_inhibited ())
14280 ffestc_R547_item_object (ffesta_tokens
[1], NULL
);
14281 ffestc_R547_finish ();
14283 ffelex_token_kill (ffesta_tokens
[1]);
14284 return (ffelexHandler
) ffesta_zero (t
);
14287 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "COMMON", t
);
14291 if (!ffesta_is_inhibited ())
14292 ffestc_R547_finish ();
14293 ffelex_token_kill (ffesta_tokens
[1]);
14294 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
14297 /* ffestb_R5476_ -- "COMMON" ... NAME OPEN_PAREN dimlist CLOSE_PAREN
14299 return ffestb_R5476_; // to lexer
14301 Handle COMMA, SLASH, CONCAT, EOS/SEMICOLON. */
14303 static ffelexHandler
14304 ffestb_R5476_ (ffelexToken t
)
14306 if (!ffestb_subrargs_
.dim_list
.ok
)
14307 goto bad
; /* :::::::::::::::::::: */
14309 switch (ffelex_token_type (t
))
14311 case FFELEX_typeCOMMA
:
14312 ffesta_confirmed ();
14313 if (!ffesta_is_inhibited ())
14315 if (!ffestb_local_
.common
.started
)
14317 ffestc_R547_start ();
14318 ffestb_local_
.common
.started
= TRUE
;
14320 ffestc_R547_item_object (ffesta_tokens
[1],
14321 ffestb_subrargs_
.dim_list
.dims
);
14323 ffelex_token_kill (ffesta_tokens
[1]);
14324 ffestt_dimlist_kill (ffestb_subrargs_
.dim_list
.dims
);
14325 return (ffelexHandler
) ffestb_R5477_
;
14327 case FFELEX_typeSLASH
:
14328 case FFELEX_typeCONCAT
:
14329 ffesta_confirmed ();
14330 if (!ffesta_is_inhibited ())
14332 if (!ffestb_local_
.common
.started
)
14334 ffestc_R547_start ();
14335 ffestb_local_
.common
.started
= TRUE
;
14337 ffestc_R547_item_object (ffesta_tokens
[1],
14338 ffestb_subrargs_
.dim_list
.dims
);
14340 ffelex_token_kill (ffesta_tokens
[1]);
14341 ffestt_dimlist_kill (ffestb_subrargs_
.dim_list
.dims
);
14342 return (ffelexHandler
) ffestb_R5471_ (t
);
14344 case FFELEX_typeEOS
:
14345 case FFELEX_typeSEMICOLON
:
14346 ffesta_confirmed ();
14347 if (!ffesta_is_inhibited ())
14349 if (!ffestb_local_
.common
.started
)
14350 ffestc_R547_start ();
14351 ffestc_R547_item_object (ffesta_tokens
[1],
14352 ffestb_subrargs_
.dim_list
.dims
);
14353 ffestc_R547_finish ();
14355 ffelex_token_kill (ffesta_tokens
[1]);
14356 ffestt_dimlist_kill (ffestb_subrargs_
.dim_list
.dims
);
14357 return (ffelexHandler
) ffesta_zero (t
);
14363 bad
: /* :::::::::::::::::::: */
14364 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "COMMON", t
);
14365 if (ffestb_local_
.common
.started
&& !ffesta_is_inhibited ())
14366 ffestc_R547_finish ();
14367 ffestt_dimlist_kill (ffestb_subrargs_
.dim_list
.dims
);
14368 ffelex_token_kill (ffesta_tokens
[1]);
14369 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
14372 /* ffestb_R5477_ -- "COMMON" ... COMMA
14374 return ffestb_R5477_; // to lexer
14376 Make sure we don't have EOS or SEMICOLON. */
14378 static ffelexHandler
14379 ffestb_R5477_ (ffelexToken t
)
14381 switch (ffelex_token_type (t
))
14383 case FFELEX_typeEOS
:
14384 case FFELEX_typeSEMICOLON
:
14385 if (!ffesta_is_inhibited ())
14386 ffestc_R547_finish ();
14387 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "COMMON", t
);
14388 return (ffelexHandler
) ffesta_zero (t
);
14391 return (ffelexHandler
) ffestb_R5471_ (t
);
14395 /* ffestb_R1229 -- Parse a STMTFUNCTION statement
14397 return ffestb_R1229; // to lexer
14399 Make sure the statement has a valid form for a STMTFUNCTION
14400 statement. If it does, implement the statement. */
14403 ffestb_R1229 (ffelexToken t
)
14405 switch (ffelex_token_type (ffesta_tokens
[0]))
14407 case FFELEX_typeNAME
:
14408 case FFELEX_typeNAMES
:
14412 goto bad_0
; /* :::::::::::::::::::: */
14415 switch (ffelex_token_type (t
))
14417 case FFELEX_typeOPEN_PAREN
:
14420 case FFELEX_typeEOS
:
14421 case FFELEX_typeSEMICOLON
:
14422 case FFELEX_typeCOMMA
:
14423 case FFELEX_typeCOLONCOLON
:
14424 case FFELEX_typeNAME
:
14425 ffesta_confirmed (); /* Error, but clearly intended. */
14426 goto bad_1
; /* :::::::::::::::::::: */
14429 goto bad_1
; /* :::::::::::::::::::: */
14432 ffestb_subrargs_
.name_list
.args
= ffestt_tokenlist_create ();
14433 ffestb_subrargs_
.name_list
.handler
= (ffelexHandler
) ffestb_R12291_
;
14434 ffestb_subrargs_
.name_list
.is_subr
= FALSE
; /* No "*" items in list! */
14435 ffestb_subrargs_
.name_list
.names
= TRUE
; /* In case "IF(FOO)CALL
14437 return (ffelexHandler
) ffestb_subr_name_list_
;
14439 bad_0
: /* :::::::::::::::::::: */
14440 bad_1
: /* :::::::::::::::::::: */
14441 ffesta_ffebad_2t (FFEBAD_UNREC_STMT
, ffesta_tokens
[0], t
);
14442 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
14445 /* ffestb_R12291_ -- "STMTFUNCTION" OPEN_PAREN dummy-name-list CLOSE_PAREN
14447 return ffestb_R12291_; // to lexer
14449 Make sure the statement has a valid form for a STMTFUNCTION statement. If
14450 it does, implement the statement. */
14452 static ffelexHandler
14453 ffestb_R12291_ (ffelexToken t
)
14455 ffelex_set_names (FALSE
);
14457 if (!ffestb_subrargs_
.name_list
.ok
)
14458 goto bad
; /* :::::::::::::::::::: */
14460 switch (ffelex_token_type (t
))
14462 case FFELEX_typeEQUALS
:
14463 ffesta_confirmed ();
14464 if (!ffesta_is_inhibited ())
14465 ffestc_R1229_start (ffesta_tokens
[0],
14466 ffestb_subrargs_
.name_list
.args
,
14467 ffestb_subrargs_
.name_list
.close_paren
);
14468 ffelex_token_kill (ffestb_subrargs_
.name_list
.close_paren
);
14469 ffestt_tokenlist_kill (ffestb_subrargs_
.name_list
.args
);
14470 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
14471 FFEEXPR_contextSFUNCDEF
, (ffeexprCallback
) ffestb_R12292_
);
14477 bad
: /* :::::::::::::::::::: */
14478 ffesta_ffebad_2t (FFEBAD_UNREC_STMT
, ffesta_tokens
[0], t
);
14479 ffelex_token_kill (ffestb_subrargs_
.name_list
.close_paren
);
14480 ffestt_tokenlist_kill (ffestb_subrargs_
.name_list
.args
);
14481 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
14484 /* ffestb_R12292_ -- "STMTFUNCTION" OPEN_PAREN dummy-name-list CLOSE_PAREN
14487 (ffestb_R12292_) // to expression handler
14489 Make sure the statement has a valid form for a STMTFUNCTION statement. If
14490 it does, implement the statement. */
14492 static ffelexHandler
14493 ffestb_R12292_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
14496 goto bad
; /* :::::::::::::::::::: */
14498 switch (ffelex_token_type (t
))
14500 case FFELEX_typeEOS
:
14501 case FFELEX_typeSEMICOLON
:
14502 if (!ffesta_is_inhibited ())
14503 ffestc_R1229_finish (expr
, ft
);
14504 return (ffelexHandler
) ffesta_zero (t
);
14510 bad
: /* :::::::::::::::::::: */
14511 ffestc_R1229_finish (NULL
, NULL
);
14512 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "statement-function-definition", t
);
14513 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
14516 /* ffestb_decl_chartype -- Parse the CHARACTER statement
14518 return ffestb_decl_chartype; // to lexer
14520 Make sure the statement has a valid form for the CHARACTER statement. If
14521 it does, implement the statement. */
14524 ffestb_decl_chartype (ffelexToken t
)
14527 unsigned const char *p
;
14529 ffestb_local_
.decl
.type
= FFESTP_typeCHARACTER
;
14530 ffestb_local_
.decl
.recursive
= NULL
;
14531 ffestb_local_
.decl
.parameter
= FALSE
; /* No PARAMETER attribute seen. */
14532 ffestb_local_
.decl
.coloncolon
= FALSE
; /* No COLONCOLON seen. */
14534 switch (ffelex_token_type (ffesta_tokens
[0]))
14536 case FFELEX_typeNAME
:
14537 if (ffesta_first_kw
!= FFESTR_firstCHRCTR
)
14538 goto bad_0
; /* :::::::::::::::::::: */
14539 switch (ffelex_token_type (t
))
14541 case FFELEX_typeEOS
:
14542 case FFELEX_typeSEMICOLON
:
14543 ffesta_confirmed (); /* Error, but clearly intended. */
14544 goto bad_1
; /* :::::::::::::::::::: */
14547 goto bad_1
; /* :::::::::::::::::::: */
14549 case FFELEX_typeCOMMA
:
14550 ffesta_confirmed ();
14551 if (!ffesta_is_inhibited ())
14552 ffestc_decl_start (ffestb_local_
.decl
.type
, ffesta_tokens
[0],
14553 NULL
, NULL
, NULL
, NULL
);
14554 return (ffelexHandler
) ffestb_decl_attrs_
;
14556 case FFELEX_typeCOLONCOLON
:
14557 ffestb_local_
.decl
.coloncolon
= TRUE
;
14558 ffesta_confirmed ();
14559 if (!ffesta_is_inhibited ())
14560 ffestc_decl_start (ffestb_local_
.decl
.type
, ffesta_tokens
[0],
14561 NULL
, NULL
, NULL
, NULL
);
14562 return (ffelexHandler
) ffestb_decl_ents_
;
14564 case FFELEX_typeASTERISK
:
14565 ffesta_confirmed ();
14566 ffestb_local_
.decl
.handler
= (ffelexHandler
) ffestb_decl_chartype1_
;
14567 ffestb_local_
.decl
.badname
= "TYPEDECL";
14568 return (ffelexHandler
) ffestb_decl_starlen_
;
14570 case FFELEX_typeOPEN_PAREN
:
14571 ffestb_local_
.decl
.kind
= NULL
;
14572 ffestb_local_
.decl
.kindt
= NULL
;
14573 ffestb_local_
.decl
.len
= NULL
;
14574 ffestb_local_
.decl
.lent
= NULL
;
14575 ffestb_local_
.decl
.handler
= (ffelexHandler
) ffestb_decl_attrsp_
;
14576 ffestb_local_
.decl
.badname
= "_TYPEDECL";
14577 return (ffelexHandler
) ffestb_decl_typeparams_
;
14579 case FFELEX_typeNAME
:
14580 ffesta_confirmed ();
14581 ffestb_local_
.decl
.kind
= NULL
;
14582 ffestb_local_
.decl
.kindt
= NULL
;
14583 ffestb_local_
.decl
.len
= NULL
;
14584 ffestb_local_
.decl
.lent
= NULL
;
14585 return (ffelexHandler
) ffestb_decl_entsp_ (t
);
14588 case FFELEX_typeNAMES
:
14589 if (ffesta_first_kw
!= FFESTR_firstCHRCTR
)
14590 goto bad_0
; /* :::::::::::::::::::: */
14591 p
= ffelex_token_text (ffesta_tokens
[0]) + (i
= FFESTR_firstlCHRCTR
);
14592 switch (ffelex_token_type (t
))
14595 goto bad_1
; /* :::::::::::::::::::: */
14597 case FFELEX_typeEOS
:
14598 case FFELEX_typeSEMICOLON
:
14599 ffesta_confirmed ();
14602 case FFELEX_typeCOMMA
:
14603 ffesta_confirmed ();
14606 if (!ffesta_is_inhibited ())
14607 ffestc_decl_start (ffestb_local_
.decl
.type
, ffesta_tokens
[0],
14608 NULL
, NULL
, NULL
, NULL
);
14609 return (ffelexHandler
) ffestb_decl_attrs_
;
14611 case FFELEX_typeCOLONCOLON
:
14612 ffestb_local_
.decl
.coloncolon
= TRUE
;
14613 ffesta_confirmed ();
14615 goto bad_i
; /* :::::::::::::::::::: */
14616 if (!ffesta_is_inhibited ())
14617 ffestc_decl_start (ffestb_local_
.decl
.type
, ffesta_tokens
[0],
14618 NULL
, NULL
, NULL
, NULL
);
14619 return (ffelexHandler
) ffestb_decl_ents_
;
14621 case FFELEX_typeASTERISK
:
14622 ffesta_confirmed ();
14625 ffestb_local_
.decl
.handler
= (ffelexHandler
) ffestb_decl_chartype1_
;
14626 ffestb_local_
.decl
.badname
= "TYPEDECL";
14627 return (ffelexHandler
) ffestb_decl_starlen_
;
14629 case FFELEX_typeSLASH
:
14630 ffesta_confirmed ();
14633 goto bad_1
; /* :::::::::::::::::::: */
14635 case FFELEX_typeOPEN_PAREN
:
14638 ffestb_local_
.decl
.kind
= NULL
;
14639 ffestb_local_
.decl
.kindt
= NULL
;
14640 ffestb_local_
.decl
.len
= NULL
;
14641 ffestb_local_
.decl
.lent
= NULL
;
14642 ffestb_local_
.decl
.handler
= (ffelexHandler
) ffestb_decl_attrsp_
;
14643 ffestb_local_
.decl
.badname
= "TYPEDECL";
14644 return (ffelexHandler
) ffestb_decl_typeparams_
;
14646 if (!ffesrc_is_name_init (*p
))
14647 goto bad_i
; /* :::::::::::::::::::: */
14648 ffestb_local_
.decl
.kind
= NULL
;
14649 ffestb_local_
.decl
.kindt
= NULL
;
14650 ffestb_local_
.decl
.len
= NULL
;
14651 ffestb_local_
.decl
.lent
= NULL
;
14652 ffesta_tokens
[1] = ffelex_token_names_from_names (ffesta_tokens
[0], i
, 0);
14653 return (ffelexHandler
) ffestb_decl_entsp_2_ (t
);
14656 goto bad_0
; /* :::::::::::::::::::: */
14659 bad_0
: /* :::::::::::::::::::: */
14660 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "type-declaration", ffesta_tokens
[0]);
14661 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
14663 bad_1
: /* :::::::::::::::::::: */
14664 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "type-declaration", t
);
14665 return (ffelexHandler
) ffelex_swallow_tokens (t
,
14666 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
14668 bad_i
: /* :::::::::::::::::::: */
14669 ffesta_ffebad_1sp (FFEBAD_INVALID_STMT_FORM
, "type-declaration", ffesta_tokens
[0], i
, t
);
14670 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
14673 /* ffestb_decl_chartype1_ -- "CHARACTER" ASTERISK char-length
14675 return ffestb_decl_chartype1_; // to lexer
14677 Handle COMMA, COLONCOLON, or anything else. */
14679 static ffelexHandler
14680 ffestb_decl_chartype1_ (ffelexToken t
)
14682 ffelex_set_names (FALSE
);
14684 switch (ffelex_token_type (t
))
14686 case FFELEX_typeCOLONCOLON
:
14687 ffestb_local_
.decl
.coloncolon
= TRUE
;
14688 /* Fall through. */
14689 case FFELEX_typeCOMMA
:
14690 ffesta_confirmed ();
14691 if (!ffesta_is_inhibited ())
14692 ffestc_decl_start (ffestb_local_
.decl
.type
, ffesta_tokens
[0],
14693 NULL
, NULL
, ffestb_local_
.decl
.len
, ffestb_local_
.decl
.lent
);
14694 if (ffestb_local_
.decl
.lent
!= NULL
)
14695 ffelex_token_kill (ffestb_local_
.decl
.lent
);
14696 return (ffelexHandler
) ffestb_decl_ents_
;
14699 return (ffelexHandler
) ffestb_decl_entsp_ (t
);
14703 /* ffestb_decl_dbltype -- Parse the DOUBLEPRECISION/DOUBLECOMPLEX statement
14705 return ffestb_decl_dbltype; // to lexer
14707 Make sure the statement has a valid form for the DOUBLEPRECISION/
14708 DOUBLECOMPLEX statement. If it does, implement the statement. */
14711 ffestb_decl_dbltype (ffelexToken t
)
14714 unsigned const char *p
;
14716 ffestb_local_
.decl
.type
= ffestb_args
.decl
.type
;
14717 ffestb_local_
.decl
.recursive
= NULL
;
14718 ffestb_local_
.decl
.parameter
= FALSE
; /* No PARAMETER attribute seen. */
14719 ffestb_local_
.decl
.coloncolon
= FALSE
; /* No COLONCOLON seen. */
14721 switch (ffelex_token_type (ffesta_tokens
[0]))
14723 case FFELEX_typeNAME
:
14724 switch (ffelex_token_type (t
))
14726 case FFELEX_typeEOS
:
14727 case FFELEX_typeSEMICOLON
:
14728 ffesta_confirmed (); /* Error, but clearly intended. */
14729 goto bad_1
; /* :::::::::::::::::::: */
14732 goto bad_1
; /* :::::::::::::::::::: */
14734 case FFELEX_typeCOMMA
:
14735 ffesta_confirmed ();
14736 if (!ffesta_is_inhibited ())
14737 ffestc_decl_start (ffestb_local_
.decl
.type
, ffesta_tokens
[0],
14738 NULL
, NULL
, NULL
, NULL
);
14739 return (ffelexHandler
) ffestb_decl_attrs_
;
14741 case FFELEX_typeCOLONCOLON
:
14742 ffestb_local_
.decl
.coloncolon
= TRUE
;
14743 ffesta_confirmed ();
14744 if (!ffesta_is_inhibited ())
14745 ffestc_decl_start (ffestb_local_
.decl
.type
, ffesta_tokens
[0],
14746 NULL
, NULL
, NULL
, NULL
);
14747 return (ffelexHandler
) ffestb_decl_ents_
;
14749 case FFELEX_typeNAME
:
14750 ffesta_confirmed ();
14751 ffestb_local_
.decl
.kind
= NULL
;
14752 ffestb_local_
.decl
.kindt
= NULL
;
14753 ffestb_local_
.decl
.len
= NULL
;
14754 ffestb_local_
.decl
.lent
= NULL
;
14755 return (ffelexHandler
) ffestb_decl_entsp_ (t
);
14758 case FFELEX_typeNAMES
:
14759 p
= ffelex_token_text (ffesta_tokens
[0]) + (i
= ffestb_args
.decl
.len
);
14760 switch (ffelex_token_type (t
))
14763 goto bad_1
; /* :::::::::::::::::::: */
14765 case FFELEX_typeEOS
:
14766 case FFELEX_typeSEMICOLON
:
14767 ffesta_confirmed ();
14770 case FFELEX_typeCOMMA
:
14771 ffesta_confirmed ();
14774 if (!ffesta_is_inhibited ())
14775 ffestc_decl_start (ffestb_local_
.decl
.type
, ffesta_tokens
[0],
14776 NULL
, NULL
, NULL
, NULL
);
14777 return (ffelexHandler
) ffestb_decl_attrs_
;
14779 case FFELEX_typeCOLONCOLON
:
14780 ffestb_local_
.decl
.coloncolon
= TRUE
;
14781 ffesta_confirmed ();
14783 goto bad_i
; /* :::::::::::::::::::: */
14784 if (!ffesta_is_inhibited ())
14785 ffestc_decl_start (ffestb_local_
.decl
.type
, ffesta_tokens
[0],
14786 NULL
, NULL
, NULL
, NULL
);
14787 return (ffelexHandler
) ffestb_decl_ents_
;
14789 case FFELEX_typeSLASH
:
14790 ffesta_confirmed ();
14793 goto bad_1
; /* :::::::::::::::::::: */
14795 case FFELEX_typeOPEN_PAREN
:
14798 goto bad_1
; /* :::::::::::::::::::: */
14800 if (!ffesrc_is_name_init (*p
))
14801 goto bad_i
; /* :::::::::::::::::::: */
14802 ffestb_local_
.decl
.kind
= NULL
;
14803 ffestb_local_
.decl
.kindt
= NULL
;
14804 ffestb_local_
.decl
.len
= NULL
;
14805 ffestb_local_
.decl
.lent
= NULL
;
14806 ffesta_tokens
[1] = ffelex_token_names_from_names (ffesta_tokens
[0], i
, 0);
14807 return (ffelexHandler
) ffestb_decl_entsp_2_ (t
);
14810 goto bad_0
; /* :::::::::::::::::::: */
14813 bad_0
: /* :::::::::::::::::::: */
14814 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "type-declaration", ffesta_tokens
[0]);
14815 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
14817 bad_1
: /* :::::::::::::::::::: */
14818 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "type-declaration", t
);
14819 return (ffelexHandler
) ffelex_swallow_tokens (t
,
14820 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
14822 bad_i
: /* :::::::::::::::::::: */
14823 ffesta_ffebad_1sp (FFEBAD_INVALID_STMT_FORM
, "type-declaration", ffesta_tokens
[0], i
, t
);
14824 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
14827 /* ffestb_decl_double -- Parse the DOUBLE PRECISION/DOUBLE COMPLEX statement
14829 return ffestb_decl_double; // to lexer
14831 Make sure the statement has a valid form for the DOUBLE PRECISION/
14832 DOUBLE COMPLEX statement. If it does, implement the statement. */
14835 ffestb_decl_double (ffelexToken t
)
14837 ffestb_local_
.decl
.recursive
= NULL
;
14838 ffestb_local_
.decl
.parameter
= FALSE
; /* No PARAMETER attribute seen. */
14839 ffestb_local_
.decl
.coloncolon
= FALSE
; /* No COLONCOLON seen. */
14841 switch (ffelex_token_type (ffesta_tokens
[0]))
14843 case FFELEX_typeNAME
:
14844 if (ffesta_first_kw
!= FFESTR_firstDBL
)
14845 goto bad_0
; /* :::::::::::::::::::: */
14846 switch (ffelex_token_type (t
))
14848 case FFELEX_typeEOS
:
14849 case FFELEX_typeSEMICOLON
:
14850 case FFELEX_typeCOMMA
:
14851 case FFELEX_typeCOLONCOLON
:
14852 ffesta_confirmed (); /* Error, but clearly intended. */
14853 goto bad_1
; /* :::::::::::::::::::: */
14856 goto bad_1
; /* :::::::::::::::::::: */
14858 case FFELEX_typeNAME
:
14859 ffesta_confirmed ();
14860 switch (ffestr_second (t
))
14862 case FFESTR_secondCOMPLEX
:
14863 ffestb_local_
.decl
.type
= FFESTP_typeDBLCMPLX
;
14866 case FFESTR_secondPRECISION
:
14867 ffestb_local_
.decl
.type
= FFESTP_typeDBLPRCSN
;
14871 goto bad_1
; /* :::::::::::::::::::: */
14873 ffestb_local_
.decl
.kind
= NULL
;
14874 ffestb_local_
.decl
.kindt
= NULL
;
14875 ffestb_local_
.decl
.len
= NULL
;
14876 ffestb_local_
.decl
.lent
= NULL
;
14877 return (ffelexHandler
) ffestb_decl_attrsp_
;
14881 goto bad_0
; /* :::::::::::::::::::: */
14884 bad_0
: /* :::::::::::::::::::: */
14885 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "type-declaration", ffesta_tokens
[0]);
14886 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
14888 bad_1
: /* :::::::::::::::::::: */
14889 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "type-declaration", t
);
14890 return (ffelexHandler
) ffelex_swallow_tokens (t
,
14891 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
14894 /* ffestb_decl_gentype -- Parse the INTEGER/REAL/COMPLEX/LOGICAL statement
14896 return ffestb_decl_gentype; // to lexer
14898 Make sure the statement has a valid form for the INTEGER/REAL/COMPLEX/
14899 LOGICAL statement. If it does, implement the statement. */
14902 ffestb_decl_gentype (ffelexToken t
)
14905 unsigned const char *p
;
14907 ffestb_local_
.decl
.type
= ffestb_args
.decl
.type
;
14908 ffestb_local_
.decl
.recursive
= NULL
;
14909 ffestb_local_
.decl
.parameter
= FALSE
; /* No PARAMETER attribute seen. */
14910 ffestb_local_
.decl
.coloncolon
= FALSE
; /* No COLONCOLON seen. */
14912 switch (ffelex_token_type (ffesta_tokens
[0]))
14914 case FFELEX_typeNAME
:
14915 switch (ffelex_token_type (t
))
14917 case FFELEX_typeEOS
:
14918 case FFELEX_typeSEMICOLON
:
14919 ffesta_confirmed (); /* Error, but clearly intended. */
14920 goto bad_1
; /* :::::::::::::::::::: */
14923 goto bad_1
; /* :::::::::::::::::::: */
14925 case FFELEX_typeCOMMA
:
14926 ffesta_confirmed ();
14927 if (!ffesta_is_inhibited ())
14928 ffestc_decl_start (ffestb_local_
.decl
.type
, ffesta_tokens
[0],
14929 NULL
, NULL
, NULL
, NULL
);
14930 return (ffelexHandler
) ffestb_decl_attrs_
;
14932 case FFELEX_typeCOLONCOLON
:
14933 ffestb_local_
.decl
.coloncolon
= TRUE
;
14934 ffesta_confirmed ();
14935 if (!ffesta_is_inhibited ())
14936 ffestc_decl_start (ffestb_local_
.decl
.type
, ffesta_tokens
[0],
14937 NULL
, NULL
, NULL
, NULL
);
14938 return (ffelexHandler
) ffestb_decl_ents_
;
14940 case FFELEX_typeASTERISK
:
14941 ffesta_confirmed ();
14942 ffestb_local_
.decl
.handler
= (ffelexHandler
) ffestb_decl_attrsp_
;
14943 ffestb_local_
.decl
.badname
= "TYPEDECL";
14944 return (ffelexHandler
) ffestb_decl_starkind_
;
14946 case FFELEX_typeOPEN_PAREN
:
14947 ffestb_local_
.decl
.handler
= (ffelexHandler
) ffestb_decl_attrsp_
;
14948 ffestb_local_
.decl
.badname
= "TYPEDECL";
14949 return (ffelexHandler
) ffestb_decl_kindparam_
;
14951 case FFELEX_typeNAME
:
14952 ffesta_confirmed ();
14953 ffestb_local_
.decl
.kind
= NULL
;
14954 ffestb_local_
.decl
.kindt
= NULL
;
14955 ffestb_local_
.decl
.len
= NULL
;
14956 ffestb_local_
.decl
.lent
= NULL
;
14957 return (ffelexHandler
) ffestb_decl_entsp_ (t
);
14960 case FFELEX_typeNAMES
:
14961 p
= ffelex_token_text (ffesta_tokens
[0]) + (i
= ffestb_args
.decl
.len
);
14962 switch (ffelex_token_type (t
))
14965 goto bad_1
; /* :::::::::::::::::::: */
14967 case FFELEX_typeEOS
:
14968 case FFELEX_typeSEMICOLON
:
14969 ffesta_confirmed ();
14972 case FFELEX_typeCOMMA
:
14973 ffesta_confirmed ();
14976 if (!ffesta_is_inhibited ())
14977 ffestc_decl_start (ffestb_local_
.decl
.type
, ffesta_tokens
[0],
14978 NULL
, NULL
, NULL
, NULL
);
14979 return (ffelexHandler
) ffestb_decl_attrs_
;
14981 case FFELEX_typeCOLONCOLON
:
14982 ffestb_local_
.decl
.coloncolon
= TRUE
;
14983 ffesta_confirmed ();
14985 goto bad_i
; /* :::::::::::::::::::: */
14986 if (!ffesta_is_inhibited ())
14987 ffestc_decl_start (ffestb_local_
.decl
.type
, ffesta_tokens
[0],
14988 NULL
, NULL
, NULL
, NULL
);
14989 return (ffelexHandler
) ffestb_decl_ents_
;
14991 case FFELEX_typeSLASH
:
14992 ffesta_confirmed ();
14995 goto bad_1
; /* :::::::::::::::::::: */
14997 case FFELEX_typeASTERISK
:
14998 ffesta_confirmed ();
15001 ffestb_local_
.decl
.handler
= (ffelexHandler
) ffestb_decl_attrsp_
;
15002 ffestb_local_
.decl
.badname
= "TYPEDECL";
15003 return (ffelexHandler
) ffestb_decl_starkind_
;
15005 case FFELEX_typeOPEN_PAREN
:
15008 ffestb_local_
.decl
.handler
= (ffelexHandler
) ffestb_decl_attrsp_
;
15009 ffestb_local_
.decl
.badname
= "TYPEDECL";
15010 return (ffelexHandler
) ffestb_decl_kindparam_
;
15012 if (!ffesrc_is_name_init (*p
))
15013 goto bad_i
; /* :::::::::::::::::::: */
15014 ffestb_local_
.decl
.kind
= NULL
;
15015 ffestb_local_
.decl
.kindt
= NULL
;
15016 ffestb_local_
.decl
.len
= NULL
;
15017 ffestb_local_
.decl
.lent
= NULL
;
15018 ffesta_tokens
[1] = ffelex_token_names_from_names (ffesta_tokens
[0], i
, 0);
15019 return (ffelexHandler
) ffestb_decl_entsp_2_ (t
);
15022 goto bad_0
; /* :::::::::::::::::::: */
15025 bad_0
: /* :::::::::::::::::::: */
15026 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "type-declaration", ffesta_tokens
[0]);
15027 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
15029 bad_1
: /* :::::::::::::::::::: */
15030 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "type-declaration", t
);
15031 return (ffelexHandler
) ffelex_swallow_tokens (t
,
15032 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
15034 bad_i
: /* :::::::::::::::::::: */
15035 ffesta_ffebad_1sp (FFEBAD_INVALID_STMT_FORM
, "type-declaration", ffesta_tokens
[0], i
, t
);
15036 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
15039 /* ffestb_decl_attrs_ -- "type" [type parameters] COMMA
15041 return ffestb_decl_attrs_; // to lexer
15043 Handle NAME of an attribute. */
15045 static ffelexHandler
15046 ffestb_decl_attrs_ (ffelexToken t
)
15048 switch (ffelex_token_type (t
))
15050 case FFELEX_typeNAME
:
15051 switch (ffestr_first (t
))
15053 case FFESTR_firstDIMENSION
:
15054 ffesta_tokens
[1] = ffelex_token_use (t
);
15055 return (ffelexHandler
) ffestb_decl_attrs_1_
;
15057 case FFESTR_firstEXTERNAL
:
15058 if (!ffesta_is_inhibited ())
15059 ffestc_decl_attrib (FFESTP_attribEXTERNAL
, t
,
15060 FFESTR_otherNone
, NULL
);
15061 return (ffelexHandler
) ffestb_decl_attrs_7_
;
15063 case FFESTR_firstINTRINSIC
:
15064 if (!ffesta_is_inhibited ())
15065 ffestc_decl_attrib (FFESTP_attribINTRINSIC
, t
,
15066 FFESTR_otherNone
, NULL
);
15067 return (ffelexHandler
) ffestb_decl_attrs_7_
;
15069 case FFESTR_firstPARAMETER
:
15070 ffestb_local_
.decl
.parameter
= TRUE
;
15071 if (!ffesta_is_inhibited ())
15072 ffestc_decl_attrib (FFESTP_attribPARAMETER
, t
,
15073 FFESTR_otherNone
, NULL
);
15074 return (ffelexHandler
) ffestb_decl_attrs_7_
;
15076 case FFESTR_firstSAVE
:
15077 if (!ffesta_is_inhibited ())
15078 ffestc_decl_attrib (FFESTP_attribSAVE
, t
,
15079 FFESTR_otherNone
, NULL
);
15080 return (ffelexHandler
) ffestb_decl_attrs_7_
;
15083 ffesta_ffebad_1t (FFEBAD_INVALID_TYPEDECL_ATTR
, t
);
15084 return (ffelexHandler
) ffestb_decl_attrs_7_
;
15092 if (!ffesta_is_inhibited ())
15093 ffestc_decl_finish ();
15094 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "type-declaration", t
);
15095 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
15098 /* ffestb_decl_attrs_1_ -- "type" [type parameters] ",DIMENSION"
15100 return ffestb_decl_attrs_1_; // to lexer
15102 Handle OPEN_PAREN. */
15104 static ffelexHandler
15105 ffestb_decl_attrs_1_ (ffelexToken t
)
15107 switch (ffelex_token_type (t
))
15109 case FFELEX_typeOPEN_PAREN
:
15110 ffestb_subrargs_
.dim_list
.dims
= ffestt_dimlist_create ();
15111 ffestb_subrargs_
.dim_list
.handler
= (ffelexHandler
) ffestb_decl_attrs_2_
;
15112 ffestb_subrargs_
.dim_list
.pool
= ffesta_scratch_pool
;
15113 ffestb_subrargs_
.dim_list
.ctx
= ffesta_is_entry_valid
15114 ? FFEEXPR_contextDIMLIST
: FFEEXPR_contextDIMLISTCOMMON
;
15115 #ifdef FFECOM_dimensionsMAX
15116 ffestb_subrargs_
.dim_list
.ndims
= 0;
15118 return (ffelexHandler
) ffeexpr_rhs (ffesta_scratch_pool
,
15119 ffestb_subrargs_
.dim_list
.ctx
,
15120 (ffeexprCallback
) ffestb_subr_dimlist_
);
15122 case FFELEX_typeCOMMA
:
15123 case FFELEX_typeCOLONCOLON
:
15124 ffesta_ffebad_1t (FFEBAD_INVALID_TYPEDECL_ATTR
, ffesta_tokens
[1]);
15125 ffelex_token_kill (ffesta_tokens
[1]);
15126 return (ffelexHandler
) ffestb_decl_attrs_7_ (t
);
15132 if (!ffesta_is_inhibited ())
15133 ffestc_decl_finish ();
15134 ffelex_token_kill (ffesta_tokens
[1]);
15135 ffesta_ffebad_1t (FFEBAD_INVALID_TYPEDECL_ATTR
, t
);
15136 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
15139 /* ffestb_decl_attrs_2_ -- "type" [type parameters] ",DIMENSION" OPEN_PAREN
15140 dimlist CLOSE_PAREN
15142 return ffestb_decl_attrs_2_; // to lexer
15144 Handle COMMA or COLONCOLON. */
15146 static ffelexHandler
15147 ffestb_decl_attrs_2_ (ffelexToken t
)
15149 if (!ffestb_subrargs_
.dim_list
.ok
)
15150 goto bad
; /* :::::::::::::::::::: */
15152 switch (ffelex_token_type (t
))
15154 case FFELEX_typeCOMMA
:
15155 case FFELEX_typeCOLONCOLON
:
15156 if (!ffesta_is_inhibited ())
15157 ffestc_decl_attrib (FFESTP_attribDIMENSION
, ffesta_tokens
[1],
15158 FFESTR_otherNone
, ffestb_subrargs_
.dim_list
.dims
);
15159 ffelex_token_kill (ffesta_tokens
[1]);
15160 ffestt_dimlist_kill (ffestb_subrargs_
.dim_list
.dims
);
15161 return (ffelexHandler
) ffestb_decl_attrs_7_ (t
);
15167 bad
: /* :::::::::::::::::::: */
15168 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "type-declaration", t
);
15169 if (!ffesta_is_inhibited ())
15170 ffestc_decl_finish ();
15171 ffestt_dimlist_kill (ffestb_subrargs_
.dim_list
.dims
);
15172 ffelex_token_kill (ffesta_tokens
[1]);
15173 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
15176 /* ffestb_decl_attrs_7_ -- "type" [type parameters] attribute
15178 return ffestb_decl_attrs_7_; // to lexer
15180 Handle COMMA (another attribute) or COLONCOLON (entities). */
15182 static ffelexHandler
15183 ffestb_decl_attrs_7_ (ffelexToken t
)
15185 switch (ffelex_token_type (t
))
15187 case FFELEX_typeCOMMA
:
15188 return (ffelexHandler
) ffestb_decl_attrs_
;
15190 case FFELEX_typeCOLONCOLON
:
15191 ffestb_local_
.decl
.coloncolon
= TRUE
;
15192 return (ffelexHandler
) ffestb_decl_ents_
;
15198 if (!ffesta_is_inhibited ())
15199 ffestc_decl_finish ();
15200 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "type-declaration", t
);
15201 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
15204 /* ffestb_decl_attrsp_ -- "type" [type parameters]
15206 return ffestb_decl_attrsp_; // to lexer
15208 Handle COMMA (meaning we have attributes), COLONCOLON (meaning we have
15209 no attributes but entities), or go to entsp to see about functions or
15212 static ffelexHandler
15213 ffestb_decl_attrsp_ (ffelexToken t
)
15215 ffelex_set_names (FALSE
);
15217 switch (ffelex_token_type (t
))
15219 case FFELEX_typeCOMMA
:
15220 ffesta_confirmed ();
15221 if (!ffesta_is_inhibited ())
15222 ffestc_decl_start (ffestb_local_
.decl
.type
, ffesta_tokens
[0],
15223 ffestb_local_
.decl
.kind
, ffestb_local_
.decl
.kindt
,
15224 ffestb_local_
.decl
.len
, ffestb_local_
.decl
.lent
);
15225 if (ffestb_local_
.decl
.kindt
!= NULL
)
15226 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
15227 if (ffestb_local_
.decl
.lent
!= NULL
)
15228 ffelex_token_kill (ffestb_local_
.decl
.lent
);
15229 return (ffelexHandler
) ffestb_decl_attrs_
;
15231 case FFELEX_typeCOLONCOLON
:
15232 ffestb_local_
.decl
.coloncolon
= TRUE
;
15233 ffesta_confirmed ();
15234 if (!ffesta_is_inhibited ())
15235 ffestc_decl_start (ffestb_local_
.decl
.type
, ffesta_tokens
[0],
15236 ffestb_local_
.decl
.kind
, ffestb_local_
.decl
.kindt
,
15237 ffestb_local_
.decl
.len
, ffestb_local_
.decl
.lent
);
15238 if (ffestb_local_
.decl
.kindt
!= NULL
)
15239 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
15240 if (ffestb_local_
.decl
.lent
!= NULL
)
15241 ffelex_token_kill (ffestb_local_
.decl
.lent
);
15242 return (ffelexHandler
) ffestb_decl_ents_
;
15245 return (ffelexHandler
) ffestb_decl_entsp_ (t
);
15249 /* ffestb_decl_ents_ -- "type" [type parameters] [attributes "::"]
15251 return ffestb_decl_ents_; // to lexer
15253 Handle NAME of an entity. */
15255 static ffelexHandler
15256 ffestb_decl_ents_ (ffelexToken t
)
15258 switch (ffelex_token_type (t
))
15260 case FFELEX_typeNAME
:
15261 ffesta_tokens
[1] = ffelex_token_use (t
);
15262 return (ffelexHandler
) ffestb_decl_ents_1_
;
15268 if (!ffesta_is_inhibited ())
15269 ffestc_decl_finish ();
15270 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "type-declaration", t
);
15271 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
15274 /* ffestb_decl_ents_1_ -- "type" [type parameters] [attributes "::"] NAME
15276 return ffestb_decl_ents_1_; // to lexer
15278 Handle ASTERISK, OPEN_PAREN, EQUALS, SLASH, COMMA, or EOS/SEMICOLON. */
15280 static ffelexHandler
15281 ffestb_decl_ents_1_ (ffelexToken t
)
15283 switch (ffelex_token_type (t
))
15285 case FFELEX_typeCOMMA
:
15286 if (!ffesta_is_inhibited ())
15287 ffestc_decl_item (ffesta_tokens
[1], NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
15289 ffelex_token_kill (ffesta_tokens
[1]);
15290 return (ffelexHandler
) ffestb_decl_ents_
;
15292 case FFELEX_typeEOS
:
15293 case FFELEX_typeSEMICOLON
:
15294 if (!ffesta_is_inhibited ())
15296 ffestc_decl_item (ffesta_tokens
[1], NULL
, NULL
, NULL
, NULL
, NULL
, NULL
,
15298 ffestc_decl_finish ();
15300 ffelex_token_kill (ffesta_tokens
[1]);
15301 return (ffelexHandler
) ffesta_zero (t
);
15303 case FFELEX_typeASTERISK
:
15304 ffestb_local_
.decl
.len
= NULL
;
15305 ffestb_local_
.decl
.lent
= NULL
;
15306 return (ffelexHandler
) ffestb_decl_ents_2_
;
15308 case FFELEX_typeOPEN_PAREN
:
15309 ffestb_local_
.decl
.kind
= NULL
;
15310 ffestb_local_
.decl
.kindt
= NULL
;
15311 ffestb_local_
.decl
.len
= NULL
;
15312 ffestb_local_
.decl
.lent
= NULL
;
15313 return (ffelexHandler
) ffestb_decl_ents_3_ (t
);
15315 case FFELEX_typeEQUALS
:
15316 case FFELEX_typeSLASH
:
15317 ffestb_local_
.decl
.kind
= NULL
;
15318 ffestb_local_
.decl
.kindt
= NULL
;
15319 ffestb_subrargs_
.dim_list
.dims
= NULL
;
15320 ffestb_local_
.decl
.len
= NULL
;
15321 ffestb_local_
.decl
.lent
= NULL
;
15322 return (ffelexHandler
) ffestb_decl_ents_7_ (t
);
15328 if (!ffesta_is_inhibited ())
15329 ffestc_decl_finish ();
15330 ffelex_token_kill (ffesta_tokens
[1]);
15331 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "type-declaration", t
);
15332 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
15335 /* ffestb_decl_ents_2_ -- "type" [type parameters] [attributes "::"] NAME
15338 return ffestb_decl_ents_2_; // to lexer
15340 Handle NUMBER or OPEN_PAREN. */
15342 static ffelexHandler
15343 ffestb_decl_ents_2_ (ffelexToken t
)
15345 switch (ffelex_token_type (t
))
15347 case FFELEX_typeNUMBER
:
15348 if (ffestb_local_
.decl
.type
!= FFESTP_typeCHARACTER
)
15350 ffestb_local_
.decl
.kind
= NULL
;
15351 ffestb_local_
.decl
.kindt
= ffelex_token_use (t
);
15352 return (ffelexHandler
) ffestb_decl_ents_3_
;
15354 /* Fall through. *//* (CHARACTER's *n is always a len spec. */
15355 case FFELEX_typeOPEN_PAREN
:/* "*(" is after the (omitted)
15357 ffestb_local_
.decl
.kind
= NULL
;
15358 ffestb_local_
.decl
.kindt
= NULL
;
15359 ffestb_subrargs_
.dim_list
.dims
= NULL
;
15360 return (ffelexHandler
) ffestb_decl_ents_5_ (t
);
15366 if (!ffesta_is_inhibited ())
15367 ffestc_decl_finish ();
15368 ffelex_token_kill (ffesta_tokens
[1]);
15369 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "type-declaration", t
);
15370 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
15373 /* ffestb_decl_ents_3_ -- "type" [type parameters] [attributes "::"] NAME
15376 return ffestb_decl_ents_3_; // to lexer
15378 Handle ASTERISK, OPEN_PAREN, EQUALS, SLASH, COMMA, or EOS/SEMICOLON. */
15380 static ffelexHandler
15381 ffestb_decl_ents_3_ (ffelexToken t
)
15383 switch (ffelex_token_type (t
))
15385 case FFELEX_typeCOMMA
:
15386 if (!ffesta_is_inhibited ())
15387 ffestc_decl_item (ffesta_tokens
[1], ffestb_local_
.decl
.kind
,
15388 ffestb_local_
.decl
.kindt
, NULL
, NULL
, NULL
, NULL
, NULL
, FALSE
);
15389 ffelex_token_kill (ffesta_tokens
[1]);
15390 if (ffestb_local_
.decl
.kindt
!= NULL
)
15391 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
15392 return (ffelexHandler
) ffestb_decl_ents_
;
15394 case FFELEX_typeEOS
:
15395 case FFELEX_typeSEMICOLON
:
15396 if (!ffesta_is_inhibited ())
15398 ffestc_decl_item (ffesta_tokens
[1], ffestb_local_
.decl
.kind
,
15399 ffestb_local_
.decl
.kindt
, NULL
, NULL
, NULL
, NULL
, NULL
, FALSE
);
15400 ffestc_decl_finish ();
15402 ffelex_token_kill (ffesta_tokens
[1]);
15403 if (ffestb_local_
.decl
.kindt
!= NULL
)
15404 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
15405 return (ffelexHandler
) ffesta_zero (t
);
15407 case FFELEX_typeASTERISK
:
15408 ffestb_subrargs_
.dim_list
.dims
= NULL
;
15409 return (ffelexHandler
) ffestb_decl_ents_5_
;
15411 case FFELEX_typeOPEN_PAREN
:
15412 ffestb_subrargs_
.dim_list
.dims
= ffestt_dimlist_create ();
15413 ffestb_subrargs_
.dim_list
.handler
= (ffelexHandler
) ffestb_decl_ents_4_
;
15414 ffestb_subrargs_
.dim_list
.pool
= ffesta_output_pool
;
15415 ffestb_subrargs_
.dim_list
.ctx
= ffesta_is_entry_valid
15416 ? FFEEXPR_contextDIMLIST
: FFEEXPR_contextDIMLISTCOMMON
;
15417 #ifdef FFECOM_dimensionsMAX
15418 ffestb_subrargs_
.dim_list
.ndims
= 0;
15420 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
15421 ffestb_subrargs_
.dim_list
.ctx
,
15422 (ffeexprCallback
) ffestb_subr_dimlist_
);
15424 case FFELEX_typeEQUALS
:
15425 case FFELEX_typeSLASH
:
15426 ffestb_local_
.decl
.kind
= NULL
;
15427 ffestb_local_
.decl
.kindt
= NULL
;
15428 ffestb_subrargs_
.dim_list
.dims
= NULL
;
15429 ffestb_local_
.decl
.len
= NULL
;
15430 ffestb_local_
.decl
.lent
= NULL
;
15431 return (ffelexHandler
) ffestb_decl_ents_7_ (t
);
15437 if (!ffesta_is_inhibited ())
15438 ffestc_decl_finish ();
15439 ffelex_token_kill (ffesta_tokens
[1]);
15440 if (ffestb_local_
.decl
.kindt
!= NULL
)
15441 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
15442 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "type-declaration", t
);
15443 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
15446 /* ffestb_decl_ents_4_ -- "type" [type parameters] [attributes "::"] NAME
15447 [ASTERISK NUMBER] [OPEN_PAREN dimlist CLOSE_PAREN]
15449 return ffestb_decl_ents_4_; // to lexer
15451 Handle ASTERISK, EQUALS, SLASH, COMMA, or EOS/SEMICOLON. */
15453 static ffelexHandler
15454 ffestb_decl_ents_4_ (ffelexToken t
)
15458 if (!ffestb_subrargs_
.dim_list
.ok
)
15459 goto bad
; /* :::::::::::::::::::: */
15461 if (ffelex_token_type (ffesta_tokens
[1]) == FFELEX_typeNAMES
)
15463 switch (ffelex_token_type (t
))
15465 case FFELEX_typeCOMMA
:
15466 case FFELEX_typeEOS
:
15467 case FFELEX_typeSEMICOLON
:
15468 case FFELEX_typeASTERISK
:
15469 case FFELEX_typeSLASH
: /* But NOT FFELEX_typeEQUALS. */
15470 case FFELEX_typeCOLONCOLON
: /* Actually an error. */
15471 break; /* Confirm and handle. */
15473 default: /* Perhaps EQUALS, as in
15474 INTEGERFUNCTIONX(A)=B. */
15475 goto bad
; /* :::::::::::::::::::: */
15477 ffesta_confirmed ();
15478 if (!ffesta_is_inhibited ())
15480 nt
= ffelex_token_name_from_names (ffesta_tokens
[1], 0, 0);
15481 ffelex_token_kill (ffesta_tokens
[1]);
15482 ffesta_tokens
[1] = nt
;
15483 ffestc_decl_start (ffestb_local_
.decl
.type
, ffesta_tokens
[0],
15484 NULL
, NULL
, NULL
, NULL
);
15488 switch (ffelex_token_type (t
))
15490 case FFELEX_typeCOMMA
:
15491 if (!ffesta_is_inhibited ())
15492 ffestc_decl_item (ffesta_tokens
[1], ffestb_local_
.decl
.kind
,
15493 ffestb_local_
.decl
.kindt
, ffestb_subrargs_
.dim_list
.dims
,
15494 ffestb_local_
.decl
.len
, ffestb_local_
.decl
.lent
, NULL
, NULL
,
15496 ffelex_token_kill (ffesta_tokens
[1]);
15497 if (ffestb_local_
.decl
.kindt
!= NULL
)
15498 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
15499 if (ffestb_local_
.decl
.lent
!= NULL
)
15500 ffelex_token_kill (ffestb_local_
.decl
.lent
);
15501 ffestt_dimlist_kill (ffestb_subrargs_
.dim_list
.dims
);
15502 return (ffelexHandler
) ffestb_decl_ents_
;
15504 case FFELEX_typeEOS
:
15505 case FFELEX_typeSEMICOLON
:
15506 if (!ffesta_is_inhibited ())
15508 ffestc_decl_item (ffesta_tokens
[1], ffestb_local_
.decl
.kind
,
15509 ffestb_local_
.decl
.kindt
, ffestb_subrargs_
.dim_list
.dims
,
15510 ffestb_local_
.decl
.len
, ffestb_local_
.decl
.lent
, NULL
, NULL
,
15512 ffestc_decl_finish ();
15514 ffelex_token_kill (ffesta_tokens
[1]);
15515 if (ffestb_local_
.decl
.kindt
!= NULL
)
15516 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
15517 if (ffestb_local_
.decl
.lent
!= NULL
)
15518 ffelex_token_kill (ffestb_local_
.decl
.lent
);
15519 ffestt_dimlist_kill (ffestb_subrargs_
.dim_list
.dims
);
15520 return (ffelexHandler
) ffesta_zero (t
);
15522 case FFELEX_typeASTERISK
:
15523 if (ffestb_local_
.decl
.lent
!= NULL
)
15524 break; /* Can't specify "*length" twice. */
15525 return (ffelexHandler
) ffestb_decl_ents_5_
;
15527 case FFELEX_typeEQUALS
:
15528 case FFELEX_typeSLASH
:
15529 return (ffelexHandler
) ffestb_decl_ents_7_ (t
);
15535 bad
: /* :::::::::::::::::::: */
15536 if ((ffelex_token_type (ffesta_tokens
[1]) != FFELEX_typeNAMES
)
15537 && !ffesta_is_inhibited ())
15538 ffestc_decl_finish ();
15539 ffelex_token_kill (ffesta_tokens
[1]);
15540 if (ffestb_local_
.decl
.kindt
!= NULL
)
15541 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
15542 if (ffestb_local_
.decl
.lent
!= NULL
)
15543 ffelex_token_kill (ffestb_local_
.decl
.lent
);
15544 ffestt_dimlist_kill (ffestb_subrargs_
.dim_list
.dims
);
15545 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "type-declaration", t
);
15546 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
15549 /* ffestb_decl_ents_5_ -- "type" [type parameters] [attributes "::"] NAME
15550 [ASTERISK NUMBER] [OPEN_PAREN dimlist CLOSE_PAREN]
15553 return ffestb_decl_ents_5_; // to lexer
15555 Handle NUMBER or OPEN_PAREN. */
15557 static ffelexHandler
15558 ffestb_decl_ents_5_ (ffelexToken t
)
15560 switch (ffelex_token_type (t
))
15562 case FFELEX_typeNUMBER
:
15563 ffestb_local_
.decl
.len
= NULL
;
15564 ffestb_local_
.decl
.lent
= ffelex_token_use (t
);
15565 return (ffelexHandler
) ffestb_decl_ents_7_
;
15567 case FFELEX_typeOPEN_PAREN
:
15568 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
15569 FFEEXPR_contextCHARACTERSIZE
, (ffeexprCallback
) ffestb_decl_ents_6_
);
15575 if (!ffesta_is_inhibited ())
15576 ffestc_decl_finish ();
15577 ffelex_token_kill (ffesta_tokens
[1]);
15578 if (ffestb_local_
.decl
.kindt
!= NULL
)
15579 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
15580 if (ffestb_subrargs_
.dim_list
.dims
!= NULL
)
15581 ffestt_dimlist_kill (ffestb_subrargs_
.dim_list
.dims
);
15582 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "type-declaration", t
);
15583 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
15586 /* ffestb_decl_ents_6_ -- "type" [type parameters] [attributes "::"] NAME
15587 [ASTERISK NUMBER] [OPEN_PAREN dimlist CLOSE_PAREN]
15588 ASTERISK OPEN_PAREN expr
15590 (ffestb_decl_ents_6_) // to expression handler
15592 Handle CLOSE_PAREN. */
15594 static ffelexHandler
15595 ffestb_decl_ents_6_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
15597 switch (ffelex_token_type (t
))
15599 case FFELEX_typeCLOSE_PAREN
:
15602 ffestb_local_
.decl
.len
= expr
;
15603 ffestb_local_
.decl
.lent
= ffelex_token_use (ft
);
15604 return (ffelexHandler
) ffestb_decl_ents_7_
;
15610 if (!ffesta_is_inhibited ())
15611 ffestc_decl_finish ();
15612 ffelex_token_kill (ffesta_tokens
[1]);
15613 if (ffestb_local_
.decl
.kindt
!= NULL
)
15614 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
15615 if (ffestb_subrargs_
.dim_list
.dims
!= NULL
)
15616 ffestt_dimlist_kill (ffestb_subrargs_
.dim_list
.dims
);
15617 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "type-declaration", t
);
15618 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
15621 /* ffestb_decl_ents_7_ -- "type" [type parameters] [attributes "::"] NAME
15622 [ASTERISK NUMBER] [OPEN_PAREN dimlist CLOSE_PAREN]
15623 [ASTERISK charlength]
15625 return ffestb_decl_ents_7_; // to lexer
15627 Handle EQUALS, SLASH, COMMA, or EOS/SEMICOLON. */
15629 static ffelexHandler
15630 ffestb_decl_ents_7_ (ffelexToken t
)
15632 switch (ffelex_token_type (t
))
15634 case FFELEX_typeCOMMA
:
15635 if (!ffesta_is_inhibited ())
15636 ffestc_decl_item (ffesta_tokens
[1], ffestb_local_
.decl
.kind
,
15637 ffestb_local_
.decl
.kindt
, ffestb_subrargs_
.dim_list
.dims
,
15638 ffestb_local_
.decl
.len
, ffestb_local_
.decl
.lent
, NULL
, NULL
,
15640 ffelex_token_kill (ffesta_tokens
[1]);
15641 if (ffestb_local_
.decl
.kindt
!= NULL
)
15642 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
15643 if (ffestb_subrargs_
.dim_list
.dims
!= NULL
)
15644 ffestt_dimlist_kill (ffestb_subrargs_
.dim_list
.dims
);
15645 if (ffestb_local_
.decl
.lent
!= NULL
)
15646 ffelex_token_kill (ffestb_local_
.decl
.lent
);
15647 return (ffelexHandler
) ffestb_decl_ents_
;
15649 case FFELEX_typeEOS
:
15650 case FFELEX_typeSEMICOLON
:
15651 if (!ffesta_is_inhibited ())
15653 ffestc_decl_item (ffesta_tokens
[1], ffestb_local_
.decl
.kind
,
15654 ffestb_local_
.decl
.kindt
, ffestb_subrargs_
.dim_list
.dims
,
15655 ffestb_local_
.decl
.len
, ffestb_local_
.decl
.lent
, NULL
, NULL
,
15657 ffestc_decl_finish ();
15659 ffelex_token_kill (ffesta_tokens
[1]);
15660 if (ffestb_local_
.decl
.kindt
!= NULL
)
15661 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
15662 if (ffestb_subrargs_
.dim_list
.dims
!= NULL
)
15663 ffestt_dimlist_kill (ffestb_subrargs_
.dim_list
.dims
);
15664 if (ffestb_local_
.decl
.lent
!= NULL
)
15665 ffelex_token_kill (ffestb_local_
.decl
.lent
);
15666 return (ffelexHandler
) ffesta_zero (t
);
15668 case FFELEX_typeEQUALS
:
15669 if (!ffestb_local_
.decl
.coloncolon
)
15670 ffesta_ffebad_1t (FFEBAD_INVALID_TYPEDECL_INIT
, t
);
15671 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
15672 ffestb_local_
.decl
.parameter
? FFEEXPR_contextPARAMETER
15673 : FFEEXPR_contextINITVAL
, (ffeexprCallback
) ffestb_decl_ents_8_
);
15675 case FFELEX_typeSLASH
:
15676 if (!ffesta_is_inhibited ())
15678 ffestc_decl_item (ffesta_tokens
[1], ffestb_local_
.decl
.kind
,
15679 ffestb_local_
.decl
.kindt
, ffestb_subrargs_
.dim_list
.dims
,
15680 ffestb_local_
.decl
.len
, ffestb_local_
.decl
.lent
, NULL
, NULL
,
15682 ffestc_decl_itemstartvals ();
15684 ffelex_token_kill (ffesta_tokens
[1]);
15685 if (ffestb_local_
.decl
.kindt
!= NULL
)
15686 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
15687 if (ffestb_subrargs_
.dim_list
.dims
!= NULL
)
15688 ffestt_dimlist_kill (ffestb_subrargs_
.dim_list
.dims
);
15689 if (ffestb_local_
.decl
.lent
!= NULL
)
15690 ffelex_token_kill (ffestb_local_
.decl
.lent
);
15691 return (ffelexHandler
) ffeexpr_rhs
15692 (ffesta_output_pool
, FFEEXPR_contextDATA
,
15693 (ffeexprCallback
) ffestb_decl_ents_9_
);
15699 if (!ffesta_is_inhibited ())
15700 ffestc_decl_finish ();
15701 ffelex_token_kill (ffesta_tokens
[1]);
15702 if (ffestb_local_
.decl
.kindt
!= NULL
)
15703 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
15704 if (ffestb_subrargs_
.dim_list
.dims
!= NULL
)
15705 ffestt_dimlist_kill (ffestb_subrargs_
.dim_list
.dims
);
15706 if (ffestb_local_
.decl
.lent
!= NULL
)
15707 ffelex_token_kill (ffestb_local_
.decl
.lent
);
15708 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "type-declaration", t
);
15709 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
15712 /* ffestb_decl_ents_8_ -- "type" [type parameters] [attributes "::"] NAME
15713 [ASTERISK NUMBER] [OPEN_PAREN dimlist CLOSE_PAREN]
15714 [ASTERISK charlength] EQUALS expr
15716 (ffestb_decl_ents_8_) // to expression handler
15718 Handle COMMA or EOS/SEMICOLON. */
15720 static ffelexHandler
15721 ffestb_decl_ents_8_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
15723 switch (ffelex_token_type (t
))
15725 case FFELEX_typeCOMMA
:
15728 if (!ffesta_is_inhibited ())
15729 ffestc_decl_item (ffesta_tokens
[1], ffestb_local_
.decl
.kind
,
15730 ffestb_local_
.decl
.kindt
, ffestb_subrargs_
.dim_list
.dims
,
15731 ffestb_local_
.decl
.len
, ffestb_local_
.decl
.lent
, expr
, ft
,
15733 ffelex_token_kill (ffesta_tokens
[1]);
15734 if (ffestb_local_
.decl
.kindt
!= NULL
)
15735 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
15736 if (ffestb_subrargs_
.dim_list
.dims
!= NULL
)
15737 ffestt_dimlist_kill (ffestb_subrargs_
.dim_list
.dims
);
15738 if (ffestb_local_
.decl
.lent
!= NULL
)
15739 ffelex_token_kill (ffestb_local_
.decl
.lent
);
15740 return (ffelexHandler
) ffestb_decl_ents_
;
15742 case FFELEX_typeEOS
:
15743 case FFELEX_typeSEMICOLON
:
15744 if (!ffesta_is_inhibited ())
15746 ffestc_decl_item (ffesta_tokens
[1], ffestb_local_
.decl
.kind
,
15747 ffestb_local_
.decl
.kindt
, ffestb_subrargs_
.dim_list
.dims
,
15748 ffestb_local_
.decl
.len
, ffestb_local_
.decl
.lent
, expr
, ft
,
15750 ffestc_decl_finish ();
15752 ffelex_token_kill (ffesta_tokens
[1]);
15753 if (ffestb_local_
.decl
.kindt
!= NULL
)
15754 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
15755 if (ffestb_subrargs_
.dim_list
.dims
!= NULL
)
15756 ffestt_dimlist_kill (ffestb_subrargs_
.dim_list
.dims
);
15757 if (ffestb_local_
.decl
.lent
!= NULL
)
15758 ffelex_token_kill (ffestb_local_
.decl
.lent
);
15759 return (ffelexHandler
) ffesta_zero (t
);
15765 if (!ffesta_is_inhibited ())
15766 ffestc_decl_finish ();
15767 ffelex_token_kill (ffesta_tokens
[1]);
15768 if (ffestb_local_
.decl
.kindt
!= NULL
)
15769 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
15770 if (ffestb_subrargs_
.dim_list
.dims
!= NULL
)
15771 ffestt_dimlist_kill (ffestb_subrargs_
.dim_list
.dims
);
15772 if (ffestb_local_
.decl
.lent
!= NULL
)
15773 ffelex_token_kill (ffestb_local_
.decl
.lent
);
15774 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "type-declaration", t
);
15775 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
15778 /* ffestb_decl_ents_9_ -- "type" ... SLASH expr
15780 (ffestb_decl_ents_9_) // to expression handler
15782 Handle ASTERISK, COMMA, or SLASH. */
15784 static ffelexHandler
15785 ffestb_decl_ents_9_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
15787 switch (ffelex_token_type (t
))
15789 case FFELEX_typeCOMMA
:
15792 if (!ffesta_is_inhibited ())
15793 ffestc_decl_itemvalue (NULL
, NULL
, expr
, ft
);
15794 return (ffelexHandler
) ffeexpr_rhs
15795 (ffesta_output_pool
, FFEEXPR_contextDATA
,
15796 (ffeexprCallback
) ffestb_decl_ents_9_
);
15798 case FFELEX_typeASTERISK
:
15801 ffestb_local_
.decl
.expr
= expr
;
15802 ffesta_tokens
[1] = ffelex_token_use (ft
);
15803 return (ffelexHandler
) ffeexpr_rhs
15804 (ffesta_output_pool
, FFEEXPR_contextDATA
,
15805 (ffeexprCallback
) ffestb_decl_ents_10_
);
15807 case FFELEX_typeSLASH
:
15810 if (!ffesta_is_inhibited ())
15812 ffestc_decl_itemvalue (NULL
, NULL
, expr
, ft
);
15813 ffestc_decl_itemendvals (t
);
15815 return (ffelexHandler
) ffestb_decl_ents_11_
;
15818 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "type-declaration", t
);
15822 if (!ffesta_is_inhibited ())
15824 ffestc_decl_itemendvals (t
);
15825 ffestc_decl_finish ();
15827 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
15830 /* ffestb_decl_ents_10_ -- "type" ... SLASH expr ASTERISK expr
15832 (ffestb_decl_ents_10_) // to expression handler
15834 Handle COMMA or SLASH. */
15836 static ffelexHandler
15837 ffestb_decl_ents_10_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
15839 switch (ffelex_token_type (t
))
15841 case FFELEX_typeCOMMA
:
15844 if (!ffesta_is_inhibited ())
15845 ffestc_decl_itemvalue (ffestb_local_
.decl
.expr
, ffesta_tokens
[1],
15847 ffelex_token_kill (ffesta_tokens
[1]);
15848 return (ffelexHandler
) ffeexpr_rhs
15849 (ffesta_output_pool
, FFEEXPR_contextDATA
,
15850 (ffeexprCallback
) ffestb_decl_ents_9_
);
15852 case FFELEX_typeSLASH
:
15855 if (!ffesta_is_inhibited ())
15857 ffestc_decl_itemvalue (ffestb_local_
.decl
.expr
, ffesta_tokens
[1],
15859 ffestc_decl_itemendvals (t
);
15861 ffelex_token_kill (ffesta_tokens
[1]);
15862 return (ffelexHandler
) ffestb_decl_ents_11_
;
15865 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "type-declaration", t
);
15869 if (!ffesta_is_inhibited ())
15871 ffestc_decl_itemendvals (t
);
15872 ffestc_decl_finish ();
15874 ffelex_token_kill (ffesta_tokens
[1]);
15875 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
15878 /* ffestb_decl_ents_11_ -- "type" [type parameters] [attributes "::"] NAME
15879 [ASTERISK NUMBER] [OPEN_PAREN dimlist CLOSE_PAREN]
15880 [ASTERISK charlength] SLASH initvals SLASH
15882 return ffestb_decl_ents_11_; // to lexer
15884 Handle COMMA or EOS/SEMICOLON. */
15886 static ffelexHandler
15887 ffestb_decl_ents_11_ (ffelexToken t
)
15889 switch (ffelex_token_type (t
))
15891 case FFELEX_typeCOMMA
:
15892 return (ffelexHandler
) ffestb_decl_ents_
;
15894 case FFELEX_typeEOS
:
15895 case FFELEX_typeSEMICOLON
:
15896 if (!ffesta_is_inhibited ())
15897 ffestc_decl_finish ();
15898 return (ffelexHandler
) ffesta_zero (t
);
15904 if (!ffesta_is_inhibited ())
15905 ffestc_decl_finish ();
15906 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "type-declaration", t
);
15907 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
15910 /* ffestb_decl_entsp_ -- "type" [type parameters]
15912 return ffestb_decl_entsp_; // to lexer
15914 Handle NAME or NAMES beginning either an entity (object) declaration or
15915 a function definition.. */
15917 static ffelexHandler
15918 ffestb_decl_entsp_ (ffelexToken t
)
15920 switch (ffelex_token_type (t
))
15922 case FFELEX_typeNAME
:
15923 ffesta_confirmed ();
15924 ffesta_tokens
[1] = ffelex_token_use (t
);
15925 return (ffelexHandler
) ffestb_decl_entsp_1_
;
15927 case FFELEX_typeNAMES
:
15928 ffesta_confirmed ();
15929 ffesta_tokens
[1] = ffelex_token_use (t
);
15930 return (ffelexHandler
) ffestb_decl_entsp_2_
;
15936 if (ffestb_local_
.decl
.kindt
!= NULL
)
15937 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
15938 if (ffestb_local_
.decl
.lent
!= NULL
)
15939 ffelex_token_kill (ffestb_local_
.decl
.lent
);
15940 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "type-declaration", t
);
15941 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
15944 /* ffestb_decl_entsp_1_ -- "type" [type parameters] NAME
15946 return ffestb_decl_entsp_1_; // to lexer
15948 If we get another NAME token here, then the previous one must be
15949 "RECURSIVE" or "FUNCTION" and we handle it accordingly. Otherwise,
15950 we send the previous and current token through to _ents_. */
15952 static ffelexHandler
15953 ffestb_decl_entsp_1_ (ffelexToken t
)
15955 switch (ffelex_token_type (t
))
15957 case FFELEX_typeNAME
:
15958 switch (ffestr_first (ffesta_tokens
[1]))
15960 case FFESTR_firstFUNCTION
:
15961 ffelex_token_kill (ffesta_tokens
[1]);
15962 return (ffelexHandler
) ffestb_decl_funcname_ (t
);
15965 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "FUNCTION", ffesta_tokens
[1]);
15971 if ((ffelex_token_type (ffesta_tokens
[1]) != FFELEX_typeNAMES
)
15972 && !ffesta_is_inhibited ())
15973 ffestc_decl_start (ffestb_local_
.decl
.type
, ffesta_tokens
[0],
15974 ffestb_local_
.decl
.kind
, ffestb_local_
.decl
.kindt
,
15975 ffestb_local_
.decl
.len
, ffestb_local_
.decl
.lent
);
15976 if (ffestb_local_
.decl
.kindt
!= NULL
)
15977 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
15978 if (ffestb_local_
.decl
.lent
!= NULL
)
15979 ffelex_token_kill (ffestb_local_
.decl
.lent
);
15980 /* NAME/NAMES token already in ffesta_tokens[1]. */
15981 return (ffelexHandler
) ffestb_decl_ents_1_ (t
);
15984 if (ffestb_local_
.decl
.kindt
!= NULL
)
15985 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
15986 if (ffestb_local_
.decl
.lent
!= NULL
)
15987 ffelex_token_kill (ffestb_local_
.decl
.lent
);
15988 ffelex_token_kill (ffesta_tokens
[1]);
15989 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
15992 /* ffestb_decl_entsp_2_ -- "type" [type parameters] NAMES
15994 return ffestb_decl_entsp_2_; // to lexer
15996 If we get an ASTERISK or OPEN_PAREN here, then if the previous NAMES
15997 begins with "FUNCTION" or "RECURSIVEFUNCTION" and is followed by a
15998 first-name-char, we have a possible syntactically ambiguous situation.
15999 Otherwise, we have a straightforward situation just as if we went
16000 through _entsp_1_ instead of here. */
16002 static ffelexHandler
16003 ffestb_decl_entsp_2_ (ffelexToken t
)
16007 unsigned const char *p
;
16010 switch (ffelex_token_type (t
))
16012 case FFELEX_typeASTERISK
:
16013 ffesta_confirmed ();
16014 switch (ffestb_local_
.decl
.type
)
16016 case FFESTP_typeINTEGER
:
16017 case FFESTP_typeREAL
:
16018 case FFESTP_typeCOMPLEX
:
16019 case FFESTP_typeLOGICAL
:
16020 asterisk_ok
= (ffestb_local_
.decl
.kindt
== NULL
);
16023 case FFESTP_typeCHARACTER
:
16024 asterisk_ok
= (ffestb_local_
.decl
.lent
== NULL
);
16027 case FFESTP_typeBYTE
:
16028 case FFESTP_typeWORD
:
16030 asterisk_ok
= FALSE
;
16033 switch (ffestr_first (ffesta_tokens
[1]))
16035 case FFESTR_firstFUNCTION
:
16037 break; /* For our own convenience, treat as non-FN
16039 p
= ffelex_token_text (ffesta_tokens
[1])
16040 + (i
= FFESTR_firstlFUNCTION
);
16041 if (!ffesrc_is_name_init (*p
))
16043 ffestb_local_
.decl
.recursive
= NULL
;
16044 ffesta_tokens
[2] = ffelex_token_name_from_names (ffesta_tokens
[1],
16045 FFESTR_firstlFUNCTION
, 0);
16046 return (ffelexHandler
) ffestb_decl_entsp_3_
;
16053 case FFELEX_typeOPEN_PAREN
:
16054 ffestb_local_
.decl
.aster_after
= FALSE
;
16055 switch (ffestr_first (ffesta_tokens
[1]))
16057 case FFESTR_firstFUNCTION
:
16058 p
= ffelex_token_text (ffesta_tokens
[1])
16059 + (i
= FFESTR_firstlFUNCTION
);
16060 if (!ffesrc_is_name_init (*p
))
16062 ffestb_local_
.decl
.recursive
= NULL
;
16063 ffesta_tokens
[2] = ffelex_token_name_from_names (ffesta_tokens
[1],
16064 FFESTR_firstlFUNCTION
, 0);
16065 return (ffelexHandler
) ffestb_decl_entsp_5_ (t
);
16070 if ((ffestb_local_
.decl
.kindt
!= NULL
)
16071 || (ffestb_local_
.decl
.lent
!= NULL
))
16072 break; /* Have kind/len type param, definitely not
16073 assignment stmt. */
16074 return (ffelexHandler
) ffestb_decl_entsp_1_ (t
);
16080 nt
= ffelex_token_name_from_names (ffesta_tokens
[1], 0, 0);
16081 ffelex_token_kill (ffesta_tokens
[1]);
16082 ffesta_tokens
[1] = nt
; /* Change NAMES to NAME. */
16083 return (ffelexHandler
) ffestb_decl_entsp_1_ (t
);
16086 /* ffestb_decl_entsp_3_ -- "type" [type parameters] [RECURSIVE] FUNCTION
16089 return ffestb_decl_entsp_3_; // to lexer
16091 Handle NUMBER or OPEN_PAREN. */
16093 static ffelexHandler
16094 ffestb_decl_entsp_3_ (ffelexToken t
)
16096 ffestb_local_
.decl
.aster_after
= TRUE
;
16098 switch (ffelex_token_type (t
))
16100 case FFELEX_typeNUMBER
:
16101 switch (ffestb_local_
.decl
.type
)
16103 case FFESTP_typeINTEGER
:
16104 case FFESTP_typeREAL
:
16105 case FFESTP_typeCOMPLEX
:
16106 case FFESTP_typeLOGICAL
:
16107 ffestb_local_
.decl
.kindt
= ffelex_token_use (t
);
16110 case FFESTP_typeCHARACTER
:
16111 ffestb_local_
.decl
.lent
= ffelex_token_use (t
);
16114 case FFESTP_typeBYTE
:
16115 case FFESTP_typeWORD
:
16119 return (ffelexHandler
) ffestb_decl_entsp_5_
;
16121 case FFELEX_typeOPEN_PAREN
:
16122 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
16123 FFEEXPR_contextCHARACTERSIZE
,
16124 (ffeexprCallback
) ffestb_decl_entsp_4_
);
16130 if (ffestb_local_
.decl
.recursive
!= NULL
)
16131 ffelex_token_kill (ffestb_local_
.decl
.recursive
);
16132 if (ffestb_local_
.decl
.kindt
!= NULL
)
16133 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
16134 if (ffestb_local_
.decl
.lent
!= NULL
)
16135 ffelex_token_kill (ffestb_local_
.decl
.lent
);
16136 ffelex_token_kill (ffesta_tokens
[1]);
16137 ffelex_token_kill (ffesta_tokens
[2]);
16138 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "FUNCTION", t
);
16139 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
16142 /* ffestb_decl_entsp_4_ -- "type" [type parameters] [RECURSIVE] FUNCTION
16143 NAME ASTERISK OPEN_PAREN expr
16145 (ffestb_decl_entsp_4_) // to expression handler
16147 Allow only CLOSE_PAREN; and deal with character-length expression. */
16149 static ffelexHandler
16150 ffestb_decl_entsp_4_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
16152 switch (ffelex_token_type (t
))
16154 case FFELEX_typeCLOSE_PAREN
:
16157 switch (ffestb_local_
.decl
.type
)
16159 case FFESTP_typeCHARACTER
:
16160 ffestb_local_
.decl
.len
= expr
;
16161 ffestb_local_
.decl
.lent
= ffelex_token_use (ft
);
16165 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "FUNCTION", t
);
16168 return (ffelexHandler
) ffestb_decl_entsp_5_
;
16174 if (ffestb_local_
.decl
.recursive
!= NULL
)
16175 ffelex_token_kill (ffestb_local_
.decl
.recursive
);
16176 if (ffestb_local_
.decl
.kindt
!= NULL
)
16177 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
16178 if (ffestb_local_
.decl
.lent
!= NULL
)
16179 ffelex_token_kill (ffestb_local_
.decl
.lent
);
16180 ffelex_token_kill (ffesta_tokens
[1]);
16181 ffelex_token_kill (ffesta_tokens
[2]);
16182 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "FUNCTION", t
);
16183 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
16186 /* ffestb_decl_entsp_5_ -- "type" [type parameters] [RECURSIVE] FUNCTION
16187 NAME [type parameter]
16189 return ffestb_decl_entsp_5_; // to lexer
16191 Make sure the next token is an OPEN_PAREN. Get the arg list or dimension
16192 list. If it can't be an arg list, or if the CLOSE_PAREN is followed by
16193 something other than EOS/SEMICOLON or NAME, then treat as dimension list
16194 and handle statement as an R426/R501. If it can't be a dimension list, or
16195 if the CLOSE_PAREN is followed by NAME, treat as an arg list and handle
16196 statement as an R1219. If it can be either an arg list or a dimension
16197 list and if the CLOSE_PAREN is followed by EOS/SEMICOLON, ask FFESTC
16198 whether to treat the statement as an R426/R501 or an R1219 and act
16201 static ffelexHandler
16202 ffestb_decl_entsp_5_ (ffelexToken t
)
16204 switch (ffelex_token_type (t
))
16206 case FFELEX_typeOPEN_PAREN
:
16207 if (ffestb_local_
.decl
.aster_after
&& (ffestb_local_
.decl
.len
!= NULL
))
16208 { /* "CHARACTER[RECURSIVE]FUNCTIONxyz*(len-expr)
16209 (..." must be a function-stmt, since the
16210 (len-expr) cannot precede (array-spec) in
16211 an object declaration but can precede
16212 (name-list) in a function stmt. */
16213 ffelex_token_kill (ffesta_tokens
[1]);
16214 ffesta_tokens
[1] = ffesta_tokens
[2];
16215 return (ffelexHandler
) ffestb_decl_funcname_4_ (t
);
16217 ffestb_local_
.decl
.toklist
= ffestt_tokenlist_create ();
16218 ffestb_local_
.decl
.empty
= TRUE
;
16219 ffestt_tokenlist_append (ffestb_local_
.decl
.toklist
, ffelex_token_use (t
));
16220 return (ffelexHandler
) ffestb_decl_entsp_6_
;
16226 assert (ffestb_local_
.decl
.aster_after
);
16227 ffesta_confirmed (); /* We've seen an ASTERISK, so even EQUALS
16229 ffestb_subr_ambig_to_ents_ ();
16230 ffestb_subrargs_
.dim_list
.dims
= NULL
;
16231 return (ffelexHandler
) ffestb_decl_ents_7_ (t
);
16234 /* ffestb_decl_entsp_6_ -- "type" [type parameters] [RECURSIVE] FUNCTION
16235 NAME [type parameter] OPEN_PAREN
16237 return ffestb_decl_entsp_6_; // to lexer
16239 If CLOSE_PAREN, we definitely have an R1219 function-stmt, since
16240 the notation "name()" is invalid for a declaration. */
16242 static ffelexHandler
16243 ffestb_decl_entsp_6_ (ffelexToken t
)
16245 ffelexHandler next
;
16247 switch (ffelex_token_type (t
))
16249 case FFELEX_typeCLOSE_PAREN
:
16250 if (!ffestb_local_
.decl
.empty
)
16251 { /* Trailing comma, just a warning for
16252 stmt func def, so allow ambiguity. */
16253 ffestt_tokenlist_append (ffestb_local_
.decl
.toklist
,
16254 ffelex_token_use (t
));
16255 return (ffelexHandler
) ffestb_decl_entsp_8_
;
16257 ffelex_token_kill (ffesta_tokens
[1]);
16258 ffesta_tokens
[1] = ffesta_tokens
[2];
16259 next
= (ffelexHandler
) ffestt_tokenlist_handle
16260 (ffestb_local_
.decl
.toklist
, (ffelexHandler
) ffestb_decl_funcname_4_
);
16261 ffestt_tokenlist_kill (ffestb_local_
.decl
.toklist
);
16262 return (ffelexHandler
) (*next
) (t
);
16264 case FFELEX_typeNAME
:
16265 ffestb_local_
.decl
.empty
= FALSE
;
16266 ffestt_tokenlist_append (ffestb_local_
.decl
.toklist
, ffelex_token_use (t
));
16267 return (ffelexHandler
) ffestb_decl_entsp_7_
;
16269 case FFELEX_typeEQUALS
:
16270 case FFELEX_typePOINTS
:
16271 case FFELEX_typePERCENT
:
16272 case FFELEX_typePERIOD
:
16273 case FFELEX_typeOPEN_PAREN
:
16274 if ((ffestb_local_
.decl
.kindt
!= NULL
)
16275 || (ffestb_local_
.decl
.lent
!= NULL
))
16276 break; /* type(params)name or type*val name, either
16278 return (ffelexHandler
) ffestb_subr_ambig_nope_ (t
);
16284 ffesta_confirmed ();
16285 ffestb_subr_ambig_to_ents_ ();
16286 next
= (ffelexHandler
) ffestt_tokenlist_handle (ffestb_local_
.decl
.toklist
,
16287 (ffelexHandler
) ffestb_decl_ents_3_
);
16288 ffestt_tokenlist_kill (ffestb_local_
.decl
.toklist
);
16289 return (ffelexHandler
) (*next
) (t
);
16292 /* ffestb_decl_entsp_7_ -- "type" [type parameters] [RECURSIVE] FUNCTION
16293 NAME [type parameter] OPEN_PAREN NAME
16295 return ffestb_decl_entsp_7_; // to lexer
16297 Expect COMMA or CLOSE_PAREN to remain ambiguous, else not an R1219
16300 static ffelexHandler
16301 ffestb_decl_entsp_7_ (ffelexToken t
)
16303 ffelexHandler next
;
16305 switch (ffelex_token_type (t
))
16307 case FFELEX_typeCLOSE_PAREN
:
16308 ffestt_tokenlist_append (ffestb_local_
.decl
.toklist
, ffelex_token_use (t
));
16309 return (ffelexHandler
) ffestb_decl_entsp_8_
;
16311 case FFELEX_typeCOMMA
:
16312 ffestt_tokenlist_append (ffestb_local_
.decl
.toklist
, ffelex_token_use (t
));
16313 return (ffelexHandler
) ffestb_decl_entsp_6_
;
16315 case FFELEX_typeEQUALS
:
16316 case FFELEX_typePOINTS
:
16317 case FFELEX_typePERCENT
:
16318 case FFELEX_typePERIOD
:
16319 case FFELEX_typeOPEN_PAREN
:
16320 if ((ffestb_local_
.decl
.kindt
!= NULL
)
16321 || (ffestb_local_
.decl
.lent
!= NULL
))
16322 break; /* type(params)name or type*val name, either
16324 return (ffelexHandler
) ffestb_subr_ambig_nope_ (t
);
16330 ffesta_confirmed ();
16331 ffestb_subr_ambig_to_ents_ ();
16332 next
= (ffelexHandler
) ffestt_tokenlist_handle (ffestb_local_
.decl
.toklist
,
16333 (ffelexHandler
) ffestb_decl_ents_3_
);
16334 ffestt_tokenlist_kill (ffestb_local_
.decl
.toklist
);
16335 return (ffelexHandler
) (*next
) (t
);
16338 /* ffestb_decl_entsp_8_ -- "type" [type parameters] [RECURSIVE] FUNCTION
16339 NAME [type parameter] OPEN_PAREN name-list
16342 return ffestb_decl_entsp_8_; // to lexer
16344 If EOS/SEMICOLON, situation remains ambiguous, ask FFESTC to resolve
16345 it. If NAME (must be "RESULT", but that is checked later on),
16346 definitely an R1219 function-stmt. Anything else, handle as entity decl. */
16348 static ffelexHandler
16349 ffestb_decl_entsp_8_ (ffelexToken t
)
16351 ffelexHandler next
;
16353 switch (ffelex_token_type (t
))
16355 case FFELEX_typeEOS
:
16356 case FFELEX_typeSEMICOLON
:
16357 ffesta_confirmed ();
16358 if (ffestc_is_decl_not_R1219 ())
16360 /* Fall through. */
16361 case FFELEX_typeNAME
:
16362 ffesta_confirmed ();
16363 ffelex_token_kill (ffesta_tokens
[1]);
16364 ffesta_tokens
[1] = ffesta_tokens
[2];
16365 next
= (ffelexHandler
) ffestt_tokenlist_handle
16366 (ffestb_local_
.decl
.toklist
, (ffelexHandler
) ffestb_decl_funcname_4_
);
16367 ffestt_tokenlist_kill (ffestb_local_
.decl
.toklist
);
16368 return (ffelexHandler
) (*next
) (t
);
16370 case FFELEX_typeEQUALS
:
16371 case FFELEX_typePOINTS
:
16372 case FFELEX_typePERCENT
:
16373 case FFELEX_typePERIOD
:
16374 case FFELEX_typeOPEN_PAREN
:
16375 if ((ffestb_local_
.decl
.kindt
!= NULL
)
16376 || (ffestb_local_
.decl
.lent
!= NULL
))
16377 break; /* type(params)name or type*val name, either
16379 return (ffelexHandler
) ffestb_subr_ambig_nope_ (t
);
16385 ffesta_confirmed ();
16386 ffestb_subr_ambig_to_ents_ ();
16387 next
= (ffelexHandler
) ffestt_tokenlist_handle (ffestb_local_
.decl
.toklist
,
16388 (ffelexHandler
) ffestb_decl_ents_3_
);
16389 ffestt_tokenlist_kill (ffestb_local_
.decl
.toklist
);
16390 return (ffelexHandler
) (*next
) (t
);
16393 /* ffestb_decl_funcname_ -- "type" [type parameters] [RECURSIVE] FUNCTION
16395 return ffestb_decl_funcname_; // to lexer
16397 Handle NAME of a function. */
16399 static ffelexHandler
16400 ffestb_decl_funcname_ (ffelexToken t
)
16402 switch (ffelex_token_type (t
))
16404 case FFELEX_typeNAME
:
16405 ffesta_tokens
[1] = ffelex_token_use (t
);
16406 return (ffelexHandler
) ffestb_decl_funcname_1_
;
16412 if (ffestb_local_
.decl
.recursive
!= NULL
)
16413 ffelex_token_kill (ffestb_local_
.decl
.recursive
);
16414 if (ffestb_local_
.decl
.kindt
!= NULL
)
16415 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
16416 if (ffestb_local_
.decl
.lent
!= NULL
)
16417 ffelex_token_kill (ffestb_local_
.decl
.lent
);
16418 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "FUNCTION", t
);
16419 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
16422 /* ffestb_decl_funcname_1_ -- "type" [type parameters] [RECURSIVE] FUNCTION
16425 return ffestb_decl_funcname_1_; // to lexer
16427 Handle ASTERISK or OPEN_PAREN. */
16429 static ffelexHandler
16430 ffestb_decl_funcname_1_ (ffelexToken t
)
16432 switch (ffelex_token_type (t
))
16434 case FFELEX_typeASTERISK
:
16435 return (ffelexHandler
) ffestb_decl_funcname_2_
;
16437 case FFELEX_typeOPEN_PAREN
:
16438 return (ffelexHandler
) ffestb_decl_funcname_4_ (t
);
16444 if (ffestb_local_
.decl
.recursive
!= NULL
)
16445 ffelex_token_kill (ffestb_local_
.decl
.recursive
);
16446 if (ffestb_local_
.decl
.kindt
!= NULL
)
16447 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
16448 if (ffestb_local_
.decl
.lent
!= NULL
)
16449 ffelex_token_kill (ffestb_local_
.decl
.lent
);
16450 ffelex_token_kill (ffesta_tokens
[1]);
16451 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "FUNCTION", t
);
16452 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
16455 /* ffestb_decl_funcname_2_ -- "type" [type parameters] [RECURSIVE] FUNCTION
16458 return ffestb_decl_funcname_2_; // to lexer
16460 Handle NUMBER or OPEN_PAREN. */
16462 static ffelexHandler
16463 ffestb_decl_funcname_2_ (ffelexToken t
)
16465 switch (ffelex_token_type (t
))
16467 case FFELEX_typeNUMBER
:
16468 switch (ffestb_local_
.decl
.type
)
16470 case FFESTP_typeINTEGER
:
16471 case FFESTP_typeREAL
:
16472 case FFESTP_typeCOMPLEX
:
16473 case FFESTP_typeLOGICAL
:
16474 if (ffestb_local_
.decl
.kindt
== NULL
)
16475 ffestb_local_
.decl
.kindt
= ffelex_token_use (t
);
16477 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "FUNCTION", t
);
16480 case FFESTP_typeCHARACTER
:
16481 if (ffestb_local_
.decl
.lent
== NULL
)
16482 ffestb_local_
.decl
.lent
= ffelex_token_use (t
);
16484 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "FUNCTION", t
);
16487 case FFESTP_typeBYTE
:
16488 case FFESTP_typeWORD
:
16490 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "FUNCTION", t
);
16493 return (ffelexHandler
) ffestb_decl_funcname_4_
;
16495 case FFELEX_typeOPEN_PAREN
:
16496 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
16497 FFEEXPR_contextCHARACTERSIZE
,
16498 (ffeexprCallback
) ffestb_decl_funcname_3_
);
16504 if (ffestb_local_
.decl
.recursive
!= NULL
)
16505 ffelex_token_kill (ffestb_local_
.decl
.recursive
);
16506 if (ffestb_local_
.decl
.kindt
!= NULL
)
16507 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
16508 if (ffestb_local_
.decl
.lent
!= NULL
)
16509 ffelex_token_kill (ffestb_local_
.decl
.lent
);
16510 ffelex_token_kill (ffesta_tokens
[1]);
16511 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "FUNCTION", t
);
16512 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
16515 /* ffestb_decl_funcname_3_ -- "type" [type parameters] [RECURSIVE] FUNCTION
16516 NAME ASTERISK OPEN_PAREN expr
16518 (ffestb_decl_funcname_3_) // to expression handler
16520 Allow only CLOSE_PAREN; and deal with character-length expression. */
16522 static ffelexHandler
16523 ffestb_decl_funcname_3_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
16525 switch (ffelex_token_type (t
))
16527 case FFELEX_typeCLOSE_PAREN
:
16530 switch (ffestb_local_
.decl
.type
)
16532 case FFESTP_typeCHARACTER
:
16533 if (ffestb_local_
.decl
.lent
== NULL
)
16535 ffestb_local_
.decl
.len
= expr
;
16536 ffestb_local_
.decl
.lent
= ffelex_token_use (ft
);
16539 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "FUNCTION", t
);
16543 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "FUNCTION", t
);
16546 return (ffelexHandler
) ffestb_decl_funcname_4_
;
16552 if (ffestb_local_
.decl
.recursive
!= NULL
)
16553 ffelex_token_kill (ffestb_local_
.decl
.recursive
);
16554 if (ffestb_local_
.decl
.kindt
!= NULL
)
16555 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
16556 if (ffestb_local_
.decl
.lent
!= NULL
)
16557 ffelex_token_kill (ffestb_local_
.decl
.lent
);
16558 ffelex_token_kill (ffesta_tokens
[1]);
16559 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "FUNCTION", t
);
16560 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
16563 /* ffestb_decl_funcname_4_ -- "type" [type parameters] [RECURSIVE] FUNCTION
16564 NAME [type parameter]
16566 return ffestb_decl_funcname_4_; // to lexer
16568 Make sure the next token is an OPEN_PAREN. Get the arg list and
16571 static ffelexHandler
16572 ffestb_decl_funcname_4_ (ffelexToken t
)
16574 switch (ffelex_token_type (t
))
16576 case FFELEX_typeOPEN_PAREN
:
16577 ffestb_subrargs_
.name_list
.args
= ffestt_tokenlist_create ();
16578 ffestb_subrargs_
.name_list
.handler
16579 = (ffelexHandler
) ffestb_decl_funcname_5_
;
16580 ffestb_subrargs_
.name_list
.is_subr
= FALSE
;
16581 ffestb_subrargs_
.name_list
.names
= FALSE
;
16582 return (ffelexHandler
) ffestb_subr_name_list_
;
16588 if (ffestb_local_
.decl
.recursive
!= NULL
)
16589 ffelex_token_kill (ffestb_local_
.decl
.recursive
);
16590 if (ffestb_local_
.decl
.kindt
!= NULL
)
16591 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
16592 if (ffestb_local_
.decl
.lent
!= NULL
)
16593 ffelex_token_kill (ffestb_local_
.decl
.lent
);
16594 ffelex_token_kill (ffesta_tokens
[1]);
16595 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "FUNCTION", t
);
16596 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
16599 /* ffestb_decl_funcname_5_ -- "type" [type parameters] [RECURSIVE] FUNCTION
16600 NAME [type parameter] OPEN_PAREN arg-list
16603 return ffestb_decl_funcname_5_; // to lexer
16605 Must have EOS/SEMICOLON or "RESULT" here. */
16607 static ffelexHandler
16608 ffestb_decl_funcname_5_ (ffelexToken t
)
16610 if (!ffestb_subrargs_
.name_list
.ok
)
16611 goto bad
; /* :::::::::::::::::::: */
16613 switch (ffelex_token_type (t
))
16615 case FFELEX_typeEOS
:
16616 case FFELEX_typeSEMICOLON
:
16617 ffesta_confirmed ();
16618 if (!ffesta_is_inhibited ())
16619 ffestc_R1219 (ffesta_tokens
[1], ffestb_subrargs_
.name_list
.args
,
16620 ffestb_subrargs_
.name_list
.close_paren
, ffestb_local_
.decl
.type
,
16621 ffestb_local_
.decl
.kind
, ffestb_local_
.decl
.kindt
,
16622 ffestb_local_
.decl
.len
, ffestb_local_
.decl
.lent
,
16623 ffestb_local_
.decl
.recursive
, NULL
);
16624 if (ffestb_local_
.decl
.recursive
!= NULL
)
16625 ffelex_token_kill (ffestb_local_
.decl
.recursive
);
16626 if (ffestb_local_
.decl
.kindt
!= NULL
)
16627 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
16628 if (ffestb_local_
.decl
.lent
!= NULL
)
16629 ffelex_token_kill (ffestb_local_
.decl
.lent
);
16630 ffelex_token_kill (ffesta_tokens
[1]);
16631 ffelex_token_kill (ffestb_subrargs_
.name_list
.close_paren
);
16632 ffestt_tokenlist_kill (ffestb_subrargs_
.name_list
.args
);
16633 return (ffelexHandler
) ffesta_zero (t
);
16635 case FFELEX_typeNAME
:
16636 if (ffestr_other (t
) != FFESTR_otherRESULT
)
16638 return (ffelexHandler
) ffestb_decl_funcname_6_
;
16644 bad
: /* :::::::::::::::::::: */
16645 if (ffestb_local_
.decl
.recursive
!= NULL
)
16646 ffelex_token_kill (ffestb_local_
.decl
.recursive
);
16647 if (ffestb_local_
.decl
.kindt
!= NULL
)
16648 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
16649 if (ffestb_local_
.decl
.lent
!= NULL
)
16650 ffelex_token_kill (ffestb_local_
.decl
.lent
);
16651 ffelex_token_kill (ffesta_tokens
[1]);
16652 ffelex_token_kill (ffestb_subrargs_
.name_list
.close_paren
);
16653 ffestt_tokenlist_kill (ffestb_subrargs_
.name_list
.args
);
16654 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "FUNCTION", t
);
16655 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
16658 /* ffestb_decl_funcname_6_ -- "type" [type parameters] [RECURSIVE] FUNCTION
16659 NAME [type parameter] OPEN_PAREN arglist
16660 CLOSE_PAREN "RESULT"
16662 return ffestb_decl_funcname_6_; // to lexer
16664 Make sure the next token is an OPEN_PAREN. */
16666 static ffelexHandler
16667 ffestb_decl_funcname_6_ (ffelexToken t
)
16669 switch (ffelex_token_type (t
))
16671 case FFELEX_typeOPEN_PAREN
:
16672 return (ffelexHandler
) ffestb_decl_funcname_7_
;
16678 if (ffestb_local_
.decl
.recursive
!= NULL
)
16679 ffelex_token_kill (ffestb_local_
.decl
.recursive
);
16680 if (ffestb_local_
.decl
.kindt
!= NULL
)
16681 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
16682 if (ffestb_local_
.decl
.lent
!= NULL
)
16683 ffelex_token_kill (ffestb_local_
.decl
.lent
);
16684 ffelex_token_kill (ffesta_tokens
[1]);
16685 ffelex_token_kill (ffestb_subrargs_
.name_list
.close_paren
);
16686 ffestt_tokenlist_kill (ffestb_subrargs_
.name_list
.args
);
16687 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "FUNCTION", t
);
16688 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
16691 /* ffestb_decl_funcname_7_ -- "type" [type parameters] [RECURSIVE] FUNCTION
16692 NAME [type parameter] OPEN_PAREN arglist
16693 CLOSE_PAREN "RESULT" OPEN_PAREN
16695 return ffestb_decl_funcname_7_; // to lexer
16697 Make sure the next token is a NAME. */
16699 static ffelexHandler
16700 ffestb_decl_funcname_7_ (ffelexToken t
)
16702 switch (ffelex_token_type (t
))
16704 case FFELEX_typeNAME
:
16705 ffesta_tokens
[2] = ffelex_token_use (t
);
16706 return (ffelexHandler
) ffestb_decl_funcname_8_
;
16712 if (ffestb_local_
.decl
.recursive
!= NULL
)
16713 ffelex_token_kill (ffestb_local_
.decl
.recursive
);
16714 if (ffestb_local_
.decl
.kindt
!= NULL
)
16715 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
16716 if (ffestb_local_
.decl
.lent
!= NULL
)
16717 ffelex_token_kill (ffestb_local_
.decl
.lent
);
16718 ffelex_token_kill (ffesta_tokens
[1]);
16719 ffelex_token_kill (ffestb_subrargs_
.name_list
.close_paren
);
16720 ffestt_tokenlist_kill (ffestb_subrargs_
.name_list
.args
);
16721 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "FUNCTION", t
);
16722 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
16725 /* ffestb_decl_funcname_8_ -- "type" [type parameters] [RECURSIVE] FUNCTION
16726 NAME [type parameter] OPEN_PAREN arglist
16727 CLOSE_PAREN "RESULT" OPEN_PAREN NAME
16729 return ffestb_decl_funcname_8_; // to lexer
16731 Make sure the next token is a CLOSE_PAREN. */
16733 static ffelexHandler
16734 ffestb_decl_funcname_8_ (ffelexToken t
)
16736 switch (ffelex_token_type (t
))
16738 case FFELEX_typeCLOSE_PAREN
:
16739 return (ffelexHandler
) ffestb_decl_funcname_9_
;
16745 if (ffestb_local_
.decl
.recursive
!= NULL
)
16746 ffelex_token_kill (ffestb_local_
.decl
.recursive
);
16747 if (ffestb_local_
.decl
.kindt
!= NULL
)
16748 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
16749 if (ffestb_local_
.decl
.lent
!= NULL
)
16750 ffelex_token_kill (ffestb_local_
.decl
.lent
);
16751 ffelex_token_kill (ffesta_tokens
[1]);
16752 ffelex_token_kill (ffesta_tokens
[2]);
16753 ffelex_token_kill (ffestb_subrargs_
.name_list
.close_paren
);
16754 ffestt_tokenlist_kill (ffestb_subrargs_
.name_list
.args
);
16755 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "FUNCTION", t
);
16756 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
16759 /* ffestb_decl_funcname_9_ -- "type" [type parameters] [RECURSIVE] FUNCTION
16760 NAME [type parameter] OPEN_PAREN arg-list
16761 CLOSE_PAREN "RESULT" OPEN_PAREN NAME CLOSE_PAREN
16763 return ffestb_decl_funcname_9_; // to lexer
16765 Must have EOS/SEMICOLON here. */
16767 static ffelexHandler
16768 ffestb_decl_funcname_9_ (ffelexToken t
)
16770 switch (ffelex_token_type (t
))
16772 case FFELEX_typeEOS
:
16773 case FFELEX_typeSEMICOLON
:
16774 if (!ffesta_is_inhibited ())
16775 ffestc_R1219 (ffesta_tokens
[1], ffestb_subrargs_
.name_list
.args
,
16776 ffestb_subrargs_
.name_list
.close_paren
, ffestb_local_
.decl
.type
,
16777 ffestb_local_
.decl
.kind
, ffestb_local_
.decl
.kindt
,
16778 ffestb_local_
.decl
.len
, ffestb_local_
.decl
.lent
,
16779 ffestb_local_
.decl
.recursive
, ffesta_tokens
[2]);
16780 if (ffestb_local_
.decl
.recursive
!= NULL
)
16781 ffelex_token_kill (ffestb_local_
.decl
.recursive
);
16782 if (ffestb_local_
.decl
.kindt
!= NULL
)
16783 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
16784 if (ffestb_local_
.decl
.lent
!= NULL
)
16785 ffelex_token_kill (ffestb_local_
.decl
.lent
);
16786 ffelex_token_kill (ffesta_tokens
[1]);
16787 ffelex_token_kill (ffesta_tokens
[2]);
16788 ffelex_token_kill (ffestb_subrargs_
.name_list
.close_paren
);
16789 ffestt_tokenlist_kill (ffestb_subrargs_
.name_list
.args
);
16790 return (ffelexHandler
) ffesta_zero (t
);
16796 if (ffestb_local_
.decl
.recursive
!= NULL
)
16797 ffelex_token_kill (ffestb_local_
.decl
.recursive
);
16798 if (ffestb_local_
.decl
.kindt
!= NULL
)
16799 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
16800 if (ffestb_local_
.decl
.lent
!= NULL
)
16801 ffelex_token_kill (ffestb_local_
.decl
.lent
);
16802 ffelex_token_kill (ffesta_tokens
[1]);
16803 ffelex_token_kill (ffesta_tokens
[2]);
16804 ffelex_token_kill (ffestb_subrargs_
.name_list
.close_paren
);
16805 ffestt_tokenlist_kill (ffestb_subrargs_
.name_list
.args
);
16806 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "FUNCTION", t
);
16807 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
16809 /* ffestb_V027 -- Parse the VXT PARAMETER statement
16811 return ffestb_V027; // to lexer
16813 Make sure the statement has a valid form for the VXT PARAMETER statement.
16814 If it does, implement the statement. */
16817 ffestb_V027 (ffelexToken t
)
16819 unsigned const char *p
;
16822 switch (ffelex_token_type (ffesta_tokens
[0]))
16824 case FFELEX_typeNAME
:
16825 if (ffesta_first_kw
!= FFESTR_firstPARAMETER
)
16826 goto bad_0
; /* :::::::::::::::::::: */
16827 switch (ffelex_token_type (t
))
16829 case FFELEX_typeNAME
:
16833 goto bad_1
; /* :::::::::::::::::::: */
16835 ffesta_confirmed ();
16836 ffestb_local_
.vxtparam
.started
= TRUE
;
16837 if (!ffesta_is_inhibited ())
16838 ffestc_V027_start ();
16839 ffesta_tokens
[1] = ffelex_token_use (t
);
16840 return (ffelexHandler
) ffestb_V0271_
;
16842 case FFELEX_typeNAMES
:
16843 if (ffesta_first_kw
!= FFESTR_firstPARAMETER
)
16844 goto bad_0
; /* :::::::::::::::::::: */
16845 p
= ffelex_token_text (ffesta_tokens
[0]) + (i
= FFESTR_firstlPARAMETER
);
16846 switch (ffelex_token_type (t
))
16848 case FFELEX_typeEQUALS
:
16852 goto bad_1
; /* :::::::::::::::::::: */
16854 if (!ffesrc_is_name_init (*p
))
16855 goto bad_i
; /* :::::::::::::::::::: */
16856 ffestb_local_
.vxtparam
.started
= FALSE
;
16857 ffesta_tokens
[1] = ffelex_token_name_from_names (ffesta_tokens
[0], i
,
16859 return (ffelexHandler
) ffestb_V0271_ (t
);
16862 goto bad_0
; /* :::::::::::::::::::: */
16865 bad_0
: /* :::::::::::::::::::: */
16866 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "PARAMETER", ffesta_tokens
[0]);
16867 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
16869 bad_1
: /* :::::::::::::::::::: */
16870 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "PARAMETER", t
);
16871 return (ffelexHandler
) ffelex_swallow_tokens (t
,
16872 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
16874 bad_i
: /* :::::::::::::::::::: */
16875 ffesta_ffebad_1sp (FFEBAD_INVALID_STMT_FORM
, "PARAMETER", ffesta_tokens
[0], i
, t
);
16876 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
16879 /* ffestb_V0271_ -- "PARAMETER" NAME
16881 return ffestb_V0271_; // to lexer
16885 static ffelexHandler
16886 ffestb_V0271_ (ffelexToken t
)
16888 switch (ffelex_token_type (t
))
16890 case FFELEX_typeEQUALS
:
16891 return (ffelexHandler
) ffeexpr_rhs (ffesta_output_pool
,
16892 FFEEXPR_contextPARAMETER
, (ffeexprCallback
) ffestb_V0272_
);
16895 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "PARAMETER", t
);
16899 ffelex_token_kill (ffesta_tokens
[1]);
16900 if (ffestb_local_
.vxtparam
.started
&& !ffesta_is_inhibited ())
16901 ffestc_V027_finish ();
16902 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
16905 /* ffestb_V0272_ -- "PARAMETER" NAME EQUALS expr
16907 (ffestb_V0272_) // to expression handler
16909 Handle COMMA or EOS/SEMICOLON. */
16911 static ffelexHandler
16912 ffestb_V0272_ (ffelexToken ft
, ffebld expr
, ffelexToken t
)
16914 switch (ffelex_token_type (t
))
16916 case FFELEX_typeEOS
:
16917 case FFELEX_typeSEMICOLON
:
16918 if (!ffestb_local_
.vxtparam
.started
)
16920 if (ffestc_is_let_not_V027 ())
16921 break; /* Not a valid VXTPARAMETER stmt. */
16922 ffesta_confirmed ();
16923 if (!ffesta_is_inhibited ())
16924 ffestc_V027_start ();
16925 ffestb_local_
.vxtparam
.started
= TRUE
;
16929 if (!ffesta_is_inhibited ())
16931 ffestc_V027_item (ffesta_tokens
[1], expr
, ft
);
16932 ffestc_V027_finish ();
16934 ffelex_token_kill (ffesta_tokens
[1]);
16935 return (ffelexHandler
) ffesta_zero (t
);
16937 case FFELEX_typeCOMMA
:
16938 ffesta_confirmed ();
16939 if (!ffestb_local_
.vxtparam
.started
)
16941 if (!ffesta_is_inhibited ())
16942 ffestc_V027_start ();
16943 ffestb_local_
.vxtparam
.started
= TRUE
;
16947 if (!ffesta_is_inhibited ())
16948 ffestc_V027_item (ffesta_tokens
[1], expr
, ft
);
16949 ffelex_token_kill (ffesta_tokens
[1]);
16950 return (ffelexHandler
) ffestb_V0273_
;
16956 ffelex_token_kill (ffesta_tokens
[1]);
16957 if (ffestb_local_
.vxtparam
.started
&& !ffesta_is_inhibited ())
16958 ffestc_V027_finish ();
16959 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "PARAMETER", t
);
16960 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
16963 /* ffestb_V0273_ -- "PARAMETER" NAME EQUALS expr COMMA
16965 return ffestb_V0273_; // to lexer
16969 static ffelexHandler
16970 ffestb_V0273_ (ffelexToken t
)
16972 switch (ffelex_token_type (t
))
16974 case FFELEX_typeNAME
:
16975 ffesta_tokens
[1] = ffelex_token_use (t
);
16976 return (ffelexHandler
) ffestb_V0271_
;
16979 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "PARAMETER", t
);
16983 if (ffestb_local_
.vxtparam
.started
&& !ffesta_is_inhibited ())
16984 ffestc_V027_finish ();
16985 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
16988 /* ffestb_decl_R539 -- Parse the IMPLICIT FUNCTION statement
16990 return ffestb_decl_R539; // to lexer
16992 Make sure the statement has a valid form for the IMPLICIT
16993 statement. If it does, implement the statement. */
16996 ffestb_decl_R539 (ffelexToken t
)
16999 unsigned const char *p
;
17003 ffestb_local_
.decl
.recursive
= NULL
;
17005 switch (ffelex_token_type (ffesta_tokens
[0]))
17007 case FFELEX_typeNAME
:
17008 if (ffesta_first_kw
!= FFESTR_firstIMPLICIT
)
17009 goto bad_0
; /* :::::::::::::::::::: */
17010 switch (ffelex_token_type (t
))
17012 case FFELEX_typeEOS
:
17013 case FFELEX_typeSEMICOLON
:
17014 case FFELEX_typeCOMMA
:
17015 case FFELEX_typeCOLONCOLON
:
17016 ffesta_confirmed (); /* Error, but clearly intended. */
17017 goto bad_1
; /* :::::::::::::::::::: */
17020 goto bad_1
; /* :::::::::::::::::::: */
17022 case FFELEX_typeNAME
:
17025 ffesta_confirmed ();
17026 ffestb_local_
.decl
.imp_started
= FALSE
;
17027 switch (ffesta_second_kw
)
17029 case FFESTR_secondINTEGER
:
17030 ffestb_local_
.decl
.type
= FFESTP_typeINTEGER
;
17031 return (ffelexHandler
) ffestb_decl_R5391_
;
17033 case FFESTR_secondBYTE
:
17034 ffestb_local_
.decl
.type
= FFESTP_typeBYTE
;
17035 return (ffelexHandler
) ffestb_decl_R5391_
;
17037 case FFESTR_secondWORD
:
17038 ffestb_local_
.decl
.type
= FFESTP_typeWORD
;
17039 return (ffelexHandler
) ffestb_decl_R5391_
;
17041 case FFESTR_secondREAL
:
17042 ffestb_local_
.decl
.type
= FFESTP_typeREAL
;
17043 return (ffelexHandler
) ffestb_decl_R5391_
;
17045 case FFESTR_secondCOMPLEX
:
17046 ffestb_local_
.decl
.type
= FFESTP_typeCOMPLEX
;
17047 return (ffelexHandler
) ffestb_decl_R5391_
;
17049 case FFESTR_secondLOGICAL
:
17050 ffestb_local_
.decl
.type
= FFESTP_typeLOGICAL
;
17051 return (ffelexHandler
) ffestb_decl_R5391_
;
17053 case FFESTR_secondCHARACTER
:
17054 ffestb_local_
.decl
.type
= FFESTP_typeCHARACTER
;
17055 return (ffelexHandler
) ffestb_decl_R5391_
;
17057 case FFESTR_secondDOUBLE
:
17058 return (ffelexHandler
) ffestb_decl_R5392_
;
17060 case FFESTR_secondDOUBLEPRECISION
:
17061 ffestb_local_
.decl
.type
= FFESTP_typeDBLPRCSN
;
17062 ffestb_local_
.decl
.kind
= NULL
;
17063 ffestb_local_
.decl
.kindt
= NULL
;
17064 ffestb_local_
.decl
.len
= NULL
;
17065 ffestb_local_
.decl
.lent
= NULL
;
17066 return (ffelexHandler
) ffestb_decl_R539letters_
;
17068 case FFESTR_secondDOUBLECOMPLEX
:
17069 ffestb_local_
.decl
.type
= FFESTP_typeDBLCMPLX
;
17070 ffestb_local_
.decl
.kind
= NULL
;
17071 ffestb_local_
.decl
.kindt
= NULL
;
17072 ffestb_local_
.decl
.len
= NULL
;
17073 ffestb_local_
.decl
.lent
= NULL
;
17074 return (ffelexHandler
) ffestb_decl_R539letters_
;
17076 case FFESTR_secondNONE
:
17077 return (ffelexHandler
) ffestb_decl_R5394_
;
17080 goto bad_1
; /* :::::::::::::::::::: */
17083 case FFELEX_typeNAMES
:
17084 if (ffesta_first_kw
!= FFESTR_firstIMPLICIT
)
17085 goto bad_0
; /* :::::::::::::::::::: */
17086 switch (ffelex_token_type (t
))
17088 case FFELEX_typeCOMMA
:
17089 case FFELEX_typeCOLONCOLON
:
17090 case FFELEX_typeASTERISK
:
17091 case FFELEX_typeSEMICOLON
:
17092 case FFELEX_typeEOS
:
17093 ffesta_confirmed ();
17096 case FFELEX_typeOPEN_PAREN
:
17100 goto bad_1
; /* :::::::::::::::::::: */
17102 p
= ffelex_token_text (ffesta_tokens
[0]) + (i
= FFESTR_firstlIMPLICIT
);
17103 if (!ffesrc_is_name_init (*p
))
17104 goto bad_0
; /* :::::::::::::::::::: */
17105 ffestb_local_
.decl
.imp_started
= FALSE
;
17106 nt
= ffelex_token_name_from_names (ffesta_tokens
[0],
17107 FFESTR_firstlIMPLICIT
, 0);
17108 kw
= ffestr_second (nt
);
17109 ffelex_token_kill (nt
);
17112 case FFESTR_secondINTEGER
:
17113 ffestb_local_
.decl
.type
= FFESTP_typeINTEGER
;
17114 return (ffelexHandler
) ffestb_decl_R5391_ (t
);
17116 case FFESTR_secondBYTE
:
17117 ffestb_local_
.decl
.type
= FFESTP_typeBYTE
;
17118 return (ffelexHandler
) ffestb_decl_R5391_ (t
);
17120 case FFESTR_secondWORD
:
17121 ffestb_local_
.decl
.type
= FFESTP_typeWORD
;
17122 return (ffelexHandler
) ffestb_decl_R5391_ (t
);
17124 case FFESTR_secondREAL
:
17125 ffestb_local_
.decl
.type
= FFESTP_typeREAL
;
17126 return (ffelexHandler
) ffestb_decl_R5391_ (t
);
17128 case FFESTR_secondCOMPLEX
:
17129 ffestb_local_
.decl
.type
= FFESTP_typeCOMPLEX
;
17130 return (ffelexHandler
) ffestb_decl_R5391_ (t
);
17132 case FFESTR_secondLOGICAL
:
17133 ffestb_local_
.decl
.type
= FFESTP_typeLOGICAL
;
17134 return (ffelexHandler
) ffestb_decl_R5391_ (t
);
17136 case FFESTR_secondCHARACTER
:
17137 ffestb_local_
.decl
.type
= FFESTP_typeCHARACTER
;
17138 return (ffelexHandler
) ffestb_decl_R5391_ (t
);
17140 case FFESTR_secondDOUBLEPRECISION
:
17141 ffestb_local_
.decl
.type
= FFESTP_typeDBLPRCSN
;
17142 ffestb_local_
.decl
.kind
= NULL
;
17143 ffestb_local_
.decl
.kindt
= NULL
;
17144 ffestb_local_
.decl
.len
= NULL
;
17145 ffestb_local_
.decl
.lent
= NULL
;
17146 return (ffelexHandler
) ffestb_decl_R539letters_ (t
);
17148 case FFESTR_secondDOUBLECOMPLEX
:
17149 ffestb_local_
.decl
.type
= FFESTP_typeDBLCMPLX
;
17150 ffestb_local_
.decl
.kind
= NULL
;
17151 ffestb_local_
.decl
.kindt
= NULL
;
17152 ffestb_local_
.decl
.len
= NULL
;
17153 ffestb_local_
.decl
.lent
= NULL
;
17154 return (ffelexHandler
) ffestb_decl_R539letters_ (t
);
17156 case FFESTR_secondNONE
:
17157 return (ffelexHandler
) ffestb_decl_R5394_ (t
);
17160 goto bad_1
; /* :::::::::::::::::::: */
17164 goto bad_0
; /* :::::::::::::::::::: */
17167 bad_0
: /* :::::::::::::::::::: */
17168 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "IMPLICIT", ffesta_tokens
[0]);
17169 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
17171 bad_1
: /* :::::::::::::::::::: */
17172 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "IMPLICIT", t
);
17173 return (ffelexHandler
) ffelex_swallow_tokens (t
,
17174 (ffelexHandler
) ffesta_zero
); /* Invalid second token. */
17177 /* ffestb_decl_R5391_ -- "IMPLICIT" generic-type
17179 return ffestb_decl_R5391_; // to lexer
17181 Handle ASTERISK or OPEN_PAREN. */
17183 static ffelexHandler
17184 ffestb_decl_R5391_ (ffelexToken t
)
17186 switch (ffelex_token_type (t
))
17188 case FFELEX_typeASTERISK
:
17189 ffesta_confirmed ();
17190 ffestb_local_
.decl
.handler
= (ffelexHandler
) ffestb_decl_R539letters_
;
17191 ffestb_local_
.decl
.badname
= "IMPLICIT";
17192 if (ffestb_local_
.decl
.type
== FFESTP_typeCHARACTER
)
17193 return (ffelexHandler
) ffestb_decl_starlen_
;
17194 return (ffelexHandler
) ffestb_decl_starkind_
;
17196 case FFELEX_typeOPEN_PAREN
:
17197 ffestb_local_
.decl
.handler
= (ffelexHandler
) ffestb_decl_R539letters_
;
17198 ffestb_local_
.decl
.badname
= "IMPLICIT";
17199 ffestb_local_
.decl
.kind
= NULL
;
17200 ffestb_local_
.decl
.kindt
= NULL
;
17201 ffestb_local_
.decl
.len
= NULL
;
17202 ffestb_local_
.decl
.lent
= NULL
;
17203 if (ffestb_local_
.decl
.type
== FFESTP_typeCHARACTER
)
17204 ffestb_local_
.decl
.imp_handler
17205 = (ffelexHandler
) ffestb_decl_typeparams_
;
17207 ffestb_local_
.decl
.imp_handler
17208 = (ffelexHandler
) ffestb_decl_kindparam_
;
17209 return (ffelexHandler
) ffestb_decl_R539maybe_ (t
);
17215 if (ffestb_local_
.decl
.imp_started
&& !ffesta_is_inhibited ())
17216 ffestc_R539finish ();
17217 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "IMPLICIT", t
);
17218 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
17221 /* ffestb_decl_R5392_ -- "IMPLICIT" "DOUBLE"
17223 return ffestb_decl_R5392_; // to lexer
17227 static ffelexHandler
17228 ffestb_decl_R5392_ (ffelexToken t
)
17230 switch (ffelex_token_type (t
))
17232 case FFELEX_typeNAME
:
17233 switch (ffestr_second (t
))
17235 case FFESTR_secondPRECISION
:
17236 ffestb_local_
.decl
.type
= FFESTP_typeDBLPRCSN
;
17239 case FFESTR_secondCOMPLEX
:
17240 ffestb_local_
.decl
.type
= FFESTP_typeDBLCMPLX
;
17244 goto bad
; /* :::::::::::::::::::: */
17246 ffestb_local_
.decl
.kind
= NULL
;
17247 ffestb_local_
.decl
.kindt
= NULL
;
17248 ffestb_local_
.decl
.len
= NULL
;
17249 ffestb_local_
.decl
.lent
= NULL
;
17250 return (ffelexHandler
) ffestb_decl_R539letters_
;
17256 bad
: /* :::::::::::::::::::: */
17257 if (ffestb_local_
.decl
.imp_started
&& !ffesta_is_inhibited ())
17258 ffestc_R539finish ();
17259 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "IMPLICIT", t
);
17260 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
17263 /* ffestb_decl_R5394_ -- "IMPLICIT" "NONE"
17265 return ffestb_decl_R5394_; // to lexer
17267 Handle EOS/SEMICOLON. */
17269 static ffelexHandler
17270 ffestb_decl_R5394_ (ffelexToken t
)
17272 switch (ffelex_token_type (t
))
17274 case FFELEX_typeEOS
:
17275 case FFELEX_typeSEMICOLON
:
17276 ffesta_confirmed ();
17277 if (!ffesta_is_inhibited ())
17278 ffestc_R539 (); /* IMPLICIT NONE. */
17279 return (ffelexHandler
) ffesta_zero (t
);
17285 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "IMPLICIT", t
);
17286 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
17289 /* ffestb_decl_R5395_ -- "IMPLICIT" implicit-spec-list COMMA
17291 return ffestb_decl_R5395_; // to lexer
17293 Handle NAME for next type-spec. */
17295 static ffelexHandler
17296 ffestb_decl_R5395_ (ffelexToken t
)
17298 switch (ffelex_token_type (t
))
17300 case FFELEX_typeNAME
:
17301 switch (ffestr_second (t
))
17303 case FFESTR_secondINTEGER
:
17304 ffestb_local_
.decl
.type
= FFESTP_typeINTEGER
;
17305 return (ffelexHandler
) ffestb_decl_R5391_
;
17307 case FFESTR_secondBYTE
:
17308 ffestb_local_
.decl
.type
= FFESTP_typeBYTE
;
17309 return (ffelexHandler
) ffestb_decl_R5391_
;
17311 case FFESTR_secondWORD
:
17312 ffestb_local_
.decl
.type
= FFESTP_typeWORD
;
17313 return (ffelexHandler
) ffestb_decl_R5391_
;
17315 case FFESTR_secondREAL
:
17316 ffestb_local_
.decl
.type
= FFESTP_typeREAL
;
17317 return (ffelexHandler
) ffestb_decl_R5391_
;
17319 case FFESTR_secondCOMPLEX
:
17320 ffestb_local_
.decl
.type
= FFESTP_typeCOMPLEX
;
17321 return (ffelexHandler
) ffestb_decl_R5391_
;
17323 case FFESTR_secondLOGICAL
:
17324 ffestb_local_
.decl
.type
= FFESTP_typeLOGICAL
;
17325 return (ffelexHandler
) ffestb_decl_R5391_
;
17327 case FFESTR_secondCHARACTER
:
17328 ffestb_local_
.decl
.type
= FFESTP_typeCHARACTER
;
17329 return (ffelexHandler
) ffestb_decl_R5391_
;
17331 case FFESTR_secondDOUBLE
:
17332 return (ffelexHandler
) ffestb_decl_R5392_
;
17334 case FFESTR_secondDOUBLEPRECISION
:
17335 ffestb_local_
.decl
.type
= FFESTP_typeDBLPRCSN
;
17336 ffestb_local_
.decl
.kind
= NULL
;
17337 ffestb_local_
.decl
.kindt
= NULL
;
17338 ffestb_local_
.decl
.len
= NULL
;
17339 ffestb_local_
.decl
.lent
= NULL
;
17340 return (ffelexHandler
) ffestb_decl_R539letters_
;
17342 case FFESTR_secondDOUBLECOMPLEX
:
17343 ffestb_local_
.decl
.type
= FFESTP_typeDBLCMPLX
;
17344 ffestb_local_
.decl
.kind
= NULL
;
17345 ffestb_local_
.decl
.kindt
= NULL
;
17346 ffestb_local_
.decl
.len
= NULL
;
17347 ffestb_local_
.decl
.lent
= NULL
;
17348 return (ffelexHandler
) ffestb_decl_R539letters_
;
17359 if (ffestb_local_
.decl
.imp_started
&& !ffesta_is_inhibited ())
17360 ffestc_R539finish ();
17361 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "IMPLICIT", t
);
17362 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
17365 /* ffestb_decl_R539letters_ -- "IMPLICIT" type-spec
17367 return ffestb_decl_R539letters_; // to lexer
17369 Handle OPEN_PAREN. */
17371 static ffelexHandler
17372 ffestb_decl_R539letters_ (ffelexToken t
)
17374 ffelex_set_names (FALSE
);
17376 switch (ffelex_token_type (t
))
17378 case FFELEX_typeOPEN_PAREN
:
17379 ffestb_local_
.decl
.imps
= ffestt_implist_create ();
17380 return (ffelexHandler
) ffestb_decl_R539letters_1_
;
17386 if (ffestb_local_
.decl
.kindt
!= NULL
)
17387 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
17388 if (ffestb_local_
.decl
.lent
!= NULL
)
17389 ffelex_token_kill (ffestb_local_
.decl
.lent
);
17390 if (ffestb_local_
.decl
.imp_started
&& !ffesta_is_inhibited ())
17391 ffestc_R539finish ();
17392 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "IMPLICIT", t
);
17393 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
17396 /* ffestb_decl_R539letters_1_ -- "IMPLICIT" type-spec OPEN_PAREN
17398 return ffestb_decl_R539letters_1_; // to lexer
17402 static ffelexHandler
17403 ffestb_decl_R539letters_1_ (ffelexToken t
)
17405 switch (ffelex_token_type (t
))
17407 case FFELEX_typeNAME
:
17408 if (ffelex_token_length (t
) != 1)
17410 ffesta_tokens
[1] = ffelex_token_use (t
);
17411 return (ffelexHandler
) ffestb_decl_R539letters_2_
;
17417 ffestt_implist_kill (ffestb_local_
.decl
.imps
);
17418 if (ffestb_local_
.decl
.kindt
!= NULL
)
17419 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
17420 if (ffestb_local_
.decl
.lent
!= NULL
)
17421 ffelex_token_kill (ffestb_local_
.decl
.lent
);
17422 if (ffestb_local_
.decl
.imp_started
&& !ffesta_is_inhibited ())
17423 ffestc_R539finish ();
17424 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "IMPLICIT", t
);
17425 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
17428 /* ffestb_decl_R539letters_2_ -- "IMPLICIT" type-spec OPEN_PAREN NAME
17430 return ffestb_decl_R539letters_2_; // to lexer
17432 Handle COMMA or MINUS. */
17434 static ffelexHandler
17435 ffestb_decl_R539letters_2_ (ffelexToken t
)
17437 switch (ffelex_token_type (t
))
17439 case FFELEX_typeCOMMA
:
17440 ffestt_implist_append (ffestb_local_
.decl
.imps
, ffesta_tokens
[1], NULL
);
17441 return (ffelexHandler
) ffestb_decl_R539letters_1_
;
17443 case FFELEX_typeCLOSE_PAREN
:
17444 ffestt_implist_append (ffestb_local_
.decl
.imps
, ffesta_tokens
[1], NULL
);
17445 return (ffelexHandler
) ffestb_decl_R539letters_5_
;
17447 case FFELEX_typeMINUS
:
17448 return (ffelexHandler
) ffestb_decl_R539letters_3_
;
17454 ffelex_token_kill (ffesta_tokens
[1]);
17455 ffestt_implist_kill (ffestb_local_
.decl
.imps
);
17456 if (ffestb_local_
.decl
.kindt
!= NULL
)
17457 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
17458 if (ffestb_local_
.decl
.lent
!= NULL
)
17459 ffelex_token_kill (ffestb_local_
.decl
.lent
);
17460 if (ffestb_local_
.decl
.imp_started
&& !ffesta_is_inhibited ())
17461 ffestc_R539finish ();
17462 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "IMPLICIT", t
);
17463 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
17466 /* ffestb_decl_R539letters_3_ -- "IMPLICIT" type-spec OPEN_PAREN NAME MINUS
17468 return ffestb_decl_R539letters_3_; // to lexer
17472 static ffelexHandler
17473 ffestb_decl_R539letters_3_ (ffelexToken t
)
17475 switch (ffelex_token_type (t
))
17477 case FFELEX_typeNAME
:
17478 if (ffelex_token_length (t
) != 1)
17480 ffestt_implist_append (ffestb_local_
.decl
.imps
, ffesta_tokens
[1],
17481 ffelex_token_use (t
));
17482 return (ffelexHandler
) ffestb_decl_R539letters_4_
;
17488 ffelex_token_kill (ffesta_tokens
[1]);
17489 ffestt_implist_kill (ffestb_local_
.decl
.imps
);
17490 if (ffestb_local_
.decl
.kindt
!= NULL
)
17491 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
17492 if (ffestb_local_
.decl
.lent
!= NULL
)
17493 ffelex_token_kill (ffestb_local_
.decl
.lent
);
17494 if (ffestb_local_
.decl
.imp_started
&& !ffesta_is_inhibited ())
17495 ffestc_R539finish ();
17496 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "IMPLICIT", t
);
17497 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
17500 /* ffestb_decl_R539letters_4_ -- "IMPLICIT" type-spec OPEN_PAREN NAME MINUS
17503 return ffestb_decl_R539letters_4_; // to lexer
17505 Handle COMMA or CLOSE_PAREN. */
17507 static ffelexHandler
17508 ffestb_decl_R539letters_4_ (ffelexToken t
)
17510 switch (ffelex_token_type (t
))
17512 case FFELEX_typeCOMMA
:
17513 return (ffelexHandler
) ffestb_decl_R539letters_1_
;
17515 case FFELEX_typeCLOSE_PAREN
:
17516 return (ffelexHandler
) ffestb_decl_R539letters_5_
;
17522 ffestt_implist_kill (ffestb_local_
.decl
.imps
);
17523 if (ffestb_local_
.decl
.kindt
!= NULL
)
17524 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
17525 if (ffestb_local_
.decl
.lent
!= NULL
)
17526 ffelex_token_kill (ffestb_local_
.decl
.lent
);
17527 if (ffestb_local_
.decl
.imp_started
&& !ffesta_is_inhibited ())
17528 ffestc_R539finish ();
17529 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "IMPLICIT", t
);
17530 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
17533 /* ffestb_decl_R539letters_5_ -- "IMPLICIT" type-spec OPEN_PAREN
17534 letter-spec-list CLOSE_PAREN
17536 return ffestb_decl_R539letters_5_; // to lexer
17538 Handle COMMA or EOS/SEMICOLON. */
17540 static ffelexHandler
17541 ffestb_decl_R539letters_5_ (ffelexToken t
)
17543 switch (ffelex_token_type (t
))
17545 case FFELEX_typeCOMMA
:
17546 case FFELEX_typeEOS
:
17547 case FFELEX_typeSEMICOLON
:
17548 if (!ffestb_local_
.decl
.imp_started
)
17550 ffestb_local_
.decl
.imp_started
= TRUE
;
17551 ffesta_confirmed ();
17552 if (!ffesta_is_inhibited ())
17553 ffestc_R539start ();
17555 if (!ffesta_is_inhibited ())
17556 ffestc_R539item (ffestb_local_
.decl
.type
, ffestb_local_
.decl
.kind
,
17557 ffestb_local_
.decl
.kindt
, ffestb_local_
.decl
.len
,
17558 ffestb_local_
.decl
.lent
, ffestb_local_
.decl
.imps
);
17559 if (ffestb_local_
.decl
.kindt
!= NULL
)
17560 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
17561 if (ffestb_local_
.decl
.lent
!= NULL
)
17562 ffelex_token_kill (ffestb_local_
.decl
.lent
);
17563 ffestt_implist_kill (ffestb_local_
.decl
.imps
);
17564 if (ffelex_token_type (t
) == FFELEX_typeCOMMA
)
17565 return (ffelexHandler
) ffestb_decl_R5395_
;
17566 if (!ffesta_is_inhibited ())
17567 ffestc_R539finish ();
17568 return (ffelexHandler
) ffesta_zero (t
);
17574 ffestt_implist_kill (ffestb_local_
.decl
.imps
);
17575 if (ffestb_local_
.decl
.kindt
!= NULL
)
17576 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
17577 if (ffestb_local_
.decl
.lent
!= NULL
)
17578 ffelex_token_kill (ffestb_local_
.decl
.lent
);
17579 if (ffestb_local_
.decl
.imp_started
&& !ffesta_is_inhibited ())
17580 ffestc_R539finish ();
17581 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "IMPLICIT", t
);
17582 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);
17585 /* ffestb_decl_R539maybe_ -- "IMPLICIT" generic-type-spec
17587 return ffestb_decl_R539maybe_; // to lexer
17589 Handle OPEN_PAREN. */
17591 static ffelexHandler
17592 ffestb_decl_R539maybe_ (ffelexToken t
)
17594 assert (ffelex_token_type (t
) == FFELEX_typeOPEN_PAREN
);
17595 ffestb_local_
.decl
.imps
= ffestt_implist_create ();
17596 ffestb_local_
.decl
.toklist
= ffestt_tokenlist_create ();
17597 ffestb_local_
.decl
.imp_seen_comma
17598 = (ffestb_local_
.decl
.type
!= FFESTP_typeCHARACTER
);
17599 return (ffelexHandler
) ffestb_decl_R539maybe_1_
;
17602 /* ffestb_decl_R539maybe_1_ -- "IMPLICIT" generic-type-spec OPEN_PAREN
17604 return ffestb_decl_R539maybe_1_; // to lexer
17608 static ffelexHandler
17609 ffestb_decl_R539maybe_1_ (ffelexToken t
)
17611 ffelexHandler next
;
17613 switch (ffelex_token_type (t
))
17615 case FFELEX_typeNAME
:
17616 if (ffelex_token_length (t
) != 1)
17618 ffesta_tokens
[1] = ffelex_token_use (t
);
17619 ffestt_tokenlist_append (ffestb_local_
.decl
.toklist
, ffelex_token_use (t
));
17620 return (ffelexHandler
) ffestb_decl_R539maybe_2_
;
17626 ffestt_implist_kill (ffestb_local_
.decl
.imps
);
17627 next
= (ffelexHandler
) ffestt_tokenlist_handle (ffestb_local_
.decl
.toklist
,
17628 (ffelexHandler
) ffestb_local_
.decl
.imp_handler
);
17629 ffestt_tokenlist_kill (ffestb_local_
.decl
.toklist
);
17630 return (ffelexHandler
) (*next
) (t
);
17633 /* ffestb_decl_R539maybe_2_ -- "IMPLICIT" generic-type-spec OPEN_PAREN NAME
17635 return ffestb_decl_R539maybe_2_; // to lexer
17637 Handle COMMA or MINUS. */
17639 static ffelexHandler
17640 ffestb_decl_R539maybe_2_ (ffelexToken t
)
17642 ffelexHandler next
;
17644 switch (ffelex_token_type (t
))
17646 case FFELEX_typeCOMMA
:
17647 ffestt_implist_append (ffestb_local_
.decl
.imps
, ffesta_tokens
[1], NULL
);
17648 if (ffestb_local_
.decl
.imp_seen_comma
)
17650 ffestt_tokenlist_kill (ffestb_local_
.decl
.toklist
);
17651 return (ffelexHandler
) ffestb_decl_R539letters_1_
;
17653 ffestb_local_
.decl
.imp_seen_comma
= TRUE
;
17654 ffestt_tokenlist_append (ffestb_local_
.decl
.toklist
, ffelex_token_use (t
));
17655 return (ffelexHandler
) ffestb_decl_R539maybe_1_
;
17657 case FFELEX_typeCLOSE_PAREN
:
17658 ffestt_implist_append (ffestb_local_
.decl
.imps
, ffesta_tokens
[1], NULL
);
17659 ffestt_tokenlist_append (ffestb_local_
.decl
.toklist
, ffelex_token_use (t
));
17660 return (ffelexHandler
) ffestb_decl_R539maybe_5_
;
17662 case FFELEX_typeMINUS
:
17663 ffestt_tokenlist_append (ffestb_local_
.decl
.toklist
, ffelex_token_use (t
));
17664 return (ffelexHandler
) ffestb_decl_R539maybe_3_
;
17670 ffelex_token_kill (ffesta_tokens
[1]);
17671 ffestt_implist_kill (ffestb_local_
.decl
.imps
);
17672 next
= (ffelexHandler
) ffestt_tokenlist_handle (ffestb_local_
.decl
.toklist
,
17673 (ffelexHandler
) ffestb_local_
.decl
.imp_handler
);
17674 ffestt_tokenlist_kill (ffestb_local_
.decl
.toklist
);
17675 return (ffelexHandler
) (*next
) (t
);
17678 /* ffestb_decl_R539maybe_3_ -- "IMPLICIT" type-spec OPEN_PAREN NAME MINUS
17680 return ffestb_decl_R539maybe_3_; // to lexer
17684 static ffelexHandler
17685 ffestb_decl_R539maybe_3_ (ffelexToken t
)
17687 ffelexHandler next
;
17689 switch (ffelex_token_type (t
))
17691 case FFELEX_typeNAME
:
17692 if (ffelex_token_length (t
) != 1)
17694 ffestt_implist_append (ffestb_local_
.decl
.imps
, ffesta_tokens
[1],
17695 ffelex_token_use (t
));
17696 ffestt_tokenlist_append (ffestb_local_
.decl
.toklist
, ffelex_token_use (t
));
17697 return (ffelexHandler
) ffestb_decl_R539maybe_4_
;
17703 ffelex_token_kill (ffesta_tokens
[1]);
17704 ffestt_implist_kill (ffestb_local_
.decl
.imps
);
17705 next
= (ffelexHandler
) ffestt_tokenlist_handle (ffestb_local_
.decl
.toklist
,
17706 (ffelexHandler
) ffestb_local_
.decl
.imp_handler
);
17707 ffestt_tokenlist_kill (ffestb_local_
.decl
.toklist
);
17708 return (ffelexHandler
) (*next
) (t
);
17711 /* ffestb_decl_R539maybe_4_ -- "IMPLICIT" type-spec OPEN_PAREN NAME MINUS
17714 return ffestb_decl_R539maybe_4_; // to lexer
17716 Handle COMMA or CLOSE_PAREN. */
17718 static ffelexHandler
17719 ffestb_decl_R539maybe_4_ (ffelexToken t
)
17721 ffelexHandler next
;
17723 switch (ffelex_token_type (t
))
17725 case FFELEX_typeCOMMA
:
17726 if (ffestb_local_
.decl
.imp_seen_comma
)
17728 ffestt_tokenlist_kill (ffestb_local_
.decl
.toklist
);
17729 return (ffelexHandler
) ffestb_decl_R539letters_1_
;
17731 ffestb_local_
.decl
.imp_seen_comma
= TRUE
;
17732 ffestt_tokenlist_append (ffestb_local_
.decl
.toklist
, ffelex_token_use (t
));
17733 return (ffelexHandler
) ffestb_decl_R539maybe_1_
;
17735 case FFELEX_typeCLOSE_PAREN
:
17736 ffestt_tokenlist_append (ffestb_local_
.decl
.toklist
, ffelex_token_use (t
));
17737 return (ffelexHandler
) ffestb_decl_R539maybe_5_
;
17743 ffestt_implist_kill (ffestb_local_
.decl
.imps
);
17744 next
= (ffelexHandler
) ffestt_tokenlist_handle (ffestb_local_
.decl
.toklist
,
17745 (ffelexHandler
) ffestb_local_
.decl
.imp_handler
);
17746 ffestt_tokenlist_kill (ffestb_local_
.decl
.toklist
);
17747 return (ffelexHandler
) (*next
) (t
);
17750 /* ffestb_decl_R539maybe_5_ -- "IMPLICIT" type-spec OPEN_PAREN
17751 letter-spec-list CLOSE_PAREN
17753 return ffestb_decl_R539maybe_5_; // to lexer
17755 Handle COMMA or EOS/SEMICOLON. */
17757 static ffelexHandler
17758 ffestb_decl_R539maybe_5_ (ffelexToken t
)
17760 ffelexHandler next
;
17762 switch (ffelex_token_type (t
))
17764 case FFELEX_typeCOMMA
:
17765 case FFELEX_typeEOS
:
17766 case FFELEX_typeSEMICOLON
:
17767 ffestt_tokenlist_kill (ffestb_local_
.decl
.toklist
);
17768 if (!ffestb_local_
.decl
.imp_started
)
17770 ffestb_local_
.decl
.imp_started
= TRUE
;
17771 ffesta_confirmed ();
17772 if (!ffesta_is_inhibited ())
17773 ffestc_R539start ();
17775 if (!ffesta_is_inhibited ())
17776 ffestc_R539item (ffestb_local_
.decl
.type
, ffestb_local_
.decl
.kind
,
17777 ffestb_local_
.decl
.kindt
, ffestb_local_
.decl
.len
,
17778 ffestb_local_
.decl
.lent
, ffestb_local_
.decl
.imps
);
17779 if (ffestb_local_
.decl
.kindt
!= NULL
)
17780 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
17781 if (ffestb_local_
.decl
.lent
!= NULL
)
17782 ffelex_token_kill (ffestb_local_
.decl
.lent
);
17783 ffestt_implist_kill (ffestb_local_
.decl
.imps
);
17784 if (ffelex_token_type (t
) == FFELEX_typeCOMMA
)
17785 return (ffelexHandler
) ffestb_decl_R5395_
;
17786 if (!ffesta_is_inhibited ())
17787 ffestc_R539finish ();
17788 return (ffelexHandler
) ffesta_zero (t
);
17790 case FFELEX_typeOPEN_PAREN
:
17791 ffesta_confirmed ();
17792 ffestt_implist_kill (ffestb_local_
.decl
.imps
);
17793 next
= (ffelexHandler
) ffestt_tokenlist_handle (ffestb_local_
.decl
.toklist
,
17794 (ffelexHandler
) ffestb_local_
.decl
.imp_handler
);
17795 ffestt_tokenlist_kill (ffestb_local_
.decl
.toklist
);
17796 return (ffelexHandler
) (*next
) (t
);
17802 ffestt_implist_kill (ffestb_local_
.decl
.imps
);
17803 ffestt_tokenlist_kill (ffestb_local_
.decl
.toklist
);
17804 if (ffestb_local_
.decl
.kindt
!= NULL
)
17805 ffelex_token_kill (ffestb_local_
.decl
.kindt
);
17806 if (ffestb_local_
.decl
.lent
!= NULL
)
17807 ffelex_token_kill (ffestb_local_
.decl
.lent
);
17808 if (ffestb_local_
.decl
.imp_started
&& !ffesta_is_inhibited ())
17809 ffestc_R539finish ();
17810 ffesta_ffebad_1st (FFEBAD_INVALID_STMT_FORM
, "IMPLICIT", t
);
17811 return (ffelexHandler
) ffelex_swallow_tokens (t
, (ffelexHandler
) ffesta_zero
);