home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
fchek284.zip
/
fortran.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-05-30
|
123KB
|
4,078 lines
/* A Bison parser, made from fortran.y with Bison version GNU Bison version 1.22
*/
#define YYBISON 1 /* Identify Bison output. */
#define tok_identifier 258
#define tok_array_identifier 259
#define tok_label 260
#define tok_integer_const 261
#define tok_real_const 262
#define tok_dp_const 263
#define tok_complex_const 264
#define tok_dcomplex_const 265
#define tok_logical_const 266
#define tok_string 267
#define tok_hollerith 268
#define tok_edit_descriptor 269
#define tok_letter 270
#define tok_relop 271
#define tok_AND 272
#define tok_OR 273
#define tok_EQV 274
#define tok_NEQV 275
#define tok_NOT 276
#define tok_power 277
#define tok_concat 278
#define tok_ACCEPT 279
#define tok_ASSIGN 280
#define tok_BACKSPACE 281
#define tok_BLOCK 282
#define tok_BLOCKDATA 283
#define tok_BYTE 284
#define tok_CALL 285
#define tok_CHARACTER 286
#define tok_CLOSE 287
#define tok_COMMON 288
#define tok_COMPLEX 289
#define tok_CONTINUE 290
#define tok_DATA 291
#define tok_DIMENSION 292
#define tok_DO 293
#define tok_DOUBLE 294
#define tok_DOUBLECOMPLEX 295
#define tok_DOUBLEPRECISION 296
#define tok_DOWHILE 297
#define tok_ELSE 298
#define tok_ELSEIF 299
#define tok_END 300
#define tok_ENDDO 301
#define tok_ENDFILE 302
#define tok_ENDIF 303
#define tok_ENTRY 304
#define tok_EQUIVALENCE 305
#define tok_EXTERNAL 306
#define tok_FILE 307
#define tok_FORMAT 308
#define tok_FUNCTION 309
#define tok_GO 310
#define tok_GOTO 311
#define tok_IF 312
#define tok_IMPLICIT 313
#define tok_INCLUDE 314
#define tok_INQUIRE 315
#define tok_INTEGER 316
#define tok_INTRINSIC 317
#define tok_LOGICAL 318
#define tok_NAMELIST 319
#define tok_NONE 320
#define tok_OPEN 321
#define tok_PARAMETER 322
#define tok_PAUSE 323
#define tok_PRECISION 324
#define tok_PRINT 325
#define tok_PROGRAM 326
#define tok_READ 327
#define tok_REAL 328
#define tok_RETURN 329
#define tok_REWIND 330
#define tok_SAVE 331
#define tok_STOP 332
#define tok_SUBROUTINE 333
#define tok_THEN 334
#define tok_TO 335
#define tok_TYPE 336
#define tok_WHILE 337
#define tok_WRITE 338
#define tok_illegal 339
#define tok_empty 340
#define EOS 127
#define REDUCE 341
#line 9 "fortran.y"
/*
fortran.c:
Copyright (C) 1992 by Robert K. Moniot.
This program is free software. Permission is granted to
modify it and/or redistribute it. There is no warranty
for this program.
This grammar is ANSI standard-conforming, except for:
-- complex constant and a few other ambiguities needing
significant lookahead cannot be split across lines.
Extensions supported:
-- Case insensitive.
-- Hollerith constants.
-- Variable names may be longer than 6 characters. Also
allows underscores and dollar signs in names.
-- DO ... ENDDO and DO WHILE loop forms allowed.
-- NAMELIST supported.
-- TYPE and ACCEPT I/O statements allowed.
-- Tabs are permitted in input, and (except in character data)
expand into blanks up to the next column equal to 1 mod 8.
-- Type declarations INTEGER*2, REAL*8, etc. are allowed.
-- IMPLICIT NONE allowed.
*/
/* Author: R. Moniot
* Date: August 1988
* Last revision: July 1993
*/
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "ftnchek.h"
#include "symtab.h"
/* The following section is for use with bison-derived
parser. Define alloca to be malloc for those cases
not covered by the cases covered there. The ifdefs
are those in the skeleton parser with includes removed */
#ifdef AIXC /* IBM RS/6000 xlc compiler does it this way */
#pragma alloca
#endif
#ifndef alloca
#ifdef __GNUC__
#else /* Not GNU C. */
#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__)
#else /* Not sparc */
#ifdef MSDOS
#endif /* MSDOS */
#endif /* Not sparc. */
#endif /* Not GNU C. */
#define alloca malloc
#endif /* alloca now defined. */
#ifndef YYDEBUG /* If not declared otherwise... */
int yydebug; /* declare yydebug to satisfy extern in ftnchek.c */
#ifdef DEVELOPMENT
#define YYDEBUG 1 /* For development it is handy */
#else
#define YYDEBUG 0
#endif
#endif
#ifdef DEVELOPMENT
#define DEBUG_PARSER
#endif
PRIVATE int current_datatype, /* set when parse type_name or type_stmt */
current_size_is_adjustable, /* set in CHARACTER declarations */
current_size_is_expression, /* set in CHARACTER declarations */
control_item_count; /* count of items in control_info_list */
int io_internal_file, /* Flag for catching misuse of internal files */
io_list_directed, /* Flag for use in processing io control lists */
io_warning_given; /* to prevent multiple warnings */
int
stmt_sequence_no; /* set when parsing, reset to 0 at end_stmt */
PRIVATE long current_typesize; /* for type*len declarations: value of len */
PRIVATE char *current_len_text; /* for type*len declarations: text of len */
PRIVATE Token save_token; /* Holds token shared by productions */
extern unsigned prev_stmt_line_num; /* shared with advance */
extern char *new_tree_text(); /* shared with symtab.c */
unsigned true_prev_stmt_line_num; /* shared with symtab.c */
PRIVATE int
current_module_hash = -1, /* hashtable index of current module name */
current_module_type,
executable_stmt=FALSE,
prev_stmt_class=0, /* flags for lexer */
prev_goto=FALSE,
goto_flag=FALSE; /* if unconditional GOTO was encountered */
int
complex_const_allowed=FALSE, /* for help in lookahead for these */
in_assignment_stmt=FALSE,
inside_format=FALSE, /* when inside parens of FORMAT */
integer_context=FALSE; /* says integers-only are to follow */
#ifdef DEBUG_PARSER
PRIVATE void
print_comlist(), print_exprlist();
#endif
PRIVATE void
check_stmt_sequence(),
init_io_ctrl_list(),
do_unexpr(),do_binexpr(),
END_processing();
PRIVATE Token
*add_tree_node(),
*append_token(),
*empty_token();
PRIVATE int
do_bounds_type();
/* NOTE: As of Aug 1994 these are undergoing revision to separate the
use of class, subclass fields */
/*
1. dim_bound_lists: dimensioning info for arrays:
token.class = no. of dimensions, --> TOK_dims
token.subclass = no. of elements --> TOK_elts
2. expressions
token.value.integer = hash index (of identifier)
token.class = type_byte = storage_class << 4 + datatype --> TOK_type
token.subclass = flags: CONST_EXPR, LVALUE_EXPR, etc. --> TOK_flags
3. common variable lists
token.subclass = flag: COMMA_FLAG used to handle extra/missing commas
--> TOK_flags
4. substring_interval
token.class = start index --> TOK_start
token.subclass = end index --> TOK_end
*/
#define SEQ_HEADER 1
#define SEQ_IMPLICIT 2
#define SEQ_SPECIF 3
#define SEQ_STMT_FUN 4
#define SEQ_EXEC 5
#define SEQ_END 6
#ifndef YYLTYPE
typedef
struct yyltype
{
int timestamp;
int first_line;
int first_column;
int last_line;
int last_column;
char *text;
}
yyltype;
#define YYLTYPE yyltype
#endif
#ifndef YYSTYPE
#define YYSTYPE int
#endif
#include <stdio.h>
#ifndef __cplusplus
#ifndef __STDC__
#define const
#endif
#endif
#define YYFINAL 801
#define YYFLAG -32768
#define YYNTBASE 101
#define YYTRANSLATE(x) ((unsigned)(x) <= 341 ? yytranslate[x] : 335)
static const char yytranslate[] = { 0,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 97, 2, 2, 2, 89,
88, 91, 98, 90, 94, 96, 93, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 92, 2, 99,
95, 100, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 86, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 1, 2, 3, 4, 5,
6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
76, 77, 78, 79, 80, 81, 82, 83, 84, 85,
87
};
static const short yyr1[] = { 0,
101, 101, 102, 102, 103, 103, 103, 104, 104, 105,
105, 106, 106, 106, 106, 106, 107, 107, 107, 107,
108, 108, 109, 110, 111, 111, 111, 111, 111, 112,
112, 113, 113, 113, 113, 113, 113, 113, 113, 114,
114, 115, 115, 115, 115, 115, 116, 116, 116, 116,
116, 116, 116, 116, 116, 116, 116, 116, 116, 116,
116, 116, 116, 117, 117, 118, 118, 118, 118, 119,
119, 119, 121, 120, 122, 122, 123, 124, 124, 124,
124, 125, 126, 127, 128, 128, 128, 129, 130, 130,
131, 132, 132, 133, 133, 134, 134, 135, 135, 136,
136, 137, 138, 138, 139, 140, 140, 141, 141, 141,
141, 143, 142, 144, 144, 145, 145, 146, 146, 146,
147, 148, 148, 149, 149, 149, 150, 150, 151, 152,
152, 152, 153, 153, 154, 154, 155, 155, 156, 157,
157, 158, 159, 160, 160, 161, 161, 162, 162, 162,
162, 163, 163, 163, 164, 164, 164, 164, 165, 165,
165, 165, 165, 166, 167, 168, 168, 169, 169, 170,
170, 171, 171, 171, 171, 172, 173, 173, 174, 175,
174, 177, 176, 178, 178, 179, 179, 180, 180, 180,
181, 182, 182, 184, 183, 185, 186, 186, 187, 188,
188, 189, 189, 190, 190, 191, 191, 192, 193, 193,
193, 195, 196, 194, 197, 197, 198, 198, 199, 199,
200, 200, 201, 201, 202, 202, 203, 203, 204, 204,
205, 206, 206, 208, 209, 207, 210, 210, 210, 210,
211, 212, 213, 213, 214, 214, 214, 215, 215, 216,
216, 217, 218, 219, 221, 220, 222, 223, 224, 222,
225, 226, 226, 227, 228, 227, 229, 227, 230, 230,
230, 231, 231, 232, 232, 233, 234, 235, 236, 236,
236, 236, 238, 237, 239, 237, 241, 240, 242, 242,
242, 242, 242, 243, 244, 244, 245, 246, 247, 245,
248, 249, 250, 248, 251, 251, 252, 252, 253, 253,
253, 254, 254, 255, 255, 256, 256, 257, 259, 258,
261, 260, 263, 262, 264, 264, 265, 266, 266, 267,
267, 268, 268, 269, 270, 270, 271, 271, 273, 272,
274, 274, 275, 275, 276, 276, 276, 277, 277, 278,
278, 278, 278, 279, 279, 279, 279, 279, 279, 280,
281, 281, 281, 283, 284, 282, 285, 286, 286, 287,
287, 288, 290, 289, 291, 289, 292, 289, 293, 294,
294, 295, 295, 296, 296, 297, 298, 299, 299, 300,
300, 301, 302, 303, 303, 303, 304, 304, 305, 305,
306, 306, 307, 307, 308, 308, 308, 308, 308, 309,
309, 309, 310, 310, 311, 311, 312, 312, 312, 312,
312, 312, 313, 313, 313, 313, 314, 314, 314, 314,
314, 315, 316, 317, 318, 319, 320, 321, 321, 322,
323, 323, 323, 324, 324, 325, 325, 325, 325, 326,
327, 327, 328, 329, 330, 330, 331, 331, 331, 331,
331, 331, 332, 333, 334
};
static const short yyr2[] = { 0,
1, 0, 1, 2, 1, 1, 1, 1, 1, 2,
1, 1, 1, 1, 1, 2, 1, 1, 1, 1,
1, 2, 2, 3, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 0, 4, 3, 6, 1, 3, 6, 3,
6, 2, 1, 1, 1, 1, 1, 1, 3, 6,
1, 0, 1, 1, 3, 1, 1, 2, 3, 2,
1, 3, 1, 3, 4, 1, 3, 1, 3, 1,
3, 0, 4, 3, 5, 3, 3, 1, 1, 1,
4, 2, 2, 3, 3, 4, 1, 2, 2, 3,
2, 1, 1, 2, 1, 2, 1, 1, 3, 1,
2, 2, 3, 1, 2, 1, 2, 3, 3, 3,
4, 1, 3, 1, 1, 1, 1, 1, 2, 1,
2, 1, 1, 1, 3, 1, 3, 1, 1, 1,
3, 1, 3, 1, 3, 1, 3, 3, 1, 0,
4, 0, 5, 1, 3, 1, 3, 3, 1, 3,
5, 1, 3, 0, 4, 3, 1, 3, 3, 1,
3, 2, 3, 1, 3, 1, 3, 3, 1, 2,
3, 0, 0, 6, 1, 3, 1, 1, 1, 3,
1, 3, 1, 1, 1, 1, 1, 3, 1, 1,
7, 3, 5, 0, 0, 6, 1, 1, 1, 1,
6, 4, 6, 7, 3, 6, 7, 1, 2, 2,
4, 10, 2, 3, 0, 5, 2, 0, 0, 8,
2, 2, 3, 5, 0, 7, 0, 6, 3, 4,
2, 3, 5, 3, 2, 2, 3, 3, 0, 1,
1, 1, 0, 3, 0, 4, 0, 5, 5, 6,
7, 3, 5, 1, 3, 5, 3, 0, 0, 7,
3, 0, 0, 7, 1, 3, 3, 1, 1, 3,
3, 3, 1, 1, 3, 1, 1, 7, 0, 6,
0, 6, 0, 6, 3, 5, 1, 3, 5, 1,
2, 3, 5, 1, 1, 1, 1, 1, 0, 6,
0, 1, 1, 2, 1, 1, 1, 3, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 2, 2, 0, 0, 5, 4, 0, 1, 1,
3, 1, 0, 3, 0, 5, 0, 6, 2, 1,
3, 1, 3, 2, 3, 4, 1, 0, 1, 1,
3, 1, 1, 1, 3, 3, 1, 3, 1, 3,
1, 2, 1, 3, 1, 2, 2, 3, 3, 1,
3, 3, 1, 3, 1, 3, 1, 1, 1, 1,
1, 3, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 4, 4, 1, 3, 1,
2, 2, 2, 2, 2, 3, 4, 4, 5, 1,
1, 1, 1, 1, 1, 1, 1, 2, 2, 1,
1, 1, 1, 0, 1
};
static const short yydefact[] = { 0,
0, 453, 454, 0, 0, 464, 327, 0, 101, 163,
0, 164, 321, 0, 157, 0, 0, 0, 464, 0,
162, 160, 0, 0, 0, 0, 0, 330, 0, 0,
112, 0, 339, 84, 0, 248, 0, 176, 0, 323,
155, 0, 158, 0, 319, 0, 279, 0, 73, 294,
156, 0, 334, 0, 279, 91, 0, 287, 7, 0,
3, 5, 8, 11, 12, 9, 21, 6, 13, 25,
29, 14, 40, 41, 15, 64, 65, 17, 30, 18,
77, 0, 0, 83, 0, 19, 88, 0, 20, 0,
32, 33, 34, 35, 36, 85, 152, 154, 86, 87,
0, 27, 26, 37, 38, 39, 28, 47, 0, 48,
42, 49, 43, 464, 44, 66, 67, 464, 70, 71,
72, 68, 0, 69, 50, 45, 51, 54, 283, 52,
0, 53, 55, 56, 60, 61, 62, 58, 0, 59,
0, 57, 0, 31, 240, 63, 373, 46, 238, 239,
237, 451, 452, 16, 10, 22, 427, 428, 429, 430,
431, 426, 424, 425, 0, 338, 0, 419, 0, 337,
415, 421, 423, 418, 420, 417, 451, 452, 0, 100,
455, 456, 379, 0, 132, 0, 138, 0, 127, 0,
0, 133, 135, 137, 276, 0, 0, 209, 0, 215,
218, 217, 0, 103, 0, 271, 161, 159, 267, 261,
257, 0, 258, 0, 331, 0, 23, 275, 262, 0,
0, 0, 197, 0, 249, 255, 0, 0, 0, 200,
0, 0, 140, 0, 0, 0, 280, 282, 0, 281,
0, 0, 384, 0, 0, 432, 405, 410, 413, 0,
202, 0, 0, 204, 206, 0, 0, 0, 4, 0,
0, 82, 0, 98, 0, 169, 0, 166, 168, 0,
0, 174, 0, 170, 172, 0, 0, 0, 0, 85,
86, 87, 0, 179, 234, 464, 0, 0, 0, 0,
253, 464, 0, 0, 0, 451, 452, 0, 0, 0,
285, 314, 317, 316, 393, 394, 397, 399, 401, 403,
0, 0, 0, 336, 0, 335, 0, 0, 0, 0,
0, 0, 0, 445, 368, 444, 0, 0, 295, 0,
442, 388, 441, 0, 443, 0, 465, 0, 0, 131,
0, 125, 128, 129, 124, 0, 134, 136, 0, 0,
227, 230, 229, 0, 208, 0, 210, 0, 212, 102,
0, 269, 0, 0, 274, 263, 75, 92, 0, 0,
196, 0, 341, 0, 24, 0, 199, 0, 0, 139,
141, 142, 144, 146, 0, 0, 192, 194, 278, 297,
298, 0, 406, 407, 0, 0, 0, 0, 0, 385,
0, 203, 0, 277, 301, 302, 0, 78, 92, 80,
92, 89, 92, 99, 148, 0, 463, 153, 0, 165,
189, 0, 149, 0, 0, 0, 150, 178, 182, 177,
180, 0, 0, 0, 245, 464, 0, 0, 254, 0,
265, 0, 402, 0, 316, 284, 0, 0, 0, 0,
0, 0, 0, 453, 454, 0, 305, 308, 335, 0,
292, 0, 0, 325, 0, 328, 0, 332, 375, 464,
0, 380, 382, 374, 0, 450, 0, 0, 369, 370,
417, 440, 0, 438, 422, 0, 0, 389, 390, 403,
416, 0, 0, 0, 130, 126, 110, 0, 106, 435,
108, 0, 211, 216, 0, 104, 270, 0, 0, 97,
0, 93, 94, 96, 0, 0, 119, 120, 118, 113,
0, 198, 361, 350, 351, 349, 356, 0, 354, 357,
355, 0, 358, 360, 0, 364, 0, 342, 343, 345,
346, 347, 359, 352, 353, 0, 0, 201, 143, 145,
147, 0, 309, 0, 0, 0, 0, 0, 74, 409,
408, 412, 411, 414, 207, 205, 0, 0, 0, 0,
0, 167, 0, 434, 0, 175, 171, 173, 151, 0,
0, 235, 0, 464, 250, 0, 464, 242, 464, 0,
0, 433, 0, 0, 315, 286, 395, 396, 398, 400,
404, 0, 0, 0, 0, 0, 0, 0, 0, 0,
377, 0, 446, 0, 0, 367, 0, 436, 0, 296,
386, 0, 437, 0, 0, 105, 0, 0, 228, 0,
427, 460, 461, 462, 0, 0, 213, 219, 0, 221,
457, 226, 225, 223, 0, 259, 0, 0, 114, 0,
0, 123, 0, 122, 0, 0, 362, 363, 0, 0,
344, 256, 0, 0, 0, 0, 191, 193, 0, 299,
303, 288, 0, 0, 0, 188, 190, 186, 0, 184,
181, 0, 0, 0, 0, 0, 0, 0, 0, 264,
0, 417, 289, 0, 0, 306, 307, 293, 326, 329,
333, 376, 383, 0, 381, 448, 447, 0, 371, 372,
439, 391, 241, 322, 107, 111, 109, 0, 458, 459,
0, 0, 0, 268, 0, 76, 95, 117, 116, 0,
0, 348, 365, 340, 324, 320, 311, 313, 310, 195,
392, 0, 0, 79, 81, 90, 0, 183, 0, 236,
0, 243, 251, 246, 0, 0, 0, 272, 0, 0,
290, 378, 449, 0, 0, 220, 214, 222, 226, 0,
121, 115, 0, 0, 300, 304, 187, 185, 244, 247,
464, 266, 0, 0, 291, 231, 0, 260, 366, 312,
0, 273, 318, 232, 0, 0, 252, 233, 0, 0,
0
};
static const short yydefgoto[] = { 799,
60, 61, 62, 63, 64, 65, 66, 67, 68, 69,
70, 71, 72, 73, 74, 75, 76, 77, 78, 242,
79, 80, 81, 82, 83, 84, 85, 86, 87, 88,
511, 512, 513, 89, 90, 91, 203, 187, 498, 499,
92, 221, 370, 515, 516, 517, 518, 93, 188, 189,
190, 191, 192, 193, 94, 232, 233, 234, 382, 383,
95, 96, 97, 98, 99, 100, 267, 268, 273, 274,
101, 102, 283, 581, 284, 580, 679, 680, 420, 103,
386, 387, 557, 104, 222, 105, 229, 106, 253, 254,
107, 197, 198, 505, 722, 199, 200, 637, 638, 639,
640, 350, 351, 201, 764, 108, 432, 682, 109, 110,
111, 112, 113, 114, 433, 115, 116, 117, 118, 374,
119, 364, 725, 120, 121, 122, 590, 363, 123, 591,
124, 125, 126, 127, 239, 128, 300, 448, 129, 258,
130, 131, 132, 133, 558, 742, 134, 567, 743, 456,
457, 552, 737, 301, 302, 303, 135, 235, 136, 184,
137, 228, 138, 139, 140, 141, 142, 143, 458, 167,
144, 224, 537, 538, 539, 540, 541, 542, 543, 544,
545, 659, 773, 145, 478, 479, 480, 146, 322, 609,
704, 147, 471, 472, 148, 168, 169, 487, 488, 740,
316, 305, 306, 307, 308, 309, 310, 247, 248, 249,
171, 172, 173, 250, 593, 575, 501, 149, 174, 483,
484, 175, 150, 324, 477, 176, 177, 178, 460, 643,
421, 434, 338
};
static const short yypact[] = { 1139,
-27,-32768,-32768, 1304, 438,-32768,-32768, 53,-32768,-32768,
98,-32768,-32768, 63,-32768, -18, 131, 98,-32768, 128,
-32768,-32768, 31, 39, 62, 57, 54,-32768, 71, 98,
-32768, 98,-32768,-32768, 99,-32768, 102,-32768, 216,-32768,
-32768, 98,-32768, 162,-32768, 152, 276, 438,-32768,-32768,
-32768, 805,-32768, 133, 276,-32768, 438,-32768,-32768, 1223,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-32768, 98, 98,-32768, 207,-32768,-32768, 98,-32768, 115,
-32768,-32768,-32768,-32768,-32768, 98, 210,-32768, 51, 113,
437,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 183,-32768,
-32768,-32768,-32768, 143,-32768,-32768,-32768, 1380,-32768,-32768,
-32768,-32768, 186,-32768,-32768,-32768,-32768,-32768, 824,-32768,
559,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 505,-32768,
603,-32768, 662,-32768,-32768,-32768, 225,-32768, 239,-32768,
-32768, 248, 254,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768, 840,-32768, -10, 239, 266, 339,
-32768,-32768,-32768, 239,-32768,-32768, 306, 314, 364,-32768,
-32768,-32768,-32768, 322,-32768, 79,-32768, 83,-32768, 98,
74,-32768, 341, 373,-32768, 33, 241,-32768, 145,-32768,
-32768,-32768, 170,-32768, 373, 364,-32768,-32768,-32768,-32768,
-32768, 359,-32768, 367,-32768, 388,-32768,-32768,-32768, 124,
397, 187,-32768, 400,-32768,-32768, 395, 405, 214,-32768,
98, -30,-32768, 98, 417, 98,-32768,-32768, 445,-32768,
233, 98,-32768, 1142, 1142, 260, 80,-32768, 261, 448,
-32768, 98, 275,-32768,-32768, 454, 281, 485,-32768, 240,
267,-32768, 300,-32768, 463,-32768, 319,-32768, 373, 554,
59, 490, 327,-32768, 296, 98, 333, 509, 511,-32768,
510,-32768, 335,-32768,-32768,-32768, 232, 364, 552, 519,
-32768,-32768, 364, 528, 523,-32768,-32768, 1026, 824, 533,
530,-32768,-32768, 504,-32768, 604, 606,-32768, 605, 260,
678, 336, 678,-32768, 539, 504, 678, 542, 678, 543,
120, 544, 867,-32768, 867,-32768, 840, 175,-32768, 824,
-32768, 712,-32768, 1142,-32768, 840,-32768, 547, 678,-32768,
538,-32768,-32768, 98,-32768, 176,-32768,-32768, 898, 545,
-32768,-32768,-32768, 254,-32768, 131,-32768, 131,-32768,-32768,
98, 546, 840, 840,-32768,-32768,-32768, 68, 98, 342,
-32768, 98, 1039, 840,-32768, 678,-32768, 98, 540,-32768,
-32768, 98,-32768, 548, 678, 318,-32768,-32768,-32768,-32768,
-32768, 551, 80, 80, 1142, 1142, 1142, 1142, 1142,-32768,
558,-32768, 95,-32768,-32768,-32768, 678,-32768, 68,-32768,
68,-32768, 68,-32768,-32768, 98,-32768,-32768, 933,-32768,
-32768, 59,-32768, 98, 59, 343,-32768,-32768,-32768,-32768,
-32768, 840, 326, 364,-32768,-32768, 555, 561,-32768, 562,
-32768, 1026, 605, 563, 175,-32768, 824, 568, 840, 840,
840, 840, 1026, 550, 560, 349,-32768,-32768, 504, 564,
-32768, 824, 366,-32768, 382,-32768, 392,-32768,-32768,-32768,
402,-32768, 504,-32768, 960, 260, 566, 573, 572,-32768,
411, 504, 415,-32768,-32768, 344, 575, 574, 504, 159,
-32768, 431, 541, 432,-32768,-32768,-32768, 440,-32768, 260,
584, 150,-32768,-32768, 299,-32768,-32768, 204, 211,-32768,
589, 588,-32768,-32768, 449, 590, 239,-32768, 607,-32768,
609,-32768,-32768,-32768,-32768,-32768,-32768, 1039,-32768,-32768,
-32768, 628,-32768,-32768, 673,-32768, 612, 1039,-32768,-32768,
-32768,-32768,-32768,-32768,-32768, 227, 460,-32768,-32768,-32768,
-32768, 467,-32768, 598, 616, 98, 600, 824,-32768, 80,
80,-32768,-32768,-32768,-32768,-32768, 824, 468, 615, 617,
618,-32768, 619, 260, 621,-32768,-32768,-32768,-32768, 689,
512, 504, 971,-32768,-32768, 471,-32768,-32768,-32768, 840,
624, 260, 623, 824,-32768,-32768, 604, 604, 606,-32768,
695, 371, 678, 731, 350, 631, 640, 641, 642, 364,
-32768, 774,-32768, 643, 991,-32768, 541,-32768, 840,-32768,
-32768, 840,-32768, 644, 660,-32768, 898, 1002,-32768, 634,
656,-32768,-32768,-32768, 287, 287, 658,-32768, 659,-32768,
-32768, 663,-32768,-32768, 669,-32768, 671, 68,-32768, 98,
98,-32768, 712,-32768, 98, 252,-32768,-32768, 1026, 672,
-32768,-32768, 675, 676, 98, 731,-32768,-32768, 840, 530,
530,-32768, 677, 679, 680,-32768,-32768, 655, 492,-32768,
-32768, 682, 1026, 684, 364, 685, 496, 364, 251,-32768,
1026, 664,-32768, 824, 369,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768, 687,-32768,-32768,-32768, 686,-32768,-32768,
-32768, 504,-32768,-32768,-32768,-32768,-32768, 1026,-32768,-32768,
299, 696, 1064,-32768, 700,-32768,-32768,-32768,-32768, 499,
500,-32768,-32768,-32768,-32768,-32768,-32768, 693,-32768,-32768,
504, 704, 705,-32768,-32768,-32768, 749,-32768, 689,-32768,
706,-32768,-32768,-32768, 707, 708, 710, 709, 1026, 377,
-32768,-32768,-32768, 714, 713,-32768,-32768,-32768,-32768, 711,
-32768,-32768, 694, 731,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768, 1026, 717,-32768,-32768, 1026,-32768,-32768,-32768,
364,-32768,-32768, 729, 721, 1026,-32768,-32768, 800, 821,
-32768
};
static const short yypgoto[] = {-32768,
-32768, 763,-32768,-32768, 820,-32768,-32768, 822,-32768,-32768,
-32768,-32768, 720,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768, 754, -98,-32768,-32768,-32768,
-75,-32768, 192,-32768,-32768,-32768,-32768, 11,-32768, 215,
-32768,-32768,-32768, 199, -58,-32768,-32768,-32768, 650, -168,
-32768, 665, -169,-32768,-32768,-32768, 625,-32768,-32768, 474,
-32768, -97,-32768,-32768, -90, -86,-32768, 442, -76, 435,
-32768,-32768,-32768,-32768, 279,-32768,-32768, 117, -109,-32768,
-32768, 308,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 459,
-32768,-32768, -171,-32768,-32768,-32768, 524,-32768, 146,-32768,
158,-32768, 381, -178,-32768,-32768,-32768,-32768, 8,-32768,
-32768,-32768,-32768,-32768, -401,-32768,-32768, 845, 27,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 125,
-32768,-32768,-32768,-32768, 830,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -255,
283,-32768,-32768, -282, -420,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -131, 37,
-32768,-32768,-32768, 360, -507,-32768,-32768,-32768,-32768,-32768,
-32768,-32768,-32768,-32768,-32768,-32768, 270,-32768,-32768,-32768,
-32768,-32768,-32768, 277,-32768,-32768,-32768,-32768,-32768,-32768,
-115,-32768, 148, 439, 441, -270, -51, -203, -108, 56,
578,-32768, -471, -544, -639, -580, 264, -177,-32768, -320,
278,-32768,-32768, -99, -445, 32, 43, 40, -9,-32768,
-263, -6, -200
};
#define YYLAST 1463
static const short yytable[] = { 179,
246, 183, 279, 280, 194, 362, 418, 315, 205, 318,
281, 320, 206, 304, 282, 492, 444, 352, 353, 343,
220, 347, 223, 277, 202, 357, 595, 443, 204, 614,
661, 151, 230, 641, 586, 151, 3, 240, 684, 153,
393, 394, 152, 153, 255, 240, 152, 486, 151, 328,
212, 758, 326, 181, 182, 380, 153, 463, 154, 152,
170, 465, 231, 467, 417, 181, 182, 195, 331, 333,
181, 182, 260, 261, 335, 329, 181, 182, 263, 330,
265, 181, 182, 494, 241, 185, 269, 438, 180, 275,
275, 151, 440, 257, 214, 37, 185, 181, 182, 153,
181, 182, 152, 170, 287, 185, 266, 288, 215, 272,
272, 293, 170, 216, 733, 181, 182, 181, 182, 209,
547, 196, 2, 3, 210, 157, 158, 159, 160, 161,
162, 163, 164, 2, 3, 181, 182, 765, 751, 218,
298, 271, 217, 792, 292, 181, 182, 419, 661, 151,
213, 568, 181, 455, 295, 186, 219, 153, 510, 345,
152, 207, 297, 719, 720, 296, 186, 312, 342, 708,
397, 340, 398, 595, 347, 186, 341, 343, 225, 605,
194, 194, 601, 445, 503, 687, 170, 252, 2, 3,
226, 560, 561, 449, 450, 459, 208, 459, 185, 426,
264, 459, 276, 459, 202, 473, 794, 469, 165, 367,
470, 482, 368, 244, 304, 798, 489, 245, 251, 196,
482, 379, 449, 450, 384, 252, 388, 227, 151, 449,
450, 286, 392, 585, 358, 354, 153, 359, 196, 152,
236, 644, 401, 2, 3, 449, 450, 508, 509, 641,
-450, 641, 395, 553, 231, 360, 396, 523, 546, 361,
34, 496, 485, 524, 525, 526, 275, 294, 186, 449,
450, 476, 371, 476, 527, 670, 372, 285, 181, 182,
490, 237, 399, 334, 671, 293, 272, 238, 562, 563,
564, 645, 157, 158, 159, 160, 161, 500, 646, 377,
270, 181, 182, 378, 631, 158, 159, 160, 161, 632,
633, 634, 576, 321, 662, 578, 582, 435, 390, 695,
436, 437, 391, 352, 353, 408, 355, 323, 409, 196,
356, 304, 730, 569, 194, 570, 325, 571, 757, 732,
528, 529, 327, 530, 531, 532, 304, 533, 534, 535,
536, 205, 410, 395, 332, 411, 481, 396, 514, 519,
402, 334, 522, 202, 403, 202, 405, 574, 548, 337,
406, 506, 384, 2, 3, 554, 157, 158, 159, 160,
161, 162, 163, 164, 349, 412, 425, 151, 413, 151,
592, 298, 635, 255, -387, 153, 636, 153, 152, 514,
152, 514, 336, 514, 415, 555, 269, 556, 416, 703,
339, 760, 423, 583, 275, 584, 424, 652, 427, 654,
430, 461, 424, 476, 431, 462, 266, 520, 579, 620,
348, 521, 424, 447, 272, 698, 602, 290, 603, 447,
2, 3, 304, 157, 158, 159, 160, 161, 162, 163,
164, 304, 365, 606, 761, 603, 693, 644, 447, 299,
694, 349, 785, 610, 244, 10, 447, 12, 245, 607,
15, 603, 697, 366, 689, 20, 21, 22, 304, 608,
375, 603, 279, 280, 753, 369, 304, 756, 373, 611,
281, 612, 630, 376, 282, 642, 473, 41, -372, 43,
-372, 278, 618, 482, 619, 385, 712, 2, 3, 51,
157, 158, 159, 160, 161, 162, 163, 164, 623, 625,
619, 603, 449, 450, 624, 298, 165, 626, 166, 627,
389, 246, 297, 400, 739, 296, 649, 482, 650, 404,
10, 354, 12, 2, 3, 15, 388, 663, 414, 603,
20, 21, 22, 741, 664, 672, 665, 603, 686, 417,
584, 2, 3, 476, 157, 158, 159, 160, 161, 162,
163, 164, 41, 407, 43, 500, 500, 685, 304, 748,
422, 749, 688, 755, 51, 584, 771, 772, 619, 650,
795, 728, 729, 313, 428, 314, 597, 598, 244, 429,
271, 490, 245, 215, 439, 2, 3, 246, 157, 158,
159, 160, 161, 162, 163, 164, 441, 442, 446, 447,
453, 451, 452, 298, 464, 692, 493, 466, 468, 474,
495, 246, 549, 657, 502, 507, 559, 551, 514, 592,
519, 519, 790, 587, -455, 519, 588, 311, 710, 166,
565, 589, 594, 596, -456, 738, 297, 615, 604, 296,
616, 617, 621, 622, 2, 3, 574, 157, 158, 159,
160, 161, 162, 163, 164, 628, 647, 648, 658, 651,
454, 455, 298, 157, 158, 159, 160, 161, 162, 163,
164, 317, 666, 314, 669, 653, 244, 655, 298, 660,
245, 667, 673, 678, 674, 675, 676, 592, 677, 690,
-32768, 642, 691, 769, 2, 3, 699, 157, 158, 159,
160, 161, 162, 163, 164, 700, 701, 702, 718, 713,
706, 592, 298, 2, 3, 574, 157, 158, 159, 160,
161, 162, 163, 164, 574, 714, -463, 721, 747, 723,
319, 298, 314, -224, 724, 244, 726, 734, 759, 245,
735, 736, 744, 777, 745, 746, 165, 750, 314, 752,
754, 244, 762, 763, 791, 245, 2, 3, 770, 157,
158, 159, 160, 161, 162, 163, 164, 774, 767, 775,
776, 779, 780, 789, 298, 782, 788, 781, 783, 800,
165, 786, 787, 475, 793, 244, 797, 2, 3, 245,
157, 158, 159, 160, 161, 162, 163, 164, 796, 165,
801, 314, 259, 155, 244, 156, 2, 3, 245, 157,
158, 159, 160, 161, 162, 163, 164, 291, 262, 727,
346, 715, 2, 3, 298, 157, 158, 159, 160, 161,
162, 163, 164, 731, 344, 550, 381, 572, 577, 681,
298, 566, 165, 668, 470, 778, 766, 244, 211, 2,
3, 245, 157, 158, 159, 160, 161, 162, 163, 164,
768, 504, 629, 784, 256, 696, 709, 656, 705, 599,
243, 717, 600, 165, 0, 0, 711, 0, 244, 0,
2, 3, 245, 157, 158, 159, 160, 161, 162, 163,
164, 491, 299, 0, 0, 0, 0, 244, 0, 0,
0, 245, 0, 0, 0, 0, 0, 0, 165, 0,
0, 0, 0, 244, 0, 2, 3, 245, 157, 158,
159, 160, 161, 162, 163, 164, 0, 0, 0, 0,
0, 0, 0, 0, 0, 165, 0, 0, 475, 0,
244, 0, 2, 3, 245, 157, 158, 159, 160, 161,
162, 163, 164, 2, 3, 0, 157, 158, 159, 160,
161, 162, 163, 164, 0, 0, 165, 0, 497, 0,
0, 244, 0, 2, 3, 245, 157, 158, 159, 160,
161, 162, 163, 164, 2, 3, 0, 157, 158, 159,
160, 161, 162, 163, 164, 0, 0, 0, 0, 0,
0, 165, 0, 573, 0, 0, 244, 0, 2, 3,
245, 157, 158, 159, 160, 161, 162, 163, 164, 0,
0, 0, 0, 0, 523, 0, 0, 613, 165, 0,
524, 525, 526, 244, 0, 0, 0, 245, 0, 165,
683, 527, 0, 0, 244, 0, 181, 182, 245, 157,
158, 159, 160, 161, 632, 633, 634, 0, 707, 165,
0, 0, 0, 0, 244, 0, 0, 0, 245, 0,
165, 0, 716, 0, 0, 244, 0, 0, 0, 245,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 165, 0, 0, 0, 0, 244,
0, 0, 0, 245, 0, 0, 0, 528, 529, 0,
530, 531, 532, 0, 533, 534, 535, 536, -2, 1,
0, 2, 3, 4, 2, 3, 0, 157, 158, 159,
160, 161, 162, 163, 164, 0, 0, 635, 0, 0,
0, 636, 5, 6, 7, 8, 9, 10, 11, 12,
13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
0, 33, 34, 35, 36, 37, 38, 39, 40, 41,
42, 43, 44, 0, 45, 46, 47, 0, 48, 49,
50, 51, 52, 53, 54, 55, 56, 0, 0, 57,
0, 58, -1, 1, 59, 2, 3, 4, 0, 0,
165, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 5, 6, 7, 8,
9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
29, 30, 31, 32, 0, 33, 34, 35, 36, 37,
38, 39, 40, 41, 42, 43, 44, 0, 45, 46,
47, 0, 48, 49, 50, 51, 52, 53, 54, 55,
56, 0, 0, 57, 1, 58, 2, 3, 59, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 5, 6, 7,
8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
28, 29, 30, 31, 32, 0, 33, 34, 35, 36,
37, 38, 0, 40, 41, 42, 43, 44, 0, 45,
46, 47, 0, 48, 49, 50, 51, 52, 53, 54,
55, 56, 2, 3, 57, 0, 58, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 5, 6, 7, 0, 0, 0, 11,
0, 13, 0, 0, 16, 0, 0, 0, 0, 0,
0, 0, 0, 0, 289, 0, 28, 0, 0, 0,
0, 0, 0, 0, 35, 36, 37, 0, 0, 40,
0, 0, 0, 0, 0, 45, 0, 47, 0, 48,
0, 50, 0, 52, 53, 0, 55, 0, 290, 0,
57, 0, 58
};
static const short yycheck[] = { 6,
52, 11, 101, 101, 14, 206, 270, 139, 18, 141,
101, 143, 19, 129, 101, 336, 299, 196, 196, 188,
30, 191, 32, 100, 17, 197, 447, 298, 18, 475,
538, 0, 42, 505, 436, 4, 4, 47, 583, 0,
244, 245, 0, 4, 54, 55, 4, 330, 17, 165,
24, 691, 152, 3, 4, 86, 17, 313, 86, 17,
5, 317, 93, 319, 6, 3, 4, 86, 168, 169,
3, 4, 82, 83, 174, 86, 3, 4, 88, 90,
90, 3, 4, 339, 48, 23, 96, 288, 36, 99,
100, 60, 293, 57, 38, 57, 23, 3, 4, 60,
3, 4, 60, 48, 114, 23, 96, 114, 52, 99,
100, 118, 57, 57, 659, 3, 4, 3, 4, 89,
376, 89, 3, 4, 86, 6, 7, 8, 9, 10,
11, 12, 13, 3, 4, 3, 4, 718, 683, 86,
21, 91, 86, 783, 118, 3, 4, 89, 656, 118,
89, 407, 3, 4, 123, 93, 86, 118, 91, 86,
118, 34, 123, 635, 636, 123, 93, 131, 86, 615,
91, 93, 93, 594, 344, 93, 186, 346, 80, 462,
190, 191, 453, 299, 356, 587, 131, 93, 3, 4,
89, 395, 396, 19, 20, 311, 69, 313, 23, 276,
86, 317, 90, 319, 197, 321, 787, 88, 89, 86,
91, 327, 89, 94, 330, 796, 332, 98, 86, 89,
336, 231, 19, 20, 234, 93, 236, 12, 197, 19,
20, 89, 242, 434, 90, 196, 197, 93, 89, 197,
89, 505, 252, 3, 4, 19, 20, 363, 364, 721,
92, 723, 94, 385, 93, 86, 98, 6, 374, 90,
54, 86, 88, 12, 13, 14, 276, 82, 93, 19,
20, 323, 86, 325, 23, 558, 90, 95, 3, 4,
332, 6, 22, 23, 567, 292, 276, 12, 397, 398,
399, 88, 6, 7, 8, 9, 10, 349, 88, 86,
91, 3, 4, 90, 6, 7, 8, 9, 10, 11,
12, 13, 422, 89, 88, 425, 432, 86, 86, 602,
89, 90, 90, 502, 502, 86, 86, 89, 89, 89,
90, 447, 653, 409, 344, 411, 89, 413, 88, 88,
89, 90, 89, 92, 93, 94, 462, 96, 97, 98,
99, 361, 86, 94, 89, 89, 325, 98, 368, 369,
86, 23, 372, 356, 90, 358, 86, 419, 378, 6,
90, 361, 382, 3, 4, 385, 6, 7, 8, 9,
10, 11, 12, 13, 89, 86, 91, 356, 89, 358,
442, 21, 94, 403, 89, 356, 98, 358, 356, 409,
358, 411, 89, 413, 86, 88, 416, 90, 90, 610,
89, 694, 86, 88, 424, 90, 90, 517, 86, 519,
86, 86, 90, 475, 90, 90, 416, 86, 86, 86,
90, 90, 90, 90, 424, 86, 88, 79, 90, 90,
3, 4, 558, 6, 7, 8, 9, 10, 11, 12,
13, 567, 86, 88, 86, 90, 86, 721, 90, 89,
90, 89, 86, 470, 94, 29, 90, 31, 98, 88,
34, 90, 604, 86, 590, 39, 40, 41, 594, 88,
86, 90, 581, 581, 685, 89, 602, 688, 89, 88,
581, 90, 502, 89, 581, 505, 612, 61, 88, 63,
90, 65, 88, 619, 90, 89, 622, 3, 4, 73,
6, 7, 8, 9, 10, 11, 12, 13, 88, 88,
90, 90, 19, 20, 493, 21, 89, 88, 91, 90,
86, 583, 493, 86, 666, 493, 88, 653, 90, 86,
29, 502, 31, 3, 4, 34, 556, 88, 86, 90,
39, 40, 41, 669, 88, 88, 90, 90, 88, 6,
90, 3, 4, 615, 6, 7, 8, 9, 10, 11,
12, 13, 61, 89, 63, 627, 628, 584, 694, 88,
91, 90, 589, 88, 73, 90, 88, 88, 90, 90,
791, 650, 651, 89, 86, 91, 449, 450, 94, 89,
91, 653, 98, 52, 86, 3, 4, 659, 6, 7,
8, 9, 10, 11, 12, 13, 89, 95, 86, 90,
16, 18, 17, 21, 86, 594, 80, 86, 86, 86,
93, 683, 93, 6, 90, 90, 86, 90, 648, 691,
650, 651, 774, 89, 95, 655, 86, 89, 617, 91,
93, 90, 90, 86, 95, 665, 617, 92, 95, 617,
88, 90, 88, 90, 3, 4, 718, 6, 7, 8,
9, 10, 11, 12, 13, 92, 88, 90, 6, 90,
3, 4, 21, 6, 7, 8, 9, 10, 11, 12,
13, 89, 95, 91, 95, 89, 94, 89, 21, 88,
98, 86, 88, 15, 88, 88, 88, 759, 88, 86,
16, 721, 90, 723, 3, 4, 86, 6, 7, 8,
9, 10, 11, 12, 13, 86, 86, 86, 95, 86,
88, 783, 21, 3, 4, 787, 6, 7, 8, 9,
10, 11, 12, 13, 796, 86, 91, 90, 94, 91,
89, 21, 91, 91, 86, 94, 86, 86, 95, 98,
86, 86, 86, 15, 86, 86, 89, 86, 91, 86,
86, 94, 86, 88, 781, 98, 3, 4, 79, 6,
7, 8, 9, 10, 11, 12, 13, 95, 93, 86,
86, 86, 86, 100, 21, 86, 86, 90, 90, 0,
89, 88, 90, 92, 88, 94, 86, 3, 4, 98,
6, 7, 8, 9, 10, 11, 12, 13, 90, 89,
0, 91, 60, 4, 94, 4, 3, 4, 98, 6,
7, 8, 9, 10, 11, 12, 13, 118, 85, 648,
191, 627, 3, 4, 21, 6, 7, 8, 9, 10,
11, 12, 13, 655, 190, 382, 232, 416, 424, 581,
21, 403, 89, 556, 91, 749, 721, 94, 24, 3,
4, 98, 6, 7, 8, 9, 10, 11, 12, 13,
723, 358, 502, 759, 55, 603, 617, 528, 612, 451,
86, 628, 452, 89, -1, -1, 619, -1, 94, -1,
3, 4, 98, 6, 7, 8, 9, 10, 11, 12,
13, 334, 89, -1, -1, -1, -1, 94, -1, -1,
-1, 98, -1, -1, -1, -1, -1, -1, 89, -1,
-1, -1, -1, 94, -1, 3, 4, 98, 6, 7,
8, 9, 10, 11, 12, 13, -1, -1, -1, -1,
-1, -1, -1, -1, -1, 89, -1, -1, 92, -1,
94, -1, 3, 4, 98, 6, 7, 8, 9, 10,
11, 12, 13, 3, 4, -1, 6, 7, 8, 9,
10, 11, 12, 13, -1, -1, 89, -1, 91, -1,
-1, 94, -1, 3, 4, 98, 6, 7, 8, 9,
10, 11, 12, 13, 3, 4, -1, 6, 7, 8,
9, 10, 11, 12, 13, -1, -1, -1, -1, -1,
-1, 89, -1, 91, -1, -1, 94, -1, 3, 4,
98, 6, 7, 8, 9, 10, 11, 12, 13, -1,
-1, -1, -1, -1, 6, -1, -1, 88, 89, -1,
12, 13, 14, 94, -1, -1, -1, 98, -1, 89,
90, 23, -1, -1, 94, -1, 3, 4, 98, 6,
7, 8, 9, 10, 11, 12, 13, -1, 88, 89,
-1, -1, -1, -1, 94, -1, -1, -1, 98, -1,
89, -1, 91, -1, -1, 94, -1, -1, -1, 98,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, 89, -1, -1, -1, -1, 94,
-1, -1, -1, 98, -1, -1, -1, 89, 90, -1,
92, 93, 94, -1, 96, 97, 98, 99, 0, 1,
-1, 3, 4, 5, 3, 4, -1, 6, 7, 8,
9, 10, 11, 12, 13, -1, -1, 94, -1, -1,
-1, 98, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
-1, 53, 54, 55, 56, 57, 58, 59, 60, 61,
62, 63, 64, -1, 66, 67, 68, -1, 70, 71,
72, 73, 74, 75, 76, 77, 78, -1, -1, 81,
-1, 83, 0, 1, 86, 3, 4, 5, -1, -1,
89, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, 24, 25, 26, 27,
28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 50, 51, -1, 53, 54, 55, 56, 57,
58, 59, 60, 61, 62, 63, 64, -1, 66, 67,
68, -1, 70, 71, 72, 73, 74, 75, 76, 77,
78, -1, -1, 81, 1, 83, 3, 4, 86, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, 24, 25, 26,
27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
47, 48, 49, 50, 51, -1, 53, 54, 55, 56,
57, 58, -1, 60, 61, 62, 63, 64, -1, 66,
67, 68, -1, 70, 71, 72, 73, 74, 75, 76,
77, 78, 3, 4, 81, -1, 83, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, 24, 25, 26, -1, -1, -1, 30,
-1, 32, -1, -1, 35, -1, -1, -1, -1, -1,
-1, -1, -1, -1, 45, -1, 47, -1, -1, -1,
-1, -1, -1, -1, 55, 56, 57, -1, -1, 60,
-1, -1, -1, -1, -1, 66, -1, 68, -1, 70,
-1, 72, -1, 74, 75, -1, 77, -1, 79, -1,
81, -1, 83
};
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
#line 3 "/usr/lib/bison.simple"
/* Skeleton output parser for bison,
Copyright (C) 1984, 1989, 1990 Bob Corbett and Richard Stallman
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
#ifndef alloca
#ifdef __GNUC__
#define alloca __builtin_alloca
#else /* not GNU C. */
#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
#include <alloca.h>
#else /* not sparc */
#if defined (MSDOS) && !defined (__TURBOC__)
#include <malloc.h>
#else /* not MSDOS, or __TURBOC__ */
#if defined(_AIX)
#include <malloc.h>
#pragma alloca
#else /* not MSDOS, __TURBOC__, or _AIX */
#ifdef __hpux
#ifdef __cplusplus
extern "C" {
void *alloca (unsigned int);
};
#else /* not __cplusplus */
void *alloca ();
#endif /* not __cplusplus */
#endif /* __hpux */
#endif /* not _AIX */
#endif /* not MSDOS, or __TURBOC__ */
#endif /* not sparc. */
#endif /* not GNU C. */
#endif /* alloca not defined. */
/* This is the parser code that is written into each bison parser
when the %semantic_parser declaration is not specified in the grammar.
It was written by Richard Stallman by simplifying the hairy parser
used when %semantic_parser is specified. */
/* Note: there must be only one dollar sign in this file.
It is replaced by the list of actions, each action
as one case of the switch. */
#define yyerrok (yyerrstatus = 0)
#define yyclearin (yychar = YYEMPTY)
#define YYEMPTY -2
#define YYEOF 0
#define YYACCEPT return(0)
#define YYABORT return(1)
#define YYERROR goto yyerrlab1
/* Like YYERROR except do call yyerror.
This remains here temporarily to ease the
transition to the new meaning of YYERROR, for GCC.
Once GCC version 2 has supplanted version 1, this can go. */
#define YYFAIL goto yyerrlab
#define YYRECOVERING() (!!yyerrstatus)
#define YYBACKUP(token, value) \
do \
if (yychar == YYEMPTY && yylen == 1) \
{ yychar = (token), yylval = (value); \
yychar1 = YYTRANSLATE (yychar); \
YYPOPSTACK; \
goto yybackup; \
} \
else \
{ yyerror ("syntax error: cannot back up"); YYERROR; } \
while (0)
#define YYTERROR 1
#define YYERRCODE 256
#ifndef YYPURE
#define YYLEX yylex()
#endif
#ifdef YYPURE
#ifdef YYLSP_NEEDED
#define YYLEX yylex(&yylval, &yylloc)
#else
#define YYLEX yylex(&yylval)
#endif
#endif
#ifndef YYPURE
int yychar; /* the lookahead symbol */
YYSTYPE yylval; /* the semantic value of the */
#ifdef YYLSP_NEEDED
YYLTYPE yylloc; /* location data for the lookahead */
#endif
int yynerrs; /* number of parse errors so far */
#endif /* not YYPURE */
#ifndef YYINITDEPTH
#define YYINITDEPTH 200
#endif
/* YYMAXDEPTH is the maximum size the stacks can grow to
(effective only if the built-in stack extension method is used). */
#if YYMAXDEPTH == 0
#undef YYMAXDEPTH
#endif
#ifndef YYMAXDEPTH
#define YYMAXDEPTH 10000
#endif
#ifdef __GNUC__
int yyparse (void);
#endif
#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
#define __yy_bcopy(FROM,TO,COUNT) __builtin_memcpy(TO,FROM,COUNT)
#else /* not GNU C or C++ */
#ifndef __cplusplus
/* This is the most reliable way to avoid incompatibilities
in available built-in functions on various systems. */
static void
__yy_bcopy (from, to, count)
char *from;
char *to;
int count;
{
register char *f = from;
register char *t = to;
register int i = count;
while (i-- > 0)
*t++ = *f++;
}
#else /* __cplusplus */
/* This is the most reliable way to avoid incompatibilities
in available built-in functions on various systems. */
static void
__yy_bcopy (char *from, char *to, int count)
{
register char *f = from;
register char *t = to;
register int i = count;
while (i-- > 0)
*t++ = *f++;
}
#endif
#endif
#line 184 "/usr/lib/bison.simple"
int
yyparse()
{
register int yystate;
register int yyn;
register short *yyssp;
register YYSTYPE *yyvsp;
int yyerrstatus; /* number of tokens to shift before error messages enabled */
int yychar1 = 0; /* lookahead token as an internal (translated) token number */
short yyssa[YYINITDEPTH]; /* the state stack */
YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
short *yyss = yyssa; /* refer to the stacks thru separate pointers */
YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
#ifdef YYLSP_NEEDED
YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
YYLTYPE *yyls = yylsa;
YYLTYPE *yylsp;
#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
#else
#define YYPOPSTACK (yyvsp--, yyssp--)
#endif
int yystacksize = YYINITDEPTH;
#ifdef YYPURE
int yychar;
YYSTYPE yylval;
int yynerrs;
#ifdef YYLSP_NEEDED
YYLTYPE yylloc;
#endif
#endif
YYSTYPE yyval; /* the variable used to return */
int yylen;
yystate = 0;
yyerrstatus = 0;
yynerrs = 0;
yychar = YYEMPTY; /* Cause a token to be read. */
/* Initialize stack pointers.
Waste one element of value and location stack
so that they stay on the same level as the state stack.
The wasted elements are never initialized. */
yyssp = yyss - 1;
yyvsp = yyvs;
#ifdef YYLSP_NEEDED
yylsp = yyls;
#endif
/* In all cases, when you get here, the value and location stacks
have just been pushed. so pushing a state here evens the stacks. */
yynewstate:
*++yyssp = yystate;
if (yyssp >= yyss + yystacksize - 1)
{
YYSTYPE *yyvs1 = yyvs;
short *yyss1 = yyss;
#ifdef YYLSP_NEEDED
YYLTYPE *yyls1 = yyls;
#endif
int size = yyssp - yyss + 1;
#ifdef yyoverflow
/* Each stack pointer address is followed by the size of
the data in use in that stack, in bytes. */
#ifdef YYLSP_NEEDED
/* This used to be a conditional around just the two extra args,
but that might be undefined if yyoverflow is a macro. */
yyoverflow("parser stack overflow",
&yyss1, size * sizeof (*yyssp),
&yyvs1, size * sizeof (*yyvsp),
&yyls1, size * sizeof (*yylsp),
&yystacksize);
#else
yyoverflow("parser stack overflow",
&yyss1, size * sizeof (*yyssp),
&yyvs1, size * sizeof (*yyvsp),
&yystacksize);
#endif
yyss = yyss1; yyvs = yyvs1;
#ifdef YYLSP_NEEDED
yyls = yyls1;
#endif
#else /* no yyoverflow */
if (yystacksize >= YYMAXDEPTH)
{
yyerror("parser stack overflow");
return 2;
}
yystacksize *= 2;
if (yystacksize > YYMAXDEPTH)
yystacksize = YYMAXDEPTH;
yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
__yy_bcopy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp));
yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
__yy_bcopy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp));
#ifdef YYLSP_NEEDED
yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
__yy_bcopy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp));
#endif
#endif /* no yyoverflow */
yyssp = yyss + size - 1;
yyvsp = yyvs + size - 1;
#ifdef YYLSP_NEEDED
yylsp = yyls + size - 1;
#endif
if (yyssp >= yyss + yystacksize - 1)
YYABORT;
}
goto yybackup;
yybackup:
yyn = yypact[yystate];
if (yyn == YYFLAG)
goto yydefault;
/* yychar is either YYEMPTY or YYEOF
or a valid token in external form. */
if (yychar == YYEMPTY)
{
yychar = YYLEX;
}
if (yychar <= 0) /* This means end of input. */
{
yychar1 = 0;
yychar = YYEOF; /* Don't call YYLEX any more */
}
else
{
yychar1 = YYTRANSLATE(yychar);
}
yyn += yychar1;
if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
goto yydefault;
yyn = yytable[yyn];
/* yyn is what to do for this token type in this state.
Negative => reduce, -yyn is rule number.
Positive => shift, yyn is new state.
New state is final state => don't bother to shift,
just return success.
0, or most negative number => error. */
if (yyn < 0)
{
if (yyn == YYFLAG)
goto yyerrlab;
yyn = -yyn;
goto yyreduce;
}
else if (yyn == 0)
goto yyerrlab;
if (yyn == YYFINAL)
YYACCEPT;
if (yychar != YYEOF)
yychar = YYEMPTY;
*++yyvsp = yylval;
#ifdef YYLSP_NEEDED
*++yylsp = yylloc;
#endif
if (yyerrstatus) yyerrstatus--;
yystate = yyn;
goto yynewstate;
yydefault:
yyn = yydefact[yystate];
if (yyn == 0)
goto yyerrlab;
yyreduce:
yylen = yyr2[yyn];
if (yylen > 0)
yyval = yyvsp[1-yylen]; /* implement default value of the action */
switch (yyn) {
case 5:
#line 272 "fortran.y"
{
if(current_module_hash == -1) {
implied_id_token(&(yyvsp[0]),unnamed_prog);
def_function(
type_PROGRAM, /* type */
size_DEFAULT, /* size */
(char *)NULL, /* size text */
&(yyvsp[0]), /* name */
(Token*)NULL); /* args */
current_module_hash =
def_curr_module(&(yyvsp[0]));
current_module_type = type_PROGRAM;
}
if(curr_stmt_class == tok_END) {
if(prev_stmt_class != tok_RETURN)
do_RETURN(current_module_hash,&(yyvsp[0]));
END_processing(&(yyval));
goto_flag = prev_goto = FALSE;
}
prev_stmt_class = curr_stmt_class;
integer_context = FALSE;
true_prev_stmt_line_num = yyval.line_num;
;
break;}
case 10:
#line 312 "fortran.y"
{
#ifdef CHECK_LABELS
def_label(&(yyvsp[-1]));
#endif
if(executable_stmt)
prev_goto = goto_flag;
;
break;}
case 11:
#line 320 "fortran.y"
{
if(executable_stmt) {
if(prev_goto)
syntax_error(yyvsp[0].line_num, NO_COL_NUM,
"No path to this statement");
prev_goto = goto_flag;
}
;
break;}
case 12:
#line 331 "fortran.y"
{
exec_stmt_count = 0;
executable_stmt = FALSE;
;
break;}
case 13:
#line 336 "fortran.y"
{
executable_stmt = FALSE;
;
break;}
case 14:
#line 340 "fortran.y"
{ /* handle statement functions correctly */
if(is_true(STMT_FUNCTION_EXPR, yyvsp[0].TOK_flags)
&& stmt_sequence_no <= SEQ_STMT_FUN) {
stmt_sequence_no = SEQ_STMT_FUN;
executable_stmt = FALSE;
}
else {
stmt_sequence_no = SEQ_EXEC;
++exec_stmt_count;
executable_stmt = TRUE;
}
;
break;}
case 15:
#line 353 "fortran.y"
{
stmt_sequence_no = SEQ_EXEC;
++exec_stmt_count;
executable_stmt = TRUE;
;
break;}
case 16:
#line 359 "fortran.y"
{
executable_stmt = TRUE;
if(stmt_sequence_no == 0)
stmt_sequence_no = SEQ_HEADER;
complex_const_allowed = FALSE; /* turn off flags */
inside_format=FALSE;
integer_context = FALSE;
in_assignment_stmt = FALSE;
yyval.line_num = prev_stmt_line_num; /* best guess */
yyerrok; /* (error message already given) */
;
break;}
case 17:
#line 373 "fortran.y"
{
current_module_type = type_PROGRAM;
;
break;}
case 18:
#line 377 "fortran.y"
{
current_module_type = type_SUBROUTINE;
;
break;}
case 19:
#line 381 "fortran.y"
{
current_module_type = type_SUBROUTINE;
;
break;}
case 20:
#line 385 "fortran.y"
{
current_module_type = type_BLOCK_DATA;
;
break;}
case 24:
#line 398 "fortran.y"
{
#ifdef ALLOW_INCLUDE
if(f77_standard || !allow_include) {
nonstandard(yyvsp[-2].line_num,yyvsp[-2].col_num);
}
open_include_file(yyvsp[-1].value.string,yyvsp[-2].line_num);
#else
syntax_error(yyvsp[-2].line_num,yyvsp[-2].col_num,
"statement not permitted");
#endif
;
break;}
case 25:
#line 417 "fortran.y"
{
if(stmt_sequence_no < SEQ_IMPLICIT) {
stmt_sequence_no = SEQ_IMPLICIT;
}
;
break;}
case 26:
#line 423 "fortran.y"
{
if(stmt_sequence_no < SEQ_IMPLICIT) {
stmt_sequence_no = SEQ_IMPLICIT;
}
else if(stmt_sequence_no > SEQ_SPECIF) {
check_stmt_sequence(&(yyvsp[0]),SEQ_SPECIF);
}
;
break;}
case 27:
#line 432 "fortran.y"
{
check_stmt_sequence(&(yyvsp[0]),SEQ_IMPLICIT);
;
break;}
case 28:
#line 436 "fortran.y"
{
if(stmt_sequence_no < SEQ_STMT_FUN) {
stmt_sequence_no = SEQ_STMT_FUN;
}
;
break;}
case 29:
#line 442 "fortran.y"
{
check_stmt_sequence(&(yyvsp[0]),SEQ_SPECIF);
;
break;}
case 30:
#line 448 "fortran.y"
{
goto_flag = prev_goto = FALSE;
;
break;}
case 40:
#line 468 "fortran.y"
{
goto_flag=TRUE;
;
break;}
case 41:
#line 472 "fortran.y"
{
goto_flag=FALSE;
;
break;}
case 64:
#line 505 "fortran.y"
{
goto_flag=FALSE;
;
break;}
case 65:
#line 509 "fortran.y"
{
prev_goto = goto_flag =FALSE;
;
break;}
case 68:
#line 518 "fortran.y"
{ /* Flag DO w/o label or DO WHILE forms here */
if(is_true(NONSTD_USAGE_FLAG,yyvsp[0].TOK_flags))
#ifdef ALLOW_DO_ENDO
if(f77_standard || !allow_do_endo)
nonstandard(yyvsp[0].line_num,yyvsp[0].col_num);
#else
syntax_error(yyvsp[0].line_num,yyvsp[0].col_num,
"Nonstandard syntax");
#endif
;
break;}
case 69:
#line 530 "fortran.y"
{
#ifdef ALLOW_DO_ENDO
if(f77_standard || !allow_do_endo)
nonstandard(yyvsp[0].line_num,yyvsp[0].col_num);
#else
syntax_error(yyvsp[0].line_num,yyvsp[0].col_num,
"Nonstandard syntax");
#endif
;
break;}
case 73:
#line 547 "fortran.y"
{check_seq_header(&(yyvsp[0]));;
break;}
case 74:
#line 549 "fortran.y"
{
def_function(
type_PROGRAM, /* type */
size_DEFAULT, /* size */
(char *)NULL, /* size text */
&(yyvsp[-1]), /* name */
(Token*)NULL);/* args */
current_module_hash =
def_curr_module(&(yyvsp[-1]));
;
break;}
case 75:
#line 566 "fortran.y"
{
do_ENTRY(&(yyvsp[-1]),(Token*)NULL
,current_module_hash);
;
break;}
case 76:
#line 571 "fortran.y"
{
do_ENTRY(&(yyvsp[-4]),&(yyvsp[-2])
,current_module_hash);
#ifdef DEBUG_PARSER
if(debug_parser)
print_exprlist("entry stmt",&(yyvsp[-2]));
#endif
;
break;}
case 78:
#line 587 "fortran.y"
{
if(f77_standard) {
nonstandard(yyvsp[-1].line_num,
(unsigned)(yyvsp[-1].col_num+strlen(token_name(yyvsp[-1]))));
msg_tail(": parentheses required");
}
def_function(
current_datatype,
current_typesize,
current_len_text,
&(yyvsp[-1]),
(Token*)NULL);
current_module_hash=
def_curr_module(&(yyvsp[-1]));
;
break;}
case 79:
#line 604 "fortran.y"
{
def_function(
current_datatype,
current_typesize,
current_len_text,
&(yyvsp[-4]),
&(yyvsp[-2]));
current_module_hash=
def_curr_module(&(yyvsp[-4]));
#ifdef DEBUG_PARSER
if(debug_parser)
print_exprlist("function stmt",&(yyvsp[-2]));
#endif
;
break;}
case 80:
#line 619 "fortran.y"
{
if(f77_standard) {
nonstandard(yyvsp[-1].line_num,
(unsigned)(yyvsp[-1].col_num+strlen(token_name(yyvsp[-1]))));
msg_tail(": parentheses required");
}
def_function(
type_UNDECL,
size_DEFAULT,
(char *)NULL,
&(yyvsp[-1]),
(Token*)NULL);
current_module_hash=
def_curr_module(&(yyvsp[-1]));
;
break;}
case 81:
#line 636 "fortran.y"
{
def_function(
type_UNDECL, /* type */
size_DEFAULT, /* size */
(char *)NULL, /* size text */
&(yyvsp[-4]), /* name */
&(yyvsp[-2])); /* args */
current_module_hash=
def_curr_module(&(yyvsp[-4]));
#ifdef DEBUG_PARSER
if(debug_parser)
print_exprlist("function stmt",&(yyvsp[-2]));
#endif
;
break;}
case 84:
#line 659 "fortran.y"
{
check_seq_header(&(yyvsp[0]));
;
break;}
case 89:
#line 678 "fortran.y"
{
def_function(
type_SUBROUTINE,
size_DEFAULT,
(char *)NULL,
&(yyvsp[-1]),
(Token*)NULL);
current_module_hash=
def_curr_module(&(yyvsp[-1]));
;
break;}
case 90:
#line 690 "fortran.y"
{
def_function(
type_SUBROUTINE,
size_DEFAULT,
(char *)NULL,
&(yyvsp[-4]),
&(yyvsp[-2]));
current_module_hash=
def_curr_module(&(yyvsp[-4]));
#ifdef DEBUG_PARSER
if(debug_parser)
print_exprlist("subroutine stmt",&(yyvsp[-2]));
#endif
;
break;}
case 91:
#line 707 "fortran.y"
{
check_seq_header(&(yyvsp[0]));
;
break;}
case 92:
#line 713 "fortran.y"
{
yyval.next_token = (Token*)NULL;
;
break;}
case 94:
#line 720 "fortran.y"
{
yyval.next_token = append_token((Token*)NULL,&(yyvsp[0]));
;
break;}
case 95:
#line 724 "fortran.y"
{
yyval.next_token = append_token(yyvsp[-2].next_token,&(yyvsp[0]));
;
break;}
case 96:
#line 730 "fortran.y"
{
def_arg_name(&(yyvsp[0]));
primary_id_expr(&(yyvsp[0]),&(yyval));
;
break;}
case 97:
#line 735 "fortran.y"
{
yyval.TOK_type = type_byte(class_LABEL,type_LABEL);
yyval.size = size_DEFAULT;
yyval.TOK_flags = 0;
yyval.left_token = (Token *)NULL;
;
break;}
case 98:
#line 747 "fortran.y"
{
++block_data_number;
(void)sprintf(unnamed_block_data+4,"%02d",
block_data_number%100);
implied_id_token(&(yyval),unnamed_block_data);
def_function(
type_BLOCK_DATA,
size_DEFAULT,
(char *)NULL,
&(yyval),
(Token*)NULL);
current_module_hash=
def_curr_module(&(yyval));
;
break;}
case 99:
#line 764 "fortran.y"
{
def_function(
type_BLOCK_DATA,
size_DEFAULT,
(char *)NULL,
&(yyvsp[-1]),
(Token*)NULL);
current_module_hash=
def_curr_module(&(yyvsp[-1]));
;
break;}
case 100:
#line 777 "fortran.y"
{
check_seq_header(&(yyvsp[0]));
;
break;}
case 101:
#line 781 "fortran.y"
{
check_seq_header(&(yyvsp[0]));
;
break;}
case 105:
#line 796 "fortran.y"
{
def_array_dim(&(yyvsp[-3]),&(yyvsp[-1]));
;
break;}
case 106:
#line 803 "fortran.y"
{
yyval.TOK_dims = 1;
yyval.TOK_elts = yyvsp[0].TOK_elts;
yyval.next_token = append_token((Token*)NULL,&(yyvsp[0]));
;
break;}
case 107:
#line 809 "fortran.y"
{
yyval.TOK_dims = yyvsp[-2].TOK_dims + 1; /* one more dimension */
yyval.TOK_elts = yyvsp[-2].TOK_elts * yyvsp[0].TOK_elts;
yyval.next_token = append_token(yyvsp[-2].next_token,&(yyvsp[0]));
;
break;}
case 108:
#line 817 "fortran.y"
{
if( datatype_of(yyvsp[0].TOK_type) == type_INTEGER
&& is_true(EVALUATED_EXPR,yyvsp[0].TOK_flags) )
yyval.TOK_elts = yyvsp[0].value.integer;
else
yyval.TOK_elts = 0;
;
break;}
case 109:
#line 825 "fortran.y"
{ /* avoid getting 0 - 0 + 1 = 1 if bounds nonconstant */
if( datatype_of(yyvsp[-2].TOK_type) == type_INTEGER
&& is_true(EVALUATED_EXPR,yyvsp[-2].TOK_flags)
&& datatype_of(yyvsp[0].TOK_type) == type_INTEGER
&& is_true(EVALUATED_EXPR,yyvsp[0].TOK_flags) )
yyval.TOK_elts = yyvsp[0].value.integer - yyvsp[-2].value.integer + 1;
else
yyval.TOK_elts = 0;
yyval.left_token = add_tree_node(&(yyvsp[-1]),&(yyvsp[-2]),&(yyvsp[0]));
;
break;}
case 110:
#line 837 "fortran.y"
{
yyval.TOK_elts = 0;
yyval.left_token = (Token *)NULL;
;
break;}
case 111:
#line 842 "fortran.y"
{
yyval.TOK_elts = 0;
yyvsp[0].left_token = (Token *)NULL;
yyval.left_token = add_tree_node(&(yyvsp[-1]),&(yyvsp[-2]),&(yyvsp[0]));
;
break;}
case 112:
#line 850 "fortran.y"
{equivalence_flag = TRUE;;
break;}
case 113:
#line 851 "fortran.y"
{equivalence_flag = FALSE;;
break;}
case 116:
#line 859 "fortran.y"
{
equivalence(&(yyvsp[-2]), &(yyvsp[0]));
;
break;}
case 117:
#line 863 "fortran.y"
{
equivalence(&(yyvsp[-2]), &(yyvsp[0]));
;
break;}
case 118:
#line 870 "fortran.y"
{
def_equiv_name(&(yyvsp[0]));
;
break;}
case 119:
#line 874 "fortran.y"
{
def_equiv_name(&(yyvsp[0]));
;
break;}
case 120:
#line 878 "fortran.y"
{
def_equiv_name(&(yyvsp[0]));
;
break;}
case 124:
#line 893 "fortran.y"
{
implied_id_token(&(yyval),blank_com_name);
def_com_block(&(yyval), &(yyvsp[-1]));
if(is_true(COMMA_FLAG,yyvsp[-1].TOK_flags))
syntax_error(
yyvsp[-1].line_num,yyvsp[-1].col_num,
"trailing comma");
#ifdef DEBUG_PARSER
if(debug_parser)
print_comlist("blank common",&(yyvsp[-1]));
#endif
;
break;}
case 125:
#line 907 "fortran.y"
{
if(is_true(COMMA_FLAG,yyvsp[-1].TOK_flags))
syntax_error(
yyvsp[-1].line_num,yyvsp[-1].col_num,
"trailing comma");
;
break;}
case 126:
#line 915 "fortran.y"
{
implied_id_token(&(yyval),blank_com_name);
def_com_block(&(yyval),&(yyvsp[-2]));
if(is_true(COMMA_FLAG,yyvsp[-1].TOK_flags))
syntax_error(
yyvsp[-1].line_num,yyvsp[-1].col_num,
"trailing comma");
#ifdef DEBUG_PARSER
if(debug_parser)
print_comlist("blank common",&(yyvsp[-2]));
#endif
;
break;}
case 127:
#line 933 "fortran.y"
{
yyval.TOK_flags = yyvsp[0].TOK_flags;
;
break;}
case 128:
#line 937 "fortran.y"
{
yyval.TOK_flags = yyvsp[0].TOK_flags;
yyval.line_num = yyvsp[0].line_num;
yyval.col_num = yyvsp[0].col_num;
;
break;}
case 129:
#line 945 "fortran.y"
{
def_com_block(&(yyvsp[-1]),&(yyvsp[0]));
yyval.TOK_flags = yyvsp[0].TOK_flags;
yyval.line_num = yyvsp[0].line_num;
yyval.col_num = yyvsp[0].col_num;
#ifdef DEBUG_PARSER
if(debug_parser)
print_comlist("labeled common",&(yyvsp[0]));
#endif
;
break;}
case 130:
#line 958 "fortran.y"
{
yyval = yyvsp[-1];
;
break;}
case 131:
#line 963 "fortran.y"
{
implied_id_token(&(yyval),blank_com_name);
;
break;}
case 132:
#line 967 "fortran.y"
{
implied_id_token(&(yyval),blank_com_name);
;
break;}
case 133:
#line 973 "fortran.y"
{
yyval.TOK_flags = yyvsp[0].TOK_flags;
yyval.next_token = append_token((Token*)NULL,&(yyvsp[0]));
;
break;}
case 134:
#line 978 "fortran.y"
{
if(!is_true(COMMA_FLAG,yyvsp[-1].TOK_flags))
syntax_error(
yyvsp[0].line_num,yyvsp[0].col_num-1,
"missing comma");
yyval.TOK_flags = yyvsp[0].TOK_flags;
yyval.line_num = yyvsp[0].line_num;
yyval.col_num = yyvsp[0].col_num;
yyval.next_token = append_token(yyvsp[-1].next_token,&(yyvsp[0]));
;
break;}
case 135:
#line 991 "fortran.y"
{ /* no comma */
yyval.TOK_flags = yyvsp[0].TOK_flags;
make_false(COMMA_FLAG,yyval.TOK_flags);
;
break;}
case 136:
#line 996 "fortran.y"
{ /* has comma */
yyval.TOK_flags = yyvsp[-1].TOK_flags;
make_true(COMMA_FLAG,yyval.TOK_flags);
;
break;}
case 137:
#line 1003 "fortran.y"
{
def_com_variable(&(yyvsp[0]));
primary_id_expr(&(yyvsp[0]),&(yyval));
;
break;}
case 138:
#line 1008 "fortran.y"
{
def_com_variable(&(yyvsp[0]));
primary_id_expr(&(yyvsp[0]),&(yyval));
;
break;}
case 139:
#line 1021 "fortran.y"
{
if(is_true(COMMA_FLAG,yyvsp[-1].TOK_flags))
syntax_error(yyvsp[-1].line_num,
(unsigned)(yyvsp[-1].col_num+strlen(token_name(yyvsp[-1]))),
"trailing comma");
if(f77_standard) {
nonstandard(yyvsp[-2].line_num,yyvsp[-2].col_num);
}
;
break;}
case 141:
#line 1034 "fortran.y"
{
yyval = yyvsp[0];
;
break;}
case 142:
#line 1040 "fortran.y"
{
def_namelist(&(yyvsp[-1]),&(yyvsp[0]));
yyval = yyvsp[0];
;
break;}
case 143:
#line 1047 "fortran.y"
{
yyval = yyvsp[-1];
;
break;}
case 144:
#line 1053 "fortran.y"
{
yyval.next_token = append_token((Token*)NULL,&(yyvsp[0]));
;
break;}
case 145:
#line 1057 "fortran.y"
{
if(!is_true(COMMA_FLAG,yyvsp[-1].TOK_flags))
syntax_error(
yyvsp[0].line_num,yyvsp[0].col_num-1,
"missing comma");
yyval.TOK_flags = yyvsp[0].TOK_flags;
yyval.line_num = yyvsp[0].line_num;
yyval.col_num = yyvsp[0].col_num;
yyval.next_token = append_token(yyvsp[-1].next_token,&(yyvsp[0]));
;
break;}
case 146:
#line 1070 "fortran.y"
{ /* no comma */
def_namelist_item(&(yyvsp[0]));
primary_id_expr(&(yyvsp[0]),&(yyval));
make_false(COMMA_FLAG,yyval.TOK_flags);
;
break;}
case 147:
#line 1076 "fortran.y"
{ /* has comma */
def_namelist_item(&(yyvsp[-1]));
primary_id_expr(&(yyvsp[-1]),&(yyval));
make_true(COMMA_FLAG,yyval.TOK_flags);
;
break;}
case 152:
#line 1091 "fortran.y"
{
current_typesize = size_DEFAULT;
current_len_text = NULL;
;
break;}
case 153:
#line 1097 "fortran.y"
{
current_typesize = yyvsp[0].value.integer;
current_len_text = NULL;
#if 0 /* defunct feature */
if(local_wordsize > 0) {
/* recognize REAL*2w as DOUBLE PRECISION */
if(current_datatype == type_REAL
&& yyvsp[0].value.integer == type_size[type_DP])
current_datatype = type_DP;
/* recognize COMPLEX*4w as DOUBLE COMPLEX */
if(current_datatype == type_COMPLEX
&& yyvsp[0].value.integer==type_size[type_DCOMPLEX])
current_datatype = type_DCOMPLEX;
}
#endif
if(f77_standard) {
nonstandard(yyvsp[0].line_num,yyvsp[0].col_num);
}
;
break;}
case 155:
#line 1121 "fortran.y"
{
current_datatype = type_INTEGER;
integer_context = TRUE;
;
break;}
case 156:
#line 1126 "fortran.y"
{
current_datatype = type_REAL;
integer_context = TRUE;
;
break;}
case 157:
#line 1131 "fortran.y"
{
current_datatype = type_COMPLEX;
integer_context = TRUE;
;
break;}
case 158:
#line 1136 "fortran.y"
{
current_datatype = type_LOGICAL;
integer_context = TRUE;
;
break;}
case 159:
#line 1143 "fortran.y"
{
current_datatype = type_DP;
current_typesize = size_DEFAULT;
current_len_text = NULL;
;
break;}
case 160:
#line 1149 "fortran.y"
{
current_datatype = type_DP;
current_typesize = size_DEFAULT;
current_len_text = NULL;
;
break;}
case 161:
#line 1155 "fortran.y"
{
current_datatype = type_DCOMPLEX;
current_typesize = size_DEFAULT;
current_len_text = NULL;
if(f77_standard) {
nonstandard(yyvsp[0].line_num,yyvsp[0].col_num);
}
;
break;}
case 162:
#line 1164 "fortran.y"
{
current_datatype = type_DCOMPLEX;
current_typesize = size_DEFAULT;
current_len_text = NULL;
if(f77_standard) {
nonstandard(yyvsp[0].line_num,yyvsp[0].col_num);
}
;
break;}
case 163:
#line 1173 "fortran.y"
{
current_datatype = type_INTEGER;
current_typesize = 1;
current_len_text = NULL;
if(f77_standard)
nonstandard(yyvsp[0].line_num,yyvsp[0].col_num);
;
break;}
case 164:
#line 1183 "fortran.y"
{
current_datatype = type_STRING;
current_typesize = 1;
current_len_text = NULL;
current_size_is_adjustable = 0;
current_size_is_expression = 0;
integer_context = TRUE;
;
break;}
case 165:
#line 1194 "fortran.y"
{
current_typesize = yyvsp[0].value.integer;
current_size_is_adjustable = yyvsp[0].size_is_adjustable;
current_size_is_expression = yyvsp[0].size_is_expression;
if(current_size_is_expression) {
if(yyvsp[0].left_token == NULL)
current_len_text = new_tree_text(&(yyvsp[0]));
else
current_len_text = new_tree_text(yyvsp[0].left_token);
}
else
current_len_text = NULL;
;
break;}
case 168:
#line 1215 "fortran.y"
{
declare_type(&(yyvsp[0]),
current_datatype,
current_typesize,
current_len_text);
;
break;}
case 169:
#line 1222 "fortran.y"
{
declare_type(&(yyvsp[0]),
current_datatype,
current_typesize,
current_len_text);
;
break;}
case 172:
#line 1235 "fortran.y"
{
yyvsp[0].size_is_adjustable = current_size_is_adjustable;
yyvsp[0].size_is_expression = current_size_is_expression;
declare_type(&(yyvsp[0]),
current_datatype,
current_typesize,
current_len_text);
;
break;}
case 173:
#line 1244 "fortran.y"
{
yyvsp[-2].size_is_adjustable = yyvsp[0].size_is_adjustable;
yyvsp[-2].size_is_expression = yyvsp[0].size_is_expression;
declare_type(&(yyvsp[-2]),
current_datatype,
yyvsp[0].value.integer,
new_tree_text(
yyvsp[0].left_token == NULL?
&(yyvsp[0]): yyvsp[0].left_token )
);
;
break;}
case 174:
#line 1256 "fortran.y"
{
yyvsp[0].size_is_adjustable = current_size_is_adjustable;
yyvsp[0].size_is_expression = current_size_is_expression;
declare_type(&(yyvsp[0]),
current_datatype,
current_typesize,
current_len_text);
;
break;}
case 175:
#line 1265 "fortran.y"
{
yyvsp[-2].size_is_adjustable = yyvsp[0].size_is_adjustable;
yyvsp[-2].size_is_expression = yyvsp[0].size_is_expression;
declare_type(&(yyvsp[-2]),
current_datatype,
yyvsp[0].value.integer,
new_tree_text(
yyvsp[0].left_token == NULL?
&(yyvsp[0]): yyvsp[0].left_token )
);
;
break;}
case 176:
#line 1280 "fortran.y"
{implicit_flag=TRUE;;
break;}
case 177:
#line 1284 "fortran.y"
{
implicit_flag=FALSE;
if(implicit_none) {
syntax_error(yyvsp[-2].line_num,yyvsp[-2].col_num,
"conflicts with IMPLICIT NONE");
}
else {
implicit_type_given = TRUE;
}
;
break;}
case 178:
#line 1296 "fortran.y"
{
implicit_flag=FALSE;
if(implicit_type_given) {
syntax_error(yyvsp[-2].line_num,yyvsp[-2].col_num,
"conflicts with IMPLICIT statement");
}
else {
if(f77_standard)
nonstandard(yyvsp[-1].line_num,yyvsp[-1].col_num);
implicit_none = TRUE;
}
;
break;}
case 180:
#line 1311 "fortran.y"
{initial_flag = TRUE;;
break;}
case 182:
#line 1317 "fortran.y"
{implicit_letter_flag = TRUE;;
break;}
case 183:
#line 1318 "fortran.y"
{implicit_letter_flag = FALSE;;
break;}
case 186:
#line 1326 "fortran.y"
{
int c1 = (int)yyvsp[0].subclass;
if( (f77_standard && !isalpha(c1))
|| (!allow_dollarsigns && c1=='$')
|| (!allow_underscores && c1=='_') ) {
nonstandard(yyvsp[0].line_num,yyvsp[0].col_num);
msg_tail(": nonalphabetic character");
}
set_implicit_type(current_datatype,
current_typesize,
current_len_text,
c1,c1);
;
break;}
case 187:
#line 1342 "fortran.y"
{
int c1 = (int)yyvsp[-2].subclass,
c2 = (int)yyvsp[0].subclass;
if( (f77_standard && (!isalpha(c1) || !isalpha(c2)))
|| (!allow_dollarsigns && (c1 == '$' || c2 == '$'))
|| (!allow_underscores && (c1 == '_' || c2 == '_')))
{
if(!isalpha(c1))
nonstandard(yyvsp[-2].line_num,yyvsp[-2].col_num);
else
nonstandard(yyvsp[0].line_num,yyvsp[0].col_num);
msg_tail(": nonalphabetic character");
}
set_implicit_type(current_datatype,
current_typesize,
current_len_text,
c1,c2);
;
break;}
case 188:
#line 1367 "fortran.y"
{
yyvsp[-1].left_token = (Token *)NULL;
yyval.value.integer = size_ADJUSTABLE;
yyval.size_is_adjustable = 1;
yyval.size_is_expression = 0;
yyval.left_token = add_tree_node(&(yyvsp[-2]),&(yyvsp[-1]),
(Token*)NULL);
;
break;}
case 189:
#line 1377 "fortran.y"
{
yyval.value.integer = yyvsp[0].value.integer;
yyval.size_is_adjustable = 0;
yyval.size_is_expression = 0;
;
break;}
case 190:
#line 1383 "fortran.y"
{
yyval = yyvsp[-1];
yyval.size_is_adjustable = 0;
yyval.size_is_expression = 1;
if( yyval.value.integer <= 0 ){
warning(yyvsp[-1].line_num,yyvsp[-1].col_num,
"invalid length specification");
msg_tail(": substituting 1");
yyval.value.integer = 1;
}
yyval.left_token = add_tree_node(&(yyvsp[-2]),&(yyvsp[-1]),
(Token*)NULL);
;
break;}
case 194:
#line 1406 "fortran.y"
{complex_const_allowed = TRUE;;
break;}
case 195:
#line 1408 "fortran.y"
{
def_parameter(&(yyvsp[-3]),&(yyvsp[0]));
primary_id_expr(&(yyvsp[-3]),&(yyvsp[-3]));
assignment_stmt_type(&(yyvsp[-3]),&(yyvsp[-1]),&(yyvsp[0]));
complex_const_allowed = FALSE;
;
break;}
case 197:
#line 1421 "fortran.y"
{
def_ext_name(&(yyvsp[0]));
;
break;}
case 198:
#line 1425 "fortran.y"
{
def_ext_name(&(yyvsp[0]));
;
break;}
case 200:
#line 1435 "fortran.y"
{
def_intrins_name(&(yyvsp[0]));
;
break;}
case 201:
#line 1439 "fortran.y"
{
def_intrins_name(&(yyvsp[0]));
;
break;}
case 202:
#line 1446 "fortran.y"
{
global_save = TRUE;
;
break;}
case 206:
#line 1457 "fortran.y"
{
save_variable(&(yyvsp[0]));
;
break;}
case 207:
#line 1461 "fortran.y"
{
/*** def_com_block(&($2),(Token*)NULL);***/
save_com_block(&(yyvsp[-1]));
;
break;}
case 212:
#line 1477 "fortran.y"
{complex_const_allowed=TRUE;;
break;}
case 213:
#line 1479 "fortran.y"
{complex_const_allowed=FALSE;;
break;}
case 217:
#line 1488 "fortran.y"
{
use_lvalue(&(yyvsp[0]));
;
break;}
case 224:
#line 1504 "fortran.y"
{
use_parameter(&(yyvsp[0]));
;
break;}
case 226:
#line 1511 "fortran.y"
{
use_parameter(&(yyvsp[0]));
;
break;}
case 229:
#line 1522 "fortran.y"
{
use_lvalue(&(yyvsp[0]));
;
break;}
case 231:
#line 1530 "fortran.y"
{
use_implied_do_index(&(yyvsp[-3]));
;
break;}
case 234:
#line 1541 "fortran.y"
{complex_const_allowed = TRUE;
in_assignment_stmt = TRUE;;
break;}
case 235:
#line 1543 "fortran.y"
{
if( ! (is_true(LVALUE_EXPR,yyvsp[-3].TOK_flags)
|| is_true(STMT_FUNCTION_EXPR,yyvsp[-3].TOK_flags) )) {
syntax_error(yyvsp[-3].line_num,yyvsp[-3].col_num,
"left side is not assignable");
}
else {
assignment_stmt_type(&(yyvsp[-3]),&(yyvsp[-2]),
&(yyvsp[0]));
}
complex_const_allowed = FALSE;
in_assignment_stmt = FALSE;
;
break;}
case 236:
#line 1557 "fortran.y"
{
if(is_true(STMT_FUNCTION_EXPR, yyvsp[-5].TOK_flags)
&& stmt_sequence_no <= SEQ_STMT_FUN)
stmt_function_stmt(&(yyvsp[-5]));
;
break;}
case 241:
#line 1575 "fortran.y"
{
do_ASSIGN(&(yyvsp[-1]));
;
break;}
case 245:
#line 1592 "fortran.y"
{
do_assigned_GOTO(&(yyvsp[-1]));
;
break;}
case 246:
#line 1596 "fortran.y"
{
do_assigned_GOTO(&(yyvsp[-4]));
;
break;}
case 247:
#line 1600 "fortran.y"
{
do_assigned_GOTO(&(yyvsp[-5]));
;
break;}
case 248:
#line 1606 "fortran.y"
{
integer_context=TRUE;
;
break;}
case 249:
#line 1610 "fortran.y"
{
integer_context=TRUE;
;
break;}
case 252:
#line 1622 "fortran.y"
{
int t=datatype_of(yyvsp[-9].class);
if(t != type_INTEGER && t != type_REAL
&& t != type_DP && t != type_ERROR ) {
syntax_error(yyvsp[-9].line_num,yyvsp[-9].col_num,
"integer, real, or double precision expression required");
}
;
break;}
case 253:
#line 1634 "fortran.y"
{
int t=datatype_of(yyvsp[-1].TOK_type);
if(t != type_LOGICAL && t != type_ERROR)
syntax_error(yyvsp[-1].line_num,yyvsp[-1].col_num,
"logical expression required");
;
break;}
case 254:
#line 1644 "fortran.y"
{
int t=datatype_of(yyvsp[-2].TOK_type);
if(t != type_LOGICAL && t != type_ERROR)
syntax_error(yyvsp[-2].line_num,yyvsp[-2].col_num,
"logical expression required");
;
break;}
case 255:
#line 1652 "fortran.y"
{complex_const_allowed = TRUE;;
break;}
case 256:
#line 1653 "fortran.y"
{
if(is_true(ID_EXPR,yyvsp[-1].TOK_flags)){
use_variable(&(yyvsp[-1]));
}
complex_const_allowed = FALSE;
initial_flag = TRUE; /* for is_keyword */
yyval = yyvsp[-1]; /* Inherit expr for type checking above */
;
break;}
case 258:
#line 1666 "fortran.y"
{complex_const_allowed = TRUE;;
break;}
case 259:
#line 1667 "fortran.y"
{
if(is_true(ID_EXPR,yyvsp[-1].TOK_flags)){
use_variable(&(yyvsp[-1]));
}
complex_const_allowed = FALSE;
initial_flag = TRUE;
;
break;}
case 264:
#line 1697 "fortran.y"
{
if( ! is_true(LVALUE_EXPR,yyvsp[-3].TOK_flags) ) {
syntax_error(yyvsp[-3].line_num,yyvsp[-3].col_num,
"index is not assignable");
}
else {
use_lvalue(&(yyvsp[-3]));
use_variable(&(yyvsp[-3]));
}
if(datatype_of(yyvsp[-3].TOK_type) == type_INTEGER
&& datatype_of(yyvsp[-1].TOK_type) != type_INTEGER)
warning(yyvsp[-2].line_num,yyvsp[-2].col_num,
"type mismatch between DO index and bounds");
else if(datatype_of(yyvsp[-3].TOK_type) != type_INTEGER)
if(datatype_of(yyvsp[-1].TOK_type) != type_INTEGER) {
if(port_check)
nonportable(yyvsp[-1].line_num,yyvsp[-1].col_num,
"non-integer DO loop bounds");
}
else {
if(trunc_check)
warning(yyvsp[-3].line_num,yyvsp[-3].col_num,
"DO index is not integer");
}
;
break;}
case 265:
#line 1726 "fortran.y"
{complex_const_allowed=TRUE;;
break;}
case 266:
#line 1727 "fortran.y"
{
if(is_true(ID_EXPR,yyvsp[-2].TOK_flags)){
use_variable(&(yyvsp[-2]));
}
complex_const_allowed=FALSE;
make_true(NONSTD_USAGE_FLAG,yyval.TOK_flags);
;
break;}
case 267:
#line 1735 "fortran.y"
{complex_const_allowed=TRUE;;
break;}
case 268:
#line 1736 "fortran.y"
{
if(is_true(ID_EXPR,yyvsp[-2].TOK_flags)){
use_variable(&(yyvsp[-2]));
}
complex_const_allowed=FALSE;
make_true(NONSTD_USAGE_FLAG,yyval.TOK_flags);
;
break;}
case 271:
#line 1748 "fortran.y"
{
make_true(NONSTD_USAGE_FLAG,yyval.TOK_flags);
integer_context=FALSE;
;
break;}
case 272:
#line 1755 "fortran.y"
{
yyval.TOK_type=do_bounds_type(&(yyvsp[-2]),&(yyvsp[0]),&(yyvsp[0]));
;
break;}
case 273:
#line 1759 "fortran.y"
{
yyval.TOK_type=do_bounds_type(&(yyvsp[-4]),&(yyvsp[-2]),&(yyvsp[0]));
;
break;}
case 281:
#line 1783 "fortran.y"
{
use_variable(&(yyvsp[0]));
;
break;}
case 283:
#line 1791 "fortran.y"
{complex_const_allowed = FALSE;;
break;}
case 285:
#line 1793 "fortran.y"
{complex_const_allowed = FALSE;;
break;}
case 287:
#line 1796 "fortran.y"
{init_io_ctrl_list();;
break;}
case 288:
#line 1798 "fortran.y"
{complex_const_allowed = TRUE;;
break;}
case 294:
#line 1811 "fortran.y"
{init_io_ctrl_list();;
break;}
case 295:
#line 1815 "fortran.y"
{
if(f77_standard)
nonstandard(yyvsp[-2].line_num,yyvsp[-2].col_num);
;
break;}
case 296:
#line 1820 "fortran.y"
{
if(f77_standard)
nonstandard(yyvsp[-4].line_num,yyvsp[-4].col_num);
;
break;}
case 298:
#line 1829 "fortran.y"
{complex_const_allowed = TRUE;;
break;}
case 299:
#line 1830 "fortran.y"
{complex_const_allowed = FALSE;;
break;}
case 301:
#line 1834 "fortran.y"
{
if(f77_standard)
nonstandard(yyvsp[-2].line_num,yyvsp[-2].col_num);
;
break;}
case 302:
#line 1839 "fortran.y"
{complex_const_allowed = TRUE;;
break;}
case 303:
#line 1840 "fortran.y"
{complex_const_allowed = FALSE;;
break;}
case 304:
#line 1841 "fortran.y"
{
if(f77_standard)
nonstandard(yyvsp[-6].line_num,yyvsp[-6].col_num);
;
break;}
case 305:
#line 1849 "fortran.y"
{
++control_item_count;
;
break;}
case 306:
#line 1853 "fortran.y"
{
++control_item_count;
if(! io_warning_given) {
if( io_internal_file ) {
if( (curr_stmt_class == tok_WRITE ||
curr_stmt_class == tok_READ) &&
io_list_directed ) {
if(f77_standard) {
nonstandard(yyvsp[0].line_num,yyvsp[0].col_num);
msg_tail(": internal file cannot be used with list-directed I/O");
}
io_warning_given = TRUE;
}
}
}
;
break;}
case 307:
#line 1875 "fortran.y"
{
use_io_keyword(&(yyvsp[-2]),&(yyvsp[0]),curr_stmt_class);
;
break;}
case 308:
#line 1879 "fortran.y"
{
if( yyvsp[0].class == '*' ) {
if(control_item_count == 1) /* format id */
{
io_list_directed = TRUE;
}
}
else if( is_true(ID_EXPR,yyvsp[0].TOK_flags)){
if(control_item_count == 0 &&
datatype_of(yyvsp[0].TOK_type) == type_STRING) {
/* unit id=char variable is
an internal file. I/O goes in
and out of the variable. */
io_internal_file = TRUE;
if(curr_stmt_class == tok_WRITE) {
use_lvalue(&(yyvsp[0]));
}
}
/* format id=namelist means
I/O with variables of namelist. */
else if( control_item_count == 1 &&
datatype_of(yyvsp[0].TOK_type) == type_NAMELIST) {
ref_namelist(&(yyvsp[0]),curr_stmt_class);
}
use_variable(&(yyvsp[0]));
}
;
break;}
case 309:
#line 1919 "fortran.y"
{
if( yyvsp[0].class != '*'
&& is_true(ID_EXPR,yyvsp[0].TOK_flags)){
use_variable(&(yyvsp[0]));
}
++control_item_count;
;
break;}
case 310:
#line 1927 "fortran.y"
{
use_io_keyword(&(yyvsp[-2]),&(yyvsp[0]),curr_stmt_class);
++control_item_count;
;
break;}
case 311:
#line 1932 "fortran.y"
{
++control_item_count;
;
break;}
case 312:
#line 1938 "fortran.y"
{
use_io_keyword(&(yyvsp[-2]),&(yyvsp[0]),curr_stmt_class);
;
break;}
case 313:
#line 1942 "fortran.y"
{
use_special_open_keywd(&(yyvsp[0]));
;
break;}
case 316:
#line 1953 "fortran.y"
{
if(is_true(ID_EXPR,yyvsp[0].TOK_flags)){
if( curr_stmt_class == tok_READ ||
curr_stmt_class == tok_ACCEPT )
use_lvalue(&(yyvsp[0]));
else
use_variable(&(yyvsp[0]));
}
;
break;}
case 318:
#line 1967 "fortran.y"
{
if( ! is_true(LVALUE_EXPR,yyvsp[-3].TOK_flags) ) {
syntax_error(yyvsp[-3].line_num,yyvsp[-3].col_num,
"index is not assignable");
}
else {
use_implied_do_index(&(yyvsp[-3]));
}
;
break;}
case 319:
#line 1979 "fortran.y"
{init_io_ctrl_list();;
break;}
case 321:
#line 1984 "fortran.y"
{init_io_ctrl_list();;
break;}
case 323:
#line 1989 "fortran.y"
{init_io_ctrl_list();;
break;}
case 325:
#line 1995 "fortran.y"
{
if( yyvsp[-1].class != '*'
&& is_true(ID_EXPR,yyvsp[-1].TOK_flags)){
use_variable(&(yyvsp[-1]));
}
;
break;}
case 327:
#line 2003 "fortran.y"
{init_io_ctrl_list();;
break;}
case 328:
#line 2008 "fortran.y"
{
if( yyvsp[-1].class != '*'
&& is_true(ID_EXPR,yyvsp[-1].TOK_flags)){
use_variable(&(yyvsp[-1]));
}
;
break;}
case 330:
#line 2016 "fortran.y"
{init_io_ctrl_list();;
break;}
case 331:
#line 2017 "fortran.y"
{init_io_ctrl_list();;
break;}
case 332:
#line 2022 "fortran.y"
{
if( yyvsp[-1].class != '*'
&& is_true(ID_EXPR,yyvsp[-1].TOK_flags)){
use_variable(&(yyvsp[-1]));
}
;
break;}
case 334:
#line 2030 "fortran.y"
{init_io_ctrl_list();;
break;}
case 337:
#line 2044 "fortran.y"
{
if(is_true(ID_EXPR,yyvsp[0].TOK_flags)){
use_variable(&(yyvsp[0]));
}
;
break;}
case 339:
#line 2053 "fortran.y"
{inside_format=TRUE;;
break;}
case 340:
#line 2054 "fortran.y"
{
inside_format=FALSE;
;
break;}
case 359:
#line 2090 "fortran.y"
{
if(f77_standard || !allow_format_dollarsigns)
nonstandard(yyvsp[0].line_num,yyvsp[0].col_num);
;
break;}
case 364:
#line 2105 "fortran.y"
{inside_format=FALSE;;
break;}
case 365:
#line 2106 "fortran.y"
{inside_format=TRUE;;
break;}
case 366:
#line 2107 "fortran.y"
{
if(f77_standard || !allow_variable_format)
nonstandard(yyvsp[-4].line_num,yyvsp[-4].col_num);
;
break;}
case 367:
#line 2116 "fortran.y"
{
check_stmt_sequence(&(yyvsp[-3]),SEQ_STMT_FUN);
def_stmt_function(&(yyvsp[-3]),&(yyvsp[-1]));
primary_id_expr(&(yyvsp[-3]),&(yyval));
#ifdef DEBUG_PARSER
if(debug_parser)
print_exprlist("stmt function",&(yyvsp[-1]));
#endif
;
break;}
case 368:
#line 2130 "fortran.y"
{
yyval.next_token = (Token*)NULL;
;
break;}
case 370:
#line 2137 "fortran.y"
{
yyval.next_token = append_token((Token*)NULL,&(yyvsp[0]));
;
break;}
case 371:
#line 2142 "fortran.y"
{
yyval.next_token = append_token(yyvsp[-2].next_token,&(yyvsp[0]));
;
break;}
case 373:
#line 2152 "fortran.y"
{
call_subr(&(yyvsp[0]),(Token*)NULL);
complex_const_allowed = FALSE;
;
break;}
case 375:
#line 2158 "fortran.y"
{
call_subr(&(yyvsp[-2]),(Token*)NULL);
complex_const_allowed = FALSE;
;
break;}
case 377:
#line 2164 "fortran.y"
{
call_subr(&(yyvsp[-3]),&(yyvsp[-1]));
#ifdef DEBUG_PARSER
if(debug_parser)
print_exprlist("call stmt",&(yyvsp[-1]));
#endif
complex_const_allowed = FALSE;
;
break;}
case 379:
#line 2175 "fortran.y"
{
complex_const_allowed = TRUE;
yyval = yyvsp[0];
;
break;}
case 380:
#line 2181 "fortran.y"
{
yyval.next_token = append_token((Token*)NULL,&(yyvsp[0]));
yyval.left_token = (Token *)NULL;
;
break;}
case 381:
#line 2186 "fortran.y"
{
yyval.next_token = append_token(yyvsp[-2].next_token,&(yyvsp[0]));
;
break;}
case 382:
#line 2192 "fortran.y"
{
if(is_true(ID_EXPR,yyvsp[0].TOK_flags)){
use_actual_arg(&(yyvsp[0]));
use_variable(&(yyvsp[0]));
}
;
break;}
case 383:
#line 2199 "fortran.y"
{
yyval = yyvsp[0];
yyval.left_token = (Token *)NULL;
;
break;}
case 384:
#line 2207 "fortran.y"
{
do_RETURN(current_module_hash,&(yyvsp[-1]));
;
break;}
case 385:
#line 2211 "fortran.y"
{
do_RETURN(current_module_hash,&(yyvsp[-2]));
;
break;}
case 386:
#line 2218 "fortran.y"
{
if(!is_true(COMPLEX_FLAG,yyvsp[-3].TOK_flags))
complex_const_allowed=FALSE;
if(is_true(IN_ASSIGN,yyvsp[-3].TOK_flags))
in_assignment_stmt = TRUE;
if(yyvsp[-1].next_token == NULL)
call_func(&(yyvsp[-3]),(Token *)NULL);
else
call_func(&(yyvsp[-3]),&(yyvsp[-1]));
func_ref_expr(&(yyvsp[-3]),&(yyvsp[-1]),&(yyval));
yyval.left_token = add_tree_node(
&(yyvsp[-2]),&(yyvsp[-3]),
(yyvsp[-1].next_token == NULL?
empty_token(&(yyvsp[-1])) :
yyvsp[-1].next_token) );
#ifdef DEBUG_PARSER
if(debug_parser)
print_exprlist("function",&(yyvsp[-1]));
#endif
;
break;}
case 387:
#line 2246 "fortran.y"
{
if(complex_const_allowed)/* save context */
make_true(COMPLEX_FLAG,yyval.TOK_flags);
complex_const_allowed=TRUE;
if(in_assignment_stmt)
make_true(IN_ASSIGN,yyval.TOK_flags);
in_assignment_stmt = FALSE;
;
break;}
case 388:
#line 2256 "fortran.y"
{
yyval.class = 0;
yyval.next_token = (Token *)NULL;
yyval.left_token = (Token *)NULL;
;
break;}
case 390:
#line 2265 "fortran.y"
{
yyval.next_token = append_token((Token*)NULL,&(yyvsp[0]));
yyval.left_token = (Token *)NULL;
;
break;}
case 391:
#line 2270 "fortran.y"
{
yyval.next_token = append_token(yyvsp[-2].next_token,&(yyvsp[0]));
;
break;}
case 392:
#line 2278 "fortran.y"
{
int t=datatype_of(yyvsp[0].TOK_type);
if( t != type_ERROR){
if( ! is_const_type(t) ) {
syntax_error(yyvsp[0].line_num,yyvsp[0].col_num,
"arithmetic, char, or logical expression expected");
}
else {
if( !is_true(PARAMETER_EXPR,yyvsp[0].TOK_flags) ) {
syntax_error(yyvsp[0].line_num,yyvsp[0].col_num,
"constant expression expected");
}
/* Here we allow, with some warnings, expr
containing intrins func or **REAL in
PARAMETER defn. */
else if( !is_true(CONST_EXPR,yyvsp[0].TOK_flags) ) {
if(f77_standard) {
nonstandard(yyvsp[0].line_num,yyvsp[0].col_num);
msg_tail(
"intrinsic function or **REAL in PARAMETER defn");
}
}
}
}
;
break;}
case 393:
#line 2307 "fortran.y"
{
yyval.next_token = (Token *) NULL;
#ifdef DEBUG_PARSER
if(debug_parser) {
(void)fprintf(list_fd,
"\nexpr: class=0x%x subclass=0x%x",
yyvsp[0].class,
yyvsp[0].subclass);
}
#endif
;
break;}
case 395:
#line 2324 "fortran.y"
{
do_binexpr(&(yyvsp[-2]),&(yyvsp[-1]),&(yyvsp[0])
,&(yyval));
;
break;}
case 396:
#line 2329 "fortran.y"
{
do_binexpr(&(yyvsp[-2]),&(yyvsp[-1]),&(yyvsp[0])
,&(yyval));
;
break;}
case 398:
#line 2338 "fortran.y"
{
do_binexpr(&(yyvsp[-2]),&(yyvsp[-1]),&(yyvsp[0])
,&(yyval));
;
break;}
case 400:
#line 2347 "fortran.y"
{
do_binexpr(&(yyvsp[-2]),&(yyvsp[-1]),&(yyvsp[0])
,&(yyval));
;
break;}
case 402:
#line 2356 "fortran.y"
{
do_unexpr(&(yyvsp[-1]),&(yyvsp[0]),&(yyval));
;
break;}
case 404:
#line 2364 "fortran.y"
{
do_binexpr(&(yyvsp[-2]),&(yyvsp[-1]),&(yyvsp[0])
,&(yyval));
;
break;}
case 406:
#line 2374 "fortran.y"
{
do_unexpr(&(yyvsp[-1]),&(yyvsp[0]),&(yyval));
;
break;}
case 407:
#line 2378 "fortran.y"
{
do_unexpr(&(yyvsp[-1]),&(yyvsp[0]),&(yyval));
;
break;}
case 408:
#line 2382 "fortran.y"
{
do_binexpr(&(yyvsp[-2]),&(yyvsp[-1]),&(yyvsp[0])
,&(yyval));
;
break;}
case 409:
#line 2387 "fortran.y"
{
do_binexpr(&(yyvsp[-2]),&(yyvsp[-1]),&(yyvsp[0])
,&(yyval));
;
break;}
case 411:
#line 2396 "fortran.y"
{
do_binexpr(&(yyvsp[-2]),&(yyvsp[-1]),&(yyvsp[0])
,&(yyval));
if(div_check &&
!is_true(CONST_EXPR,yyvsp[0].TOK_flags)){
warning(yyvsp[-1].line_num,yyvsp[-1].col_num,
"Possible division by zero");
}
;
break;}
case 412:
#line 2406 "fortran.y"
{
do_binexpr(&(yyvsp[-2]),&(yyvsp[-1]),&(yyvsp[0])
,&(yyval));
;
break;}
case 414:
#line 2415 "fortran.y"
{
do_binexpr(&(yyvsp[-2]),&(yyvsp[-1]),&(yyvsp[0])
,&(yyval));
;
break;}
case 416:
#line 2424 "fortran.y"
{
do_binexpr(&(yyvsp[-2]),&(yyvsp[-1]),&(yyvsp[0])
,&(yyval));
;
break;}
case 421:
#line 2439 "fortran.y"
{
yyval.TOK_flags = 0;
yyval.left_token = (Token *)NULL;
make_true(CONST_EXPR,yyval.TOK_flags);
make_true(PARAMETER_EXPR,yyval.TOK_flags);
make_true(LIT_CONST,yyval.TOK_flags);
make_true(EVALUATED_EXPR,yyval.TOK_flags);
;
break;}
case 422:
#line 2448 "fortran.y"
{
yyval = yyvsp[-1];
if(is_true(LVALUE_EXPR,yyvsp[-1].TOK_flags)) {
if(pretty_flag) {
ugly_code(yyvsp[-1].line_num,yyvsp[-1].col_num,
"Extraneous parentheses");
}
use_variable(&(yyvsp[-1]));
make_false(LVALUE_EXPR,yyval.TOK_flags);
make_false(ARRAY_ID_EXPR,yyval.TOK_flags);
make_false(ARRAY_ELEMENT_EXPR,yyval.TOK_flags);
make_false(ID_EXPR,yyval.TOK_flags);
}
yyval.left_token = add_tree_node(&(yyvsp[-2]),&(yyvsp[-1]),
(Token*)NULL);
;
break;}
case 423:
#line 2471 "fortran.y"
{
yyval.size = size_DEFAULT;
;
break;}
case 424:
#line 2476 "fortran.y"
{
yyval.TOK_type = type_byte(class_VAR,type_STRING);
;
break;}
case 425:
#line 2481 "fortran.y"
{
yyval.TOK_type = type_byte(class_VAR,type_HOLLERITH);
if(port_check && hollerith_check) {
warning(yyvsp[0].line_num,yyvsp[0].col_num,
"hollerith constant may not be portable");
}
;
break;}
case 426:
#line 2490 "fortran.y"
{
yyval.TOK_type = type_byte(class_VAR,type_LOGICAL);
yyval.size = size_DEFAULT;
;
break;}
case 427:
#line 2497 "fortran.y"
{
yyval.TOK_type = type_byte(class_VAR,type_INTEGER);
;
break;}
case 428:
#line 2501 "fortran.y"
{
yyval.TOK_type = type_byte(class_VAR,type_REAL);
;
break;}
case 429:
#line 2505 "fortran.y"
{
yyval.TOK_type = type_byte(class_VAR,type_DP);
;
break;}
case 430:
#line 2509 "fortran.y"
{
yyval.TOK_type = type_byte(class_VAR,type_COMPLEX);
;
break;}
case 431:
#line 2513 "fortran.y"
{
yyval.TOK_type = type_byte(class_VAR,type_DCOMPLEX);
;
break;}
case 432:
#line 2520 "fortran.y"
{
if(is_true(ID_EXPR,yyvsp[0].TOK_flags)){
use_variable(&(yyvsp[0]));
}
if(datatype_of(yyvsp[0].TOK_type) != type_INTEGER) {
syntax_error(
yyvsp[0].line_num,yyvsp[0].col_num,
"expression must be integer type");
}
;
break;}
case 433:
#line 2534 "fortran.y"
{
if(is_true(ID_EXPR,yyvsp[0].TOK_flags)){
use_variable(&(yyvsp[0]));
}
{
int t=datatype_of(yyvsp[0].TOK_type);
if(t != type_INTEGER && t != type_REAL
&& t != type_DP ) {
syntax_error(
yyvsp[0].line_num,yyvsp[0].col_num,
"expression must be integer, real, or double precision type");
}
}
;
break;}
case 434:
#line 2554 "fortran.y"
{
if(is_true(ID_EXPR,yyvsp[0].TOK_flags)){
use_variable(&(yyvsp[0]));
}
if( ! is_true(CONST_EXPR,yyvsp[0].TOK_flags) ) {
syntax_error(
yyvsp[0].line_num,yyvsp[0].col_num,
"constant expression expected");
}
else {
if(datatype_of(yyvsp[0].TOK_type) != type_INTEGER){
syntax_error(
yyvsp[0].line_num,yyvsp[0].col_num,
"integer expression expected");
}
else {
yyval.value.integer = int_expr_value(&(yyvsp[0]));
}
}
;
break;}
case 435:
#line 2578 "fortran.y"
{
if(is_true(ID_EXPR,yyvsp[0].TOK_flags)){
use_variable(&(yyvsp[0]));
}
if( datatype_of(yyvsp[0].TOK_type) != type_INTEGER ){
syntax_error(
yyvsp[0].line_num,yyvsp[0].col_num,
"integer dimension expected");
yyval.value.integer = 0;
}
else {
if( is_true(EVALUATED_EXPR,yyvsp[0].TOK_flags) )
yyval.value.integer =
int_expr_value(&(yyvsp[0]));
else /* must be dummy */
yyval.value.integer = 0;
}
;
break;}
case 436:
#line 2604 "fortran.y"
{
ref_array(&(yyvsp[-3]),&(yyvsp[-1]));
#ifdef DEBUG_PARSER
if(debug_parser)
print_exprlist("array lvalue",&(yyvsp[-1]));
#endif
make_false(ARRAY_ID_EXPR,yyval.TOK_flags);
make_true(ARRAY_ELEMENT_EXPR,yyval.TOK_flags);
yyval.left_token = add_tree_node(
&(yyvsp[-2]),&(yyvsp[-3]),yyvsp[-1].next_token);
yyval.next_token = (Token *) NULL;
;
break;}
case 437:
#line 2620 "fortran.y"
{
ref_array(&(yyvsp[-3]),&(yyvsp[-1]));
#ifdef DEBUG_PARSER
if(debug_parser)
print_exprlist("array",&(yyvsp[-1]));
#endif
make_false(ARRAY_ID_EXPR,yyval.TOK_flags);
make_true(ARRAY_ELEMENT_EXPR,yyval.TOK_flags);
yyval.left_token = add_tree_node(
&(yyvsp[-2]),&(yyvsp[-3]),yyvsp[-1].next_token);
yyval.next_token = (Token *) NULL;
;
break;}
case 438:
#line 2636 "fortran.y"
{
yyval.next_token = append_token((Token*)NULL,&(yyvsp[0]));
;
break;}
case 439:
#line 2640 "fortran.y"
{
yyval.next_token = append_token(yyvsp[-2].next_token,&(yyvsp[0]));
;
break;}
case 440:
#line 2646 "fortran.y"
{
if(is_true(ID_EXPR,yyvsp[0].TOK_flags)){
use_variable(&(yyvsp[0]));
}
if(datatype_of(yyvsp[0].TOK_type) != type_INTEGER)
if(trunc_check)
warning(yyvsp[0].line_num,yyvsp[0].col_num,
"subscript is not integer");
;
break;}
case 441:
#line 2660 "fortran.y"
{
if(!is_true(COMPLEX_FLAG,yyvsp[-1].TOK_flags))
complex_const_allowed=FALSE;
/* set flag to keep more than just id for
arg list text */
if(is_true(ID_EXPR,yyvsp[-1].TOK_flags))
make_true(ARRAY_ELEMENT_EXPR,yyval.TOK_flags);
yyval.size=substring_size(&(yyvsp[-1]),&(yyvsp[0]));
yyval.left_token = add_tree_node(
&save_token,&(yyvsp[-1]),&(yyvsp[0]));
yyval.next_token = (Token *) NULL;
;
break;}
case 442:
#line 2675 "fortran.y"
{
yyval.size=substring_size(&(yyvsp[-1]),&(yyvsp[0]));
yyval.left_token = add_tree_node(
&save_token,&(yyvsp[-1]),&(yyvsp[0]));
yyval.next_token = (Token *) NULL;
;
break;}
case 443:
#line 2683 "fortran.y"
{
yyval.size=substring_size(&(yyvsp[-1]),&(yyvsp[0]));
yyval.left_token = add_tree_node(
&save_token,&(yyvsp[-1]),&(yyvsp[0]));
yyval.next_token = (Token *) NULL;
;
break;}
case 444:
#line 2692 "fortran.y"
{
yyval.size=substring_size(&(yyvsp[-1]),&(yyvsp[0]));
;
break;}
case 445:
#line 2696 "fortran.y"
{
yyval.size=substring_size(&(yyvsp[-1]),&(yyvsp[0]));
;
break;}
case 446:
#line 2705 "fortran.y"
{
yyval.TOK_start=1;
yyval.TOK_end=0; /* 0 means LEN */
save_token = yyvsp[-2]; /* Save the paren for tree node */
yyval.left_token =
add_tree_node(&(yyvsp[-1]),
empty_token(&(yyvsp[-2])),empty_token(&(yyvsp[0])));
/* Nullify next_token so it looks like
a tokenlist */
yyval.next_token = (Token *)NULL;
;
break;}
case 447:
#line 2719 "fortran.y"
{
yyval.TOK_start=yyvsp[-2].value.integer;
yyval.TOK_end=0; /* 0 means LEN */
save_token = yyvsp[-3]; /* Save the paren for tree node */
yyval.left_token =
add_tree_node(&(yyvsp[-1]),&(yyvsp[-2]),empty_token(&(yyvsp[0])));
yyval.next_token = (Token *)NULL;
;
break;}
case 448:
#line 2729 "fortran.y"
{
yyval.TOK_start=1;
yyval.TOK_end=yyvsp[-1].value.integer;
save_token = yyvsp[-3]; /* Save the paren for tree node */
yyval.left_token =
add_tree_node(&(yyvsp[-2]),empty_token(&(yyvsp[-3])),&(yyvsp[-1]));
yyval.next_token = (Token *)NULL;
;
break;}
case 449:
#line 2739 "fortran.y"
{
yyval.TOK_start=yyvsp[-3].value.integer;
yyval.TOK_end=yyvsp[-1].value.integer;
save_token = yyvsp[-4]; /* Save the paren for tree node */
yyval.left_token =
add_tree_node(&(yyvsp[-2]),&(yyvsp[-3]),&(yyvsp[-1]));
yyval.next_token = (Token *)NULL;
;
break;}
case 450:
#line 2751 "fortran.y"
{
if(is_true(ID_EXPR,yyvsp[0].TOK_flags)){
use_variable(&(yyvsp[0]));
}
/* check validity and replace nonconst
value by size_UNKNOWN. */
if(is_true(CONST_EXPR,yyvsp[0].TOK_flags)) {
if( (yyval.value.integer=int_expr_value(&(yyvsp[0]))) < 1) {
syntax_error(yyvsp[0].line_num,yyvsp[0].col_num,
"invalid substring index");
}
}
else /* (no longer need ID hash index) */
yyval.value.integer=size_UNKNOWN;
;
break;}
case 453:
#line 2776 "fortran.y"
{
ref_variable(&(yyvsp[0]));
primary_id_expr(&(yyvsp[0]),&(yyval));
;
break;}
case 454:
#line 2783 "fortran.y"
{
ref_variable(&(yyvsp[0]));
primary_id_expr(&(yyvsp[0]),&(yyval));
;
break;}
case 463:
#line 2809 "fortran.y"
{
if(yyvsp[0].value.integer == 0) {
warning(yyvsp[0].line_num,yyvsp[0].col_num,
"nonzero integer expected");
msg_tail(": substituting 1");
yyval.value.integer = 1;
}
yyval.left_token = (Token *)NULL;
;
break;}
case 464:
#line 2825 "fortran.y"
{
integer_context=TRUE;
;
break;}
case 465:
#line 2832 "fortran.y"
{
integer_context=FALSE;
yyval.TOK_type = type_byte(class_LABEL,type_LABEL);
yyval.size = size_DEFAULT;
yyval.TOK_flags = 0;
;
break;}
}
#line 465 "/usr/lib/bison.simple"
yyvsp -= yylen;
yyssp -= yylen;
#ifdef YYLSP_NEEDED
yylsp -= yylen;
#endif
*++yyvsp = yyval;
#ifdef YYLSP_NEEDED
yylsp++;
if (yylen == 0)
{
yylsp->first_line = yylloc.first_line;
yylsp->first_column = yylloc.first_column;
yylsp->last_line = (yylsp-1)->last_line;
yylsp->last_column = (yylsp-1)->last_column;
yylsp->text = 0;
}
else
{
yylsp->last_line = (yylsp+yylen-1)->last_line;
yylsp->last_column = (yylsp+yylen-1)->last_column;
}
#endif
/* Now "shift" the result of the reduction.
Determine what state that goes to,
based on the state we popped back to
and the rule number reduced by. */
yyn = yyr1[yyn];
yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
yystate = yytable[yystate];
else
yystate = yydefgoto[yyn - YYNTBASE];
goto yynewstate;
yyerrlab: /* here on detecting error */
if (! yyerrstatus)
{
++yynerrs;
#ifdef YYERROR_VERBOSE
yyn = yypact[yystate];
if (yyn > YYFLAG && yyn < YYLAST)
{
int size = 0;
char *msg;
int x, count;
count = 0;
for (x = (yyn < 0 ? -yyn : 0);
x < (sizeof(yytname) / sizeof(char *)); x++)
if (yycheck[x + yyn] == x)
size += strlen(yytname[x]) + 15, count++;
msg = (char *) malloc(size + 15);
if (msg != 0)
{
strcpy(msg, "parse error");
if (count < 5)
{
count = 0;
for (x = (yyn < 0 ? -yyn : 0);
x < (sizeof(yytname) / sizeof(char *)); x++)
if (yycheck[x + yyn] == x)
{
strcat(msg, count == 0 ? ", expecting `" : " or `");
strcat(msg, yytname[x]);
strcat(msg, "'");
count++;
}
}
yyerror(msg);
free(msg);
}
else
yyerror ("parse error; also virtual memory exceeded");
}
else
#endif /* YYERROR_VERBOSE */
yyerror("parse error");
}
goto yyerrlab1;
yyerrlab1: /* here on error raised explicitly by an action */
if (yyerrstatus == 3)
{
if (yychar == YYEOF)
YYABORT;
yychar = YYEMPTY;
}
/* Else will try to reuse lookahead token
after shifting the error token. */
yyerrstatus = 3; /* Each real token shifted decrements this */
goto yyerrhandle;
yyerrdefault: /* current state does not do anything special for the error token. */
#if 0
/* This is wrong; only states that explicitly want error tokens
should shift them. */
yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
if (yyn) goto yydefault;
#endif
yyerrpop: /* pop the current state because it cannot handle the error token */
if (yyssp == yyss) YYABORT;
yyvsp--;
yystate = *--yyssp;
#ifdef YYLSP_NEEDED
yylsp--;
#endif
yyerrhandle:
yyn = yypact[yystate];
if (yyn == YYFLAG)
goto yyerrdefault;
yyn += YYTERROR;
if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
goto yyerrdefault;
yyn = yytable[yyn];
if (yyn < 0)
{
if (yyn == YYFLAG)
goto yyerrpop;
yyn = -yyn;
goto yyreduce;
}
else if (yyn == 0)
goto yyerrpop;
if (yyn == YYFINAL)
YYACCEPT;
*++yyvsp = yylval;
#ifdef YYLSP_NEEDED
*++yylsp = yylloc;
#endif
yystate = yyn;
goto yynewstate;
}
#line 2842 "fortran.y"
void
init_parser() /* Initialize various flags & counters */
{
initial_flag = TRUE; /* set flag for keyword test */
implicit_flag=FALSE; /* clear flags for IMPLICIT stmt */
implicit_letter_flag = FALSE;
implicit_type_given = FALSE;
implicit_none = FALSE;
global_save = FALSE;
prev_token_class = EOS;
complex_const_allowed = FALSE;
stmt_sequence_no = 0;
true_prev_stmt_line_num = 0;
}
/* Handle unary expressions: link
into a tree and propagate type.
*/
PRIVATE void
do_unexpr(op,expr,result)
Token *op,*expr,*result;
{
unexpr_type(op,expr,result);
result->left_token = add_tree_node(op, expr, (Token*)NULL);
}
/* Handle binary expressions: link
into a tree and propagate type.
*/
PRIVATE void
do_binexpr(l_expr,op,r_expr,result)
Token *l_expr,*op,*r_expr,*result;
{
binexpr_type(l_expr,op,r_expr,result); /* Propagate the type */
result->left_token = add_tree_node(op, l_expr, r_expr);
}
/* Changes a token to empty and replaces
src_text by null string, value by 0. Other
info (line, col, etc.) unchanged. */
PRIVATE Token *
empty_token(t)
Token *t;
{
#ifdef DEBUG_EMPTY_TOKEN
static char *nullstring="(empty)"; /* for debugging. */
#else
static char *nullstring=""; /* for operation. */
#endif
t->class = tok_empty;
t->subclass = 0;
t->value.integer = 0;
t->left_token = (Token *) NULL;
t->src_text = nullstring;
return t;
}
/* Propagate non-integer type if any of DO loop
bounds are non-integer. */
PRIVATE int
do_bounds_type(t1,t2,t3)
Token *t1, *t2, *t3;
{
int result_type;
if(datatype_of(t1->TOK_type) != type_INTEGER)result_type = t1->TOK_type;
else if(datatype_of(t2->TOK_type) != type_INTEGER)result_type = t2->TOK_type;
else if(datatype_of(t3->TOK_type) != type_INTEGER)result_type = t3->TOK_type;
else result_type = t1->TOK_type;
return result_type;
}
#ifdef DEBUG_PARSER
PRIVATE void
print_exprlist(s,t)
char *s;
Token *t;
{
(void)fprintf(list_fd,"\n%s arglist: ",s);
if(t == NULL)
(void)fprintf(list_fd,"(empty)");
else {
while( (t=t->next_token) != NULL) {
fprintf(list_fd,"%s ",type_name[datatype_of(t->TOK_type)]);
if( is_true(ID_EXPR,t->TOK_flags) )
(void)fprintf(list_fd,"(%s) ",token_name(*t));
}
}
}
PRIVATE void
print_comlist(s,t)
char *s;
Token *t;
{
(void)fprintf(list_fd,"\n%s varlist: ",s);
if(t == NULL)
(void)fprintf(list_fd,"(empty)");
else {
while( (t=t->next_token) != NULL) {
fprintf(list_fd,"%s ",type_name[datatype_of(t->TOK_type)]);
if( is_true(ID_EXPR,t->TOK_flags) )
(void)fprintf(list_fd,"(%s) ",token_name(*t));
}
}
}
#endif
/* After having parsed prog_stmt, function_stmt, subroutine_stmt,
block_data_stmt, the stmt_sequence_no is set to the value SEQ_HEADER.
*/
void
check_seq_header(t)
Token *t;
{
if(stmt_sequence_no >= SEQ_HEADER) {
syntax_error( (t == (Token *) NULL? line_num: t->line_num),
NO_COL_NUM,
"missing END statement inserted");
msg_tail( (t == (Token *) NULL? "at end of file":
"prior to statement") );
END_processing(t);
}
stmt_sequence_no = SEQ_HEADER;
}
PRIVATE void
check_stmt_sequence(t,seq_num)
Token *t;
int seq_num;
{
if(stmt_sequence_no > seq_num) {
syntax_error(t->line_num, NO_COL_NUM,
"Statement out of order.");
}
else {
stmt_sequence_no = seq_num;
}
}
PRIVATE void
init_io_ctrl_list()
{
control_item_count = 0;
io_internal_file = FALSE;
io_list_directed = FALSE;
io_warning_given = FALSE;
}
/* After having parsed end_stmt, common block lists and
subprogram argument lists are copied over into global symbol
table, the local symbol table is printed out and then cleared,
and stmt_sequence_no is set to zero for start of next module.
*/
PRIVATE void
END_processing(t)
Token *t;
{
++tot_module_count;
if(current_module_hash != -1) {
if(exec_stmt_count == 0 &&
current_module_type != type_BLOCK_DATA) {
warning(t == (Token *)NULL? line_num: t->line_num, NO_COL_NUM,
"Module contains no executable statements");
}
if(do_list && t != (Token *)NULL)
(void)flush_line_out(t->line_num);
check_loose_ends(current_module_hash);
process_lists(current_module_hash);
debug_symtabs();
print_loc_symbols(current_module_hash);
init_symtab();
}
exec_stmt_count = 0;
stmt_sequence_no = 0;
current_module_hash = -1;
implicit_type_given = FALSE;
implicit_none = FALSE;
true_prev_stmt_line_num = 0;
integer_context = FALSE;
global_save = FALSE;
}
/* Routine to create a node for an expr tree. Returns
a pointer to the newly created node.
*/
PRIVATE Token *
add_tree_node(node,left,right)
Token *node,*left,*right;
{
Token *new_node, *new_left, *new_right;
new_node=new_token();
*new_node = *node; /* Make a permanent copy of root */
/* Add the children. If child's left_token pointer is
null, then that expression is a primary. Otherwise
it is the root node of a subtree.
*/
if(left->left_token == (Token *)NULL) {
new_left=new_token();
*new_left = *left; /* Copy primary to permanent space */
}
else {
new_left = left->left_token; /* No copying needed in this case */
}
if(right == (Token *)NULL) {
new_right = (Token *)NULL; /* No right child */
}
else if(right->left_token == (Token *)NULL
|| node->class == '(') { /* Paren means right child is expr list */
new_right=new_token();
*new_right = *right; /* Copy primary to permanent space */
}
else {
new_right = right->left_token; /* No copying needed in this case */
}
new_node->left_token = new_left; /* Link children onto the new root */
new_node->next_token = new_right;
return new_node;
}
PRIVATE Token *
append_token(tlist,t)
Token *tlist, *t;
{
Token *tcopy;
tcopy=new_token();
*tcopy = *t; /* make permanent copy of token */
tcopy->next_token = tlist; /* link it onto front of list */
return tcopy; /* return it as new tlist */
}