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

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

E-mail: