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

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

E-mail: