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

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

E-mail: