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

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

E-mail: