Annotation of parser3/src/main/compile.tab.C, revision 1.2

1.1       parser      1: 
                      2: /*  A Bison parser, made from compile.y
                      3:     by GNU Bison version 1.28  */
                      4: 
                      5: #define YYBISON 1  /* Identify Bison output.  */
                      6: 
                      7: #define        EON     257
                      8: #define        STRING  258
                      9: #define        BOGUS   259
                     10: #define        BAD_STRING_COMPARISON_OPERATOR  260
                     11: #define        BAD_HEX_LITERAL 261
                     12: #define        LAND    262
                     13: #define        LOR     263
                     14: #define        LXOR    264
                     15: #define        NLE     265
                     16: #define        NGE     266
                     17: #define        NEQ     267
                     18: #define        NNE     268
                     19: #define        SLT     269
                     20: #define        SGT     270
                     21: #define        SLE     271
                     22: #define        SGE     272
                     23: #define        SEQ     273
                     24: #define        SNE     274
                     25: #define        DEF     275
                     26: #define        IN      276
                     27: #define        FEXISTS 277
                     28: #define        DEXISTS 278
                     29: #define        IS      279
                     30: #define        NEG     280
                     31: 
                     32: #line 8 "compile.y"
                     33: 
                     34: static char *RCSId="$Id: compile.y,v 1.158 2001/07/28 12:01:50 parser Exp $"; 
                     35: 
                     36: /**
                     37:        @todo parser4: 
                     38:        - cache compiled code from request to request. to do that...
                     39:                -#:     make method definitions, @CLASS, @BASE, @USE instructions,
                     40:                        which would be executed afterwards, and actions
                     41:                        now performed at compile time would be delayed to run time.
                     42:                -#:     make cache expiration on time and on disk-change of class source
                     43:                -#:     in apache use subpools for compiled class storage
                     44:                -#:     in iis make up specialized Pool object for that
                     45: */
                     46: 
                     47: #define YYSTYPE  Array/*<Operation>*/ *
                     48: #define YYPARSE_PARAM  pc
                     49: #define YYLEX_PARAM  pc
                     50: #define YYDEBUG  1
                     51: #define YYERROR_VERBOSE        1
                     52: #define yyerror(msg)  real_yyerror((parse_control *)pc, msg)
                     53: #define YYPRINT(file, type, value)  yyprint(file, type, value)
                     54: 
                     55: #include "compile_tools.h"
                     56: #include "pa_value.h"
                     57: #include "pa_request.h"
                     58: #include "pa_vobject.h"
                     59: #include "pa_vdouble.h"
                     60: #include "pa_globals.h"
                     61: #include "pa_vvoid.h"
                     62: 
                     63: #define SELF_ELEMENT_NAME "self"
                     64: #define USE_CONTROL_METHOD_NAME "USE"
                     65: 
                     66: static int real_yyerror(parse_control *pc, char *s);
                     67: static void yyprint(FILE *file, int type, YYSTYPE value);
                     68: static int yylex(YYSTYPE *lvalp, void *pc);
                     69: 
                     70: 
                     71: // local convinient inplace typecast & var
                     72: #define PC  (*(parse_control *)pc)
                     73: #define POOL  (*PC.pool)
                     74: #undef NEW
                     75: #define NEW new(POOL)
                     76: #ifndef DOXYGEN
                     77: #ifndef YYSTYPE
                     78: #define YYSTYPE int
                     79: #endif
                     80: #include <stdio.h>
                     81: 
                     82: #ifndef __cplusplus
                     83: #ifndef __STDC__
                     84: #define const
                     85: #endif
                     86: #endif
                     87: 
                     88: 
                     89: 
                     90: #define        YYFINAL         240
                     91: #define        YYFLAG          -32768
                     92: #define        YYNTBASE        54
                     93: 
                     94: #define YYTRANSLATE(x) ((unsigned)(x) <= 280 ? yytranslate[x] : 132)
                     95: 
                     96: static const char yytranslate[] = {     0,
                     97:      2,     2,     2,     2,     2,     2,     2,     2,     2,    40,
                     98:      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                     99:      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                    100:      2,     2,    28,    52,    29,    44,    37,    31,    53,    48,
                    101:     49,    35,    34,     2,    33,    47,    36,     2,     2,     2,
                    102:      2,     2,     2,     2,     2,     2,     2,    51,    43,    26,
                    103:      2,    27,     2,    39,     2,     2,     2,     2,     2,     2,
                    104:      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                    105:      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                    106:     41,     2,    42,    50,     2,     2,     2,     2,     2,     2,
                    107:      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                    108:      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                    109:      2,     2,    45,    30,    46,    32,     2,     2,     2,     2,
                    110:      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                    111:      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                    112:      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                    113:      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                    114:      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                    115:      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                    116:      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                    117:      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                    118:      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                    119:      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                    120:      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                    121:      2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                    122:      2,     2,     2,     2,     2,     1,     3,     4,     5,     6,
                    123:      7,     8,     9,    10,    11,    12,    13,    14,    15,    16,
                    124:     17,    18,    19,    20,    21,    22,    23,    24,    25,    38
                    125: };
                    126: 
                    127: #if YYDEBUG != 0
                    128: static const short yyprhs[] = {     0,
                    129:      0,     2,     4,     6,     9,    11,    13,    15,    20,    22,
                    130:     24,    26,    29,    32,    34,    36,    44,    46,    48,    52,
                    131:     54,    56,    58,    62,    64,    66,    68,    70,    72,    75,
                    132:     77,    79,    81,    83,    85,    87,    90,    93,    95,    99,
                    133:    101,   103,   105,   108,   110,   113,   117,   119,   121,   123,
                    134:    125,   128,   131,   133,   135,   137,   141,   145,   149,   151,
                    135:    153,   155,   157,   159,   161,   164,   166,   167,   168,   175,
                    136:    177,   179,   182,   184,   186,   188,   192,   196,   200,   202,
                    137:    206,   208,   212,   214,   218,   220,   222,   224,   226,   228,
                    138:    230,   232,   234,   237,   239,   242,   245,   247,   249,   252,
                    139:    254,   256,   258,   261,   264,   266,   268,   271,   274,   276,
                    140:    278,   281,   284,   286,   288,   290,   292,   296,   300,   304,
                    141:    307,   310,   313,   316,   319,   322,   325,   329,   333,   337,
                    142:    341,   345,   349,   353,   357,   361,   365,   369,   373,   377,
                    143:    381,   385,   389,   393,   397,   401,   405,   409,   413,   417,
                    144:    421,   423,   425,   426
                    145: };
                    146: 
                    147: static const short yyrhs[] = {    56,
                    148:      0,    55,     0,    57,     0,    55,    57,     0,    69,     0,
                    149:     58,     0,    63,     0,    39,     4,    40,    59,     0,   131,
                    150:      0,    60,     0,    61,     0,    60,    61,     0,    62,    40,
                    151:      0,   131,     0,     4,     0,    39,     4,    65,    64,    68,
                    152:     40,    69,     0,   131,     0,    65,     0,    41,    66,    42,
                    153:      0,   131,     0,    67,     0,     4,     0,    67,    43,     4,
                    154:      0,   131,     0,     4,     0,   131,     0,    70,     0,    71,
                    155:      0,    70,    71,     0,   129,     0,    72,     0,    73,     0,
                    156:     81,     0,    94,     0,    74,     0,    44,    75,     0,    77,
                    157:      3,     0,    76,     0,    45,    77,    46,     0,    78,     0,
                    158:     79,     0,    80,     0,   123,    80,     0,   116,     0,   113,
                    159:    116,     0,    44,    82,    86,     0,    83,     0,    84,     0,
                    160:     85,     0,   112,     0,    47,   112,     0,   123,   112,     0,
                    161:     87,     0,    88,     0,    89,     0,    41,    90,    42,     0,
                    162:     48,   126,    49,     0,    45,    69,    46,     0,   130,     0,
                    163:      4,     0,    91,     0,    92,     0,    93,     0,    72,     0,
                    164:     71,    70,     0,    95,     0,     0,     0,    50,    96,    98,
                    165:     97,    99,     3,     0,    77,     0,   100,     0,    99,   100,
                    166:      0,   101,     0,   102,     0,   103,     0,    41,   104,    42,
                    167:      0,    48,   105,    49,     0,    45,   106,    46,     0,   107,
                    168:      0,   104,    43,   107,     0,   108,     0,   105,    43,   108,
                    169:      0,   109,     0,   106,    43,   109,     0,   110,     0,   111,
                    170:      0,    69,     0,   130,     0,     4,     0,    91,     0,   126,
                    171:      0,   117,     0,   113,   117,     0,   114,     0,   113,   114,
                    172:      0,   115,    47,     0,   117,     0,   117,     0,     4,     5,
                    173:      0,     4,     0,   118,     0,   119,     0,    44,   120,     0,
                    174:      4,   121,     0,     4,     0,   122,     0,   121,   122,     0,
                    175:     44,   120,     0,   124,     0,   125,     0,     4,    51,     0,
                    176:    124,    51,     0,   127,     0,     4,     0,    74,     0,    95,
                    177:      0,    52,   128,    52,     0,    53,   128,    53,     0,    48,
                    178:    127,    49,     0,    33,   127,     0,    32,   127,     0,    28,
                    179:    127,     0,    21,   127,     0,    22,   127,     0,    23,   127,
                    180:      0,    24,   127,     0,   127,    33,   127,     0,   127,    34,
                    181:    127,     0,   127,    35,   127,     0,   127,    36,   127,     0,
                    182:    127,    37,   127,     0,   127,    31,   127,     0,   127,    30,
                    183:    127,     0,   127,    29,   127,     0,   127,     8,   127,     0,
                    184:    127,     9,   127,     0,   127,    10,   127,     0,   127,    26,
                    185:    127,     0,   127,    27,   127,     0,   127,    11,   127,     0,
                    186:    127,    12,   127,     0,   127,    13,   127,     0,   127,    14,
                    187:    127,     0,   127,    15,   127,     0,   127,    16,   127,     0,
                    188:    127,    17,   127,     0,   127,    18,   127,     0,   127,    19,
                    189:    127,     0,   127,    20,   127,     0,   127,    25,   127,     0,
                    190:     69,     0,     4,     0,     0,     0
                    191: };
                    192: 
                    193: #endif
                    194: 
                    195: #if YYDEBUG != 0
                    196: static const short yyrline[] = { 0,
1.2     ! parser    197:    106,   116,   118,   118,   119,   121,   121,   123,   189,   189,
        !           198:    190,   190,   191,   192,   192,   194,   223,   223,   224,   225,
        !           199:    225,   226,   226,   228,   228,   232,   232,   234,   234,   235,
        !           200:    235,   236,   236,   236,   240,   244,   245,   245,   246,   247,
        !           201:    249,   250,   265,   266,   266,   270,   274,   276,   277,   278,
        !           202:    293,   298,   300,   301,   302,   305,   311,   317,   323,   325,
        !           203:    326,   328,   334,   335,   335,   339,   343,   344,   345,   359,
        !           204:    361,   361,   362,   364,   365,   367,   368,   369,   370,   372,
        !           205:    374,   376,   378,   380,   382,   386,   390,   394,   396,   397,
        !           206:    399,   406,   406,   408,   408,   409,   410,   415,   420,   422,
        !           207:    424,   425,   427,   431,   439,   444,   444,   445,   450,   452,
        !           208:    454,   458,   470,   474,   476,   477,   478,   479,   480,   482,
        !           209:    483,   484,   485,   486,   487,   488,   490,   491,   492,   493,
        !           210:    494,   495,   496,   497,   498,   499,   500,   501,   502,   503,
        !           211:    504,   505,   506,   507,   508,   509,   510,   511,   512,   513,
        !           212:    516,   525,   530,   531
1.1       parser    213: };
                    214: #endif
                    215: 
                    216: 
                    217: #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
                    218: 
                    219: static const char * const yytname[] = {   "$","error","$undefined.","EON","STRING",
                    220: "BOGUS","BAD_STRING_COMPARISON_OPERATOR","BAD_HEX_LITERAL","\"&&\"","\"||\"",
                    221: "\"##\"","\"<=\"","\">=\"","\"==\"","\"!=\"","\"lt\"","\"gt\"","\"le\"","\"ge\"",
                    222: "\"eq\"","\"ne\"","\"def\"","\"in\"","\"-f\"","\"-d\"","\"is\"","'<'","'>'",
                    223: "'!'","'#'","'|'","'&'","'~'","'-'","'+'","'*'","'/'","'%'","NEG","'@'","'\\n'",
                    224: "'['","']'","';'","'$'","'{'","'}'","'.'","'('","')'","'^'","':'","'\\\"'","'\\''",
                    225: "all","methods","one_big_piece","method","control_method","maybe_control_strings",
                    226: "control_strings","control_string","maybe_string","code_method","maybe_bracketed_strings",
                    227: "bracketed_maybe_strings","maybe_strings","strings","maybe_comment","maybe_codes",
                    228: "codes","code","action","get","get_value","get_name_value","name_in_curly_rdive",
                    229: "name_without_curly_rdive","name_without_curly_rdive_read","name_without_curly_rdive_class",
                    230: "name_without_curly_rdive_code","put","name_expr_wdive","name_expr_wdive_root",
                    231: "name_expr_wdive_write","name_expr_wdive_class","construct","construct_square",
                    232: "construct_round","construct_curly","any_constructor_code_value","constructor_code_value",
                    233: "constructor_code","codes__excluding_sole_str_literal","call","call_value","@1",
                    234: "@2","call_name","store_params","store_param","store_square_param","store_round_param",
                    235: "store_curly_param","store_code_param_parts","store_expr_param_parts","store_curly_param_parts",
                    236: "store_code_param_part","store_expr_param_part","store_curly_param_part","code_param_value",
                    237: "write_expr_value","name_expr_dive_code","name_path","name_step","name_advance1",
                    238: "name_advance2","name_expr_value","name_expr_subvar_value","name_expr_with_subvar_value",
                    239: "subvar_ref_name_rdive","subvar_get_writes","subvar__get_write","class_prefix",
                    240: "class_static_prefix","class_constructor_prefix","expr_value","expr","string_inside_quotes_value",
                    241: "write_string","void_value","empty", NULL
                    242: };
                    243: #endif
                    244: 
                    245: static const short yyr1[] = {     0,
                    246:     54,    54,    55,    55,    56,    57,    57,    58,    59,    59,
                    247:     60,    60,    61,    62,    62,    63,    64,    64,    65,    66,
                    248:     66,    67,    67,    68,    68,    69,    69,    70,    70,    71,
                    249:     71,    72,    72,    72,    73,    74,    75,    75,    76,    77,
                    250:     77,    78,    79,    80,    80,    81,    82,    82,    82,    83,
                    251:     84,    85,    86,    86,    86,    87,    88,    89,    90,    90,
                    252:     90,    91,    92,    93,    93,    94,    96,    97,    95,    98,
                    253:     99,    99,   100,   100,   100,   101,   102,   103,   104,   104,
                    254:    105,   105,   106,   106,   107,   108,   109,   110,   110,   110,
                    255:    111,   112,   112,   113,   113,   114,   115,   116,   116,   117,
                    256:    117,   117,   118,   119,   120,   121,   121,   122,   123,   123,
                    257:    124,   125,   126,   127,   127,   127,   127,   127,   127,   127,
                    258:    127,   127,   127,   127,   127,   127,   127,   127,   127,   127,
                    259:    127,   127,   127,   127,   127,   127,   127,   127,   127,   127,
                    260:    127,   127,   127,   127,   127,   127,   127,   127,   127,   127,
                    261:    128,   129,   130,   131
                    262: };
                    263: 
                    264: static const short yyr2[] = {     0,
                    265:      1,     1,     1,     2,     1,     1,     1,     4,     1,     1,
                    266:      1,     2,     2,     1,     1,     7,     1,     1,     3,     1,
                    267:      1,     1,     3,     1,     1,     1,     1,     1,     2,     1,
                    268:      1,     1,     1,     1,     1,     2,     2,     1,     3,     1,
                    269:      1,     1,     2,     1,     2,     3,     1,     1,     1,     1,
                    270:      2,     2,     1,     1,     1,     3,     3,     3,     1,     1,
                    271:      1,     1,     1,     1,     2,     1,     0,     0,     6,     1,
                    272:      1,     2,     1,     1,     1,     3,     3,     3,     1,     3,
                    273:      1,     3,     1,     3,     1,     1,     1,     1,     1,     1,
                    274:      1,     1,     2,     1,     2,     2,     1,     1,     2,     1,
                    275:      1,     1,     2,     2,     1,     1,     2,     2,     1,     1,
                    276:      2,     2,     1,     1,     1,     1,     3,     3,     3,     2,
                    277:      2,     2,     2,     2,     2,     2,     3,     3,     3,     3,
                    278:      3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
                    279:      3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
                    280:      1,     1,     0,     0
                    281: };
                    282: 
                    283: static const short yydefact[] = {   154,
                    284:    152,     0,     0,    67,     2,     1,     3,     6,     7,     5,
                    285:     27,    28,    31,    32,    35,    33,    34,    66,    30,    26,
                    286:      0,   100,     0,     0,     0,    36,    38,     0,    40,    41,
                    287:     42,     0,    47,    48,    49,    50,     0,    94,     0,    44,
                    288:     92,   101,   102,     0,   109,   110,     0,     4,    29,   154,
                    289:    154,   154,    99,     0,   111,   104,   106,   105,   103,     0,
                    290:      0,    98,     0,   100,    51,     0,    92,    37,   153,   154,
                    291:      0,    46,    53,    54,    55,   100,    95,    45,    93,    96,
                    292:     43,    52,   112,    70,    68,    15,     8,    10,    11,     0,
                    293:      9,    22,     0,    21,    20,   154,    18,    17,   108,   107,
                    294:     39,    93,   152,     0,    31,     0,    61,    62,    63,    59,
                    295:      0,   114,     0,     0,     0,     0,     0,     0,     0,     0,
                    296:      0,   154,   154,   115,   116,     0,   113,     0,    12,    14,
                    297:     13,    19,     0,    25,     0,    24,    65,    56,    58,   123,
                    298:    124,   125,   126,   122,   121,   120,     0,   151,     0,     0,
                    299:     57,     0,     0,     0,     0,     0,     0,     0,     0,     0,
                    300:      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
                    301:      0,     0,     0,     0,     0,   153,   154,     0,     0,    71,
                    302:     73,    74,    75,    23,   154,   119,   117,   118,   135,   136,
                    303:    137,   140,   141,   142,   143,   144,   145,   146,   147,   148,
                    304:    149,   150,   138,   139,   134,   133,   132,   127,   128,   129,
                    305:    130,   131,   152,    90,     0,    79,    85,    88,    87,     0,
                    306:     83,     0,    81,    86,    91,    69,    72,    16,    76,   153,
                    307:    154,    78,     0,    77,    80,    84,    82,     0,     0,     0
                    308: };
                    309: 
                    310: static const short yydefgoto[] = {   238,
                    311:      5,     6,     7,     8,    87,    88,    89,    90,     9,    96,
                    312:     52,    93,    94,   135,   148,    11,    12,    13,    14,   124,
                    313:     26,    27,    28,    29,    30,    31,    16,    32,    33,    34,
                    314:     35,    72,    73,    74,    75,   106,   214,   108,   109,    17,
                    315:    125,    47,   128,    85,   179,   180,   181,   182,   183,   215,
                    316:    222,   220,   216,   223,   221,   217,   224,    36,    61,    38,
                    317:     39,    40,    62,    42,    43,    59,    56,    57,    63,    45,
                    318:     46,   225,   127,   149,    19,   218,    20
                    319: };
                    320: 
                    321: static const short yypact[] = {    10,
                    322: -32768,    15,    58,-32768,    -8,-32768,-32768,-32768,-32768,-32768,
                    323:      6,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,
                    324:     80,     4,    32,    70,   105,-32768,-32768,    44,-32768,-32768,
                    325: -32768,   -21,-32768,-32768,-32768,-32768,   106,-32768,    54,-32768,
                    326:     19,-32768,-32768,   106,    66,-32768,    70,-32768,-32768,   122,
                    327:    124,    92,-32768,    32,-32768,    90,-32768,-32768,-32768,    97,
                    328:    106,   101,   106,    90,-32768,   105,   101,-32768,    13,     6,
                    329:    108,-32768,-32768,-32768,-32768,   111,-32768,-32768,    19,-32768,
                    330: -32768,-32768,-32768,-32768,-32768,-32768,-32768,    11,-32768,   113,
                    331:    117,-32768,   120,   116,-32768,   147,-32768,-32768,-32768,-32768,
                    332: -32768,   101,   128,     6,   139,   144,-32768,-32768,-32768,-32768,
                    333:    118,-32768,   108,   108,   108,   108,   108,   108,   108,    63,
                    334:    108,     6,     6,-32768,-32768,   162,   230,   -20,-32768,-32768,
                    335: -32768,-32768,   186,-32768,   172,-32768,     6,-32768,-32768,   351,
                    336:    351,   351,   351,   351,   364,-32768,   188,-32768,   164,   173,
                    337: -32768,   108,   108,   108,   108,   108,   108,   108,   108,   108,
                    338:    108,   108,   108,   108,   108,   108,   108,   108,   108,   108,
                    339:    108,   108,   108,   108,   108,    14,     6,   108,    20,-32768,
                    340: -32768,-32768,-32768,-32768,     6,-32768,-32768,-32768,   317,   290,
                    341:    260,   342,   342,   138,   138,   342,   342,   342,   342,   138,
                    342:    138,   351,   342,   342,   359,   158,   364,   109,   109,-32768,
                    343: -32768,-32768,   141,-32768,   167,-32768,-32768,-32768,-32768,   -13,
                    344: -32768,   -17,-32768,-32768,-32768,-32768,-32768,-32768,-32768,    14,
                    345:      6,-32768,   108,-32768,-32768,-32768,-32768,   227,   228,-32768
                    346: };
                    347: 
                    348: static const short yypgoto[] = {-32768,
                    349: -32768,-32768,   224,-32768,-32768,-32768,   148,-32768,-32768,-32768,
                    350:    183,-32768,-32768,-32768,     3,   149,   -10,   -65,-32768,     0,
                    351: -32768,-32768,    91,-32768,-32768,   -28,-32768,-32768,-32768,-32768,
                    352: -32768,-32768,-32768,-32768,-32768,-32768,   182,-32768,-32768,-32768,
                    353:      2,-32768,-32768,-32768,-32768,    73,-32768,-32768,-32768,-32768,
                    354: -32768,-32768,    24,    25,    31,-32768,-32768,    75,   110,    81,
                    355: -32768,   -32,     9,-32768,-32768,   216,-32768,   225,   279,-32768,
                    356: -32768,   212,   -76,   161,-32768,   219,   -44
                    357: };
                    358: 
                    359: 
                    360: #define        YYLAST          401
                    361: 
                    362: 
                    363: static const short yytable[] = {    15,
                    364:     49,    18,    10,   105,    78,    91,    95,    98,    53,     1,
                    365:     15,    41,    18,     1,    86,    81,   103,   213,    21,    69,
                    366:    176,   -98,   226,    70,   177,   233,    71,   178,    78,   231,
                    367:      2,   234,   232,    67,    81,    58,   140,   141,   142,   143,
                    368:    144,   145,   146,   130,   147,    79,    68,    54,     2,     3,
                    369:   -154,   136,    41,     3,    55,     4,     3,     3,   104,     4,
                    370:    176,    22,     4,     4,   177,   -97,    22,   178,    15,    15,
                    371:     18,    18,   111,    22,   102,   189,   190,   191,   192,   193,
                    372:    194,   195,   196,   197,   198,   199,   200,   201,   202,   203,
                    373:    204,   205,   206,   207,   208,   209,   210,   211,   212,    65,
                    374:     80,    23,    24,    15,    25,    18,    23,    24,    64,    76,
                    375:    105,   112,    37,    23,    60,    53,    83,    77,    82,    50,
                    376:     51,    15,    15,    18,    18,    86,    49,    92,   113,   114,
                    377:    115,   116,    51,    54,    66,   117,    15,    84,    18,   118,
                    378:    119,    77,   101,   173,   174,   175,    77,   -97,    23,    23,
                    379:    134,   120,   131,    37,    54,   121,   -14,     4,   133,   122,
                    380:    123,   132,   165,   139,   105,   104,   168,   169,   170,   -60,
                    381:    171,   172,   173,   174,   175,    15,    15,    18,    18,   219,
                    382:    -64,   -64,   -89,   -89,    15,   138,    18,   228,   170,   184,
                    383:    171,   172,   173,   174,   175,   152,   153,   154,   155,   156,
                    384:    157,   158,   159,   160,   161,   162,   163,   164,   229,   230,
                    385:    151,   185,   165,   166,   167,   187,   168,   169,   170,   104,
                    386:    171,   172,   173,   174,   175,   188,   239,   240,    48,    15,
                    387:     15,    18,    18,   219,    97,   129,   186,   152,   153,   154,
                    388:    155,   156,   157,   158,   159,   160,   161,   162,   163,   164,
                    389:    107,   227,   137,   235,   165,   166,   167,   237,   168,   169,
                    390:    170,   236,   171,   172,   173,   174,   175,   152,   153,    99,
                    391:    155,   156,   157,   158,   159,   160,   161,   162,   163,   164,
                    392:    100,    44,   126,   150,   165,   166,   167,   110,   168,   169,
                    393:    170,     0,   171,   172,   173,   174,   175,   152,     0,     0,
                    394:    155,   156,   157,   158,   159,   160,   161,   162,   163,   164,
                    395:      0,     0,     0,     0,   165,   166,   167,     0,   168,   169,
                    396:    170,     0,   171,   172,   173,   174,   175,   155,   156,   157,
                    397:    158,   159,   160,   161,   162,   163,   164,     0,     0,     0,
                    398:      0,   165,   166,   167,     0,   168,   169,   170,     0,   171,
                    399:    172,   173,   174,   175,   157,   158,     0,     0,     0,     0,
                    400:    163,   164,     0,     0,     0,     0,   165,     0,     0,     0,
                    401:    168,   169,   170,     0,   171,   172,   173,   174,   175,   168,
                    402:    169,   170,     0,   171,   172,   173,   174,   175,   169,   170,
                    403:      0,   171,   172,   173,   174,   175,   171,   172,   173,   174,
                    404:    175
                    405: };
                    406: 
                    407: static const short yycheck[] = {     0,
                    408:     11,     0,     0,    69,    37,    50,    51,    52,     5,     4,
                    409:     11,     3,    11,     4,     4,    44,     4,     4,     4,    41,
                    410:     41,     3,     3,    45,    45,    43,    48,    48,    61,    43,
                    411:     39,    49,    46,    25,    63,     4,   113,   114,   115,   116,
                    412:    117,   118,   119,    88,   121,    37,     3,    44,    39,    44,
                    413:     40,    96,    44,    44,    51,    50,    44,    44,    69,    50,
                    414:     41,     4,    50,    50,    45,    47,     4,    48,    69,    70,
                    415:     69,    70,    70,     4,    66,   152,   153,   154,   155,   156,
                    416:    157,   158,   159,   160,   161,   162,   163,   164,   165,   166,
                    417:    167,   168,   169,   170,   171,   172,   173,   174,   175,    25,
                    418:     47,    44,    45,   104,    47,   104,    44,    45,     4,     4,
                    419:    176,     4,     3,    44,    24,     5,    51,    37,    44,    40,
                    420:     41,   122,   123,   122,   123,     4,   137,     4,    21,    22,
                    421:     23,    24,    41,    44,    25,    28,   137,    47,   137,    32,
                    422:     33,    61,    46,    35,    36,    37,    66,    47,    44,    44,
                    423:      4,    44,    40,    44,    44,    48,    40,    50,    43,    52,
                    424:     53,    42,    25,    46,   230,   176,    29,    30,    31,    42,
                    425:     33,    34,    35,    36,    37,   176,   177,   176,   177,   177,
                    426:     42,    43,    42,    43,   185,    42,   185,   185,    31,     4,
                    427:     33,    34,    35,    36,    37,     8,     9,    10,    11,    12,
                    428:     13,    14,    15,    16,    17,    18,    19,    20,    42,    43,
                    429:     49,    40,    25,    26,    27,    52,    29,    30,    31,   230,
                    430:     33,    34,    35,    36,    37,    53,     0,     0,     5,   230,
                    431:    231,   230,   231,   231,    52,    88,    49,     8,     9,    10,
                    432:     11,    12,    13,    14,    15,    16,    17,    18,    19,    20,
                    433:     69,   179,   104,   230,    25,    26,    27,   233,    29,    30,
                    434:     31,   231,    33,    34,    35,    36,    37,     8,     9,    54,
                    435:     11,    12,    13,    14,    15,    16,    17,    18,    19,    20,
                    436:     56,     3,    71,   123,    25,    26,    27,    69,    29,    30,
                    437:     31,    -1,    33,    34,    35,    36,    37,     8,    -1,    -1,
                    438:     11,    12,    13,    14,    15,    16,    17,    18,    19,    20,
                    439:     -1,    -1,    -1,    -1,    25,    26,    27,    -1,    29,    30,
                    440:     31,    -1,    33,    34,    35,    36,    37,    11,    12,    13,
                    441:     14,    15,    16,    17,    18,    19,    20,    -1,    -1,    -1,
                    442:     -1,    25,    26,    27,    -1,    29,    30,    31,    -1,    33,
                    443:     34,    35,    36,    37,    13,    14,    -1,    -1,    -1,    -1,
                    444:     19,    20,    -1,    -1,    -1,    -1,    25,    -1,    -1,    -1,
                    445:     29,    30,    31,    -1,    33,    34,    35,    36,    37,    29,
                    446:     30,    31,    -1,    33,    34,    35,    36,    37,    30,    31,
                    447:     -1,    33,    34,    35,    36,    37,    33,    34,    35,    36,
                    448:     37
                    449: };
                    450: #define YYPURE 1
                    451: 
                    452: /* -*-C-*-  Note some compilers choke on comments on `#line' lines.  */
                    453: #line 3 "D:/cygwin/usr/share/bison.simple"
                    454: /* This file comes from bison-1.28.  */
                    455: 
                    456: /* Skeleton output parser for bison,
                    457:    Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
                    458: 
                    459:    This program is free software; you can redistribute it and/or modify
                    460:    it under the terms of the GNU General Public License as published by
                    461:    the Free Software Foundation; either version 2, or (at your option)
                    462:    any later version.
                    463: 
                    464:    This program is distributed in the hope that it will be useful,
                    465:    but WITHOUT ANY WARRANTY; without even the implied warranty of
                    466:    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                    467:    GNU General Public License for more details.
                    468: 
                    469:    You should have received a copy of the GNU General Public License
                    470:    along with this program; if not, write to the Free Software
                    471:    Foundation, Inc., 59 Temple Place - Suite 330,
                    472:    Boston, MA 02111-1307, USA.  */
                    473: 
                    474: /* As a special exception, when this file is copied by Bison into a
                    475:    Bison output file, you may use that output file without restriction.
                    476:    This special exception was added by the Free Software Foundation
                    477:    in version 1.24 of Bison.  */
                    478: 
                    479: /* This is the parser code that is written into each bison parser
                    480:   when the %semantic_parser declaration is not specified in the grammar.
                    481:   It was written by Richard Stallman by simplifying the hairy parser
                    482:   used when %semantic_parser is specified.  */
                    483: 
                    484: #ifndef YYSTACK_USE_ALLOCA
                    485: #ifdef alloca
                    486: #define YYSTACK_USE_ALLOCA
                    487: #else /* alloca not defined */
                    488: #ifdef __GNUC__
                    489: #define YYSTACK_USE_ALLOCA
                    490: #define alloca __builtin_alloca
                    491: #else /* not GNU C.  */
                    492: #if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386))
                    493: #define YYSTACK_USE_ALLOCA
                    494: #include <alloca.h>
                    495: #else /* not sparc */
                    496: /* We think this test detects Watcom and Microsoft C.  */
                    497: /* This used to test MSDOS, but that is a bad idea
                    498:    since that symbol is in the user namespace.  */
                    499: #if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__)
                    500: #if 0 /* No need for malloc.h, which pollutes the namespace;
                    501:         instead, just don't use alloca.  */
                    502: #include <malloc.h>
                    503: #endif
                    504: #else /* not MSDOS, or __TURBOC__ */
                    505: #if defined(_AIX)
                    506: /* I don't know what this was needed for, but it pollutes the namespace.
                    507:    So I turned it off.   rms, 2 May 1997.  */
                    508: /* #include <malloc.h>  */
                    509:  #pragma alloca
                    510: #define YYSTACK_USE_ALLOCA
                    511: #else /* not MSDOS, or __TURBOC__, or _AIX */
                    512: #if 0
                    513: #ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up,
                    514:                 and on HPUX 10.  Eventually we can turn this on.  */
                    515: #define YYSTACK_USE_ALLOCA
                    516: #define alloca __builtin_alloca
                    517: #endif /* __hpux */
                    518: #endif
                    519: #endif /* not _AIX */
                    520: #endif /* not MSDOS, or __TURBOC__ */
                    521: #endif /* not sparc */
                    522: #endif /* not GNU C */
                    523: #endif /* alloca not defined */
                    524: #endif /* YYSTACK_USE_ALLOCA not defined */
                    525: 
                    526: #ifdef YYSTACK_USE_ALLOCA
                    527: #define YYSTACK_ALLOC alloca
                    528: #else
                    529: #define YYSTACK_ALLOC malloc
                    530: #endif
                    531: 
                    532: /* Note: there must be only one dollar sign in this file.
                    533:    It is replaced by the list of actions, each action
                    534:    as one case of the switch.  */
                    535: 
                    536: #define yyerrok                (yyerrstatus = 0)
                    537: #define yyclearin      (yychar = YYEMPTY)
                    538: #define YYEMPTY                -2
                    539: #define YYEOF          0
                    540: #define YYACCEPT       goto yyacceptlab
                    541: #define YYABORT        goto yyabortlab
                    542: #define YYERROR                goto yyerrlab1
                    543: /* Like YYERROR except do call yyerror.
                    544:    This remains here temporarily to ease the
                    545:    transition to the new meaning of YYERROR, for GCC.
                    546:    Once GCC version 2 has supplanted version 1, this can go.  */
                    547: #define YYFAIL         goto yyerrlab
                    548: #define YYRECOVERING()  (!!yyerrstatus)
                    549: #define YYBACKUP(token, value) \
                    550: do                                                             \
                    551:   if (yychar == YYEMPTY && yylen == 1)                         \
                    552:     { yychar = (token), yylval = (value);                      \
                    553:       yychar1 = YYTRANSLATE (yychar);                          \
                    554:       YYPOPSTACK;                                              \
                    555:       goto yybackup;                                           \
                    556:     }                                                          \
                    557:   else                                                         \
                    558:     { yyerror ("syntax error: cannot back up"); YYERROR; }     \
                    559: while (0)
                    560: 
                    561: #define YYTERROR       1
                    562: #define YYERRCODE      256
                    563: 
                    564: #ifndef YYPURE
                    565: #define YYLEX          yylex()
                    566: #endif
                    567: 
                    568: #ifdef YYPURE
                    569: #ifdef YYLSP_NEEDED
                    570: #ifdef YYLEX_PARAM
                    571: #define YYLEX          yylex(&yylval, &yylloc, YYLEX_PARAM)
                    572: #else
                    573: #define YYLEX          yylex(&yylval, &yylloc)
                    574: #endif
                    575: #else /* not YYLSP_NEEDED */
                    576: #ifdef YYLEX_PARAM
                    577: #define YYLEX          yylex(&yylval, YYLEX_PARAM)
                    578: #else
                    579: #define YYLEX          yylex(&yylval)
                    580: #endif
                    581: #endif /* not YYLSP_NEEDED */
                    582: #endif
                    583: 
                    584: /* If nonreentrant, generate the variables here */
                    585: 
                    586: #ifndef YYPURE
                    587: 
                    588: int    yychar;                 /*  the lookahead symbol                */
                    589: YYSTYPE        yylval;                 /*  the semantic value of the           */
                    590:                                /*  lookahead symbol                    */
                    591: 
                    592: #ifdef YYLSP_NEEDED
                    593: YYLTYPE yylloc;                        /*  location data for the lookahead     */
                    594:                                /*  symbol                              */
                    595: #endif
                    596: 
                    597: int yynerrs;                   /*  number of parse errors so far       */
                    598: #endif  /* not YYPURE */
                    599: 
                    600: #if YYDEBUG != 0
                    601: int yydebug;                   /*  nonzero means print parse trace     */
                    602: /* Since this is uninitialized, it does not stop multiple parsers
                    603:    from coexisting.  */
                    604: #endif
                    605: 
                    606: /*  YYINITDEPTH indicates the initial size of the parser's stacks      */
                    607: 
                    608: #ifndef        YYINITDEPTH
                    609: #define YYINITDEPTH 200
                    610: #endif
                    611: 
                    612: /*  YYMAXDEPTH is the maximum size the stacks can grow to
                    613:     (effective only if the built-in stack extension method is used).  */
                    614: 
                    615: #if YYMAXDEPTH == 0
                    616: #undef YYMAXDEPTH
                    617: #endif
                    618: 
                    619: #ifndef YYMAXDEPTH
                    620: #define YYMAXDEPTH 10000
                    621: #endif
                    622: 
                    623: /* Define __yy_memcpy.  Note that the size argument
                    624:    should be passed with type unsigned int, because that is what the non-GCC
                    625:    definitions require.  With GCC, __builtin_memcpy takes an arg
                    626:    of type size_t, but it can handle unsigned int.  */
                    627: 
                    628: #if __GNUC__ > 1               /* GNU C and GNU C++ define this.  */
                    629: #define __yy_memcpy(TO,FROM,COUNT)     __builtin_memcpy(TO,FROM,COUNT)
                    630: #else                          /* not GNU C or C++ */
                    631: #ifndef __cplusplus
                    632: 
                    633: /* This is the most reliable way to avoid incompatibilities
                    634:    in available built-in functions on various systems.  */
                    635: static void
                    636: __yy_memcpy (to, from, count)
                    637:      char *to;
                    638:      char *from;
                    639:      unsigned int count;
                    640: {
                    641:   register char *f = from;
                    642:   register char *t = to;
                    643:   register int i = count;
                    644: 
                    645:   while (i-- > 0)
                    646:     *t++ = *f++;
                    647: }
                    648: 
                    649: #else /* __cplusplus */
                    650: 
                    651: /* This is the most reliable way to avoid incompatibilities
                    652:    in available built-in functions on various systems.  */
                    653: static void
                    654: __yy_memcpy (char *to, char *from, unsigned int count)
                    655: {
                    656:   register char *t = to;
                    657:   register char *f = from;
                    658:   register int i = count;
                    659: 
                    660:   while (i-- > 0)
                    661:     *t++ = *f++;
                    662: }
                    663: 
                    664: #endif
                    665: #endif
                    666: 
                    667: #line 217 "D:/cygwin/usr/share/bison.simple"
                    668: 
                    669: /* The user can define YYPARSE_PARAM as the name of an argument to be passed
                    670:    into yyparse.  The argument should have type void *.
                    671:    It should actually point to an object.
                    672:    Grammar actions can access the variable by casting it
                    673:    to the proper pointer type.  */
                    674: 
                    675: #ifdef YYPARSE_PARAM
                    676: #ifdef __cplusplus
                    677: #define YYPARSE_PARAM_ARG void *YYPARSE_PARAM
                    678: #define YYPARSE_PARAM_DECL
                    679: #else /* not __cplusplus */
                    680: #define YYPARSE_PARAM_ARG YYPARSE_PARAM
                    681: #define YYPARSE_PARAM_DECL void *YYPARSE_PARAM;
                    682: #endif /* not __cplusplus */
                    683: #else /* not YYPARSE_PARAM */
                    684: #define YYPARSE_PARAM_ARG
                    685: #define YYPARSE_PARAM_DECL
                    686: #endif /* not YYPARSE_PARAM */
                    687: 
                    688: /* Prevent warning if -Wstrict-prototypes.  */
                    689: #ifdef __GNUC__
                    690: #ifdef YYPARSE_PARAM
                    691: int yyparse (void *);
                    692: #else
                    693: int yyparse (void);
                    694: #endif
                    695: #endif
                    696: 
                    697: int
                    698: yyparse(YYPARSE_PARAM_ARG)
                    699:      YYPARSE_PARAM_DECL
                    700: {
                    701:   register int yystate;
                    702:   register int yyn;
                    703:   register short *yyssp;
                    704:   register YYSTYPE *yyvsp;
                    705:   int yyerrstatus;     /*  number of tokens to shift before error messages enabled */
                    706:   int yychar1 = 0;             /*  lookahead token as an internal (translated) token number */
                    707: 
                    708:   short        yyssa[YYINITDEPTH];     /*  the state stack                     */
                    709:   YYSTYPE yyvsa[YYINITDEPTH];  /*  the semantic value stack            */
                    710: 
                    711:   short *yyss = yyssa;         /*  refer to the stacks thru separate pointers */
                    712:   YYSTYPE *yyvs = yyvsa;       /*  to allow yyoverflow to reallocate them elsewhere */
                    713: 
                    714: #ifdef YYLSP_NEEDED
                    715:   YYLTYPE yylsa[YYINITDEPTH];  /*  the location stack                  */
                    716:   YYLTYPE *yyls = yylsa;
                    717:   YYLTYPE *yylsp;
                    718: 
                    719: #define YYPOPSTACK   (yyvsp--, yyssp--, yylsp--)
                    720: #else
                    721: #define YYPOPSTACK   (yyvsp--, yyssp--)
                    722: #endif
                    723: 
                    724:   int yystacksize = YYINITDEPTH;
                    725:   int yyfree_stacks = 0;
                    726: 
                    727: #ifdef YYPURE
                    728:   int yychar;
                    729:   YYSTYPE yylval;
                    730:   int yynerrs;
                    731: #ifdef YYLSP_NEEDED
                    732:   YYLTYPE yylloc;
                    733: #endif
                    734: #endif
                    735: 
                    736:   YYSTYPE yyval;               /*  the variable used to return         */
                    737:                                /*  semantic values from the action     */
                    738:                                /*  routines                            */
                    739: 
                    740:   int yylen;
                    741: 
                    742: #if YYDEBUG != 0
                    743:   if (yydebug)
                    744:     fprintf(stderr, "Starting parse\n");
                    745: #endif
                    746: 
                    747:   yystate = 0;
                    748:   yyerrstatus = 0;
                    749:   yynerrs = 0;
                    750:   yychar = YYEMPTY;            /* Cause a token to be read.  */
                    751: 
                    752:   /* Initialize stack pointers.
                    753:      Waste one element of value and location stack
                    754:      so that they stay on the same level as the state stack.
                    755:      The wasted elements are never initialized.  */
                    756: 
                    757:   yyssp = yyss - 1;
                    758:   yyvsp = yyvs;
                    759: #ifdef YYLSP_NEEDED
                    760:   yylsp = yyls;
                    761: #endif
                    762: 
                    763: /* Push a new state, which is found in  yystate  .  */
                    764: /* In all cases, when you get here, the value and location stacks
                    765:    have just been pushed. so pushing a state here evens the stacks.  */
                    766: yynewstate:
                    767: 
                    768:   *++yyssp = yystate;
                    769: 
                    770:   if (yyssp >= yyss + yystacksize - 1)
                    771:     {
                    772:       /* Give user a chance to reallocate the stack */
                    773:       /* Use copies of these so that the &'s don't force the real ones into memory. */
                    774:       YYSTYPE *yyvs1 = yyvs;
                    775:       short *yyss1 = yyss;
                    776: #ifdef YYLSP_NEEDED
                    777:       YYLTYPE *yyls1 = yyls;
                    778: #endif
                    779: 
                    780:       /* Get the current used size of the three stacks, in elements.  */
                    781:       int size = yyssp - yyss + 1;
                    782: 
                    783: #ifdef yyoverflow
                    784:       /* Each stack pointer address is followed by the size of
                    785:         the data in use in that stack, in bytes.  */
                    786: #ifdef YYLSP_NEEDED
                    787:       /* This used to be a conditional around just the two extra args,
                    788:         but that might be undefined if yyoverflow is a macro.  */
                    789:       yyoverflow("parser stack overflow",
                    790:                 &yyss1, size * sizeof (*yyssp),
                    791:                 &yyvs1, size * sizeof (*yyvsp),
                    792:                 &yyls1, size * sizeof (*yylsp),
                    793:                 &yystacksize);
                    794: #else
                    795:       yyoverflow("parser stack overflow",
                    796:                 &yyss1, size * sizeof (*yyssp),
                    797:                 &yyvs1, size * sizeof (*yyvsp),
                    798:                 &yystacksize);
                    799: #endif
                    800: 
                    801:       yyss = yyss1; yyvs = yyvs1;
                    802: #ifdef YYLSP_NEEDED
                    803:       yyls = yyls1;
                    804: #endif
                    805: #else /* no yyoverflow */
                    806:       /* Extend the stack our own way.  */
                    807:       if (yystacksize >= YYMAXDEPTH)
                    808:        {
                    809:          yyerror("parser stack overflow");
                    810:          if (yyfree_stacks)
                    811:            {
                    812:              free (yyss);
                    813:              free (yyvs);
                    814: #ifdef YYLSP_NEEDED
                    815:              free (yyls);
                    816: #endif
                    817:            }
                    818:          return 2;
                    819:        }
                    820:       yystacksize *= 2;
                    821:       if (yystacksize > YYMAXDEPTH)
                    822:        yystacksize = YYMAXDEPTH;
                    823: #ifndef YYSTACK_USE_ALLOCA
                    824:       yyfree_stacks = 1;
                    825: #endif
                    826:       yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp));
                    827:       __yy_memcpy ((char *)yyss, (char *)yyss1,
                    828:                   size * (unsigned int) sizeof (*yyssp));
                    829:       yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp));
                    830:       __yy_memcpy ((char *)yyvs, (char *)yyvs1,
                    831:                   size * (unsigned int) sizeof (*yyvsp));
                    832: #ifdef YYLSP_NEEDED
                    833:       yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp));
                    834:       __yy_memcpy ((char *)yyls, (char *)yyls1,
                    835:                   size * (unsigned int) sizeof (*yylsp));
                    836: #endif
                    837: #endif /* no yyoverflow */
                    838: 
                    839:       yyssp = yyss + size - 1;
                    840:       yyvsp = yyvs + size - 1;
                    841: #ifdef YYLSP_NEEDED
                    842:       yylsp = yyls + size - 1;
                    843: #endif
                    844: 
                    845: #if YYDEBUG != 0
                    846:       if (yydebug)
                    847:        fprintf(stderr, "Stack size increased to %d\n", yystacksize);
                    848: #endif
                    849: 
                    850:       if (yyssp >= yyss + yystacksize - 1)
                    851:        YYABORT;
                    852:     }
                    853: 
                    854: #if YYDEBUG != 0
                    855:   if (yydebug)
                    856:     fprintf(stderr, "Entering state %d\n", yystate);
                    857: #endif
                    858: 
                    859:   goto yybackup;
                    860:  yybackup:
                    861: 
                    862: /* Do appropriate processing given the current state.  */
                    863: /* Read a lookahead token if we need one and don't already have one.  */
                    864: /* yyresume: */
                    865: 
                    866:   /* First try to decide what to do without reference to lookahead token.  */
                    867: 
                    868:   yyn = yypact[yystate];
                    869:   if (yyn == YYFLAG)
                    870:     goto yydefault;
                    871: 
                    872:   /* Not known => get a lookahead token if don't already have one.  */
                    873: 
                    874:   /* yychar is either YYEMPTY or YYEOF
                    875:      or a valid token in external form.  */
                    876: 
                    877:   if (yychar == YYEMPTY)
                    878:     {
                    879: #if YYDEBUG != 0
                    880:       if (yydebug)
                    881:        fprintf(stderr, "Reading a token: ");
                    882: #endif
                    883:       yychar = YYLEX;
                    884:     }
                    885: 
                    886:   /* Convert token to internal form (in yychar1) for indexing tables with */
                    887: 
                    888:   if (yychar <= 0)             /* This means end of input. */
                    889:     {
                    890:       yychar1 = 0;
                    891:       yychar = YYEOF;          /* Don't call YYLEX any more */
                    892: 
                    893: #if YYDEBUG != 0
                    894:       if (yydebug)
                    895:        fprintf(stderr, "Now at end of input.\n");
                    896: #endif
                    897:     }
                    898:   else
                    899:     {
                    900:       yychar1 = YYTRANSLATE(yychar);
                    901: 
                    902: #if YYDEBUG != 0
                    903:       if (yydebug)
                    904:        {
                    905:          fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
                    906:          /* Give the individual parser a way to print the precise meaning
                    907:             of a token, for further debugging info.  */
                    908: #ifdef YYPRINT
                    909:          YYPRINT (stderr, yychar, yylval);
                    910: #endif
                    911:          fprintf (stderr, ")\n");
                    912:        }
                    913: #endif
                    914:     }
                    915: 
                    916:   yyn += yychar1;
                    917:   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
                    918:     goto yydefault;
                    919: 
                    920:   yyn = yytable[yyn];
                    921: 
                    922:   /* yyn is what to do for this token type in this state.
                    923:      Negative => reduce, -yyn is rule number.
                    924:      Positive => shift, yyn is new state.
                    925:        New state is final state => don't bother to shift,
                    926:        just return success.
                    927:      0, or most negative number => error.  */
                    928: 
                    929:   if (yyn < 0)
                    930:     {
                    931:       if (yyn == YYFLAG)
                    932:        goto yyerrlab;
                    933:       yyn = -yyn;
                    934:       goto yyreduce;
                    935:     }
                    936:   else if (yyn == 0)
                    937:     goto yyerrlab;
                    938: 
                    939:   if (yyn == YYFINAL)
                    940:     YYACCEPT;
                    941: 
                    942:   /* Shift the lookahead token.  */
                    943: 
                    944: #if YYDEBUG != 0
                    945:   if (yydebug)
                    946:     fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
                    947: #endif
                    948: 
                    949:   /* Discard the token being shifted unless it is eof.  */
                    950:   if (yychar != YYEOF)
                    951:     yychar = YYEMPTY;
                    952: 
                    953:   *++yyvsp = yylval;
                    954: #ifdef YYLSP_NEEDED
                    955:   *++yylsp = yylloc;
                    956: #endif
                    957: 
                    958:   /* count tokens shifted since error; after three, turn off error status.  */
                    959:   if (yyerrstatus) yyerrstatus--;
                    960: 
                    961:   yystate = yyn;
                    962:   goto yynewstate;
                    963: 
                    964: /* Do the default action for the current state.  */
                    965: yydefault:
                    966: 
                    967:   yyn = yydefact[yystate];
                    968:   if (yyn == 0)
                    969:     goto yyerrlab;
                    970: 
                    971: /* Do a reduction.  yyn is the number of a rule to reduce with.  */
                    972: yyreduce:
                    973:   yylen = yyr2[yyn];
                    974:   if (yylen > 0)
                    975:     yyval = yyvsp[1-yylen]; /* implement default value of the action */
                    976: 
                    977: #if YYDEBUG != 0
                    978:   if (yydebug)
                    979:     {
                    980:       int i;
                    981: 
                    982:       fprintf (stderr, "Reducing via rule %d (line %d), ",
                    983:               yyn, yyrline[yyn]);
                    984: 
                    985:       /* Print the symbols being reduced, and their result.  */
                    986:       for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
                    987:        fprintf (stderr, "%s ", yytname[yyrhs[i]]);
                    988:       fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
                    989:     }
                    990: #endif
                    991: 
                    992: 
                    993:   switch (yyn) {
                    994: 
                    995: case 1:
                    996: #line 107 "compile.y"
                    997: {
                    998:        Method& method=*NEW Method(POOL, 
                    999:                *main_method_name, 
                   1000:                Method::CT_ANY,
                   1001:                0, 0, /*min, max numbered_params_count*/
                   1002:                0/*param_names*/, 0/*local_names*/, 
                   1003:                yyvsp[0]/*parser_code*/, 0/*native_code*/);
                   1004:        PC.cclass->add_method(*main_method_name, method);
                   1005: ;
                   1006:     break;}
                   1007: case 8:
                   1008: #line 124 "compile.y"
                   1009: {
                   1010:        const String& command=*LA2S(yyvsp[-2]);
                   1011:        YYSTYPE strings_code=yyvsp[0];
                   1012:        if(strings_code->size()<1*2) {
                   1013:                strcpy(PC.error, "@");
                   1014:                strcat(PC.error, command.cstr());
                   1015:                strcat(PC.error, " is empty");
                   1016:                YYERROR;
                   1017:        }
                   1018:        if(command==CLASS_NAME) {
                   1019:                if(PC.cclass->base()) { // already changed from default?
                   1020:                        strcpy(PC.error, "class already have a name '");
                   1021:                        strncat(PC.error, PC.cclass->name().cstr(), 100);
                   1022:                        strcat(PC.error, "'");
                   1023:                        YYERROR;
                   1024:                }
                   1025:                if(strings_code->size()==1*2) {
                   1026:                        // new class' name
                   1027:                        const String *name=LA2S(strings_code);
                   1028:                        // creating the class
                   1029:                        PC.cclass=NEW VClass(POOL);
                   1030:                        PC.cclass->set_name(*name);
                   1031:                        // append to request's classes
                   1032:                        PC.request->classes().put(*name, PC.cclass);
                   1033:                } else {
                   1034:                        strcpy(PC.error, "@"CLASS_NAME" must contain sole name");
                   1035:                        YYERROR;
                   1036:                }
                   1037:        } else if(command==USE_CONTROL_METHOD_NAME) {
                   1038:                for(int i=0; i<strings_code->size(); i+=2) 
1.2     ! parser   1039:                        PC.request->use_file(*LA2S(strings_code, i));
1.1       parser   1040:        } else if(command==BASE_NAME) {
                   1041:                if(PC.cclass->base()) { // already changed from default?
                   1042:                        strcpy(PC.error, "class already have a base '");
                   1043:                        strncat(PC.error, PC.cclass->base()->name().cstr(), 100);
                   1044:                        strcat(PC.error, "'");
                   1045:                        YYERROR;
                   1046:                }
                   1047:                if(strings_code->size()==1*2) {
                   1048:                        const String& base_name=*LA2S(strings_code);
                   1049:                        VClass *base=static_cast<VClass *>(
                   1050:                                PC.request->classes().get(base_name));
                   1051:                        if(!base) {
                   1052:                                strcpy(PC.error, base_name.cstr());
                   1053:                                strcat(PC.error, ": undefined class in @"BASE_NAME);
                   1054:                                YYERROR;
                   1055:                        }
                   1056:                        // @CLASS == @BASE sanity check
                   1057:                        if(PC.cclass==base) {
                   1058:                                strcpy(PC.error, "@"CLASS_NAME" equals @"BASE_NAME);
                   1059:                                YYERROR;
                   1060:                        }
                   1061:                        PC.cclass->set_base(*base);
                   1062:                } else {
                   1063:                        strcpy(PC.error, "@"BASE_NAME" must contain sole name");
                   1064:                        YYERROR;
                   1065:                }
                   1066:        } else {
                   1067:                strcpy(PC.error, "'");
                   1068:                strncat(PC.error, command.cstr(), MAX_STRING/2);
                   1069:                strcat(PC.error, "' invalid special name. valid names are "
                   1070:                        "'"CLASS_NAME"', '"USE_CONTROL_METHOD_NAME"' and '"BASE_NAME"'");
                   1071:                YYERROR;
                   1072:        }
                   1073: ;
                   1074:     break;}
                   1075: case 12:
1.2     ! parser   1076: #line 190 "compile.y"
1.1       parser   1077: { yyval=yyvsp[-1]; P(yyval, yyvsp[0]) ;
                   1078:     break;}
                   1079: case 16:
1.2     ! parser   1080: #line 195 "compile.y"
1.1       parser   1081: {
                   1082:        const String *name=LA2S(yyvsp[-5]);
                   1083: 
                   1084:        YYSTYPE params_names_code=yyvsp[-4];
                   1085:        Array *params_names=0;
                   1086:        if(int size=params_names_code->size()) {
                   1087:                params_names=NEW Array(POOL);
                   1088:                for(int i=0; i<size; i+=2)
                   1089:                        *params_names+=LA2S(params_names_code, i);
                   1090:        }
                   1091: 
                   1092:        YYSTYPE locals_names_code=yyvsp[-3];
                   1093:        Array *locals_names=0;
                   1094:        if(int size=locals_names_code->size()) {
                   1095:                locals_names=NEW Array(POOL);
                   1096:                for(int i=0; i<size; i+=2)
                   1097:                        *locals_names+=LA2S(locals_names_code, i);
                   1098:        }
                   1099: 
                   1100:        Method& method=*NEW Method(POOL, 
                   1101:                *name, 
                   1102:                Method::CT_ANY,
                   1103:                0, 0/*min,max numbered_params_count*/, 
                   1104:                params_names, locals_names, 
                   1105:                yyvsp[0], 0);
                   1106:        PC.cclass->add_method(*name, method);
                   1107: ;
                   1108:     break;}
                   1109: case 19:
1.2     ! parser   1110: #line 224 "compile.y"
1.1       parser   1111: {yyval=yyvsp[-1];
                   1112:     break;}
                   1113: case 23:
1.2     ! parser   1114: #line 226 "compile.y"
1.1       parser   1115: { yyval=yyvsp[-2]; P(yyval, yyvsp[0]) ;
                   1116:     break;}
                   1117: case 29:
1.2     ! parser   1118: #line 234 "compile.y"
1.1       parser   1119: { yyval=yyvsp[-1]; P(yyval, yyvsp[0]) ;
                   1120:     break;}
                   1121: case 35:
1.2     ! parser   1122: #line 240 "compile.y"
1.1       parser   1123: {
                   1124:        yyval=yyvsp[0]; /* stack: resulting value */
                   1125:        O(yyval, OP_WRITE_VALUE); /* value=pop; wcontext.write(value) */
                   1126: ;
                   1127:     break;}
                   1128: case 36:
1.2     ! parser   1129: #line 244 "compile.y"
1.1       parser   1130: { yyval=yyvsp[0] ;
                   1131:     break;}
                   1132: case 39:
1.2     ! parser   1133: #line 246 "compile.y"
1.1       parser   1134: { yyval=yyvsp[-1] ;
                   1135:     break;}
                   1136: case 42:
1.2     ! parser   1137: #line 250 "compile.y"
1.1       parser   1138: {
                   1139:        yyval=N(POOL); 
                   1140:        Array *diving_code=yyvsp[0];
                   1141:        const String *first_name=LA2S(diving_code);
                   1142:        if(first_name && *first_name==SELF_ELEMENT_NAME) {
                   1143:                O(yyval, OP_WITH_SELF); /* stack: starting context */
                   1144:                P(yyval, diving_code, 
                   1145:                        /* skip over... */
                   1146:                        diving_code->size()>2?3/*OP_+string+get_element*/:2/*OP_+string*/);
                   1147:        } else {
                   1148:                O(yyval, OP_WITH_READ); /* stack: starting context */
                   1149:                P(yyval, diving_code);
                   1150:        }
                   1151:        /* diving code; stack: current context */
                   1152: ;
                   1153:     break;}
                   1154: case 43:
1.2     ! parser   1155: #line 265 "compile.y"
1.1       parser   1156: { yyval=yyvsp[-1]; P(yyval, yyvsp[0]) ;
                   1157:     break;}
                   1158: case 45:
1.2     ! parser   1159: #line 266 "compile.y"
1.1       parser   1160: { yyval=yyvsp[-1]; P(yyval, yyvsp[0]) ;
                   1161:     break;}
                   1162: case 46:
1.2     ! parser   1163: #line 270 "compile.y"
1.1       parser   1164: {
                   1165:        yyval=yyvsp[-1]; /* stack: context,name */
                   1166:        P(yyval, yyvsp[0]); /* stack: context,name,constructor_value */
                   1167: ;
                   1168:     break;}
                   1169: case 50:
1.2     ! parser   1170: #line 278 "compile.y"
1.1       parser   1171: {
                   1172:        yyval=N(POOL);
                   1173:        Array *diving_code=yyvsp[0];
                   1174:        const String *first_name=LA2S(diving_code);
                   1175:        if(first_name && *first_name==SELF_ELEMENT_NAME) {
                   1176:                O(yyval, OP_WITH_SELF); /* stack: starting context */
                   1177:                P(yyval, diving_code, 
                   1178:                        /* skip over... */
                   1179:                        diving_code->size()>2?3/*OP_+string+get_element*/:2/*OP_+string*/);
                   1180:        } else {
                   1181:                O(yyval, OP_WITH_ROOT); /* stack: starting context */
                   1182:                P(yyval, diving_code);
                   1183:        }
                   1184:        /* diving code; stack: current context */
                   1185: ;
                   1186:     break;}
                   1187: case 51:
1.2     ! parser   1188: #line 293 "compile.y"
1.1       parser   1189: {
                   1190:        yyval=N(POOL); 
                   1191:        O(yyval, OP_WITH_WRITE); /* stack: starting context */
                   1192:        P(yyval, yyvsp[0]); /* diving code; stack: context,name */
                   1193: ;
                   1194:     break;}
                   1195: case 52:
1.2     ! parser   1196: #line 298 "compile.y"
1.1       parser   1197: { yyval=yyvsp[-1]; P(yyval, yyvsp[0]) ;
                   1198:     break;}
                   1199: case 56:
1.2     ! parser   1200: #line 305 "compile.y"
1.1       parser   1201: {
                   1202:        // stack: context, name
                   1203:        yyval=yyvsp[-1]; // stack: context, name, value
                   1204:        O(yyval, OP_CONSTRUCT_VALUE); /* value=pop; name=pop; context=pop; construct(context,name,value) */
                   1205: ;
                   1206:     break;}
                   1207: case 57:
1.2     ! parser   1208: #line 311 "compile.y"
1.1       parser   1209: { 
                   1210:        // stack: context, name
                   1211:        yyval=yyvsp[-1]; // stack: context, name, value
                   1212:        O(yyval, OP_CONSTRUCT_EXPR); /* value=pop; name=pop; context=pop; construct(context,name,value) */
                   1213: ;
                   1214:     break;}
                   1215: case 58:
1.2     ! parser   1216: #line 317 "compile.y"
1.1       parser   1217: {
                   1218:        // stack: context, name
                   1219:        yyval=N(POOL); 
                   1220:        CCA(yyval, yyvsp[-1]); /* code=pop; name=pop; context=pop; construct(context,name,junction(code)) */
                   1221: ;
                   1222:     break;}
                   1223: case 62:
1.2     ! parser   1224: #line 328 "compile.y"
1.1       parser   1225: {
                   1226:        yyval=N(POOL); 
                   1227:        O(yyval, OP_CREATE_EWPOOL); /* stack: empty write context */
                   1228:        P(yyval, yyvsp[0]); /* some code that writes to that context */
                   1229:        O(yyval, OP_REDUCE_EWPOOL); /* context=pop; stack: context.value() */
                   1230: ;
                   1231:     break;}
                   1232: case 65:
1.2     ! parser   1233: #line 335 "compile.y"
1.1       parser   1234: { yyval=yyvsp[-1]; P(yyval, yyvsp[0]) ;
                   1235:     break;}
                   1236: case 66:
1.2     ! parser   1237: #line 339 "compile.y"
1.1       parser   1238: {
                   1239:        yyval=yyvsp[0]; /* stack: value */
                   1240:        O(yyval, OP_WRITE_VALUE); /* value=pop; wcontext.write(value) */
                   1241: ;
                   1242:     break;}
                   1243: case 67:
1.2     ! parser   1244: #line 343 "compile.y"
1.1       parser   1245: { PC.object_constructor_allowed=true ;
                   1246:     break;}
                   1247: case 68:
1.2     ! parser   1248: #line 344 "compile.y"
1.1       parser   1249: { PC.object_constructor_allowed=false ;
                   1250:     break;}
                   1251: case 69:
1.2     ! parser   1252: #line 345 "compile.y"
1.1       parser   1253: { /* ^field.$method{vasya} */
                   1254:        yyval=yyvsp[-3]; /* with_xxx,diving code; stack: context,method_junction */
                   1255:        O(yyval, OP_GET_METHOD_FRAME); /* stack: context,method_frame */
                   1256: 
                   1257:        YYSTYPE params_code=yyvsp[-1];
                   1258:        if(params_code->size()==3) // probably [] case. [OP_VALUE + Void + STORE_PARAM]
                   1259:                if(Value *value=LA2V(params_code)) // it is OP_VALUE + value?
                   1260:                        if(!value->is_defined()) // value is VVoid?
                   1261:                                params_code=0; // ^zzz[] case. don't append lone empty param.
                   1262:        if(params_code)
                   1263:                P(yyval, params_code); // filling method_frame.store_params
                   1264:        O(yyval, OP_CALL); // method_frame=pop; ncontext=pop; call(ncontext,method_frame) stack: value
                   1265: ;
                   1266:     break;}
                   1267: case 72:
1.2     ! parser   1268: #line 361 "compile.y"
1.1       parser   1269: { yyval=yyvsp[-1]; P(yyval, yyvsp[0]) ;
                   1270:     break;}
                   1271: case 76:
1.2     ! parser   1272: #line 367 "compile.y"
1.1       parser   1273: {yyval=yyvsp[-1];
                   1274:     break;}
                   1275: case 77:
1.2     ! parser   1276: #line 368 "compile.y"
1.1       parser   1277: {yyval=yyvsp[-1];
                   1278:     break;}
                   1279: case 78:
1.2     ! parser   1280: #line 369 "compile.y"
1.1       parser   1281: {yyval=yyvsp[-1];
                   1282:     break;}
                   1283: case 80:
1.2     ! parser   1284: #line 372 "compile.y"
1.1       parser   1285: { yyval=yyvsp[-2]; P(yyval, yyvsp[0]) ;
                   1286:     break;}
                   1287: case 82:
1.2     ! parser   1288: #line 376 "compile.y"
1.1       parser   1289: { yyval=yyvsp[-2]; P(yyval, yyvsp[0]) ;
                   1290:     break;}
                   1291: case 84:
1.2     ! parser   1292: #line 380 "compile.y"
1.1       parser   1293: { yyval=yyvsp[-2]; P(yyval, yyvsp[0]) ;
                   1294:     break;}
                   1295: case 85:
1.2     ! parser   1296: #line 382 "compile.y"
1.1       parser   1297: {
                   1298:        yyval=yyvsp[0];
                   1299:        O(yyval, OP_STORE_PARAM);
                   1300: ;
                   1301:     break;}
                   1302: case 86:
1.2     ! parser   1303: #line 386 "compile.y"
1.1       parser   1304: {
                   1305:        yyval=N(POOL); 
                   1306:        PEA(yyval, yyvsp[0]);
                   1307: ;
                   1308:     break;}
                   1309: case 87:
1.2     ! parser   1310: #line 390 "compile.y"
1.1       parser   1311: {
                   1312:        yyval=N(POOL); 
                   1313:        PCA(yyval, yyvsp[0]);
                   1314: ;
                   1315:     break;}
                   1316: case 91:
1.2     ! parser   1317: #line 399 "compile.y"
1.1       parser   1318: {
                   1319:        yyval=yyvsp[0];
                   1320:        O(yyval, OP_WRITE_EXPR_RESULT);
                   1321: ;
                   1322:     break;}
                   1323: case 93:
1.2     ! parser   1324: #line 406 "compile.y"
1.1       parser   1325: { yyval=yyvsp[-1]; P(yyval, yyvsp[0]) ;
                   1326:     break;}
                   1327: case 95:
1.2     ! parser   1328: #line 408 "compile.y"
1.1       parser   1329: { yyval=yyvsp[-1]; P(yyval, yyvsp[0]) ;
                   1330:     break;}
                   1331: case 97:
1.2     ! parser   1332: #line 410 "compile.y"
1.1       parser   1333: {
                   1334:        /* stack: context */
                   1335:        yyval=yyvsp[0]; /* stack: context,name */
                   1336:        O(yyval, OP_GET_ELEMENT); /* name=pop; context=pop; stack: context.get_element(name) */
                   1337: ;
                   1338:     break;}
                   1339: case 98:
1.2     ! parser   1340: #line 415 "compile.y"
1.1       parser   1341: {
                   1342:        /* stack: context */
                   1343:        yyval=yyvsp[0]; /* stack: context,name */
                   1344:        O(yyval, OP_GET_ELEMENT); /* name=pop; context=pop; stack: context.get_element(name) */
                   1345: ;
                   1346:     break;}
                   1347: case 103:
1.2     ! parser   1348: #line 427 "compile.y"
1.1       parser   1349: {
                   1350:        yyval=yyvsp[0];
                   1351:        O(yyval, OP_GET_ELEMENT);
                   1352: ;
                   1353:     break;}
                   1354: case 104:
1.2     ! parser   1355: #line 431 "compile.y"
1.1       parser   1356: {
                   1357:        yyval=N(POOL); 
                   1358:        O(yyval, OP_CREATE_EWPOOL);
                   1359:        P(yyval, yyvsp[-1]);
                   1360:        O(yyval, OP_WRITE_VALUE);
                   1361:        P(yyval, yyvsp[0]);
                   1362:        O(yyval, OP_REDUCE_EWPOOL);
                   1363: ;
                   1364:     break;}
                   1365: case 105:
1.2     ! parser   1366: #line 439 "compile.y"
1.1       parser   1367: {
                   1368:        yyval=N(POOL); 
                   1369:        O(yyval, OP_WITH_READ);
                   1370:        P(yyval, yyvsp[0]);
                   1371: ;
                   1372:     break;}
                   1373: case 107:
1.2     ! parser   1374: #line 444 "compile.y"
1.1       parser   1375: { yyval=yyvsp[-1]; P(yyval, yyvsp[0]) ;
                   1376:     break;}
                   1377: case 108:
1.2     ! parser   1378: #line 445 "compile.y"
1.1       parser   1379: {
                   1380:        yyval=yyvsp[0];
                   1381:        O(yyval, OP_GET_ELEMENT__WRITE);
                   1382: ;
                   1383:     break;}
                   1384: case 111:
1.2     ! parser   1385: #line 454 "compile.y"
1.1       parser   1386: {
                   1387:        yyval=yyvsp[-1]; // stack: class name string
                   1388:        O(yyval, OP_GET_CLASS);
                   1389: ;
                   1390:     break;}
                   1391: case 112:
1.2     ! parser   1392: #line 458 "compile.y"
1.1       parser   1393: {
                   1394:        yyval=yyvsp[-1];
                   1395:        if(!PC.object_constructor_allowed) {
                   1396:                strcpy(PC.error, ":: not allowed here");
                   1397:                YYERROR;
                   1398:        }
                   1399:        O(yyval, OP_PREPARE_TO_CONSTRUCT_OBJECT);
                   1400: ;
                   1401:     break;}
                   1402: case 113:
1.2     ! parser   1403: #line 470 "compile.y"
1.1       parser   1404: {
                   1405:        if((yyval=yyvsp[0])->size()==2) // only one string literal in there?
                   1406:                change_string_literal_to_double_literal(yyval); // make that string literal Double
                   1407: ;
                   1408:     break;}
                   1409: case 117:
1.2     ! parser   1410: #line 478 "compile.y"
1.1       parser   1411: { yyval = yyvsp[-1]; ;
                   1412:     break;}
                   1413: case 118:
1.2     ! parser   1414: #line 479 "compile.y"
1.1       parser   1415: { yyval = yyvsp[-1]; ;
                   1416:     break;}
                   1417: case 119:
1.2     ! parser   1418: #line 480 "compile.y"
1.1       parser   1419: { yyval = yyvsp[-1]; ;
                   1420:     break;}
                   1421: case 120:
1.2     ! parser   1422: #line 482 "compile.y"
1.1       parser   1423: { yyval=yyvsp[0];  O(yyval, OP_NEG) ;
                   1424:     break;}
                   1425: case 121:
1.2     ! parser   1426: #line 483 "compile.y"
1.1       parser   1427: { yyval=yyvsp[0];       O(yyval, OP_INV) ;
                   1428:     break;}
                   1429: case 122:
1.2     ! parser   1430: #line 484 "compile.y"
1.1       parser   1431: { yyval=yyvsp[0];  O(yyval, OP_NOT) ;
                   1432:     break;}
                   1433: case 123:
1.2     ! parser   1434: #line 485 "compile.y"
1.1       parser   1435: { yyval=yyvsp[0];  O(yyval, OP_DEF) ;
                   1436:     break;}
                   1437: case 124:
1.2     ! parser   1438: #line 486 "compile.y"
1.1       parser   1439: { yyval=yyvsp[0];  O(yyval, OP_IN) ;
                   1440:     break;}
                   1441: case 125:
1.2     ! parser   1442: #line 487 "compile.y"
1.1       parser   1443: { yyval=yyvsp[0];  O(yyval, OP_FEXISTS) ;
                   1444:     break;}
                   1445: case 126:
1.2     ! parser   1446: #line 488 "compile.y"
1.1       parser   1447: { yyval=yyvsp[0];  O(yyval, OP_DEXISTS) ;
                   1448:     break;}
                   1449: case 127:
1.2     ! parser   1450: #line 490 "compile.y"
1.1       parser   1451: {      yyval=yyvsp[-2];  P(yyval, yyvsp[0]);  O(yyval, OP_SUB) ;
                   1452:     break;}
                   1453: case 128:
1.2     ! parser   1454: #line 491 "compile.y"
1.1       parser   1455: { yyval=yyvsp[-2];  P(yyval, yyvsp[0]);  O(yyval, OP_ADD) ;
                   1456:     break;}
                   1457: case 129:
1.2     ! parser   1458: #line 492 "compile.y"
1.1       parser   1459: { yyval=yyvsp[-2];  P(yyval, yyvsp[0]);  O(yyval, OP_MUL) ;
                   1460:     break;}
                   1461: case 130:
1.2     ! parser   1462: #line 493 "compile.y"
1.1       parser   1463: { yyval=yyvsp[-2];  P(yyval, yyvsp[0]);  O(yyval, OP_DIV) ;
                   1464:     break;}
                   1465: case 131:
1.2     ! parser   1466: #line 494 "compile.y"
1.1       parser   1467: { yyval=yyvsp[-2];  P(yyval, yyvsp[0]);  O(yyval, OP_MOD) ;
                   1468:     break;}
                   1469: case 132:
1.2     ! parser   1470: #line 495 "compile.y"
1.1       parser   1471: { yyval=yyvsp[-2];     P(yyval, yyvsp[0]);  O(yyval, OP_BIN_AND) ;
                   1472:     break;}
                   1473: case 133:
1.2     ! parser   1474: #line 496 "compile.y"
1.1       parser   1475: { yyval=yyvsp[-2];  P(yyval, yyvsp[0]);  O(yyval, OP_BIN_OR) ;
                   1476:     break;}
                   1477: case 134:
1.2     ! parser   1478: #line 497 "compile.y"
1.1       parser   1479: { yyval=yyvsp[-2];  P(yyval, yyvsp[0]);  O(yyval, OP_BIN_XOR) ;
                   1480:     break;}
                   1481: case 135:
1.2     ! parser   1482: #line 498 "compile.y"
1.1       parser   1483: { yyval=yyvsp[-2];  P(yyval, yyvsp[0]);  O(yyval, OP_LOG_AND) ;
                   1484:     break;}
                   1485: case 136:
1.2     ! parser   1486: #line 499 "compile.y"
1.1       parser   1487: { yyval=yyvsp[-2];  P(yyval, yyvsp[0]);  O(yyval, OP_LOG_OR) ;
                   1488:     break;}
                   1489: case 137:
1.2     ! parser   1490: #line 500 "compile.y"
1.1       parser   1491: { yyval=yyvsp[-2];  P(yyval, yyvsp[0]);  O(yyval, OP_LOG_XOR) ;
                   1492:     break;}
                   1493: case 138:
1.2     ! parser   1494: #line 501 "compile.y"
1.1       parser   1495: { yyval=yyvsp[-2];  P(yyval, yyvsp[0]);  O(yyval, OP_NUM_LT) ;
                   1496:     break;}
                   1497: case 139:
1.2     ! parser   1498: #line 502 "compile.y"
1.1       parser   1499: { yyval=yyvsp[-2];  P(yyval, yyvsp[0]);  O(yyval, OP_NUM_GT) ;
                   1500:     break;}
                   1501: case 140:
1.2     ! parser   1502: #line 503 "compile.y"
1.1       parser   1503: { yyval=yyvsp[-2];  P(yyval, yyvsp[0]);  O(yyval, OP_NUM_LE) ;
                   1504:     break;}
                   1505: case 141:
1.2     ! parser   1506: #line 504 "compile.y"
1.1       parser   1507: { yyval=yyvsp[-2];  P(yyval, yyvsp[0]);  O(yyval, OP_NUM_GE) ;
                   1508:     break;}
                   1509: case 142:
1.2     ! parser   1510: #line 505 "compile.y"
1.1       parser   1511: { yyval=yyvsp[-2];  P(yyval, yyvsp[0]);  O(yyval, OP_NUM_EQ) ;
                   1512:     break;}
                   1513: case 143:
1.2     ! parser   1514: #line 506 "compile.y"
1.1       parser   1515: { yyval=yyvsp[-2];  P(yyval, yyvsp[0]);  O(yyval, OP_NUM_NE) ;
                   1516:     break;}
                   1517: case 144:
1.2     ! parser   1518: #line 507 "compile.y"
1.1       parser   1519: { yyval=yyvsp[-2];  P(yyval, yyvsp[0]);  O(yyval, OP_STR_LT) ;
                   1520:     break;}
                   1521: case 145:
1.2     ! parser   1522: #line 508 "compile.y"
1.1       parser   1523: { yyval=yyvsp[-2];  P(yyval, yyvsp[0]);  O(yyval, OP_STR_GT) ;
                   1524:     break;}
                   1525: case 146:
1.2     ! parser   1526: #line 509 "compile.y"
1.1       parser   1527: { yyval=yyvsp[-2];  P(yyval, yyvsp[0]);  O(yyval, OP_STR_LE) ;
                   1528:     break;}
                   1529: case 147:
1.2     ! parser   1530: #line 510 "compile.y"
1.1       parser   1531: { yyval=yyvsp[-2];  P(yyval, yyvsp[0]);  O(yyval, OP_STR_GE) ;
                   1532:     break;}
                   1533: case 148:
1.2     ! parser   1534: #line 511 "compile.y"
1.1       parser   1535: { yyval=yyvsp[-2];  P(yyval, yyvsp[0]);  O(yyval, OP_STR_EQ) ;
                   1536:     break;}
                   1537: case 149:
1.2     ! parser   1538: #line 512 "compile.y"
1.1       parser   1539: { yyval=yyvsp[-2];  P(yyval, yyvsp[0]);  O(yyval, OP_STR_NE) ;
                   1540:     break;}
                   1541: case 150:
1.2     ! parser   1542: #line 513 "compile.y"
1.1       parser   1543: { yyval=yyvsp[-2];  P(yyval, yyvsp[0]);  O(yyval, OP_IS) ;
                   1544:     break;}
                   1545: case 151:
1.2     ! parser   1546: #line 516 "compile.y"
1.1       parser   1547: {
                   1548:        yyval=N(POOL);
                   1549:        O(yyval, OP_CREATE_SWPOOL); /* stack: empty write context */
                   1550:        P(yyval, yyvsp[0]); /* some code that writes to that context */
                   1551:        O(yyval, OP_REDUCE_SWPOOL); /* context=pop; stack: context.get_string() */
                   1552: ;
                   1553:     break;}
                   1554: case 152:
1.2     ! parser   1555: #line 525 "compile.y"
1.1       parser   1556: {
                   1557:        // optimized from OP_STRING+OP_WRITE_VALUE to OP_STRING__WRITE
                   1558:        change_string_literal_to_write_string_literal(yyval=yyvsp[0])
                   1559: ;
                   1560:     break;}
                   1561: case 153:
1.2     ! parser   1562: #line 530 "compile.y"
1.1       parser   1563: { yyval=VL(NEW VVoid(POOL)) ;
                   1564:     break;}
                   1565: case 154:
1.2     ! parser   1566: #line 531 "compile.y"
1.1       parser   1567: { yyval=N(POOL) ;
                   1568:     break;}
                   1569: }
                   1570:    /* the action file gets copied in in place of this dollarsign */
                   1571: #line 543 "D:/cygwin/usr/share/bison.simple"
                   1572: 
                   1573:   yyvsp -= yylen;
                   1574:   yyssp -= yylen;
                   1575: #ifdef YYLSP_NEEDED
                   1576:   yylsp -= yylen;
                   1577: #endif
                   1578: 
                   1579: #if YYDEBUG != 0
                   1580:   if (yydebug)
                   1581:     {
                   1582:       short *ssp1 = yyss - 1;
                   1583:       fprintf (stderr, "state stack now");
                   1584:       while (ssp1 != yyssp)
                   1585:        fprintf (stderr, " %d", *++ssp1);
                   1586:       fprintf (stderr, "\n");
                   1587:     }
                   1588: #endif
                   1589: 
                   1590:   *++yyvsp = yyval;
                   1591: 
                   1592: #ifdef YYLSP_NEEDED
                   1593:   yylsp++;
                   1594:   if (yylen == 0)
                   1595:     {
                   1596:       yylsp->first_line = yylloc.first_line;
                   1597:       yylsp->first_column = yylloc.first_column;
                   1598:       yylsp->last_line = (yylsp-1)->last_line;
                   1599:       yylsp->last_column = (yylsp-1)->last_column;
                   1600:       yylsp->text = 0;
                   1601:     }
                   1602:   else
                   1603:     {
                   1604:       yylsp->last_line = (yylsp+yylen-1)->last_line;
                   1605:       yylsp->last_column = (yylsp+yylen-1)->last_column;
                   1606:     }
                   1607: #endif
                   1608: 
                   1609:   /* Now "shift" the result of the reduction.
                   1610:      Determine what state that goes to,
                   1611:      based on the state we popped back to
                   1612:      and the rule number reduced by.  */
                   1613: 
                   1614:   yyn = yyr1[yyn];
                   1615: 
                   1616:   yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
                   1617:   if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
                   1618:     yystate = yytable[yystate];
                   1619:   else
                   1620:     yystate = yydefgoto[yyn - YYNTBASE];
                   1621: 
                   1622:   goto yynewstate;
                   1623: 
                   1624: yyerrlab:   /* here on detecting error */
                   1625: 
                   1626:   if (! yyerrstatus)
                   1627:     /* If not already recovering from an error, report this error.  */
                   1628:     {
                   1629:       ++yynerrs;
                   1630: 
                   1631: #ifdef YYERROR_VERBOSE
                   1632:       yyn = yypact[yystate];
                   1633: 
                   1634:       if (yyn > YYFLAG && yyn < YYLAST)
                   1635:        {
                   1636:          int size = 0;
                   1637:          char *msg;
                   1638:          int x, count;
                   1639: 
                   1640:          count = 0;
                   1641:          /* Start X at -yyn if nec to avoid negative indexes in yycheck.  */
                   1642:          for (x = (yyn < 0 ? -yyn : 0);
                   1643:               x < (sizeof(yytname) / sizeof(char *)); x++)
                   1644:            if (yycheck[x + yyn] == x)
                   1645:              size += strlen(yytname[x]) + 15, count++;
                   1646:          msg = (char *) malloc(size + 15);
                   1647:          if (msg != 0)
                   1648:            {
                   1649:              strcpy(msg, "parse error");
                   1650: 
                   1651:              if (count < 5)
                   1652:                {
                   1653:                  count = 0;
                   1654:                  for (x = (yyn < 0 ? -yyn : 0);
                   1655:                       x < (sizeof(yytname) / sizeof(char *)); x++)
                   1656:                    if (yycheck[x + yyn] == x)
                   1657:                      {
                   1658:                        strcat(msg, count == 0 ? ", expecting `" : " or `");
                   1659:                        strcat(msg, yytname[x]);
                   1660:                        strcat(msg, "'");
                   1661:                        count++;
                   1662:                      }
                   1663:                }
                   1664:              yyerror(msg);
                   1665:              free(msg);
                   1666:            }
                   1667:          else
                   1668:            yyerror ("parse error; also virtual memory exceeded");
                   1669:        }
                   1670:       else
                   1671: #endif /* YYERROR_VERBOSE */
                   1672:        yyerror("parse error");
                   1673:     }
                   1674: 
                   1675:   goto yyerrlab1;
                   1676: yyerrlab1:   /* here on error raised explicitly by an action */
                   1677: 
                   1678:   if (yyerrstatus == 3)
                   1679:     {
                   1680:       /* if just tried and failed to reuse lookahead token after an error, discard it.  */
                   1681: 
                   1682:       /* return failure if at end of input */
                   1683:       if (yychar == YYEOF)
                   1684:        YYABORT;
                   1685: 
                   1686: #if YYDEBUG != 0
                   1687:       if (yydebug)
                   1688:        fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
                   1689: #endif
                   1690: 
                   1691:       yychar = YYEMPTY;
                   1692:     }
                   1693: 
                   1694:   /* Else will try to reuse lookahead token
                   1695:      after shifting the error token.  */
                   1696: 
                   1697:   yyerrstatus = 3;             /* Each real token shifted decrements this */
                   1698: 
                   1699:   goto yyerrhandle;
                   1700: 
                   1701: yyerrdefault:  /* current state does not do anything special for the error token. */
                   1702: 
                   1703: #if 0
                   1704:   /* This is wrong; only states that explicitly want error tokens
                   1705:      should shift them.  */
                   1706:   yyn = yydefact[yystate];  /* If its default is to accept any token, ok.  Otherwise pop it.*/
                   1707:   if (yyn) goto yydefault;
                   1708: #endif
                   1709: 
                   1710: yyerrpop:   /* pop the current state because it cannot handle the error token */
                   1711: 
                   1712:   if (yyssp == yyss) YYABORT;
                   1713:   yyvsp--;
                   1714:   yystate = *--yyssp;
                   1715: #ifdef YYLSP_NEEDED
                   1716:   yylsp--;
                   1717: #endif
                   1718: 
                   1719: #if YYDEBUG != 0
                   1720:   if (yydebug)
                   1721:     {
                   1722:       short *ssp1 = yyss - 1;
                   1723:       fprintf (stderr, "Error: state stack now");
                   1724:       while (ssp1 != yyssp)
                   1725:        fprintf (stderr, " %d", *++ssp1);
                   1726:       fprintf (stderr, "\n");
                   1727:     }
                   1728: #endif
                   1729: 
                   1730: yyerrhandle:
                   1731: 
                   1732:   yyn = yypact[yystate];
                   1733:   if (yyn == YYFLAG)
                   1734:     goto yyerrdefault;
                   1735: 
                   1736:   yyn += YYTERROR;
                   1737:   if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
                   1738:     goto yyerrdefault;
                   1739: 
                   1740:   yyn = yytable[yyn];
                   1741:   if (yyn < 0)
                   1742:     {
                   1743:       if (yyn == YYFLAG)
                   1744:        goto yyerrpop;
                   1745:       yyn = -yyn;
                   1746:       goto yyreduce;
                   1747:     }
                   1748:   else if (yyn == 0)
                   1749:     goto yyerrpop;
                   1750: 
                   1751:   if (yyn == YYFINAL)
                   1752:     YYACCEPT;
                   1753: 
                   1754: #if YYDEBUG != 0
                   1755:   if (yydebug)
                   1756:     fprintf(stderr, "Shifting error token, ");
                   1757: #endif
                   1758: 
                   1759:   *++yyvsp = yylval;
                   1760: #ifdef YYLSP_NEEDED
                   1761:   *++yylsp = yylloc;
                   1762: #endif
                   1763: 
                   1764:   yystate = yyn;
                   1765:   goto yynewstate;
                   1766: 
                   1767:  yyacceptlab:
                   1768:   /* YYACCEPT comes here.  */
                   1769:   if (yyfree_stacks)
                   1770:     {
                   1771:       free (yyss);
                   1772:       free (yyvs);
                   1773: #ifdef YYLSP_NEEDED
                   1774:       free (yyls);
                   1775: #endif
                   1776:     }
                   1777:   return 0;
                   1778: 
                   1779:  yyabortlab:
                   1780:   /* YYABORT comes here.  */
                   1781:   if (yyfree_stacks)
                   1782:     {
                   1783:       free (yyss);
                   1784:       free (yyvs);
                   1785: #ifdef YYLSP_NEEDED
                   1786:       free (yyls);
                   1787: #endif
                   1788:     }
                   1789:   return 1;
                   1790: }
1.2     ! parser   1791: #line 533 "compile.y"
1.1       parser   1792: 
                   1793: #endif
                   1794: 
                   1795: /*
                   1796:        000$111(2222)00 
                   1797:                000$111{3333}00
                   1798:        $,^: push,=0
                   1799:        1:( { break=pop
                   1800:        2:( )  pop
                   1801:        3:{ }  pop
                   1802: 
                   1803:        000^111(2222)4444{33333}4000
                   1804:        $,^: push,=0
                   1805:        1:( { break=pop
                   1806:        2:( )=4
                   1807:        3:{ }=4
                   1808:                4:[^({]=pop
                   1809: */
                   1810: 
                   1811: static int yylex(YYSTYPE *lvalp, void *pc) {
                   1812:        #define lexical_brackets_nestage PC.brackets_nestages[PC.sp]
                   1813:        #define RC {result=c; goto break2; }
                   1814: 
                   1815:     register int c;
                   1816:     int result;
                   1817:        
                   1818:        if(PC.pending_state) {
                   1819:                result=PC.pending_state;
                   1820:                PC.pending_state=0;
                   1821:                return result;
                   1822:        }
                   1823:        
                   1824:        const char *begin=PC.source;
                   1825:        const char *end;
                   1826:        int begin_line=PC.line;
                   1827:        int skip_analized=0;
                   1828:        while(true) {
                   1829:                c=*(end=(PC.source++));
                   1830: 
                   1831:                if(c=='\n') {
                   1832:                        PC.line++;
                   1833:                        PC.col=0;
                   1834:                } else
                   1835:                        PC.col++;
                   1836: 
                   1837:                if(c=='^' && PC.ls!=LS_COMMENT && PC.ls!=LS_DEF_COMMENT) 
                   1838:                        switch(*PC.source) {
                   1839:                        // escaping: ^^ & co
                   1840:                        case '^': case '$': case ';':
                   1841:                        case '(': case ')':
                   1842:                        case '[': case ']':
                   1843:                        case '{': case '}':
                   1844:                        case '"': 
                   1845:                                if(end!=begin) {
                   1846:                                        // append piece till ^
                   1847:                                        PC.string->APPEND_CLEAN(begin, end-begin, PC.file, begin_line);
                   1848:                                }
                   1849:                                // reset piece 'begin' position & line
                   1850:                                begin=PC.source; // ^
                   1851:                                begin_line=PC.line;
                   1852:                                // skip over ^ and _
                   1853:                                PC.source++;  PC.col++;
                   1854:                                // skip analysis = forced literal
                   1855:                                continue;
                   1856: 
                   1857:                        // converting ^#HH into char(hex(HH))
                   1858:                        case '#':
                   1859:                                if(end!=begin) {
                   1860:                                        // append piece till ^
                   1861:                                        PC.string->APPEND_CLEAN(begin, end-begin, PC.file, begin_line);
                   1862:                                }
                   1863:                                // #HH ?
                   1864:                                if(PC.source[0]=='#' && PC.source[1] && PC.source[2]) {
                   1865:                                        char *hex=(char *)POOL.malloc(1);
                   1866:                                        hex[0]=
                   1867:                                                hex_value[(unsigned char)PC.source[1]]*0x10+
                   1868:                                                hex_value[(unsigned char)PC.source[2]];
                   1869:                                        if(hex[0]==0) {
                   1870:                                                result=BAD_HEX_LITERAL;
                   1871:                                                goto break2; // wrong hex value[no ^#00 chars allowed]: bail out
                   1872:                                        }
                   1873:                                        // append char(hex(HH))
                   1874:                                        PC.string->APPEND_CLEAN(hex, 1, PC.file, begin_line);
                   1875:                                        // skip over ^#HH
                   1876:                                        PC.source+=3;
                   1877:                                        PC.col+=3;
                   1878:                                        // reset piece 'begin' position & line
                   1879:                                        begin=PC.source; // ^
                   1880:                                        begin_line=PC.line;
                   1881:                                        continue;
                   1882:                                }
                   1883:                                break;
                   1884:                        }
                   1885:                // #comment  start skipping
                   1886:                if(c=='#' && PC.col==1) {
                   1887:                        if(end!=begin) {
                   1888:                                // append piece till #
                   1889:                                PC.string->APPEND_CLEAN(begin, end-begin, PC.file, begin_line);
                   1890:                        }
                   1891:                        // fall into COMMENT lexical state [wait for \n]
                   1892:                        push_LS(PC, LS_COMMENT);
                   1893:                }
                   1894:                switch(PC.ls) {
                   1895: 
                   1896:                // USER'S = NOT OURS
                   1897:                case LS_USER:
                   1898:                        if(PC.trim_bof)
                   1899:                                switch(c) {
                   1900:                                case '\n': case ' ': case '\t':
                   1901:                                        begin=PC.source;
                   1902:                                        begin_line=PC.line;
                   1903:                                        continue; // skip it
                   1904:                                default:
                   1905:                                        PC.trim_bof=false;
                   1906:                                }
                   1907:                        switch(c) {
                   1908:                        case '$':
                   1909:                                push_LS(PC, LS_VAR_NAME_SIMPLE);
                   1910:                                RC;
                   1911:                        case '^':
                   1912:                                push_LS(PC, LS_METHOD_NAME);
                   1913:                                RC;
                   1914:                        case '@':
                   1915:                                if(PC.col==0+1) {
                   1916:                                        push_LS(PC, LS_DEF_NAME);
                   1917:                                        RC;
                   1918:                                }
                   1919:                                break;
                   1920:                        }
                   1921:                        break;
                   1922:                        
                   1923:                // #COMMENT
                   1924:                case LS_COMMENT:
                   1925:                        if(c=='\n') {
                   1926:                                // skip comment
                   1927:                                begin=PC.source;
                   1928:                                begin_line=PC.line;
                   1929: 
                   1930:                                pop_LS(PC);
                   1931:                                continue;
                   1932:                        }
                   1933:                        break;
                   1934:                        
                   1935:                // STRING IN EXPRESSION
                   1936:                case LS_EXPRESSION_STRING_QUOTED:
                   1937:                case LS_EXPRESSION_STRING_APOSTROFED:
                   1938:                        switch(c) {
                   1939:                        case '"':
                   1940:                        case '\'':
                   1941:                                if(
                   1942:                                        PC.ls == LS_EXPRESSION_STRING_QUOTED && c=='"' ||
                   1943:                                        PC.ls == LS_EXPRESSION_STRING_APOSTROFED && c=='\'') {
                   1944:                                        pop_LS(PC); //"abc". | 'abc'.
                   1945:                                        RC;
                   1946:                                }
                   1947:                                break;
                   1948:                        case '$':
                   1949:                                push_LS(PC, LS_VAR_NAME_SIMPLE);
                   1950:                                RC;
                   1951:                        case '^':
                   1952:                                push_LS(PC, LS_METHOD_NAME);
                   1953:                                RC;
                   1954:                        }
                   1955:                        break;
                   1956: 
                   1957:                // METHOD DEFINITION
                   1958:                case LS_DEF_NAME:
                   1959:                        switch(c) {
                   1960:                        case '[':
                   1961:                                PC.ls=LS_DEF_PARAMS;
                   1962:                                RC;
                   1963:                        case '\n':
                   1964:                                PC.ls=LS_DEF_SPECIAL_BODY;
                   1965:                                RC;
                   1966:                        }
                   1967:                        break;
                   1968: 
                   1969:                case LS_DEF_PARAMS:
                   1970:                        switch(c) {
                   1971:                        case ';':
                   1972:                                RC;
                   1973:                        case ']':
                   1974:                                PC.ls=*PC.source=='['?LS_DEF_LOCALS:LS_DEF_COMMENT;
                   1975:                                RC;
                   1976:                        case '\n': // wrong. bailing out
                   1977:                                pop_LS(PC);
                   1978:                                RC;
                   1979:                        }
                   1980:                        break;
                   1981: 
                   1982:                case LS_DEF_LOCALS:
                   1983:                        switch(c) {
                   1984:                        case '[':
                   1985:                        case ';':
                   1986:                                RC;
                   1987:                        case ']':
                   1988:                                PC.ls=LS_DEF_COMMENT;
                   1989:                                RC;
                   1990:                        case '\n': // wrong. bailing out
                   1991:                                pop_LS(PC);
                   1992:                                RC;
                   1993:                        }
                   1994:                        break;
                   1995: 
                   1996:                case LS_DEF_COMMENT:
                   1997:                        if(c=='\n') {
                   1998:                                pop_LS(PC);
                   1999:                                RC;
                   2000:                        }
                   2001:                        break;
                   2002: 
                   2003:                case LS_DEF_SPECIAL_BODY:
                   2004:                        //                          @todo in case
                   2005:                        // ################
                   2006:                        // @next-method
                   2007:                        // we are here with c=='@'
                   2008:                        // which is wrong, and need action
                   2009:                        if(c=='\n') {
                   2010:                                switch(*PC.source) {
                   2011:                                case '@': case 0: // end of special_code
                   2012:                                        pop_LS(PC);
                   2013:                                        break;
                   2014:                                }
                   2015:                                RC;
                   2016:                        }
                   2017:                        break;
                   2018: 
                   2019:                // (EXPRESSION)
                   2020:                case LS_VAR_ROUND:
                   2021:                case LS_METHOD_ROUND:
                   2022:                        switch(c) {
                   2023:                        case ')':
                   2024:                                if(--lexical_brackets_nestage==0)
                   2025:                                        if(PC.ls==LS_METHOD_ROUND) // method round param ended
                   2026:                                                PC.ls=LS_METHOD_AFTER; // look for method end
                   2027:                                        else // PC.ls==LS_VAR_ROUND // variable constructor ended
                   2028:                                                pop_LS(PC); // return to normal life
                   2029:                                RC;
                   2030:                        case '$':
                   2031:                                push_LS(PC, LS_EXPRESSION_VAR_NAME);                            
                   2032:                                RC;
                   2033:                        case '^':
                   2034:                                push_LS(PC, LS_METHOD_NAME);
                   2035:                                RC;
                   2036:                        case '(':
                   2037:                                lexical_brackets_nestage++;
                   2038:                                RC;
                   2039:                        case '-':
                   2040:                                switch(*PC.source) {
                   2041:                                case 'f': // -f
                   2042:                                        skip_analized=1;
                   2043:                                        result=FEXISTS;
                   2044:                                        goto break2;
                   2045:                                case 'd': // -d
                   2046:                                        skip_analized=1;
                   2047:                                        result=DEXISTS;
                   2048:                                        goto break2;
                   2049:                                default:
                   2050:                                        result=c;
                   2051:                                        goto break2;
                   2052:                                }
                   2053:                                goto break2;
                   2054:                        case '+': case '*': case '/': case '%': 
                   2055:                        case '~':
                   2056:                        case ';':
                   2057:                                RC;
                   2058:                        case '&': case '|':  case '#':
                   2059:                                if(*PC.source==c) { // && ||
                   2060:                                        result=c=='#'?LXOR:c=='&'?LAND:LOR;
                   2061:                                        skip_analized=1;
                   2062:                                } else
                   2063:                                        result=c;
                   2064:                                goto break2;
                   2065:                        case '<': case '>': case '=': case '!': 
                   2066:                                if(*PC.source=='=') { // <= >= == !=
                   2067:                                        skip_analized=1;
                   2068:                                        switch(c) {
                   2069:                                        case '<': result=NLE; break;
                   2070:                                        case '>': result=NGE; break;
                   2071:                                        case '=': result=NEQ; break;
                   2072:                                        case '!': result=NNE; break;
                   2073:                                        }
                   2074:                                } else
                   2075:                                        result=c;
                   2076:                                goto break2;
                   2077:                        case '"':
                   2078:                                push_LS(PC, LS_EXPRESSION_STRING_QUOTED);
                   2079:                                RC;
                   2080:                        case '\'':
                   2081:                                push_LS(PC, LS_EXPRESSION_STRING_APOSTROFED);
                   2082:                                RC;
                   2083:                        case 'l': case 'g': case 'e': case 'n':
                   2084:                                if(end==begin) // right after whitespace
                   2085:                                        if(isspace(PC.source[1])) {
                   2086:                                                switch(*PC.source) {
                   2087:                                                        //                                      case '?': // ok [and bad cases, yacc would bark at them]
                   2088:                                                case 't': // lt gt [et nt]
                   2089:                                                        result=c=='l'?SLT:c=='g'?SGT:BAD_STRING_COMPARISON_OPERATOR;
                   2090:                                                        skip_analized=1;
                   2091:                                                        goto break2;
                   2092:                                                case 'e': // le ge ne [ee]
                   2093:                                                        result=c=='l'?SLE:c=='g'?SGE:c=='n'?SNE:BAD_STRING_COMPARISON_OPERATOR;
                   2094:                                                        skip_analized=1;
                   2095:                                                        goto break2;
                   2096:                                                case 'q': // eq [lq gq nq]
                   2097:                                                        result=c=='e'?SEQ:BAD_STRING_COMPARISON_OPERATOR;
                   2098:                                                        skip_analized=1;
                   2099:                                                        goto break2;
                   2100:                                                }
                   2101:                                        }
                   2102:                                break;
                   2103:                        case 'i':
                   2104:                                if(end==begin) // right after whitespace
                   2105:                                        if(isspace(PC.source[1])) {
                   2106:                                                switch(PC.source[0]) {
                   2107:                                                case 'n': // in
                   2108:                                                        skip_analized=1;
                   2109:                                                        result=IN;
                   2110:                                                        goto break2;
                   2111:                                                case 's': // is
                   2112:                                                        skip_analized=1;
                   2113:                                                        result=IS;
                   2114:                                                        goto break2;
                   2115:                                                }
                   2116:                                        }
                   2117:                                break;
                   2118:                        case 'd':
                   2119:                                if(end==begin) // right after whitespace
                   2120:                                        if(PC.source[0]=='e' && PC.source[1]=='f') { // def
                   2121:                                                skip_analized=2;
                   2122:                                                result=DEF;
                   2123:                                                goto break2;
                   2124:                                        }
                   2125:                                break;
                   2126:                        case ' ': case '\t': case '\n':
                   2127:                                if(end!=begin) { // there were a string after previous operator?
                   2128:                                        result=0; // return that string
                   2129:                                        goto break2;
                   2130:                                }
                   2131:                                // that's a leading|traling space or after-operator-space
                   2132:                                // ignoring it
                   2133:                                // reset piece 'begin' position & line
                   2134:                                begin=PC.source; // after whitespace char
                   2135:                                begin_line=PC.line;
                   2136:                                continue;
                   2137:                        }
                   2138:                        break;
                   2139: 
                   2140:                // VARIABLE GET/PUT/WITH
                   2141:                case LS_VAR_NAME_SIMPLE:
                   2142:                case LS_EXPRESSION_VAR_NAME:
                   2143:                case LS_VAR_NAME_NO_COLON:
                   2144:                        if(PC.ls==LS_EXPRESSION_VAR_NAME) {
                   2145:                                // name in expr ends also before binary operators 
                   2146:                                switch(c) {
                   2147:                                case '-': 
                   2148:                                        pop_LS(PC);
                   2149:                                        PC.source--;  if(--PC.col<0) { PC.line--;  PC.col=-1; }
                   2150:                                        result=EON;
                   2151:                                        goto break2;
                   2152:                                }
                   2153:                        }
                   2154:                        if(PC.ls==LS_VAR_NAME_NO_COLON) {
                   2155:                                // name already has ':', stop before next 
                   2156:                                switch(c) {
                   2157:                                case ':': 
                   2158:                                        pop_LS(PC);
                   2159:                                        PC.source--;  if(--PC.col<0) { PC.line--;  PC.col=-1; }
                   2160:                                        result=EON;
                   2161:                                        goto break2;
                   2162:                                }
                   2163:                        }
                   2164:                        switch(c) {
                   2165:                        case 0:
                   2166:                        case ' ': case '\t': case '\n':
                   2167:                        case ';':
                   2168:                        case ']': case '}': case ')': 
                   2169:                        case '"': case '\'':
                   2170:                        case '<': case '>':  // these stand for HTML brackets AND expression binary ops
                   2171:                        case '+': case '*': case '/': case '%': 
                   2172:                        case '&': case '|': 
                   2173:                        case '=': case '!':
                   2174:                        // common delimiters
                   2175:                        case ',': case '?':
                   2176:                        // before call
                   2177:                        case '^': 
                   2178:                                pop_LS(PC);
                   2179:                                PC.source--;  if(--PC.col<0) { PC.line--;  PC.col=-1; }
                   2180:                                result=EON;
                   2181:                                goto break2;
                   2182:                        case '[':
                   2183:                                PC.ls=LS_VAR_SQUARE;
                   2184:                                lexical_brackets_nestage=1;
                   2185:                                RC;
                   2186:                        case '{':
                   2187:                                if(begin==end) { // ${name}, no need of EON, switching LS
                   2188:                                        PC.ls=LS_VAR_NAME_CURLY; 
                   2189:                                } else {
                   2190:                                        PC.ls=LS_VAR_CURLY;
                   2191:                                        lexical_brackets_nestage=1;
                   2192:                                }
                   2193: 
                   2194:                                RC;
                   2195:                        case '(':
                   2196:                                PC.ls=LS_VAR_ROUND;
                   2197:                                lexical_brackets_nestage=1;
                   2198:                                RC;
                   2199:                        case '.': // name part delim
                   2200:                        case '$': // name part subvar
                   2201:                        case ':': // ':name' or 'class:name'
                   2202:                                PC.ls=LS_VAR_NAME_NO_COLON; // stop before next ':'
                   2203:                                RC;
                   2204:                        }
                   2205:                        break;
                   2206: 
                   2207:                case LS_VAR_NAME_CURLY:
                   2208:                        switch(c) {
                   2209:                        case '}': // ${name} finished, restoring LS
                   2210:                                pop_LS(PC);
                   2211:                                RC;
                   2212:                        case '.': // name part delim
                   2213:                        case '$': // name part subvar
                   2214:                        case ':': // ':name' or 'class:name'
                   2215:                                RC;
                   2216:                        }
                   2217:                        break;
                   2218: 
                   2219:                case LS_VAR_SQUARE:
                   2220:                        switch(c) {
                   2221:                        case '$':
                   2222:                                push_LS(PC, LS_VAR_NAME_SIMPLE);
                   2223:                                RC;
                   2224:                        case '^':
                   2225:                                push_LS(PC, LS_METHOD_NAME);
                   2226:                                RC;
                   2227:                        case ']':
                   2228:                                if(--lexical_brackets_nestage==0) {
                   2229:                                        pop_LS(PC);
                   2230:                                        RC;
                   2231:                                }
                   2232:                                break;
                   2233:                        case ';': // operator_or_fmt;value delim
                   2234:                                RC;
                   2235:                        case '[':
                   2236:                                lexical_brackets_nestage++;
                   2237:                                break;
                   2238:                        }
                   2239:                        break;
                   2240: 
                   2241:                case LS_VAR_CURLY:
                   2242:                        switch(c) {
                   2243:                        case '$':
                   2244:                                push_LS(PC, LS_VAR_NAME_SIMPLE);
                   2245:                                RC;
                   2246:                        case '^':
                   2247:                                push_LS(PC, LS_METHOD_NAME);
                   2248:                                RC;
                   2249:                        case '}':
                   2250:                                if(--lexical_brackets_nestage==0) {
                   2251:                                        pop_LS(PC);
                   2252:                                        RC;
                   2253:                                }
                   2254:                                break;
                   2255:                        case '{':
                   2256:                                lexical_brackets_nestage++;
                   2257:                                break;
                   2258:                        }
                   2259:                        break;
                   2260: 
                   2261:                // METHOD CALL
                   2262:                case LS_METHOD_NAME:
                   2263:                        switch(c) {
                   2264:                        case '[':
                   2265:                                PC.ls=LS_METHOD_SQUARE;
                   2266:                                lexical_brackets_nestage=1;
                   2267:                                RC;
                   2268:                        case '{':
                   2269:                                PC.ls=LS_METHOD_CURLY;
                   2270:                                lexical_brackets_nestage=1;
                   2271:                                RC;
                   2272:                        case '(':
                   2273:                                PC.ls=LS_METHOD_ROUND;
                   2274:                                lexical_brackets_nestage=1;
                   2275:                                RC;
                   2276:                        case '.': // name part delim 
                   2277:                        case '$': // name part subvar
                   2278:                        case ':': // ':name' or 'class:name'
                   2279:                                RC;
                   2280:                        }
                   2281:                        break;
                   2282: 
                   2283:                case LS_METHOD_SQUARE:
                   2284:                        switch(c) {
                   2285:                        case '$':
                   2286:                                push_LS(PC, LS_VAR_NAME_SIMPLE);
                   2287:                                RC;
                   2288:                        case '^':
                   2289:                                push_LS(PC, LS_METHOD_NAME);
                   2290:                                RC;
                   2291:                        case ';': // param delim
                   2292:                                RC;
                   2293:                        case ']':
                   2294:                                if(--lexical_brackets_nestage==0) {
                   2295:                                        PC.ls=LS_METHOD_AFTER;
                   2296:                                        RC;
                   2297:                                }
                   2298:                                break;
                   2299:                        case '[':
                   2300:                                lexical_brackets_nestage++;
                   2301:                                break;
                   2302:                        }
                   2303:                        break;
                   2304: 
                   2305:                case LS_METHOD_CURLY:
                   2306:                        switch(c) {
                   2307:                        case '$':
                   2308:                                push_LS(PC, LS_VAR_NAME_SIMPLE);
                   2309:                                RC;
                   2310:                        case '^':
                   2311:                                push_LS(PC, LS_METHOD_NAME);
                   2312:                                RC;
                   2313:                        case ';': // param delim
                   2314:                                RC;
                   2315:                        case '}':
                   2316:                                if(--lexical_brackets_nestage==0) {
                   2317:                                        PC.ls=LS_METHOD_AFTER;
                   2318:                                        RC;
                   2319:                                }
                   2320:                                break;
                   2321:                        case '{':
                   2322:                                lexical_brackets_nestage++;
                   2323:                                break;
                   2324:                        }
                   2325:                        break;
                   2326: 
                   2327:                case LS_METHOD_AFTER:
                   2328:                        if(c=='[') {/* ][ }[ )[ */
                   2329:                                PC.ls=LS_METHOD_SQUARE;
                   2330:                                lexical_brackets_nestage=1;
                   2331:                                RC;
                   2332:                        }                                          
                   2333:                        if(c=='{') {/* ]{ }{ ){ */
                   2334:                                PC.ls=LS_METHOD_CURLY;
                   2335:                                lexical_brackets_nestage=1;
                   2336:                                RC;
                   2337:                        }                                          
                   2338:                        if(c=='(') {/* ]( }( )( */
                   2339:                                PC.ls=LS_METHOD_ROUND;
                   2340:                                lexical_brackets_nestage=1;
                   2341:                                RC;
                   2342:                        }                                          
                   2343:                        pop_LS(PC);
                   2344:                        PC.source--;  if(--PC.col<0) { PC.line--;  PC.col=-1; }
                   2345:                        result=EON;
                   2346:                        goto break2;
                   2347:                }
                   2348:                if(c==0) {
                   2349:                        result=-1;
                   2350:                        break;
                   2351:                }
                   2352:        }
                   2353: 
                   2354: break2:
                   2355:        if(end!=begin) { // there is last piece?
                   2356:                if((c=='@' || c==0) && end[-1]=='\n') { // we are before LS_DEF_NAME or EOF?
                   2357:                        // strip last \n
                   2358:                        end--;
                   2359:                        if(end!=begin && end[-1]=='\n') // allow one empty line before LS_DEF_NAME
                   2360:                                end--;
                   2361:                }
                   2362:                if(end!=begin && PC.ls!=LS_COMMENT) { // last piece still alive and not comment?
                   2363:                        // append it
                   2364:                        PC.string->APPEND_CLEAN(begin, end-begin, PC.file, begin_line/*, start_col*/);
                   2365:                }
                   2366:        }
                   2367:        if(PC.string->size()) { // something accumulated?
                   2368:                // create STRING value: array of OP_VALUE+vstring
                   2369:                *lvalp=VL(NEW VString(*PC.string));
                   2370:                // new pieces storage
                   2371:                PC.string=NEW String(POOL);
                   2372:                // make current result be pending for next call, return STRING for now
                   2373:                PC.pending_state=result;  result=STRING;
                   2374:        }
                   2375:        if(skip_analized) {
                   2376:                PC.source+=skip_analized;  PC.col+=skip_analized;
                   2377:        }
                   2378:        return result;
                   2379: }
                   2380: 
                   2381: static int real_yyerror(parse_control *pc, char *s) {  // Called by yyparse on error
                   2382:           strncpy(PC.error, s, MAX_STRING);
                   2383:           return 1;
                   2384: }
                   2385: 
                   2386: static void yyprint(FILE *file, int type, YYSTYPE value) {
                   2387:        if(type==STRING)
                   2388:                fprintf(file, " \"%s\"", LA2S(value)->cstr());
                   2389: }

E-mail: