Home | History | Annotate | Line # | Download | only in yacc
expr.oxout.tab.c revision 1.1
      1  1.1  christos /*	$NetBSD: expr.oxout.tab.c,v 1.1 2017/02/11 19:30:03 christos Exp $	*/
      2  1.1  christos 
      3  1.1  christos /* original parser id follows */
      4  1.1  christos /* yysccsid[] = "@(#)yaccpar	1.9 (Berkeley) 02/21/93" */
      5  1.1  christos /* (use YYMAJOR/YYMINOR for ifdefs dependent on parser version) */
      6  1.1  christos 
      7  1.1  christos #define YYBYACC 1
      8  1.1  christos #define YYMAJOR 1
      9  1.1  christos #define YYMINOR 9
     10  1.1  christos #define YYCHECK "yyyymmdd"
     11  1.1  christos 
     12  1.1  christos #define YYEMPTY        (-1)
     13  1.1  christos #define yyclearin      (yychar = YYEMPTY)
     14  1.1  christos #define yyerrok        (yyerrflag = 0)
     15  1.1  christos #define YYRECOVERING() (yyerrflag != 0)
     16  1.1  christos #define YYENOMEM       (-2)
     17  1.1  christos #define YYEOF          0
     18  1.1  christos 
     19  1.1  christos #ifndef yyparse
     20  1.1  christos #define yyparse    expr.oxout_parse
     21  1.1  christos #endif /* yyparse */
     22  1.1  christos 
     23  1.1  christos #ifndef yylex
     24  1.1  christos #define yylex      expr.oxout_lex
     25  1.1  christos #endif /* yylex */
     26  1.1  christos 
     27  1.1  christos #ifndef yyerror
     28  1.1  christos #define yyerror    expr.oxout_error
     29  1.1  christos #endif /* yyerror */
     30  1.1  christos 
     31  1.1  christos #ifndef yychar
     32  1.1  christos #define yychar     expr.oxout_char
     33  1.1  christos #endif /* yychar */
     34  1.1  christos 
     35  1.1  christos #ifndef yyval
     36  1.1  christos #define yyval      expr.oxout_val
     37  1.1  christos #endif /* yyval */
     38  1.1  christos 
     39  1.1  christos #ifndef yylval
     40  1.1  christos #define yylval     expr.oxout_lval
     41  1.1  christos #endif /* yylval */
     42  1.1  christos 
     43  1.1  christos #ifndef yydebug
     44  1.1  christos #define yydebug    expr.oxout_debug
     45  1.1  christos #endif /* yydebug */
     46  1.1  christos 
     47  1.1  christos #ifndef yynerrs
     48  1.1  christos #define yynerrs    expr.oxout_nerrs
     49  1.1  christos #endif /* yynerrs */
     50  1.1  christos 
     51  1.1  christos #ifndef yyerrflag
     52  1.1  christos #define yyerrflag  expr.oxout_errflag
     53  1.1  christos #endif /* yyerrflag */
     54  1.1  christos 
     55  1.1  christos #ifndef yylhs
     56  1.1  christos #define yylhs      expr.oxout_lhs
     57  1.1  christos #endif /* yylhs */
     58  1.1  christos 
     59  1.1  christos #ifndef yylen
     60  1.1  christos #define yylen      expr.oxout_len
     61  1.1  christos #endif /* yylen */
     62  1.1  christos 
     63  1.1  christos #ifndef yydefred
     64  1.1  christos #define yydefred   expr.oxout_defred
     65  1.1  christos #endif /* yydefred */
     66  1.1  christos 
     67  1.1  christos #ifndef yydgoto
     68  1.1  christos #define yydgoto    expr.oxout_dgoto
     69  1.1  christos #endif /* yydgoto */
     70  1.1  christos 
     71  1.1  christos #ifndef yysindex
     72  1.1  christos #define yysindex   expr.oxout_sindex
     73  1.1  christos #endif /* yysindex */
     74  1.1  christos 
     75  1.1  christos #ifndef yyrindex
     76  1.1  christos #define yyrindex   expr.oxout_rindex
     77  1.1  christos #endif /* yyrindex */
     78  1.1  christos 
     79  1.1  christos #ifndef yygindex
     80  1.1  christos #define yygindex   expr.oxout_gindex
     81  1.1  christos #endif /* yygindex */
     82  1.1  christos 
     83  1.1  christos #ifndef yytable
     84  1.1  christos #define yytable    expr.oxout_table
     85  1.1  christos #endif /* yytable */
     86  1.1  christos 
     87  1.1  christos #ifndef yycheck
     88  1.1  christos #define yycheck    expr.oxout_check
     89  1.1  christos #endif /* yycheck */
     90  1.1  christos 
     91  1.1  christos #ifndef yyname
     92  1.1  christos #define yyname     expr.oxout_name
     93  1.1  christos #endif /* yyname */
     94  1.1  christos 
     95  1.1  christos #ifndef yyrule
     96  1.1  christos #define yyrule     expr.oxout_rule
     97  1.1  christos #endif /* yyrule */
     98  1.1  christos #define YYPREFIX "expr.oxout_"
     99  1.1  christos 
    100  1.1  christos #define YYPURE 0
    101  1.1  christos 
    102  1.1  christos #line 5 "expr.oxout.y"
    103  1.1  christos #include <stdlib.h>
    104  1.1  christos #include <string.h>
    105  1.1  christos #line 8 "expr.Y"
    106  1.1  christos 
    107  1.1  christos #include "expr.oxout.h"
    108  1.1  christos #include <stdio.h>
    109  1.1  christos 
    110  1.1  christos extern int yylex(void);
    111  1.1  christos extern void yyerror(const char *);
    112  1.1  christos #line 27 "expr.oxout.y"
    113  1.1  christos #include <limits.h>
    114  1.1  christos #define yyyR USHRT_MAX
    115  1.1  christos #ifdef YYSTYPE
    116  1.1  christos #undef  YYSTYPE_IS_DECLARED
    117  1.1  christos #define YYSTYPE_IS_DECLARED 1
    118  1.1  christos #endif
    119  1.1  christos #ifndef YYSTYPE_IS_DECLARED
    120  1.1  christos #define YYSTYPE_IS_DECLARED 1
    121  1.1  christos #line 31 "expr.oxout.y"
    122  1.1  christos typedef union {
    123  1.1  christos struct yyyOxAttrbs {
    124  1.1  christos struct yyyStackItem *yyyOxStackItem;
    125  1.1  christos } yyyOxAttrbs;
    126  1.1  christos } YYSTYPE;
    127  1.1  christos #endif /* !YYSTYPE_IS_DECLARED */
    128  1.1  christos #line 38 "expr.oxout.y"
    129  1.1  christos #include <stdio.h>
    130  1.1  christos #include <stdarg.h>
    131  1.1  christos 
    132  1.1  christos static int yyyYok = 1;
    133  1.1  christos 
    134  1.1  christos extern yyyFT yyyRCIL[];
    135  1.1  christos 
    136  1.1  christos void yyyExecuteRRsection(yyyGNT *rootNode);
    137  1.1  christos void yyyYoxInit(void);
    138  1.1  christos void yyyDecorate(void);
    139  1.1  christos struct yyyOxAttrbs; /* hack required to compensate for 'msta' behavior */
    140  1.1  christos void yyyGenIntNode(long yyyProdNum, int yyyRHSlength, int yyyNattrbs, struct yyyOxAttrbs *yyval_OxAttrbs, ...);
    141  1.1  christos void yyyAdjustINRC(long yyyProdNum, int yyyRHSlength, long startP, long stopP, struct yyyOxAttrbs *yyval_OxAttrbs, ...);
    142  1.1  christos void yyyCheckUnsolvedInstTrav(yyyGNT *rootNode,long *nNZrc,long *cycleSum);
    143  1.1  christos void yyyUnsolvedInstSearchTrav(yyyGNT *pNode);
    144  1.1  christos void yyyUnsolvedInstSearchTravAux(yyyGNT *pNode);
    145  1.1  christos void yyyabort(void);
    146  1.1  christos 
    147  1.1  christos #line 146 "expr.oxout.tab.c"
    148  1.1  christos 
    149  1.1  christos /* compatibility with bison */
    150  1.1  christos #ifdef YYPARSE_PARAM
    151  1.1  christos /* compatibility with FreeBSD */
    152  1.1  christos # ifdef YYPARSE_PARAM_TYPE
    153  1.1  christos #  define YYPARSE_DECL() yyparse(YYPARSE_PARAM_TYPE YYPARSE_PARAM)
    154  1.1  christos # else
    155  1.1  christos #  define YYPARSE_DECL() yyparse(void *YYPARSE_PARAM)
    156  1.1  christos # endif
    157  1.1  christos #else
    158  1.1  christos # define YYPARSE_DECL() yyparse(void)
    159  1.1  christos #endif
    160  1.1  christos 
    161  1.1  christos /* Parameters sent to lex. */
    162  1.1  christos #ifdef YYLEX_PARAM
    163  1.1  christos # define YYLEX_DECL() yylex(void *YYLEX_PARAM)
    164  1.1  christos # define YYLEX yylex(YYLEX_PARAM)
    165  1.1  christos #else
    166  1.1  christos # define YYLEX_DECL() yylex(void)
    167  1.1  christos # define YYLEX yylex()
    168  1.1  christos #endif
    169  1.1  christos 
    170  1.1  christos /* Parameters sent to yyerror. */
    171  1.1  christos #ifndef YYERROR_DECL
    172  1.1  christos #define YYERROR_DECL() yyerror(const char *s)
    173  1.1  christos #endif
    174  1.1  christos #ifndef YYERROR_CALL
    175  1.1  christos #define YYERROR_CALL(msg) yyerror(msg)
    176  1.1  christos #endif
    177  1.1  christos 
    178  1.1  christos extern int YYPARSE_DECL();
    179  1.1  christos 
    180  1.1  christos #define ID 257
    181  1.1  christos #define CONST 258
    182  1.1  christos #define YYERRCODE 256
    183  1.1  christos typedef short YYINT;
    184  1.1  christos static const YYINT expr.oxout_lhs[] = {                  -1,
    185  1.1  christos     2,    0,    1,    3,    3,    3,    3,    3,    3,    3,
    186  1.1  christos };
    187  1.1  christos static const YYINT expr.oxout_len[] = {                   2,
    188  1.1  christos     0,    2,    1,    3,    3,    3,    3,    3,    1,    1,
    189  1.1  christos };
    190  1.1  christos static const YYINT expr.oxout_defred[] = {                1,
    191  1.1  christos     0,    0,    9,   10,    0,    2,    0,    0,    0,    0,
    192  1.1  christos     0,    0,    8,    0,    0,    4,    0,
    193  1.1  christos };
    194  1.1  christos static const YYINT expr.oxout_dgoto[] = {                 1,
    195  1.1  christos     6,    2,    7,
    196  1.1  christos };
    197  1.1  christos static const YYINT expr.oxout_sindex[] = {                0,
    198  1.1  christos     0,  -40,    0,    0,  -40,    0,  -18,  -24,  -40,  -40,
    199  1.1  christos   -40,  -40,    0,  -37,  -37,    0,  -39,
    200  1.1  christos };
    201  1.1  christos static const YYINT expr.oxout_rindex[] = {                0,
    202  1.1  christos     0,    0,    0,    0,    0,    0,    6,    0,    0,    0,
    203  1.1  christos     0,    0,    0,    2,    8,    0,    1,
    204  1.1  christos };
    205  1.1  christos static const YYINT expr.oxout_gindex[] = {                0,
    206  1.1  christos     0,    0,    4,
    207  1.1  christos };
    208  1.1  christos #define YYTABLESIZE 218
    209  1.1  christos static const YYINT expr.oxout_table[] = {                 5,
    210  1.1  christos     6,    5,   11,    0,   11,    3,    0,    7,    8,   12,
    211  1.1  christos     0,    0,   14,   15,   16,   17,   13,   11,    9,    0,
    212  1.1  christos    10,    0,   12,   11,    9,    0,   10,    0,   12,    0,
    213  1.1  christos     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    214  1.1  christos     0,    6,    5,    6,    5,    6,    5,    6,    7,    0,
    215  1.1  christos     7,    0,    7,    0,    0,    0,    0,    0,    0,    0,
    216  1.1  christos     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    217  1.1  christos     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    218  1.1  christos     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    219  1.1  christos     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    220  1.1  christos     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    221  1.1  christos     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    222  1.1  christos     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    223  1.1  christos     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    224  1.1  christos     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    225  1.1  christos     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    226  1.1  christos     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    227  1.1  christos     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    228  1.1  christos     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    229  1.1  christos     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    230  1.1  christos     0,    0,    0,    0,    0,    0,    0,    0,    0,    0,
    231  1.1  christos     0,    0,    0,    0,    0,    0,    3,    4,
    232  1.1  christos };
    233  1.1  christos static const YYINT expr.oxout_check[] = {                40,
    234  1.1  christos     0,    0,   42,   -1,   42,    0,   -1,    0,    5,   47,
    235  1.1  christos    -1,   -1,    9,   10,   11,   12,   41,   42,   43,   -1,
    236  1.1  christos    45,   -1,   47,   42,   43,   -1,   45,   -1,   47,   -1,
    237  1.1  christos    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    238  1.1  christos    -1,   41,   41,   43,   43,   45,   45,   47,   41,   -1,
    239  1.1  christos    43,   -1,   45,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    240  1.1  christos    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    241  1.1  christos    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    242  1.1  christos    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    243  1.1  christos    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    244  1.1  christos    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    245  1.1  christos    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    246  1.1  christos    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    247  1.1  christos    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    248  1.1  christos    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    249  1.1  christos    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    250  1.1  christos    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    251  1.1  christos    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    252  1.1  christos    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    253  1.1  christos    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    254  1.1  christos    -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,   -1,
    255  1.1  christos    -1,   -1,   -1,   -1,   -1,   -1,  257,  258,
    256  1.1  christos };
    257  1.1  christos #define YYFINAL 1
    258  1.1  christos #ifndef YYDEBUG
    259  1.1  christos #define YYDEBUG 0
    260  1.1  christos #endif
    261  1.1  christos #define YYMAXTOKEN 258
    262  1.1  christos #define YYUNDFTOKEN 264
    263  1.1  christos #define YYTRANSLATE(a) ((a) > YYMAXTOKEN ? YYUNDFTOKEN : (a))
    264  1.1  christos #if YYDEBUG
    265  1.1  christos static const char *const expr.oxout_name[] = {
    266  1.1  christos 
    267  1.1  christos "end-of-file",0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    268  1.1  christos 0,0,0,0,0,0,"'('","')'","'*'","'+'",0,"'-'",0,"'/'",0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    269  1.1  christos 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    270  1.1  christos 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    271  1.1  christos 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    272  1.1  christos 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
    273  1.1  christos 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,"ID",
    274  1.1  christos "CONST",0,0,0,0,0,"illegal-symbol",
    275  1.1  christos };
    276  1.1  christos static const char *const expr.oxout_rule[] = {
    277  1.1  christos "$accept : yyyAugNonterm",
    278  1.1  christos "$$1 :",
    279  1.1  christos "yyyAugNonterm : $$1 s",
    280  1.1  christos "s : expr",
    281  1.1  christos "expr : expr '*' expr",
    282  1.1  christos "expr : expr '+' expr",
    283  1.1  christos "expr : expr '/' expr",
    284  1.1  christos "expr : expr '-' expr",
    285  1.1  christos "expr : '(' expr ')'",
    286  1.1  christos "expr : ID",
    287  1.1  christos "expr : CONST",
    288  1.1  christos 
    289  1.1  christos };
    290  1.1  christos #endif
    291  1.1  christos 
    292  1.1  christos int      yydebug;
    293  1.1  christos int      yynerrs;
    294  1.1  christos 
    295  1.1  christos int      yyerrflag;
    296  1.1  christos int      yychar;
    297  1.1  christos YYSTYPE  yyval;
    298  1.1  christos YYSTYPE  yylval;
    299  1.1  christos 
    300  1.1  christos /* define the initial stack-sizes */
    301  1.1  christos #ifdef YYSTACKSIZE
    302  1.1  christos #undef YYMAXDEPTH
    303  1.1  christos #define YYMAXDEPTH  YYSTACKSIZE
    304  1.1  christos #else
    305  1.1  christos #ifdef YYMAXDEPTH
    306  1.1  christos #define YYSTACKSIZE YYMAXDEPTH
    307  1.1  christos #else
    308  1.1  christos #define YYSTACKSIZE 10000
    309  1.1  christos #define YYMAXDEPTH  10000
    310  1.1  christos #endif
    311  1.1  christos #endif
    312  1.1  christos 
    313  1.1  christos #define YYINITSTACKSIZE 200
    314  1.1  christos 
    315  1.1  christos typedef struct {
    316  1.1  christos     unsigned stacksize;
    317  1.1  christos     YYINT    *s_base;
    318  1.1  christos     YYINT    *s_mark;
    319  1.1  christos     YYINT    *s_last;
    320  1.1  christos     YYSTYPE  *l_base;
    321  1.1  christos     YYSTYPE  *l_mark;
    322  1.1  christos } YYSTACKDATA;
    323  1.1  christos /* variables for the parser stack */
    324  1.1  christos static YYSTACKDATA yystack;
    325  1.1  christos #line 53 "expr.Y"
    326  1.1  christos 
    327  1.1  christos 
    328  1.1  christos int yyparse(void);
    329  1.1  christos 
    330  1.1  christos int main()
    331  1.1  christos   {yyparse();
    332  1.1  christos   }
    333  1.1  christos 
    334  1.1  christos 
    335  1.1  christos 
    336  1.1  christos #line 138 "expr.oxout.y"
    337  1.1  christos long yyySSALspaceSize =    20000;
    338  1.1  christos long yyyRSmaxSize =        1000;
    339  1.1  christos long yyyTravStackMaxSize = 2000;
    340  1.1  christos 
    341  1.1  christos struct yyySolvedSAlistCell {yyyWAT attrbNum;
    342  1.1  christos                             long next;
    343  1.1  christos                            };
    344  1.1  christos 
    345  1.1  christos #define yyyLambdaSSAL 0
    346  1.1  christos long yyySSALCfreeList = yyyLambdaSSAL;
    347  1.1  christos long yyyNewSSALC = 1;
    348  1.1  christos 
    349  1.1  christos struct yyySolvedSAlistCell *yyySSALspace;
    350  1.1  christos 
    351  1.1  christos long yyyNbytesStackStg;
    352  1.1  christos 
    353  1.1  christos 
    354  1.1  christos 
    355  1.1  christos yyyFT yyyRCIL[1];
    356  1.1  christos 
    357  1.1  christos short yyyIIIEL[] = {0,
    358  1.1  christos 0,2,6,10,14,18,22,24,
    359  1.1  christos };
    360  1.1  christos 
    361  1.1  christos long yyyIIEL[] = {
    362  1.1  christos 0,0,0,0,0,0,0,0,0,0,0,0,
    363  1.1  christos 0,0,0,0,0,0,0,0,0,0,0,0,
    364  1.1  christos 1,1,
    365  1.1  christos };
    366  1.1  christos 
    367  1.1  christos long yyyIEL[] = {
    368  1.1  christos 0,0,0,
    369  1.1  christos };
    370  1.1  christos 
    371  1.1  christos yyyFT yyyEntL[1];
    372  1.1  christos 
    373  1.1  christos void yyyfatal(char *msg)
    374  1.1  christos {fputs(msg,stderr);exit(-1);}
    375  1.1  christos 
    376  1.1  christos 
    377  1.1  christos 
    378  1.1  christos #define yyySSALof 'S'
    379  1.1  christos #define yyyRSof   'q'
    380  1.1  christos #define yyyTSof   't'
    381  1.1  christos 
    382  1.1  christos 
    383  1.1  christos 
    384  1.1  christos void yyyHandleOverflow(char which)
    385  1.1  christos   {char *msg1,*msg2;
    386  1.1  christos    long  oldSize,newSize;
    387  1.1  christos    switch(which)
    388  1.1  christos      {
    389  1.1  christos       case yyySSALof :
    390  1.1  christos            msg1 = "SSAL overflow: ";
    391  1.1  christos            oldSize = yyySSALspaceSize;
    392  1.1  christos            break;
    393  1.1  christos       case yyyRSof   :
    394  1.1  christos            msg1 = "ready set overflow: ";
    395  1.1  christos            oldSize = yyyRSmaxSize;
    396  1.1  christos            break;
    397  1.1  christos       case yyyTSof   :
    398  1.1  christos            msg1 = "traversal stack overflow: ";
    399  1.1  christos            oldSize = yyyTravStackMaxSize;
    400  1.1  christos            break;
    401  1.1  christos       default        :;
    402  1.1  christos      }
    403  1.1  christos    newSize = (3*oldSize)/2;
    404  1.1  christos    if (newSize < 100) newSize = 100;
    405  1.1  christos    fputs(msg1,stderr);
    406  1.1  christos    fprintf(stderr,"size was %ld.\n",oldSize);
    407  1.1  christos    msg2 = "     Have to modify evaluator:  -Y%c%ld.\n";
    408  1.1  christos    fprintf(stderr,msg2,which,newSize);
    409  1.1  christos    exit(-1);
    410  1.1  christos   }
    411  1.1  christos 
    412  1.1  christos 
    413  1.1  christos 
    414  1.1  christos void yyySignalEnts(yyyGNT *node,long startP,long stopP)
    415  1.1  christos   {yyyGNT *dumNode;
    416  1.1  christos 
    417  1.1  christos    while (startP < stopP)
    418  1.1  christos      {
    419  1.1  christos       if (!yyyEntL[startP]) dumNode = node;
    420  1.1  christos          else dumNode = (node->cL)[yyyEntL[startP]-1];
    421  1.1  christos       if (!(--((dumNode->refCountList)[yyyEntL[startP+1]]
    422  1.1  christos               )
    423  1.1  christos            )
    424  1.1  christos          )
    425  1.1  christos          {
    426  1.1  christos           if (++yyyRSTop == yyyAfterRS)
    427  1.1  christos              {yyyHandleOverflow(yyyRSof);
    428  1.1  christos               break;
    429  1.1  christos              }
    430  1.1  christos           yyyRSTop->node = dumNode;
    431  1.1  christos           yyyRSTop->whichSym = yyyEntL[startP];
    432  1.1  christos           yyyRSTop->wa = yyyEntL[startP+1];
    433  1.1  christos          }
    434  1.1  christos       startP += 2;
    435  1.1  christos      }
    436  1.1  christos   }
    437  1.1  christos 
    438  1.1  christos 
    439  1.1  christos 
    440  1.1  christos 
    441  1.1  christos 
    442  1.1  christos 
    443  1.1  christos void yyySolveAndSignal() {
    444  1.1  christos long yyyiDum,*yyypL;
    445  1.1  christos int yyyws,yyywa;
    446  1.1  christos yyyGNT *yyyRSTopN,*yyyRefN;
    447  1.1  christos yyyParent yyyRSTopNp;
    448  1.1  christos 
    449  1.1  christos 
    450  1.1  christos yyyRSTopNp = (yyyRSTopN = yyyRSTop->node)->parent;
    451  1.1  christos yyyRefN= (yyyws = (yyyRSTop->whichSym))?yyyRSTopNp.noderef:yyyRSTopN;
    452  1.1  christos yyywa = yyyRSTop->wa;
    453  1.1  christos yyyRSTop--;
    454  1.1  christos switch(yyyRefN->prodNum) {
    455  1.1  christos case 1:  /***yacc rule 1***/
    456  1.1  christos   switch (yyyws) {
    457  1.1  christos   }
    458  1.1  christos break;
    459  1.1  christos case 2:  /***yacc rule 2***/
    460  1.1  christos   switch (yyyws) {
    461  1.1  christos   }
    462  1.1  christos break;
    463  1.1  christos case 3:  /***yacc rule 3***/
    464  1.1  christos   switch (yyyws) {
    465  1.1  christos   }
    466  1.1  christos break;
    467  1.1  christos case 4:  /***yacc rule 4***/
    468  1.1  christos   switch (yyyws) {
    469  1.1  christos   }
    470  1.1  christos break;
    471  1.1  christos case 5:  /***yacc rule 5***/
    472  1.1  christos   switch (yyyws) {
    473  1.1  christos   }
    474  1.1  christos break;
    475  1.1  christos case 6:  /***yacc rule 6***/
    476  1.1  christos   switch (yyyws) {
    477  1.1  christos   }
    478  1.1  christos break;
    479  1.1  christos case 7:  /***yacc rule 7***/
    480  1.1  christos   switch (yyyws) {
    481  1.1  christos   case 1:  /**/
    482  1.1  christos     switch (yyywa) {
    483  1.1  christos     }
    484  1.1  christos   break;
    485  1.1  christos   }
    486  1.1  christos break;
    487  1.1  christos case 8:  /***yacc rule 8***/
    488  1.1  christos   switch (yyyws) {
    489  1.1  christos   case 1:  /**/
    490  1.1  christos     switch (yyywa) {
    491  1.1  christos     }
    492  1.1  christos   break;
    493  1.1  christos   }
    494  1.1  christos break;
    495  1.1  christos } /* switch */
    496  1.1  christos 
    497  1.1  christos if (yyyws)  /* the just-solved instance was inherited. */
    498  1.1  christos    {if (yyyRSTopN->prodNum)
    499  1.1  christos        {yyyiDum = yyyIIEL[yyyIIIEL[yyyRSTopN->prodNum]] + yyywa;
    500  1.1  christos         yyySignalEnts(yyyRSTopN,yyyIEL[yyyiDum],
    501  1.1  christos                                 yyyIEL[yyyiDum+1]
    502  1.1  christos                      );
    503  1.1  christos        }
    504  1.1  christos    }
    505  1.1  christos    else     /* the just-solved instance was synthesized. */
    506  1.1  christos    {if (!(yyyRSTopN->parentIsStack)) /* node has a parent. */
    507  1.1  christos        {yyyiDum = yyyIIEL[yyyIIIEL[yyyRSTopNp.noderef->prodNum] +
    508  1.1  christos                           yyyRSTopN->whichSym
    509  1.1  christos                          ] +
    510  1.1  christos                   yyywa;
    511  1.1  christos         yyySignalEnts(yyyRSTopNp.noderef,
    512  1.1  christos                       yyyIEL[yyyiDum],
    513  1.1  christos                       yyyIEL[yyyiDum+1]
    514  1.1  christos                      );
    515  1.1  christos        }
    516  1.1  christos        else   /* node is still on the stack--it has no parent yet. */
    517  1.1  christos        {yyypL = &(yyyRSTopNp.stackref->solvedSAlist);
    518  1.1  christos         if (yyySSALCfreeList == yyyLambdaSSAL)
    519  1.1  christos            {yyySSALspace[yyyNewSSALC].next = *yyypL;
    520  1.1  christos             if ((*yyypL = yyyNewSSALC++) == yyySSALspaceSize)
    521  1.1  christos                yyyHandleOverflow(yyySSALof);
    522  1.1  christos            }
    523  1.1  christos            else
    524  1.1  christos            {yyyiDum = yyySSALCfreeList;
    525  1.1  christos             yyySSALCfreeList = yyySSALspace[yyySSALCfreeList].next;
    526  1.1  christos             yyySSALspace[yyyiDum].next = *yyypL;
    527  1.1  christos             *yyypL = yyyiDum;
    528  1.1  christos            }
    529  1.1  christos         yyySSALspace[*yyypL].attrbNum = yyywa;
    530  1.1  christos        }
    531  1.1  christos    }
    532  1.1  christos 
    533  1.1  christos } /* yyySolveAndSignal */
    534  1.1  christos 
    535  1.1  christos 
    536  1.1  christos 
    537  1.1  christos 
    538  1.1  christos 
    539  1.1  christos 
    540  1.1  christos #define condStg unsigned int conds;
    541  1.1  christos #define yyyClearConds {yyyTST->conds = 0;}
    542  1.1  christos #define yyySetCond(n) {yyyTST->conds += (1<<(n));}
    543  1.1  christos #define yyyCond(n) ((yyyTST->conds & (1<<(n)))?1:0)
    544  1.1  christos 
    545  1.1  christos 
    546  1.1  christos 
    547  1.1  christos struct yyyTravStackItem {yyyGNT *node;
    548  1.1  christos                          char isReady;
    549  1.1  christos                          condStg
    550  1.1  christos                         };
    551  1.1  christos 
    552  1.1  christos 
    553  1.1  christos 
    554  1.1  christos void yyyDoTraversals(yyyGNT *rootNode)
    555  1.1  christos {struct yyyTravStackItem *yyyTravStack,*yyyTST,*yyyAfterTravStack;
    556  1.1  christos  yyyGNT *yyyTSTn,**yyyCLptr2;
    557  1.1  christos  int yyyi,yyyRL,yyyPass;
    558  1.1  christos  int i;
    559  1.1  christos 
    560  1.1  christos  if (!yyyYok) return;
    561  1.1  christos  if ((yyyTravStack =
    562  1.1  christos                  ((struct yyyTravStackItem *)
    563  1.1  christos                   calloc((size_t)yyyTravStackMaxSize,
    564  1.1  christos                          (size_t)sizeof(struct yyyTravStackItem)
    565  1.1  christos                         )
    566  1.1  christos                  )
    567  1.1  christos      )
    568  1.1  christos      ==
    569  1.1  christos      (struct yyyTravStackItem *)NULL
    570  1.1  christos     )
    571  1.1  christos     {fputs("malloc error in traversal stack allocation\n",stderr);
    572  1.1  christos      exit(-1);
    573  1.1  christos     }
    574  1.1  christos 
    575  1.1  christos yyyAfterTravStack = yyyTravStack + yyyTravStackMaxSize;
    576  1.1  christos yyyTravStack++;
    577  1.1  christos 
    578  1.1  christos 
    579  1.1  christos for (yyyi=0; yyyi<2; yyyi++) {
    580  1.1  christos yyyTST = yyyTravStack;
    581  1.1  christos yyyTST->node = rootNode;
    582  1.1  christos yyyTST->isReady = 0;
    583  1.1  christos yyyClearConds
    584  1.1  christos 
    585  1.1  christos while(yyyTST >= yyyTravStack)
    586  1.1  christos   {yyyTSTn = yyyTST->node;
    587  1.1  christos    if (yyyTST->isReady)
    588  1.1  christos       {yyyPass = 1;
    589  1.1  christos        goto yyyTravSwitch;
    590  1.1  christos yyyTpop:
    591  1.1  christos        yyyTST--;
    592  1.1  christos       }
    593  1.1  christos       else
    594  1.1  christos       {yyyPass = 0;
    595  1.1  christos        goto yyyTravSwitch;
    596  1.1  christos yyyTpush:
    597  1.1  christos        yyyTST->isReady = 1;
    598  1.1  christos        if (yyyTSTn->prodNum)
    599  1.1  christos           {if (yyyRL)
    600  1.1  christos              {yyyCLptr2 = yyyTSTn->cL;
    601  1.1  christos               i = yyyTSTn->cLlen;
    602  1.1  christos               while (i--)
    603  1.1  christos                 {if (++yyyTST == yyyAfterTravStack)
    604  1.1  christos                     yyyHandleOverflow(yyyTSof);
    605  1.1  christos                     else
    606  1.1  christos                     {yyyTST->node = *yyyCLptr2;
    607  1.1  christos                      yyyTST->isReady = 0;
    608  1.1  christos                      yyyClearConds
    609  1.1  christos                     }
    610  1.1  christos                  yyyCLptr2++;
    611  1.1  christos                 }
    612  1.1  christos              } /* right to left */
    613  1.1  christos              else  /* left to right */
    614  1.1  christos              {i = yyyTSTn->cLlen;
    615  1.1  christos               yyyCLptr2 = yyyTSTn->cL + i;
    616  1.1  christos               while (i--)
    617  1.1  christos                 {yyyCLptr2--;
    618  1.1  christos                  if (++yyyTST == yyyAfterTravStack)
    619  1.1  christos                     yyyHandleOverflow(yyyTSof);
    620  1.1  christos                     else
    621  1.1  christos                     {yyyTST->node = *yyyCLptr2;
    622  1.1  christos                      yyyTST->isReady = 0;
    623  1.1  christos                      yyyClearConds
    624  1.1  christos                     }
    625  1.1  christos                 }
    626  1.1  christos              } /* left to right */
    627  1.1  christos           }
    628  1.1  christos       } /* else */
    629  1.1  christos    continue;
    630  1.1  christos yyyTravSwitch:
    631  1.1  christos 				switch(yyyTSTn->prodNum)	{
    632  1.1  christos case 1:
    633  1.1  christos 	switch(yyyi)	{
    634  1.1  christos 		case 0:
    635  1.1  christos 			switch(yyyPass)	{
    636  1.1  christos 				case 0:
    637  1.1  christos yyyRL = 0;yyySetCond(0)
    638  1.1  christos 
    639  1.1  christos if (!
    640  1.1  christos #line 24 "expr.Y"
    641  1.1  christos   (1)
    642  1.1  christos #line 444 "expr.oxout.y"
    643  1.1  christos ) yyySetCond(1)
    644  1.1  christos yyySetCond(2)
    645  1.1  christos 
    646  1.1  christos 				case 1:
    647  1.1  christos 
    648  1.1  christos if (yyyCond(0) != yyyPass) {
    649  1.1  christos #line 24 "expr.Y"
    650  1.1  christos 
    651  1.1  christos #line 453 "expr.oxout.y"
    652  1.1  christos }
    653  1.1  christos if (yyyCond(1) != yyyPass) {
    654  1.1  christos #line 24 "expr.Y"
    655  1.1  christos  printf("\n");
    656  1.1  christos 
    657  1.1  christos #line 459 "expr.oxout.y"
    658  1.1  christos }
    659  1.1  christos if (yyyCond(2) != yyyPass) {
    660  1.1  christos #line 25 "expr.Y"
    661  1.1  christos   printf("prefix:   ");
    662  1.1  christos 
    663  1.1  christos #line 465 "expr.oxout.y"
    664  1.1  christos }
    665  1.1  christos 				break;
    666  1.1  christos 					}
    667  1.1  christos 		break;
    668  1.1  christos 		case 1:
    669  1.1  christos 			switch(yyyPass)	{
    670  1.1  christos 				case 0:
    671  1.1  christos yyyRL = 0;
    672  1.1  christos if (
    673  1.1  christos #line 23 "expr.Y"
    674  1.1  christos   (1)
    675  1.1  christos #line 477 "expr.oxout.y"
    676  1.1  christos ) yyySetCond(2)
    677  1.1  christos 
    678  1.1  christos 				case 1:
    679  1.1  christos 
    680  1.1  christos if (yyyCond(0) != yyyPass) {
    681  1.1  christos #line 22 "expr.Y"
    682  1.1  christos  printf("\n");
    683  1.1  christos 
    684  1.1  christos #line 486 "expr.oxout.y"
    685  1.1  christos }
    686  1.1  christos if (yyyCond(1) != yyyPass) {
    687  1.1  christos #line 23 "expr.Y"
    688  1.1  christos 
    689  1.1  christos #line 491 "expr.oxout.y"
    690  1.1  christos }
    691  1.1  christos if (yyyCond(2) != yyyPass) {
    692  1.1  christos #line 23 "expr.Y"
    693  1.1  christos  printf("postfix:  ")/* missing ; */
    694  1.1  christos 
    695  1.1  christos #line 497 "expr.oxout.y"
    696  1.1  christos }
    697  1.1  christos 				break;
    698  1.1  christos 					}
    699  1.1  christos 		break;
    700  1.1  christos 			}
    701  1.1  christos 
    702  1.1  christos break;
    703  1.1  christos case 2:
    704  1.1  christos 	switch(yyyi)	{
    705  1.1  christos 		case 0:
    706  1.1  christos 			switch(yyyPass)	{
    707  1.1  christos 				case 0:
    708  1.1  christos yyyRL = 0;yyySetCond(0)
    709  1.1  christos 
    710  1.1  christos 				case 1:
    711  1.1  christos 
    712  1.1  christos if (yyyCond(0) != yyyPass) {
    713  1.1  christos #line 29 "expr.Y"
    714  1.1  christos   printf(" * ");
    715  1.1  christos 
    716  1.1  christos #line 518 "expr.oxout.y"
    717  1.1  christos }
    718  1.1  christos 				break;
    719  1.1  christos 					}
    720  1.1  christos 		break;
    721  1.1  christos 		case 1:
    722  1.1  christos 			switch(yyyPass)	{
    723  1.1  christos 				case 0:
    724  1.1  christos yyyRL = 0;
    725  1.1  christos 				case 1:
    726  1.1  christos 
    727  1.1  christos if (yyyCond(0) != yyyPass) {
    728  1.1  christos #line 28 "expr.Y"
    729  1.1  christos  printf(" * ");
    730  1.1  christos 
    731  1.1  christos #line 533 "expr.oxout.y"
    732  1.1  christos }
    733  1.1  christos 				break;
    734  1.1  christos 					}
    735  1.1  christos 		break;
    736  1.1  christos 			}
    737  1.1  christos 
    738  1.1  christos break;
    739  1.1  christos case 3:
    740  1.1  christos 	switch(yyyi)	{
    741  1.1  christos 		case 0:
    742  1.1  christos 			switch(yyyPass)	{
    743  1.1  christos 				case 0:
    744  1.1  christos yyyRL = 0;yyySetCond(0)
    745  1.1  christos 
    746  1.1  christos 				case 1:
    747  1.1  christos 
    748  1.1  christos if (yyyCond(0) != yyyPass) {
    749  1.1  christos #line 32 "expr.Y"
    750  1.1  christos   printf(" + ");
    751  1.1  christos 
    752  1.1  christos #line 554 "expr.oxout.y"
    753  1.1  christos }
    754  1.1  christos 				break;
    755  1.1  christos 					}
    756  1.1  christos 		break;
    757  1.1  christos 		case 1:
    758  1.1  christos 			switch(yyyPass)	{
    759  1.1  christos 				case 0:
    760  1.1  christos yyyRL = 0;
    761  1.1  christos 				case 1:
    762  1.1  christos 
    763  1.1  christos if (yyyCond(0) != yyyPass) {
    764  1.1  christos #line 33 "expr.Y"
    765  1.1  christos  printf(" + ");
    766  1.1  christos 
    767  1.1  christos #line 569 "expr.oxout.y"
    768  1.1  christos }
    769  1.1  christos 				break;
    770  1.1  christos 					}
    771  1.1  christos 		break;
    772  1.1  christos 			}
    773  1.1  christos 
    774  1.1  christos break;
    775  1.1  christos case 4:
    776  1.1  christos 	switch(yyyi)	{
    777  1.1  christos 		case 0:
    778  1.1  christos 			switch(yyyPass)	{
    779  1.1  christos 				case 0:
    780  1.1  christos yyyRL = 0;yyySetCond(0)
    781  1.1  christos 
    782  1.1  christos 				case 1:
    783  1.1  christos 
    784  1.1  christos if (yyyCond(0) != yyyPass) {
    785  1.1  christos #line 37 "expr.Y"
    786  1.1  christos   printf(" / ");
    787  1.1  christos 
    788  1.1  christos #line 590 "expr.oxout.y"
    789  1.1  christos }
    790  1.1  christos 				break;
    791  1.1  christos 					}
    792  1.1  christos 		break;
    793  1.1  christos 		case 1:
    794  1.1  christos 			switch(yyyPass)	{
    795  1.1  christos 				case 0:
    796  1.1  christos yyyRL = 0;
    797  1.1  christos 				case 1:
    798  1.1  christos 
    799  1.1  christos if (yyyCond(0) != yyyPass) {
    800  1.1  christos #line 36 "expr.Y"
    801  1.1  christos  printf(" / ");
    802  1.1  christos 
    803  1.1  christos #line 605 "expr.oxout.y"
    804  1.1  christos }
    805  1.1  christos 				break;
    806  1.1  christos 					}
    807  1.1  christos 		break;
    808  1.1  christos 			}
    809  1.1  christos 
    810  1.1  christos break;
    811  1.1  christos case 5:
    812  1.1  christos 	switch(yyyi)	{
    813  1.1  christos 		case 0:
    814  1.1  christos 			switch(yyyPass)	{
    815  1.1  christos 				case 0:
    816  1.1  christos yyyRL = 0;yyySetCond(0)
    817  1.1  christos 
    818  1.1  christos 				case 1:
    819  1.1  christos 
    820  1.1  christos if (yyyCond(0) != yyyPass) {
    821  1.1  christos #line 41 "expr.Y"
    822  1.1  christos   printf(" - ");
    823  1.1  christos 
    824  1.1  christos #line 626 "expr.oxout.y"
    825  1.1  christos }
    826  1.1  christos 				break;
    827  1.1  christos 					}
    828  1.1  christos 		break;
    829  1.1  christos 		case 1:
    830  1.1  christos 			switch(yyyPass)	{
    831  1.1  christos 				case 0:
    832  1.1  christos yyyRL = 0;
    833  1.1  christos 				case 1:
    834  1.1  christos 
    835  1.1  christos if (yyyCond(0) != yyyPass) {
    836  1.1  christos #line 40 "expr.Y"
    837  1.1  christos  printf(" - ");
    838  1.1  christos 
    839  1.1  christos #line 641 "expr.oxout.y"
    840  1.1  christos }
    841  1.1  christos 				break;
    842  1.1  christos 					}
    843  1.1  christos 		break;
    844  1.1  christos 			}
    845  1.1  christos 
    846  1.1  christos break;
    847  1.1  christos case 6:
    848  1.1  christos 	switch(yyyi)	{
    849  1.1  christos 		case 0:
    850  1.1  christos 			switch(yyyPass)	{
    851  1.1  christos 				case 0:
    852  1.1  christos yyyRL = 0;
    853  1.1  christos 				case 1:
    854  1.1  christos 
    855  1.1  christos 				break;
    856  1.1  christos 					}
    857  1.1  christos 		break;
    858  1.1  christos 		case 1:
    859  1.1  christos 			switch(yyyPass)	{
    860  1.1  christos 				case 0:
    861  1.1  christos yyyRL = 0;
    862  1.1  christos 				case 1:
    863  1.1  christos 
    864  1.1  christos 				break;
    865  1.1  christos 					}
    866  1.1  christos 		break;
    867  1.1  christos 			}
    868  1.1  christos 
    869  1.1  christos break;
    870  1.1  christos case 7:
    871  1.1  christos 	switch(yyyi)	{
    872  1.1  christos 		case 0:
    873  1.1  christos 			switch(yyyPass)	{
    874  1.1  christos 				case 0:
    875  1.1  christos yyyRL = 0;yyySetCond(0)
    876  1.1  christos 
    877  1.1  christos 				case 1:
    878  1.1  christos 
    879  1.1  christos if (yyyCond(0) != yyyPass) {
    880  1.1  christos #line 46 "expr.Y"
    881  1.1  christos   printf(" %s ",yyyTSTn->cL[0]->yyyAttrbs.yyyAttrb1.lexeme);
    882  1.1  christos 
    883  1.1  christos #line 685 "expr.oxout.y"
    884  1.1  christos }
    885  1.1  christos 				break;
    886  1.1  christos 					}
    887  1.1  christos 		break;
    888  1.1  christos 		case 1:
    889  1.1  christos 			switch(yyyPass)	{
    890  1.1  christos 				case 0:
    891  1.1  christos yyyRL = 0;
    892  1.1  christos 				case 1:
    893  1.1  christos 
    894  1.1  christos if (yyyCond(0) != yyyPass) {
    895  1.1  christos #line 45 "expr.Y"
    896  1.1  christos  printf(" %s ",yyyTSTn->cL[0]->yyyAttrbs.yyyAttrb1.lexeme);
    897  1.1  christos 
    898  1.1  christos #line 700 "expr.oxout.y"
    899  1.1  christos }
    900  1.1  christos 				break;
    901  1.1  christos 					}
    902  1.1  christos 		break;
    903  1.1  christos 			}
    904  1.1  christos 
    905  1.1  christos break;
    906  1.1  christos case 8:
    907  1.1  christos 	switch(yyyi)	{
    908  1.1  christos 		case 0:
    909  1.1  christos 			switch(yyyPass)	{
    910  1.1  christos 				case 0:
    911  1.1  christos yyyRL = 0;yyySetCond(0)
    912  1.1  christos 
    913  1.1  christos 				case 1:
    914  1.1  christos 
    915  1.1  christos if (yyyCond(0) != yyyPass) {
    916  1.1  christos #line 50 "expr.Y"
    917  1.1  christos   printf(" %s ",yyyTSTn->cL[0]->yyyAttrbs.yyyAttrb1.lexeme);
    918  1.1  christos 
    919  1.1  christos #line 721 "expr.oxout.y"
    920  1.1  christos }
    921  1.1  christos 				break;
    922  1.1  christos 					}
    923  1.1  christos 		break;
    924  1.1  christos 		case 1:
    925  1.1  christos 			switch(yyyPass)	{
    926  1.1  christos 				case 0:
    927  1.1  christos yyyRL = 0;
    928  1.1  christos 				case 1:
    929  1.1  christos 
    930  1.1  christos if (yyyCond(0) != yyyPass) {
    931  1.1  christos #line 49 "expr.Y"
    932  1.1  christos  printf(" %s ",yyyTSTn->cL[0]->yyyAttrbs.yyyAttrb1.lexeme);
    933  1.1  christos 
    934  1.1  christos #line 736 "expr.oxout.y"
    935  1.1  christos }
    936  1.1  christos 				break;
    937  1.1  christos 					}
    938  1.1  christos 		break;
    939  1.1  christos 			}
    940  1.1  christos 
    941  1.1  christos break;
    942  1.1  christos 								} /* switch */
    943  1.1  christos    if (yyyPass) goto yyyTpop; else goto yyyTpush;
    944  1.1  christos   } /* while */
    945  1.1  christos  } /* for */
    946  1.1  christos } /* yyyDoTraversals */
    947  1.1  christos 
    948  1.1  christos void yyyExecuteRRsection(yyyGNT *rootNode)  {
    949  1.1  christos    int yyyi;
    950  1.1  christos    long cycleSum = 0;
    951  1.1  christos    long nNZrc = 0;
    952  1.1  christos 
    953  1.1  christos    if (!yyyYok) return;
    954  1.1  christos    yyyCheckUnsolvedInstTrav(rootNode,&nNZrc,&cycleSum);
    955  1.1  christos    if (nNZrc)
    956  1.1  christos       {
    957  1.1  christos        fputs("\n\n\n**********\n",stderr);
    958  1.1  christos        fputs("cycle detected in completed parse tree",stderr);
    959  1.1  christos        fputs(" after decoration.\n",stderr);
    960  1.1  christos #if CYCLE_VERBOSE
    961  1.1  christos        fprintf(stderr,
    962  1.1  christos                "number of unsolved attribute instances == %ld.\n",
    963  1.1  christos                nNZrc
    964  1.1  christos               );
    965  1.1  christos        fprintf(stderr,
    966  1.1  christos                "total number of remaining dependencies == %ld.\n",
    967  1.1  christos                cycleSum
    968  1.1  christos               );
    969  1.1  christos        fputs("average number of remaining dependencies\n",stderr);
    970  1.1  christos        fprintf(stderr,"  per unsolved instance == %f.\n",
    971  1.1  christos                ((float)(cycleSum)/(float)(nNZrc))
    972  1.1  christos               );
    973  1.1  christos #endif
    974  1.1  christos        fprintf(stderr,
    975  1.1  christos          "searching parse tree for %ld unsolved instances:\n",
    976  1.1  christos                nNZrc
    977  1.1  christos               );
    978  1.1  christos        yyyUnsolvedInstSearchTravAux(rootNode);
    979  1.1  christos       }
    980  1.1  christos    yyyDoTraversals(rootNode);
    981  1.1  christos } /* yyyExecuteRRsection */
    982  1.1  christos 
    983  1.1  christos 
    984  1.1  christos 
    985  1.1  christos yyyWAT yyyLRCIL[2] = {0,0,
    986  1.1  christos };
    987  1.1  christos 
    988  1.1  christos 
    989  1.1  christos 
    990  1.1  christos void yyyYoxInit(void)
    991  1.1  christos   {
    992  1.1  christos    static int yyyInitDone = 0;
    993  1.1  christos    if (yyyInitDone) return;
    994  1.1  christos 
    995  1.1  christos    if ((yyyRS = (struct yyyRSitem *)
    996  1.1  christos          calloc((size_t)(yyyRSmaxSize+1), (size_t)sizeof(struct yyyRSitem))
    997  1.1  christos        )
    998  1.1  christos        ==
    999  1.1  christos        ((struct yyyRSitem *) NULL)
   1000  1.1  christos       )
   1001  1.1  christos       yyyfatal("malloc error in ox ready set space allocation\n");
   1002  1.1  christos    yyyRS++;
   1003  1.1  christos    yyyAfterRS = yyyRS + yyyRSmaxSize;
   1004  1.1  christos 
   1005  1.1  christos 
   1006  1.1  christos    if ((yyySSALspace = (struct yyySolvedSAlistCell *)
   1007  1.1  christos           calloc((size_t)(yyySSALspaceSize+1), (size_t)sizeof(struct yyySolvedSAlistCell))
   1008  1.1  christos        )
   1009  1.1  christos        ==
   1010  1.1  christos        ((struct yyySolvedSAlistCell *) NULL)
   1011  1.1  christos       )
   1012  1.1  christos       yyyfatal("malloc error in stack solved list space allocation\n");
   1013  1.1  christos    yyyInitDone = 1;
   1014  1.1  christos 
   1015  1.1  christos    yyyRSTop = yyyRS - 1;
   1016  1.1  christos   } /* yyyYoxInit */
   1017  1.1  christos 
   1018  1.1  christos 
   1019  1.1  christos 
   1020  1.1  christos void yyyDecorate(void)
   1021  1.1  christos   {
   1022  1.1  christos    while (yyyRSTop >= yyyRS)
   1023  1.1  christos       yyySolveAndSignal();
   1024  1.1  christos   }
   1025  1.1  christos 
   1026  1.1  christos 
   1027  1.1  christos 
   1028  1.1  christos void yyyGenIntNode(long yyyProdNum, int yyyRHSlength, int yyyNattrbs, struct yyyOxAttrbs *yyval_OxAttrbs, ...)
   1029  1.1  christos   {yyyWST i;
   1030  1.1  christos    yyySIT **yyyOxStackItem = &yyval_OxAttrbs->yyyOxStackItem;
   1031  1.1  christos    yyyGNT *gnpDum;
   1032  1.1  christos    va_list ap;
   1033  1.1  christos 
   1034  1.1  christos    *yyyOxStackItem = (yyySIT *) malloc((size_t)sizeof(yyySIT));
   1035  1.1  christos    if (*yyyOxStackItem == (yyySIT *) NULL)
   1036  1.1  christos       yyyfatal("malloc error in ox yacc semantic stack space allocation\n");
   1037  1.1  christos    (*yyyOxStackItem)->node =
   1038  1.1  christos                                 (yyyGNT *) malloc((size_t)sizeof(yyyGNT));
   1039  1.1  christos    if ((*yyyOxStackItem)->node == (yyyGNT *) NULL)
   1040  1.1  christos       yyyfatal("malloc error in ox node space allocation\n");
   1041  1.1  christos    (*yyyOxStackItem)->solvedSAlist = yyyLambdaSSAL;
   1042  1.1  christos    (*yyyOxStackItem)->node->parent.stackref = *yyyOxStackItem;
   1043  1.1  christos    (*yyyOxStackItem)->node->parentIsStack = 1;
   1044  1.1  christos    (*yyyOxStackItem)->node->cLlen  = yyyRHSlength;
   1045  1.1  christos    (*yyyOxStackItem)->node->cL =
   1046  1.1  christos             (yyyGNT **) calloc((size_t)yyyRHSlength, (size_t)sizeof(yyyGNT *));
   1047  1.1  christos    if ((*yyyOxStackItem)->node->cL == (yyyGNT **) NULL)
   1048  1.1  christos       yyyfatal("malloc error in ox child list space allocation\n");
   1049  1.1  christos    (*yyyOxStackItem)->node->refCountListLen = yyyNattrbs;
   1050  1.1  christos    (*yyyOxStackItem)->node->refCountList =
   1051  1.1  christos             (yyyRCT *) calloc((size_t)yyyNattrbs, (size_t)sizeof(yyyRCT));
   1052  1.1  christos    if ((*yyyOxStackItem)->node->refCountList == (yyyRCT *) NULL)
   1053  1.1  christos       yyyfatal("malloc error in ox reference count list space allocation\n");
   1054  1.1  christos    (*yyyOxStackItem)->node->prodNum = yyyProdNum;
   1055  1.1  christos    va_start(ap, yyval_OxAttrbs);
   1056  1.1  christos    for (i=1;i<=yyyRHSlength;i++)
   1057  1.1  christos      {yyySIT *yaccStDum = va_arg(ap,struct yyyOxAttrbs *)->yyyOxStackItem;
   1058  1.1  christos       gnpDum = (*yyyOxStackItem)->node->cL[i-1] = yaccStDum->node;
   1059  1.1  christos       gnpDum->whichSym = i;
   1060  1.1  christos       gnpDum->parent.noderef = (*yyyOxStackItem)->node;
   1061  1.1  christos       gnpDum->parentIsStack = 0;
   1062  1.1  christos      }
   1063  1.1  christos    va_end(ap);
   1064  1.1  christos   }
   1065  1.1  christos 
   1066  1.1  christos 
   1067  1.1  christos 
   1068  1.1  christos #define yyyDECORfREQ 50
   1069  1.1  christos 
   1070  1.1  christos 
   1071  1.1  christos 
   1072  1.1  christos void yyyAdjustINRC(long yyyProdNum, int yyyRHSlength, long startP, long stopP, struct yyyOxAttrbs *yyval_OxAttrbs, ...)
   1073  1.1  christos   {yyyWST i;
   1074  1.1  christos    yyySIT *yyyOxStackItem = yyval_OxAttrbs->yyyOxStackItem;
   1075  1.1  christos    long SSALptr,SSALptrHead,*cPtrPtr;
   1076  1.1  christos    long *pL;
   1077  1.1  christos    yyyGNT *gnpDum;
   1078  1.1  christos    long iTemp;
   1079  1.1  christos    long nextP;
   1080  1.1  christos    static unsigned short intNodeCount = yyyDECORfREQ;
   1081  1.1  christos    va_list ap;
   1082  1.1  christos 
   1083  1.1  christos    nextP = startP;
   1084  1.1  christos    while (nextP < stopP)
   1085  1.1  christos      {if (yyyRCIL[nextP] == yyyR)
   1086  1.1  christos          {(yyyOxStackItem->node->refCountList)[yyyRCIL[nextP+1]] = yyyRCIL[nextP+2];
   1087  1.1  christos          }
   1088  1.1  christos          else
   1089  1.1  christos          {(((yyyOxStackItem->node->cL)[yyyRCIL[nextP]])->refCountList)[yyyRCIL[nextP+1]] = yyyRCIL[nextP+2];
   1090  1.1  christos          }
   1091  1.1  christos       nextP += 3;
   1092  1.1  christos      }
   1093  1.1  christos    pL = yyyIIEL + yyyIIIEL[yyyProdNum];
   1094  1.1  christos    va_start(ap, yyval_OxAttrbs);
   1095  1.1  christos    for (i=1;i<=yyyRHSlength;i++)
   1096  1.1  christos      {yyySIT *yaccStDum = va_arg(ap,struct yyyOxAttrbs *)->yyyOxStackItem;
   1097  1.1  christos       pL++;
   1098  1.1  christos       SSALptrHead = SSALptr = *(cPtrPtr = &(yaccStDum->solvedSAlist));
   1099  1.1  christos       if (SSALptr != yyyLambdaSSAL)
   1100  1.1  christos          {*cPtrPtr = yyyLambdaSSAL;
   1101  1.1  christos           do
   1102  1.1  christos             {
   1103  1.1  christos              iTemp = (*pL+yyySSALspace[SSALptr].attrbNum);
   1104  1.1  christos              yyySignalEnts(yyyOxStackItem->node,
   1105  1.1  christos                            yyyIEL[iTemp],
   1106  1.1  christos                            yyyIEL[iTemp+1]
   1107  1.1  christos                           );
   1108  1.1  christos              SSALptr = *(cPtrPtr = &(yyySSALspace[SSALptr].next));
   1109  1.1  christos             }
   1110  1.1  christos             while (SSALptr != yyyLambdaSSAL);
   1111  1.1  christos           *cPtrPtr = yyySSALCfreeList;
   1112  1.1  christos           yyySSALCfreeList = SSALptrHead;
   1113  1.1  christos          }
   1114  1.1  christos      }
   1115  1.1  christos    va_end(ap);
   1116  1.1  christos    nextP = startP + 2;
   1117  1.1  christos    while (nextP < stopP)
   1118  1.1  christos      {if (!yyyRCIL[nextP])
   1119  1.1  christos          {if (yyyRCIL[nextP-2] == yyyR)
   1120  1.1  christos              {pL = &(yyyOxStackItem->solvedSAlist);
   1121  1.1  christos               if (yyySSALCfreeList == yyyLambdaSSAL)
   1122  1.1  christos                  {yyySSALspace[yyyNewSSALC].next = *pL;
   1123  1.1  christos                   if ((*pL = yyyNewSSALC++) == yyySSALspaceSize)
   1124  1.1  christos                      yyyHandleOverflow(yyySSALof);
   1125  1.1  christos                  }
   1126  1.1  christos                  else
   1127  1.1  christos                  {iTemp = yyySSALCfreeList;
   1128  1.1  christos                   yyySSALCfreeList = yyySSALspace[yyySSALCfreeList].next;
   1129  1.1  christos                   yyySSALspace[iTemp].next = *pL;
   1130  1.1  christos                   *pL = iTemp;
   1131  1.1  christos                  }
   1132  1.1  christos               yyySSALspace[*pL].attrbNum = yyyRCIL[nextP-1];
   1133  1.1  christos              }
   1134  1.1  christos              else
   1135  1.1  christos              {if ((gnpDum = (yyyOxStackItem->node->cL)[yyyRCIL[nextP-2]])->prodNum != 0)
   1136  1.1  christos                  {
   1137  1.1  christos                   iTemp = yyyIIEL[yyyIIIEL[gnpDum->prodNum]] + yyyRCIL[nextP-1];
   1138  1.1  christos                   yyySignalEnts(gnpDum,
   1139  1.1  christos                                 yyyIEL[iTemp],
   1140  1.1  christos                                 yyyIEL[iTemp+1]
   1141  1.1  christos                                );
   1142  1.1  christos                  }
   1143  1.1  christos              }
   1144  1.1  christos          }
   1145  1.1  christos       nextP += 3;
   1146  1.1  christos      }
   1147  1.1  christos    if (!--intNodeCount)
   1148  1.1  christos       {intNodeCount = yyyDECORfREQ;
   1149  1.1  christos        yyyDecorate();
   1150  1.1  christos       }
   1151  1.1  christos   }
   1152  1.1  christos 
   1153  1.1  christos 
   1154  1.1  christos 
   1155  1.1  christos void yyyGenLeaf(int nAttrbs,int typeNum,long startP,long stopP,YYSTYPE *yylval)
   1156  1.1  christos   {yyyRCT *rcPdum;
   1157  1.1  christos    yyySIT **yyyOxStackItem = &yylval->yyyOxAttrbs.yyyOxStackItem;
   1158  1.1  christos    (*yyyOxStackItem) = (yyySIT *) malloc((size_t)sizeof(yyySIT));
   1159  1.1  christos    if ((*yyyOxStackItem) == (yyySIT *) NULL)
   1160  1.1  christos       yyyfatal("malloc error in ox yacc semantic stack space allocation\n");
   1161  1.1  christos    (*yyyOxStackItem)->node =
   1162  1.1  christos                           (yyyGNT *) malloc((size_t)sizeof(yyyGNT))
   1163  1.1  christos                          ;
   1164  1.1  christos    if ((*yyyOxStackItem)->node == (yyyGNT *) NULL)
   1165  1.1  christos       yyyfatal("malloc error in ox node space allocation\n");
   1166  1.1  christos    (*yyyOxStackItem)->solvedSAlist = yyyLambdaSSAL;
   1167  1.1  christos    (*yyyOxStackItem)->node->parent.stackref = *yyyOxStackItem;
   1168  1.1  christos    (*yyyOxStackItem)->node->parentIsStack = 1;
   1169  1.1  christos    (*yyyOxStackItem)->node->cLlen = 0;
   1170  1.1  christos    (*yyyOxStackItem)->node->cL = (yyyGNT **)NULL;
   1171  1.1  christos    (*yyyOxStackItem)->node->refCountListLen = nAttrbs;
   1172  1.1  christos    rcPdum = (*yyyOxStackItem)->node->refCountList =
   1173  1.1  christos             (yyyRCT *) calloc((size_t)nAttrbs, (size_t)sizeof(yyyRCT));
   1174  1.1  christos    if (rcPdum == (yyyRCT *) NULL)
   1175  1.1  christos       yyyfatal("malloc error in ox reference count list space allocation\n");
   1176  1.1  christos    while (startP < stopP) rcPdum[yyyLRCIL[startP++]] = 0;
   1177  1.1  christos    (*yyyOxStackItem)->node->prodNum = 0;
   1178  1.1  christos    (*yyyOxStackItem)->node->whichSym = 0;
   1179  1.1  christos   }
   1180  1.1  christos 
   1181  1.1  christos 
   1182  1.1  christos 
   1183  1.1  christos void yyyabort(void)
   1184  1.1  christos   {yyyYok = 0;
   1185  1.1  christos   }
   1186  1.1  christos 
   1187  1.1  christos 
   1188  1.1  christos 
   1189  1.1  christos 
   1190  1.1  christos 
   1191  1.1  christos #define yyyLastProdNum 8
   1192  1.1  christos 
   1193  1.1  christos 
   1194  1.1  christos #define yyyNsorts 1
   1195  1.1  christos 
   1196  1.1  christos 
   1197  1.1  christos int yyyProdsInd[] = {
   1198  1.1  christos    0,
   1199  1.1  christos    0,   2,   6,  10,  14,  18,  22,  24,
   1200  1.1  christos   26,
   1201  1.1  christos };
   1202  1.1  christos 
   1203  1.1  christos 
   1204  1.1  christos int yyyProds[][2] = {
   1205  1.1  christos { 116,   0},{ 462,   0},{ 462,   0},{ 462,   0},{ 412,   0},
   1206  1.1  christos { 462,   0},{ 462,   0},{ 462,   0},{ 420,   0},{ 462,   0},
   1207  1.1  christos { 462,   0},{ 462,   0},{ 452,   0},{ 462,   0},{ 462,   0},
   1208  1.1  christos { 462,   0},{ 436,   0},{ 462,   0},{ 462,   0},{ 396,   0},
   1209  1.1  christos { 462,   0},{ 404,   0},{ 462,   0},{ 619,   1},{ 462,   0},
   1210  1.1  christos { 567,   1},
   1211  1.1  christos };
   1212  1.1  christos 
   1213  1.1  christos 
   1214  1.1  christos int yyySortsInd[] = {
   1215  1.1  christos   0,
   1216  1.1  christos   0,
   1217  1.1  christos   1,
   1218  1.1  christos };
   1219  1.1  christos 
   1220  1.1  christos 
   1221  1.1  christos int yyySorts[] = {
   1222  1.1  christos   413,
   1223  1.1  christos };
   1224  1.1  christos 
   1225  1.1  christos 
   1226  1.1  christos 
   1227  1.1  christos char *yyyStringTab[] = {
   1228  1.1  christos 0,0,0,0,0,
   1229  1.1  christos 0,0,0,0,0,
   1230  1.1  christos 0,0,0,0,0,
   1231  1.1  christos 0,0,0,0,0,
   1232  1.1  christos 0,0,0,0,0,
   1233  1.1  christos 0,0,0,0,0,
   1234  1.1  christos 0,0,0,0,0,
   1235  1.1  christos 0,0,0,0,0,
   1236  1.1  christos 0,0,0,0,0,
   1237  1.1  christos 0,0,0,0,0,
   1238  1.1  christos 0,0,0,0,0,
   1239  1.1  christos 0,0,0,0,0,
   1240  1.1  christos 0,0,0,0,0,
   1241  1.1  christos 0,0,0,0,0,
   1242  1.1  christos 0,0,0,0,0,
   1243  1.1  christos 0,0,0,0,0,
   1244  1.1  christos 0,0,0,0,0,
   1245  1.1  christos 0,0,0,0,0,
   1246  1.1  christos 0,0,0,0,0,
   1247  1.1  christos 0,0,0,0,0,
   1248  1.1  christos 0,0,0,0,0,
   1249  1.1  christos 0,0,0,0,0,
   1250  1.1  christos 0,0,0,0,0,
   1251  1.1  christos 0,"s",0,0,0,
   1252  1.1  christos 0,0,"y",0,0,
   1253  1.1  christos 0,0,0,0,0,
   1254  1.1  christos 0,0,0,0,0,
   1255  1.1  christos 0,0,0,0,0,
   1256  1.1  christos 0,0,0,0,0,
   1257  1.1  christos 0,0,0,0,0,
   1258  1.1  christos 0,0,0,0,0,
   1259  1.1  christos 0,0,0,0,0,
   1260  1.1  christos 0,0,0,0,0,
   1261  1.1  christos 0,0,0,0,0,
   1262  1.1  christos 0,0,0,0,0,
   1263  1.1  christos 0,0,0,0,0,
   1264  1.1  christos 0,0,0,0,0,
   1265  1.1  christos 0,0,0,0,0,
   1266  1.1  christos 0,0,0,0,0,
   1267  1.1  christos 0,0,0,0,0,
   1268  1.1  christos 0,0,0,0,0,
   1269  1.1  christos 0,0,0,0,0,
   1270  1.1  christos 0,0,0,0,0,
   1271  1.1  christos 0,0,0,0,0,
   1272  1.1  christos 0,0,0,0,0,
   1273  1.1  christos 0,0,0,0,0,
   1274  1.1  christos 0,0,0,0,0,
   1275  1.1  christos 0,0,0,0,0,
   1276  1.1  christos 0,0,0,0,0,
   1277  1.1  christos 0,0,0,0,0,
   1278  1.1  christos 0,0,0,0,0,
   1279  1.1  christos 0,0,0,0,0,
   1280  1.1  christos 0,0,0,0,0,
   1281  1.1  christos 0,0,0,0,0,
   1282  1.1  christos 0,0,0,0,0,
   1283  1.1  christos 0,0,0,0,0,
   1284  1.1  christos 0,0,0,0,0,
   1285  1.1  christos 0,0,0,0,0,
   1286  1.1  christos 0,0,0,0,0,
   1287  1.1  christos 0,0,0,0,0,
   1288  1.1  christos 0,0,0,0,0,
   1289  1.1  christos 0,0,0,0,0,
   1290  1.1  christos 0,0,0,0,0,
   1291  1.1  christos 0,0,0,0,0,
   1292  1.1  christos 0,0,0,0,0,
   1293  1.1  christos 0,"LRpre",0,0,0,
   1294  1.1  christos 0,0,0,0,0,
   1295  1.1  christos 0,0,0,0,0,
   1296  1.1  christos 0,0,0,0,0,
   1297  1.1  christos 0,0,0,0,0,
   1298  1.1  christos 0,0,0,0,0,
   1299  1.1  christos 0,0,0,0,0,
   1300  1.1  christos 0,0,0,0,0,
   1301  1.1  christos 0,0,0,0,0,
   1302  1.1  christos 0,0,0,0,0,
   1303  1.1  christos 0,0,0,0,0,
   1304  1.1  christos 0,0,0,0,0,
   1305  1.1  christos 0,0,0,0,0,
   1306  1.1  christos 0,0,0,0,0,
   1307  1.1  christos 0,"'('",0,0,0,
   1308  1.1  christos 0,0,0,0,"')'",
   1309  1.1  christos 0,0,0,0,0,
   1310  1.1  christos 0,0,"'*'","lexeme",0,
   1311  1.1  christos 0,0,0,0,0,
   1312  1.1  christos "'+'",0,0,0,0,
   1313  1.1  christos 0,0,0,0,0,
   1314  1.1  christos 0,0,0,0,0,
   1315  1.1  christos 0,"'-'",0,0,0,
   1316  1.1  christos 0,0,0,0,0,
   1317  1.1  christos 0,0,0,0,0,
   1318  1.1  christos 0,0,"'/'",0,0,
   1319  1.1  christos 0,0,0,0,0,
   1320  1.1  christos 0,0,"expr",0,0,
   1321  1.1  christos 0,0,0,0,0,
   1322  1.1  christos 0,0,0,0,0,
   1323  1.1  christos 0,"printf",0,0,0,
   1324  1.1  christos 0,0,0,0,0,
   1325  1.1  christos 0,0,0,0,0,
   1326  1.1  christos 0,0,0,0,0,
   1327  1.1  christos 0,0,0,0,0,
   1328  1.1  christos 0,0,0,0,0,
   1329  1.1  christos 0,0,0,0,0,
   1330  1.1  christos 0,0,0,0,0,
   1331  1.1  christos 0,0,0,0,0,
   1332  1.1  christos 0,0,0,0,0,
   1333  1.1  christos 0,0,0,0,0,
   1334  1.1  christos 0,0,0,0,0,
   1335  1.1  christos 0,0,0,0,0,
   1336  1.1  christos 0,0,0,0,0,
   1337  1.1  christos 0,0,0,0,0,
   1338  1.1  christos 0,0,0,0,0,
   1339  1.1  christos 0,0,0,0,0,
   1340  1.1  christos 0,0,0,0,0,
   1341  1.1  christos 0,0,"CONST","LRpost",0,
   1342  1.1  christos 0,0,0,0,0,
   1343  1.1  christos 0,0,0,0,0,
   1344  1.1  christos 0,0,0,0,0,
   1345  1.1  christos 0,0,0,0,0,
   1346  1.1  christos 0,0,0,0,0,
   1347  1.1  christos 0,0,0,0,0,
   1348  1.1  christos 0,0,0,0,0,
   1349  1.1  christos 0,0,0,0,0,
   1350  1.1  christos 0,0,0,0,0,
   1351  1.1  christos 0,0,0,0,"ID",
   1352  1.1  christos 0,0,0,0,0,
   1353  1.1  christos 0,0,0,0,0,
   1354  1.1  christos 0,0,0,0,0,
   1355  1.1  christos 0,0,0,0,0,
   1356  1.1  christos 0,0,0,0,0,
   1357  1.1  christos 0,0,0,0,0,
   1358  1.1  christos 0,0,0,0,0,
   1359  1.1  christos 0,0,0,0,0,
   1360  1.1  christos 0,0,0,0,0,
   1361  1.1  christos 0,0,0,0,0,
   1362  1.1  christos 0,0,0,0,0,
   1363  1.1  christos 0,0,0,0,0,
   1364  1.1  christos 0,0,0,0,0,
   1365  1.1  christos 0,0,0,0,0,
   1366  1.1  christos 0,0,0,0,0,
   1367  1.1  christos 0,0,0,0,0,
   1368  1.1  christos 0,0,0,0,0,
   1369  1.1  christos 0,0,0,0,0,
   1370  1.1  christos 0,0,0,0,0,
   1371  1.1  christos 0,0,0,0,0,
   1372  1.1  christos 0,0,0,0,0,
   1373  1.1  christos 0,0,0,0,0,
   1374  1.1  christos 0,0,0,0,0,
   1375  1.1  christos 0,0,0,0,0,
   1376  1.1  christos 0,0,0,0,0,
   1377  1.1  christos 0,0,0,0,0,
   1378  1.1  christos 0,0,0,0,0,
   1379  1.1  christos 0,0,0,0,0,
   1380  1.1  christos 0,0,0,0,0,
   1381  1.1  christos 0,0,0,0,0,
   1382  1.1  christos 0,0,0,0,0,
   1383  1.1  christos 0,0,0,0,0,
   1384  1.1  christos 0,0,0,0,0,
   1385  1.1  christos 0,0,0,0,0,
   1386  1.1  christos 0,0,0,0,0,
   1387  1.1  christos 0,0,0,0,0,
   1388  1.1  christos 0,0,0,0,0,
   1389  1.1  christos 0,0,0,0,0,
   1390  1.1  christos 0,0,0,0,0,
   1391  1.1  christos 0,0,0,0,0,
   1392  1.1  christos 0,0,0,0,0,
   1393  1.1  christos 0,0,0,0,0,
   1394  1.1  christos 0,0,0,0,0,
   1395  1.1  christos 0,0,0,0,0,
   1396  1.1  christos 0,0,0,0,0,
   1397  1.1  christos 0,0,0,0,0,
   1398  1.1  christos 0,0,0,0,0,
   1399  1.1  christos 0,0,0,0,0,
   1400  1.1  christos 0,0,0,0,0,
   1401  1.1  christos 0,0,0,0,0,
   1402  1.1  christos 0,0,0,0,0,
   1403  1.1  christos 0,0,0,0,0,
   1404  1.1  christos 0,0,0,0,0,
   1405  1.1  christos 0,0,0,0,0,
   1406  1.1  christos 0,0,0,0,0,
   1407  1.1  christos 0,0,0,0,0,
   1408  1.1  christos 0,0,0,0,0,
   1409  1.1  christos 0,0,0,0,0,
   1410  1.1  christos 0,0,0,0,0,
   1411  1.1  christos 0,0,0,0,0,
   1412  1.1  christos 0,0,0,0,0,
   1413  1.1  christos 0,0,0,0,0,
   1414  1.1  christos 0,0,0,0,0,
   1415  1.1  christos 0,0,0,0,0,
   1416  1.1  christos 0,0,0,0,0,
   1417  1.1  christos 0,0,0,0,0,
   1418  1.1  christos 0,0,0,0,0,
   1419  1.1  christos 0,0,0,0,0,
   1420  1.1  christos 0,0,0,0,0,
   1421  1.1  christos 0,0,0,0,0,
   1422  1.1  christos 0,0,0,0,0,
   1423  1.1  christos 0,0,0,0,0,
   1424  1.1  christos 0,0,0,0,0,
   1425  1.1  christos 0,0,0,0,0,
   1426  1.1  christos 0,0,0,0,0,
   1427  1.1  christos 0,0,0,0,0,
   1428  1.1  christos 0,0,0,0,0,
   1429  1.1  christos 0,0,0,0,0,
   1430  1.1  christos 0,0,0,0,0,
   1431  1.1  christos 0,0,0,0,0,
   1432  1.1  christos 0,0,0,0,0,
   1433  1.1  christos 0,0,0,0,0,
   1434  1.1  christos 0,0,0,0,0,
   1435  1.1  christos 0,0,0,0,0,
   1436  1.1  christos 0,0,0,0,0,
   1437  1.1  christos 0,0,0,0,0,
   1438  1.1  christos 0,0,0,0,0,
   1439  1.1  christos 0,0,0,0,0,
   1440  1.1  christos 0,0,0,0,0,
   1441  1.1  christos 0,0,0,0,0,
   1442  1.1  christos 0,0,0,0,0,
   1443  1.1  christos 0,0,0,0,0,
   1444  1.1  christos 0,0,0,0,0,
   1445  1.1  christos 0,0,0,0,0,
   1446  1.1  christos 0,0,0,0,0,
   1447  1.1  christos 0,0,0,0,0,
   1448  1.1  christos 0,0,0,0,0,
   1449  1.1  christos 0,0,0,0,0,
   1450  1.1  christos 0,0,0,0,0,
   1451  1.1  christos 0,0,0,0,0,
   1452  1.1  christos 0,0,0,0,0,
   1453  1.1  christos 0,0,0,0,0,
   1454  1.1  christos 0,0,0,0,0,
   1455  1.1  christos 0,0,0,0,0,
   1456  1.1  christos 0,0,0,0,0,
   1457  1.1  christos 0,0,0,0,0,
   1458  1.1  christos 0,0,0,0,0,
   1459  1.1  christos 0,0,0,0,0,
   1460  1.1  christos 0,0,0,0,0,
   1461  1.1  christos 0,0,0,0,0,
   1462  1.1  christos 0,0,0,0,0,
   1463  1.1  christos 0,0,0,0,0,
   1464  1.1  christos 0,0,0,0,0,
   1465  1.1  christos 0,0,0,0,0,
   1466  1.1  christos 0,0,0,0,0,
   1467  1.1  christos 0,0,0,0,0,
   1468  1.1  christos 0,0,0,0,0,
   1469  1.1  christos 0,0,0,0,0,
   1470  1.1  christos 0,0,0,0,0,
   1471  1.1  christos 0,0,0,0,0,
   1472  1.1  christos 0,0,0,0,0,
   1473  1.1  christos 0,0,0,0,0,
   1474  1.1  christos 0,
   1475  1.1  christos };
   1476  1.1  christos 
   1477  1.1  christos 
   1478  1.1  christos 
   1479  1.1  christos #define yyySizeofProd(num) (yyyProdsInd[(num)+1] - yyyProdsInd[(num)])
   1480  1.1  christos 
   1481  1.1  christos #define yyyGSoccurStr(prodNum,symPos) \
   1482  1.1  christos    (yyyStringTab[yyyProds[yyyProdsInd[(prodNum)] + (symPos)][0]])
   1483  1.1  christos 
   1484  1.1  christos #define yyySizeofSort(num) (yyySortsInd[(num)+1] - yyySortsInd[(num)])
   1485  1.1  christos 
   1486  1.1  christos #define yyySortOf(prodNum,symPos) \
   1487  1.1  christos   (yyyProds[yyyProdsInd[(prodNum)] + (symPos)][1])
   1488  1.1  christos 
   1489  1.1  christos #define yyyAttrbStr(prodNum,symPos,attrbNum)                      \
   1490  1.1  christos   (yyyStringTab[yyySorts[yyySortsInd[yyySortOf(prodNum,symPos)] + \
   1491  1.1  christos                          (attrbNum)                               \
   1492  1.1  christos                         ]                                         \
   1493  1.1  christos                ]                                                  \
   1494  1.1  christos   )
   1495  1.1  christos 
   1496  1.1  christos 
   1497  1.1  christos 
   1498  1.1  christos void yyyShowProd(int i)
   1499  1.1  christos   {int j,nSyms;
   1500  1.1  christos 
   1501  1.1  christos    nSyms = yyySizeofProd(i);
   1502  1.1  christos    for (j=0; j<nSyms; j++)
   1503  1.1  christos      {
   1504  1.1  christos       fprintf(stderr,"%s",yyyGSoccurStr(i,j));
   1505  1.1  christos       if (j == 0) fputs(" : ",stderr); else putc(' ',stderr);
   1506  1.1  christos      }
   1507  1.1  christos    fputs(";\n",stderr);
   1508  1.1  christos   }
   1509  1.1  christos 
   1510  1.1  christos 
   1511  1.1  christos 
   1512  1.1  christos void yyyShowProds()
   1513  1.1  christos   {int i; for (i=1; i<=yyyLastProdNum; i++) yyyShowProd(i);}
   1514  1.1  christos 
   1515  1.1  christos 
   1516  1.1  christos 
   1517  1.1  christos void yyyShowSymsAndSorts()
   1518  1.1  christos   {int i;
   1519  1.1  christos 
   1520  1.1  christos    for (i=1; i<=yyyLastProdNum; i++)
   1521  1.1  christos      {int j, nSyms;
   1522  1.1  christos 
   1523  1.1  christos       fprintf(stderr,
   1524  1.1  christos               "\n\n\n---------------------------------- %3.1d\n",i);
   1525  1.1  christos       /* yyyShowProd(i); */
   1526  1.1  christos       nSyms = yyySizeofProd(i);
   1527  1.1  christos       for (j=0; j<nSyms; j++)
   1528  1.1  christos         {int k, sortSize;
   1529  1.1  christos 
   1530  1.1  christos          fprintf(stderr,"%s\n",yyyGSoccurStr(i,j));
   1531  1.1  christos          sortSize = yyySizeofSort(yyySortOf(i,j));
   1532  1.1  christos          for (k=0; k<sortSize; k++)
   1533  1.1  christos             fprintf(stderr,"  %s\n",yyyAttrbStr(i,j,k));
   1534  1.1  christos          if (j == 0) fputs("->\n",stderr);
   1535  1.1  christos               else
   1536  1.1  christos               putc('\n',stderr);
   1537  1.1  christos         }
   1538  1.1  christos      }
   1539  1.1  christos   }
   1540  1.1  christos 
   1541  1.1  christos 
   1542  1.1  christos 
   1543  1.1  christos void yyyCheckNodeInstancesSolved(yyyGNT *np)
   1544  1.1  christos   {int mysort,sortSize,i,prodNum,symPos,inTerminalNode;
   1545  1.1  christos    int nUnsolvedInsts = 0;
   1546  1.1  christos 
   1547  1.1  christos    if (np->prodNum != 0)
   1548  1.1  christos      {inTerminalNode = 0;
   1549  1.1  christos       prodNum = np->prodNum;
   1550  1.1  christos       symPos = 0;
   1551  1.1  christos      }
   1552  1.1  christos    else
   1553  1.1  christos      {inTerminalNode = 1;
   1554  1.1  christos       prodNum = np->parent.noderef->prodNum;
   1555  1.1  christos       symPos = np->whichSym;
   1556  1.1  christos      }
   1557  1.1  christos    mysort = yyySortOf(prodNum,symPos);
   1558  1.1  christos    sortSize = yyySizeofSort(mysort);
   1559  1.1  christos    for (i=0; i<sortSize; i++)
   1560  1.1  christos      if ((np->refCountList)[i] != 0) nUnsolvedInsts += 1;
   1561  1.1  christos    if (nUnsolvedInsts)
   1562  1.1  christos      {fprintf(stderr,
   1563  1.1  christos       "\nFound node that has %d unsolved attribute instance(s).\n",
   1564  1.1  christos               nUnsolvedInsts
   1565  1.1  christos              );
   1566  1.1  christos       fprintf(stderr,"Node is labeled \"%s\".\n",
   1567  1.1  christos              yyyGSoccurStr(prodNum,symPos));
   1568  1.1  christos       if (inTerminalNode)
   1569  1.1  christos         {fputs("Node is terminal.  Its parent production is:\n  ",stderr);
   1570  1.1  christos          yyyShowProd(prodNum);
   1571  1.1  christos         }
   1572  1.1  christos       else
   1573  1.1  christos         {fputs("Node is nonterminal.  ",stderr);
   1574  1.1  christos          if (!(np->parentIsStack))
   1575  1.1  christos            {fprintf(stderr,
   1576  1.1  christos                     "Node is %dth child in its parent production:\n  ",
   1577  1.1  christos                    np->whichSym
   1578  1.1  christos                   );
   1579  1.1  christos             yyyShowProd(np->parent.noderef->prodNum);
   1580  1.1  christos            }
   1581  1.1  christos          fputs("Node is on left hand side of this production:\n  ",stderr);
   1582  1.1  christos          yyyShowProd(np->prodNum);
   1583  1.1  christos         }
   1584  1.1  christos       fputs("The following instances are unsolved:\n",stderr);
   1585  1.1  christos       for (i=0; i<sortSize; i++)
   1586  1.1  christos         if ((np->refCountList)[i] != 0)
   1587  1.1  christos           fprintf(stderr,"     %-16s still has %1d dependencies.\n",
   1588  1.1  christos                   yyyAttrbStr(prodNum,symPos,i),(np->refCountList)[i]);
   1589  1.1  christos      }
   1590  1.1  christos   }
   1591  1.1  christos 
   1592  1.1  christos 
   1593  1.1  christos 
   1594  1.1  christos void yyyCheckUnsolvedInstTrav(yyyGNT *pNode,long *nNZrc,long *cycleSum)
   1595  1.1  christos   {yyyGNT **yyyCLpdum;
   1596  1.1  christos    yyyRCT *rcp;
   1597  1.1  christos    int i;
   1598  1.1  christos 
   1599  1.1  christos    /* visit the refCountList of each node in the tree, and sum the non-zero refCounts */
   1600  1.1  christos    rcp = pNode->refCountList;
   1601  1.1  christos    i = pNode->refCountListLen;
   1602  1.1  christos    while (i--)
   1603  1.1  christos       if (*rcp++) {*cycleSum += *(rcp - 1); (*nNZrc)++;}
   1604  1.1  christos    yyyCLpdum = pNode->cL;
   1605  1.1  christos    i = pNode->cLlen;
   1606  1.1  christos    while (i--)
   1607  1.1  christos      {
   1608  1.1  christos       yyyCheckUnsolvedInstTrav(*yyyCLpdum,nNZrc,cycleSum);
   1609  1.1  christos       yyyCLpdum++;
   1610  1.1  christos      }
   1611  1.1  christos   }
   1612  1.1  christos 
   1613  1.1  christos 
   1614  1.1  christos 
   1615  1.1  christos void yyyUnsolvedInstSearchTravAux(yyyGNT *pNode)
   1616  1.1  christos   {yyyGNT **yyyCLpdum;
   1617  1.1  christos    int i;
   1618  1.1  christos 
   1619  1.1  christos    yyyCheckNodeInstancesSolved(pNode);
   1620  1.1  christos    yyyCLpdum = pNode->cL;
   1621  1.1  christos    i = pNode->cLlen;
   1622  1.1  christos    while (i--)
   1623  1.1  christos      {
   1624  1.1  christos       yyyUnsolvedInstSearchTravAux(*yyyCLpdum);
   1625  1.1  christos       yyyCLpdum++;
   1626  1.1  christos      }
   1627  1.1  christos   }
   1628  1.1  christos 
   1629  1.1  christos 
   1630  1.1  christos 
   1631  1.1  christos void yyyUnsolvedInstSearchTrav(yyyGNT *pNode)
   1632  1.1  christos   {yyyGNT **yyyCLpdum;
   1633  1.1  christos    int i;
   1634  1.1  christos 
   1635  1.1  christos    yyyCLpdum = pNode->cL;
   1636  1.1  christos    i = pNode->cLlen;
   1637  1.1  christos    while (i--)
   1638  1.1  christos      {
   1639  1.1  christos       yyyUnsolvedInstSearchTravAux(*yyyCLpdum);
   1640  1.1  christos       yyyCLpdum++;
   1641  1.1  christos      }
   1642  1.1  christos   }
   1643  1.1  christos 
   1644  1.1  christos 
   1645  1.1  christos 
   1646  1.1  christos #line 1645 "expr.oxout.tab.c"
   1647  1.1  christos 
   1648  1.1  christos #if YYDEBUG
   1649  1.1  christos #include <stdio.h>	/* needed for printf */
   1650  1.1  christos #endif
   1651  1.1  christos 
   1652  1.1  christos #include <stdlib.h>	/* needed for malloc, etc */
   1653  1.1  christos #include <string.h>	/* needed for memset */
   1654  1.1  christos 
   1655  1.1  christos /* allocate initial stack or double stack size, up to YYMAXDEPTH */
   1656  1.1  christos static int yygrowstack(YYSTACKDATA *data)
   1657  1.1  christos {
   1658  1.1  christos     int i;
   1659  1.1  christos     unsigned newsize;
   1660  1.1  christos     YYINT *newss;
   1661  1.1  christos     YYSTYPE *newvs;
   1662  1.1  christos 
   1663  1.1  christos     if ((newsize = data->stacksize) == 0)
   1664  1.1  christos         newsize = YYINITSTACKSIZE;
   1665  1.1  christos     else if (newsize >= YYMAXDEPTH)
   1666  1.1  christos         return YYENOMEM;
   1667  1.1  christos     else if ((newsize *= 2) > YYMAXDEPTH)
   1668  1.1  christos         newsize = YYMAXDEPTH;
   1669  1.1  christos 
   1670  1.1  christos     i = (int) (data->s_mark - data->s_base);
   1671  1.1  christos     newss = (YYINT *)realloc(data->s_base, newsize * sizeof(*newss));
   1672  1.1  christos     if (newss == 0)
   1673  1.1  christos         return YYENOMEM;
   1674  1.1  christos 
   1675  1.1  christos     data->s_base = newss;
   1676  1.1  christos     data->s_mark = newss + i;
   1677  1.1  christos 
   1678  1.1  christos     newvs = (YYSTYPE *)realloc(data->l_base, newsize * sizeof(*newvs));
   1679  1.1  christos     if (newvs == 0)
   1680  1.1  christos         return YYENOMEM;
   1681  1.1  christos 
   1682  1.1  christos     data->l_base = newvs;
   1683  1.1  christos     data->l_mark = newvs + i;
   1684  1.1  christos 
   1685  1.1  christos     data->stacksize = newsize;
   1686  1.1  christos     data->s_last = data->s_base + newsize - 1;
   1687  1.1  christos     return 0;
   1688  1.1  christos }
   1689  1.1  christos 
   1690  1.1  christos #if YYPURE || defined(YY_NO_LEAKS)
   1691  1.1  christos static void yyfreestack(YYSTACKDATA *data)
   1692  1.1  christos {
   1693  1.1  christos     free(data->s_base);
   1694  1.1  christos     free(data->l_base);
   1695  1.1  christos     memset(data, 0, sizeof(*data));
   1696  1.1  christos }
   1697  1.1  christos #else
   1698  1.1  christos #define yyfreestack(data) /* nothing */
   1699  1.1  christos #endif
   1700  1.1  christos 
   1701  1.1  christos #define YYABORT  goto yyabort
   1702  1.1  christos #define YYREJECT goto yyabort
   1703  1.1  christos #define YYACCEPT goto yyaccept
   1704  1.1  christos #define YYERROR  goto yyerrlab
   1705  1.1  christos 
   1706  1.1  christos int
   1707  1.1  christos YYPARSE_DECL()
   1708  1.1  christos {
   1709  1.1  christos     int yym, yyn, yystate;
   1710  1.1  christos #if YYDEBUG
   1711  1.1  christos     const char *yys;
   1712  1.1  christos 
   1713  1.1  christos     if ((yys = getenv("YYDEBUG")) != 0)
   1714  1.1  christos     {
   1715  1.1  christos         yyn = *yys;
   1716  1.1  christos         if (yyn >= '0' && yyn <= '9')
   1717  1.1  christos             yydebug = yyn - '0';
   1718  1.1  christos     }
   1719  1.1  christos #endif
   1720  1.1  christos 
   1721  1.1  christos     yym = 0;
   1722  1.1  christos     yyn = 0;
   1723  1.1  christos     yynerrs = 0;
   1724  1.1  christos     yyerrflag = 0;
   1725  1.1  christos     yychar = YYEMPTY;
   1726  1.1  christos     yystate = 0;
   1727  1.1  christos 
   1728  1.1  christos #if YYPURE
   1729  1.1  christos     memset(&yystack, 0, sizeof(yystack));
   1730  1.1  christos #endif
   1731  1.1  christos 
   1732  1.1  christos     if (yystack.s_base == NULL && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
   1733  1.1  christos     yystack.s_mark = yystack.s_base;
   1734  1.1  christos     yystack.l_mark = yystack.l_base;
   1735  1.1  christos     yystate = 0;
   1736  1.1  christos     *yystack.s_mark = 0;
   1737  1.1  christos 
   1738  1.1  christos yyloop:
   1739  1.1  christos     if ((yyn = yydefred[yystate]) != 0) goto yyreduce;
   1740  1.1  christos     if (yychar < 0)
   1741  1.1  christos     {
   1742  1.1  christos         yychar = YYLEX;
   1743  1.1  christos         if (yychar < 0) yychar = YYEOF;
   1744  1.1  christos #if YYDEBUG
   1745  1.1  christos         if (yydebug)
   1746  1.1  christos         {
   1747  1.1  christos             if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
   1748  1.1  christos             printf("%sdebug: state %d, reading %d (%s)\n",
   1749  1.1  christos                     YYPREFIX, yystate, yychar, yys);
   1750  1.1  christos         }
   1751  1.1  christos #endif
   1752  1.1  christos     }
   1753  1.1  christos     if (((yyn = yysindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
   1754  1.1  christos             yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
   1755  1.1  christos     {
   1756  1.1  christos #if YYDEBUG
   1757  1.1  christos         if (yydebug)
   1758  1.1  christos             printf("%sdebug: state %d, shifting to state %d\n",
   1759  1.1  christos                     YYPREFIX, yystate, yytable[yyn]);
   1760  1.1  christos #endif
   1761  1.1  christos         if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
   1762  1.1  christos         yystate = yytable[yyn];
   1763  1.1  christos         *++yystack.s_mark = yytable[yyn];
   1764  1.1  christos         *++yystack.l_mark = yylval;
   1765  1.1  christos         yychar = YYEMPTY;
   1766  1.1  christos         if (yyerrflag > 0)  --yyerrflag;
   1767  1.1  christos         goto yyloop;
   1768  1.1  christos     }
   1769  1.1  christos     if (((yyn = yyrindex[yystate]) != 0) && (yyn += yychar) >= 0 &&
   1770  1.1  christos             yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yychar)
   1771  1.1  christos     {
   1772  1.1  christos         yyn = yytable[yyn];
   1773  1.1  christos         goto yyreduce;
   1774  1.1  christos     }
   1775  1.1  christos     if (yyerrflag != 0) goto yyinrecovery;
   1776  1.1  christos 
   1777  1.1  christos     YYERROR_CALL("syntax error");
   1778  1.1  christos 
   1779  1.1  christos     goto yyerrlab; /* redundant goto avoids 'unused label' warning */
   1780  1.1  christos yyerrlab:
   1781  1.1  christos     ++yynerrs;
   1782  1.1  christos 
   1783  1.1  christos yyinrecovery:
   1784  1.1  christos     if (yyerrflag < 3)
   1785  1.1  christos     {
   1786  1.1  christos         yyerrflag = 3;
   1787  1.1  christos         for (;;)
   1788  1.1  christos         {
   1789  1.1  christos             if (((yyn = yysindex[*yystack.s_mark]) != 0) && (yyn += YYERRCODE) >= 0 &&
   1790  1.1  christos                     yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) YYERRCODE)
   1791  1.1  christos             {
   1792  1.1  christos #if YYDEBUG
   1793  1.1  christos                 if (yydebug)
   1794  1.1  christos                     printf("%sdebug: state %d, error recovery shifting\
   1795  1.1  christos  to state %d\n", YYPREFIX, *yystack.s_mark, yytable[yyn]);
   1796  1.1  christos #endif
   1797  1.1  christos                 if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
   1798  1.1  christos                 yystate = yytable[yyn];
   1799  1.1  christos                 *++yystack.s_mark = yytable[yyn];
   1800  1.1  christos                 *++yystack.l_mark = yylval;
   1801  1.1  christos                 goto yyloop;
   1802  1.1  christos             }
   1803  1.1  christos             else
   1804  1.1  christos             {
   1805  1.1  christos #if YYDEBUG
   1806  1.1  christos                 if (yydebug)
   1807  1.1  christos                     printf("%sdebug: error recovery discarding state %d\n",
   1808  1.1  christos                             YYPREFIX, *yystack.s_mark);
   1809  1.1  christos #endif
   1810  1.1  christos                 if (yystack.s_mark <= yystack.s_base) goto yyabort;
   1811  1.1  christos                 --yystack.s_mark;
   1812  1.1  christos                 --yystack.l_mark;
   1813  1.1  christos             }
   1814  1.1  christos         }
   1815  1.1  christos     }
   1816  1.1  christos     else
   1817  1.1  christos     {
   1818  1.1  christos         if (yychar == YYEOF) goto yyabort;
   1819  1.1  christos #if YYDEBUG
   1820  1.1  christos         if (yydebug)
   1821  1.1  christos         {
   1822  1.1  christos             if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
   1823  1.1  christos             printf("%sdebug: state %d, error recovery discards token %d (%s)\n",
   1824  1.1  christos                     YYPREFIX, yystate, yychar, yys);
   1825  1.1  christos         }
   1826  1.1  christos #endif
   1827  1.1  christos         yychar = YYEMPTY;
   1828  1.1  christos         goto yyloop;
   1829  1.1  christos     }
   1830  1.1  christos 
   1831  1.1  christos yyreduce:
   1832  1.1  christos #if YYDEBUG
   1833  1.1  christos     if (yydebug)
   1834  1.1  christos         printf("%sdebug: state %d, reducing by rule %d (%s)\n",
   1835  1.1  christos                 YYPREFIX, yystate, yyn, yyrule[yyn]);
   1836  1.1  christos #endif
   1837  1.1  christos     yym = yylen[yyn];
   1838  1.1  christos     if (yym > 0)
   1839  1.1  christos         yyval = yystack.l_mark[1-yym];
   1840  1.1  christos     else
   1841  1.1  christos         memset(&yyval, 0, sizeof yyval);
   1842  1.1  christos 
   1843  1.1  christos     switch (yyn)
   1844  1.1  christos     {
   1845  1.1  christos case 1:
   1846  1.1  christos #line 64 "expr.oxout.y"
   1847  1.1  christos 	{yyyYoxInit();}
   1848  1.1  christos break;
   1849  1.1  christos case 2:
   1850  1.1  christos #line 66 "expr.oxout.y"
   1851  1.1  christos 	{
   1852  1.1  christos 		 yyyDecorate(); yyyExecuteRRsection(yystack.l_mark[0].yyyOxAttrbs.yyyOxStackItem->node);
   1853  1.1  christos 		}
   1854  1.1  christos break;
   1855  1.1  christos case 3:
   1856  1.1  christos #line 73 "expr.oxout.y"
   1857  1.1  christos 	{if(yyyYok){
   1858  1.1  christos yyyGenIntNode(1,1,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);
   1859  1.1  christos yyyAdjustINRC(1,1,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}}
   1860  1.1  christos break;
   1861  1.1  christos case 4:
   1862  1.1  christos #line 80 "expr.oxout.y"
   1863  1.1  christos 	{if(yyyYok){
   1864  1.1  christos yyyGenIntNode(2,3,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);
   1865  1.1  christos yyyAdjustINRC(2,3,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}}
   1866  1.1  christos break;
   1867  1.1  christos case 5:
   1868  1.1  christos #line 87 "expr.oxout.y"
   1869  1.1  christos 	{if(yyyYok){
   1870  1.1  christos yyyGenIntNode(3,3,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);
   1871  1.1  christos yyyAdjustINRC(3,3,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}}
   1872  1.1  christos break;
   1873  1.1  christos case 6:
   1874  1.1  christos #line 94 "expr.oxout.y"
   1875  1.1  christos 	{if(yyyYok){
   1876  1.1  christos yyyGenIntNode(4,3,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);
   1877  1.1  christos yyyAdjustINRC(4,3,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}}
   1878  1.1  christos break;
   1879  1.1  christos case 7:
   1880  1.1  christos #line 101 "expr.oxout.y"
   1881  1.1  christos 	{if(yyyYok){
   1882  1.1  christos yyyGenIntNode(5,3,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);
   1883  1.1  christos yyyAdjustINRC(5,3,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}}
   1884  1.1  christos break;
   1885  1.1  christos case 8:
   1886  1.1  christos #line 108 "expr.oxout.y"
   1887  1.1  christos 	{if(yyyYok){
   1888  1.1  christos yyyGenIntNode(6,3,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);
   1889  1.1  christos yyyAdjustINRC(6,3,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[-2].yyyOxAttrbs,&yystack.l_mark[-1].yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}}
   1890  1.1  christos break;
   1891  1.1  christos case 9:
   1892  1.1  christos #line 114 "expr.oxout.y"
   1893  1.1  christos 	{if(yyyYok){
   1894  1.1  christos yyyGenIntNode(7,1,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);
   1895  1.1  christos yyyAdjustINRC(7,1,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}}
   1896  1.1  christos break;
   1897  1.1  christos case 10:
   1898  1.1  christos #line 121 "expr.oxout.y"
   1899  1.1  christos 	{if(yyyYok){
   1900  1.1  christos yyyGenIntNode(8,1,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);
   1901  1.1  christos yyyAdjustINRC(8,1,0,0,&yyval.yyyOxAttrbs,&yystack.l_mark[0].yyyOxAttrbs);}}
   1902  1.1  christos break;
   1903  1.1  christos #line 1902 "expr.oxout.tab.c"
   1904  1.1  christos     }
   1905  1.1  christos     yystack.s_mark -= yym;
   1906  1.1  christos     yystate = *yystack.s_mark;
   1907  1.1  christos     yystack.l_mark -= yym;
   1908  1.1  christos     yym = yylhs[yyn];
   1909  1.1  christos     if (yystate == 0 && yym == 0)
   1910  1.1  christos     {
   1911  1.1  christos #if YYDEBUG
   1912  1.1  christos         if (yydebug)
   1913  1.1  christos             printf("%sdebug: after reduction, shifting from state 0 to\
   1914  1.1  christos  state %d\n", YYPREFIX, YYFINAL);
   1915  1.1  christos #endif
   1916  1.1  christos         yystate = YYFINAL;
   1917  1.1  christos         *++yystack.s_mark = YYFINAL;
   1918  1.1  christos         *++yystack.l_mark = yyval;
   1919  1.1  christos         if (yychar < 0)
   1920  1.1  christos         {
   1921  1.1  christos             yychar = YYLEX;
   1922  1.1  christos             if (yychar < 0) yychar = YYEOF;
   1923  1.1  christos #if YYDEBUG
   1924  1.1  christos             if (yydebug)
   1925  1.1  christos             {
   1926  1.1  christos                 if ((yys = yyname[YYTRANSLATE(yychar)]) == NULL) yys = yyname[YYUNDFTOKEN];
   1927  1.1  christos                 printf("%sdebug: state %d, reading %d (%s)\n",
   1928  1.1  christos                         YYPREFIX, YYFINAL, yychar, yys);
   1929  1.1  christos             }
   1930  1.1  christos #endif
   1931  1.1  christos         }
   1932  1.1  christos         if (yychar == YYEOF) goto yyaccept;
   1933  1.1  christos         goto yyloop;
   1934  1.1  christos     }
   1935  1.1  christos     if (((yyn = yygindex[yym]) != 0) && (yyn += yystate) >= 0 &&
   1936  1.1  christos             yyn <= YYTABLESIZE && yycheck[yyn] == (YYINT) yystate)
   1937  1.1  christos         yystate = yytable[yyn];
   1938  1.1  christos     else
   1939  1.1  christos         yystate = yydgoto[yym];
   1940  1.1  christos #if YYDEBUG
   1941  1.1  christos     if (yydebug)
   1942  1.1  christos         printf("%sdebug: after reduction, shifting from state %d \
   1943  1.1  christos to state %d\n", YYPREFIX, *yystack.s_mark, yystate);
   1944  1.1  christos #endif
   1945  1.1  christos     if (yystack.s_mark >= yystack.s_last && yygrowstack(&yystack) == YYENOMEM) goto yyoverflow;
   1946  1.1  christos     *++yystack.s_mark = (YYINT) yystate;
   1947  1.1  christos     *++yystack.l_mark = yyval;
   1948  1.1  christos     goto yyloop;
   1949  1.1  christos 
   1950  1.1  christos yyoverflow:
   1951  1.1  christos     YYERROR_CALL("yacc stack overflow");
   1952  1.1  christos 
   1953  1.1  christos yyabort:
   1954  1.1  christos     yyfreestack(&yystack);
   1955  1.1  christos     return (1);
   1956  1.1  christos 
   1957  1.1  christos yyaccept:
   1958  1.1  christos     yyfreestack(&yystack);
   1959  1.1  christos     return (0);
   1960  1.1  christos }
   1961