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

1.114     misha       1: /* A Bison parser, made by GNU Bison 1.875d.  */
1.112     paf         2: 
                      3: /* Skeleton parser for Yacc-like parsing with Bison,
1.114     misha       4:    Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
1.112     paf         5: 
                      6:    This program is free software; you can redistribute it and/or modify
                      7:    it under the terms of the GNU General Public License as published by
                      8:    the Free Software Foundation; either version 2, or (at your option)
                      9:    any later version.
                     10: 
                     11:    This program is distributed in the hope that it will be useful,
                     12:    but WITHOUT ANY WARRANTY; without even the implied warranty of
                     13:    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                     14:    GNU General Public License for more details.
                     15: 
                     16:    You should have received a copy of the GNU General Public License
                     17:    along with this program; if not, write to the Free Software
                     18:    Foundation, Inc., 59 Temple Place - Suite 330,
                     19:    Boston, MA 02111-1307, USA.  */
                     20: 
                     21: /* As a special exception, when this file is copied by Bison into a
                     22:    Bison output file, you may use that output file without restriction.
                     23:    This special exception was added by the Free Software Foundation
                     24:    in version 1.24 of Bison.  */
                     25: 
                     26: /* Written by Richard Stallman by simplifying the original so called
                     27:    ``semantic'' parser.  */
                     28: 
                     29: /* All symbols defined below should begin with yy or YY, to avoid
                     30:    infringing on user name space.  This should be done even for local
                     31:    variables, as they might otherwise be expanded by user macros.
                     32:    There are some unavoidable exceptions within include files to
                     33:    define necessary library symbols; they are noted "INFRINGES ON
                     34:    USER NAME SPACE" below.  */
                     35: 
                     36: /* Identify Bison output.  */
                     37: #define YYBISON 1
                     38: 
                     39: /* Skeleton name.  */
1.113     paf        40: #define YYSKELETON_NAME "yacc.c"
1.112     paf        41: 
                     42: /* Pure parsers.  */
                     43: #define YYPURE 1
                     44: 
                     45: /* Using locations.  */
                     46: #define YYLSP_NEEDED 0
1.105     paf        47: 
1.1       parser     48: 
                     49: 
1.112     paf        50: /* Tokens.  */
                     51: #ifndef YYTOKENTYPE
                     52: # define YYTOKENTYPE
                     53:    /* Put the tokens into the symbol table, so that GDB and other debuggers
                     54:       know about them.  */
                     55:    enum yytokentype {
                     56:      EON = 258,
                     57:      STRING = 259,
                     58:      BOGUS = 260,
                     59:      BAD_STRING_COMPARISON_OPERATOR = 261,
                     60:      BAD_HEX_LITERAL = 262,
                     61:      BAD_METHOD_DECL_START = 263,
                     62:      BAD_METHOD_PARAMETER_NAME_CHARACTER = 264,
                     63:      BAD_NONWHITESPACE_CHARACTER_IN_EXPLICIT_RESULT_MODE = 265,
                     64:      LAND = 266,
                     65:      LOR = 267,
                     66:      LXOR = 268,
                     67:      NXOR = 269,
                     68:      NLE = 270,
                     69:      NGE = 271,
                     70:      NEQ = 272,
                     71:      NNE = 273,
                     72:      NSL = 274,
                     73:      NSR = 275,
                     74:      SLT = 276,
                     75:      SGT = 277,
                     76:      SLE = 278,
                     77:      SGE = 279,
                     78:      SEQ = 280,
                     79:      SNE = 281,
                     80:      DEF = 282,
                     81:      IN = 283,
                     82:      FEXISTS = 284,
                     83:      DEXISTS = 285,
                     84:      IS = 286,
                     85:      LITERAL_TRUE = 287,
                     86:      LITERAL_FALSE = 288,
                     87:      NUNARY = 289
                     88:    };
                     89: #endif
                     90: #define EON 258
                     91: #define STRING 259
                     92: #define BOGUS 260
                     93: #define BAD_STRING_COMPARISON_OPERATOR 261
                     94: #define BAD_HEX_LITERAL 262
                     95: #define BAD_METHOD_DECL_START 263
                     96: #define BAD_METHOD_PARAMETER_NAME_CHARACTER 264
                     97: #define BAD_NONWHITESPACE_CHARACTER_IN_EXPLICIT_RESULT_MODE 265
                     98: #define LAND 266
                     99: #define LOR 267
                    100: #define LXOR 268
                    101: #define NXOR 269
                    102: #define NLE 270
                    103: #define NGE 271
                    104: #define NEQ 272
                    105: #define NNE 273
                    106: #define NSL 274
                    107: #define NSR 275
                    108: #define SLT 276
                    109: #define SGT 277
                    110: #define SLE 278
                    111: #define SGE 279
                    112: #define SEQ 280
                    113: #define SNE 281
                    114: #define DEF 282
                    115: #define IN 283
                    116: #define FEXISTS 284
                    117: #define DEXISTS 285
                    118: #define IS 286
                    119: #define LITERAL_TRUE 287
                    120: #define LITERAL_FALSE 288
                    121: #define NUNARY 289
1.1       parser    122: 
1.112     paf       123: 
                    124: 
                    125: 
                    126: /* Copy the first part of user declarations.  */
1.14      parser    127: #line 1 "compile.y"
1.1       parser    128: 
1.14      parser    129: /** @file
                    130:        Parser: compiler(lexical parser and grammar).
                    131: 
1.132     misha     132:        Copyright (c) 2001-2009 ArtLebedev Group (http://www.artlebedev.com)
1.27      paf       133:        Author: Alexander Petrosyan <paf@design.ru> (http://design.ru/paf)
1.109     paf       134: 
1.138   ! misha     135:        $Id: compile.y,v 1.245 2009-06-04 09:31:37 misha Exp $
1.14      parser    136: */
1.1       parser    137: 
                    138: /**
                    139:        @todo parser4: 
                    140:        - cache compiled code from request to request. to do that...
                    141:                -#:     make method definitions, @CLASS, @BASE, @USE instructions,
                    142:                        which would be executed afterwards, and actions
                    143:                        now performed at compile time would be delayed to run time.
                    144:                -#:     make cache expiration on time and on disk-change of class source
                    145:                -#:     in apache use subpools for compiled class storage
                    146:                -#:     in iis make up specialized Pool object for that
                    147: */
                    148: 
1.84      paf       149: #define YYSTYPE  ArrayOperation* 
1.1       parser    150: #define YYPARSE_PARAM  pc
                    151: #define YYLEX_PARAM  pc
                    152: #define YYDEBUG  1
                    153: #define YYERROR_VERBOSE        1
1.84      paf       154: #define yyerror(msg)  real_yyerror((Parse_control *)pc, msg)
1.1       parser    155: #define YYPRINT(file, type, value)  yyprint(file, type, value)
                    156: 
1.84      paf       157: // includes
                    158: 
1.1       parser    159: #include "compile_tools.h"
                    160: #include "pa_value.h"
                    161: #include "pa_request.h"
                    162: #include "pa_vobject.h"
                    163: #include "pa_vdouble.h"
                    164: #include "pa_globals.h"
                    165: #include "pa_vvoid.h"
1.72      paf       166: #include "pa_vmethod_frame.h"
1.1       parser    167: 
1.84      paf       168: // defines
                    169: 
1.1       parser    170: #define USE_CONTROL_METHOD_NAME "USE"
1.119     misha     171: #define OPTIONS_CONTROL_METHOD_NAME "OPTIONS"
                    172: #define OPTION_ALL_VARS_LOCAL_NAME "locals"
1.123     misha     173: #define OPTION_PARTIAL_CLASS "partial"
1.131     misha     174: #define REM_OPERATOR_NAME "rem"
1.1       parser    175: 
1.84      paf       176: // forwards
                    177: 
                    178: static int real_yyerror(Parse_control* pc, char* s);
                    179: static void yyprint(FILE* file, int type, YYSTYPE value);
                    180: static int yylex(YYSTYPE* lvalp, void* pc);
1.1       parser    181: 
1.107     paf       182: static const VBool vfalse(false);
                    183: static const VBool vtrue(true);
                    184: static const VVoid vvoid;
                    185: 
1.1       parser    186: // local convinient inplace typecast & var
1.83      paf       187: #undef PC
1.84      paf       188: #define PC  (*(Parse_control *)pc)
                    189: #undef POOL
1.1       parser    190: #define POOL  (*PC.pool)
                    191: #ifndef DOXYGEN
1.112     paf       192: 
                    193: 
                    194: /* Enabling traces.  */
                    195: #ifndef YYDEBUG
                    196: # define YYDEBUG 0
1.109     paf       197: #endif
1.108     paf       198: 
1.112     paf       199: /* Enabling verbose error messages.  */
                    200: #ifdef YYERROR_VERBOSE
                    201: # undef YYERROR_VERBOSE
                    202: # define YYERROR_VERBOSE 1
                    203: #else
                    204: # define YYERROR_VERBOSE 0
1.106     paf       205: #endif
1.112     paf       206: 
                    207: #if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
                    208: typedef int YYSTYPE;
                    209: # define yystype YYSTYPE /* obsolescent; will be withdrawn */
                    210: # define YYSTYPE_IS_DECLARED 1
                    211: # define YYSTYPE_IS_TRIVIAL 1
                    212: #endif
                    213: 
                    214: 
                    215: 
                    216: /* Copy the second part of user declarations.  */
                    217: 
                    218: 
                    219: /* Line 214 of yacc.c.  */
1.131     misha     220: #line 221 "compile.tab.C"
1.112     paf       221: 
                    222: #if ! defined (yyoverflow) || YYERROR_VERBOSE
                    223: 
1.114     misha     224: # ifndef YYFREE
                    225: #  define YYFREE free
                    226: # endif
                    227: # ifndef YYMALLOC
                    228: #  define YYMALLOC malloc
                    229: # endif
                    230: 
1.112     paf       231: /* The parser invokes alloca or malloc; define the necessary symbols.  */
                    232: 
1.113     paf       233: # ifdef YYSTACK_USE_ALLOCA
                    234: #  if YYSTACK_USE_ALLOCA
                    235: #   define YYSTACK_ALLOC alloca
                    236: #  endif
1.112     paf       237: # else
1.113     paf       238: #  if defined (alloca) || defined (_ALLOCA_H)
                    239: #   define YYSTACK_ALLOC alloca
                    240: #  else
                    241: #   ifdef __GNUC__
                    242: #    define YYSTACK_ALLOC __builtin_alloca
1.112     paf       243: #   endif
                    244: #  endif
                    245: # endif
                    246: 
                    247: # ifdef YYSTACK_ALLOC
                    248:    /* Pacify GCC's `empty if-body' warning. */
                    249: #  define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
                    250: # else
                    251: #  if defined (__STDC__) || defined (__cplusplus)
                    252: #   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
                    253: #   define YYSIZE_T size_t
                    254: #  endif
1.114     misha     255: #  define YYSTACK_ALLOC YYMALLOC
                    256: #  define YYSTACK_FREE YYFREE
1.112     paf       257: # endif
                    258: #endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */
                    259: 
                    260: 
                    261: #if (! defined (yyoverflow) \
                    262:      && (! defined (__cplusplus) \
1.113     paf       263:         || (defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL)))
1.112     paf       264: 
                    265: /* A type that is properly aligned for any stack member.  */
                    266: union yyalloc
                    267: {
1.114     misha     268:   short int yyss;
1.112     paf       269:   YYSTYPE yyvs;
                    270:   };
                    271: 
                    272: /* The size of the maximum gap between one aligned stack and the next.  */
                    273: # define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
                    274: 
                    275: /* The size of an array large to enough to hold all stacks, each with
                    276:    N elements.  */
                    277: # define YYSTACK_BYTES(N) \
1.114     misha     278:      ((N) * (sizeof (short int) + sizeof (YYSTYPE))                    \
1.112     paf       279:       + YYSTACK_GAP_MAXIMUM)
                    280: 
                    281: /* Copy COUNT objects from FROM to TO.  The source and destination do
                    282:    not overlap.  */
                    283: # ifndef YYCOPY
1.113     paf       284: #  if defined (__GNUC__) && 1 < __GNUC__
1.112     paf       285: #   define YYCOPY(To, From, Count) \
                    286:       __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
                    287: #  else
                    288: #   define YYCOPY(To, From, Count)             \
                    289:       do                                       \
                    290:        {                                       \
                    291:          register YYSIZE_T yyi;                \
                    292:          for (yyi = 0; yyi < (Count); yyi++)   \
                    293:            (To)[yyi] = (From)[yyi];            \
                    294:        }                                       \
                    295:       while (0)
                    296: #  endif
                    297: # endif
                    298: 
                    299: /* Relocate STACK from its old location to the new one.  The
                    300:    local variables YYSIZE and YYSTACKSIZE give the old and new number of
                    301:    elements in the stack, and YYPTR gives the new location of the
                    302:    stack.  Advance YYPTR to a properly aligned location for the next
                    303:    stack.  */
                    304: # define YYSTACK_RELOCATE(Stack)                                       \
                    305:     do                                                                 \
                    306:       {                                                                        \
                    307:        YYSIZE_T yynewbytes;                                            \
                    308:        YYCOPY (&yyptr->Stack, Stack, yysize);                          \
                    309:        Stack = &yyptr->Stack;                                          \
                    310:        yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
                    311:        yyptr += yynewbytes / sizeof (*yyptr);                          \
                    312:       }                                                                        \
                    313:     while (0)
                    314: 
1.1       parser    315: #endif
1.108     paf       316: 
1.112     paf       317: #if defined (__STDC__) || defined (__cplusplus)
                    318:    typedef signed char yysigned_char;
                    319: #else
1.114     misha     320:    typedef short int yysigned_char;
1.112     paf       321: #endif
1.108     paf       322: 
1.112     paf       323: /* YYFINAL -- State number of the termination state. */
                    324: #define YYFINAL  51
                    325: /* YYLAST -- Last index in YYTABLE.  */
1.115     misha     326: #define YYLAST   470
1.112     paf       327: 
                    328: /* YYNTOKENS -- Number of terminals. */
                    329: #define YYNTOKENS  62
                    330: /* YYNNTS -- Number of nonterminals. */
1.115     misha     331: #define YYNNTS  89
1.112     paf       332: /* YYNRULES -- Number of rules. */
1.115     misha     333: #define YYNRULES  172
1.112     paf       334: /* YYNRULES -- Number of states. */
1.115     misha     335: #define YYNSTATES  263
1.112     paf       336: 
                    337: /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
                    338: #define YYUNDEFTOK  2
                    339: #define YYMAXUTOK   289
                    340: 
                    341: #define YYTRANSLATE(YYX)                                               \
                    342:   ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
                    343: 
                    344: /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
                    345: static const unsigned char yytranslate[] =
                    346: {
                    347:        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                    348:       48,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                    349:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                    350:        2,     2,     2,    46,    60,     2,    52,    43,    37,    61,
                    351:       56,    57,    40,    38,     2,    39,    55,    41,     2,     2,
                    352:        2,     2,     2,     2,     2,     2,     2,     2,    59,    51,
                    353:       34,     2,    35,     2,    47,     2,     2,     2,     2,     2,
                    354:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                    355:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                    356:        2,    49,    42,    50,    58,     2,     2,     2,     2,     2,
                    357:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                    358:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                    359:        2,     2,     2,    53,    36,    54,    45,     2,     2,     2,
                    360:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                    361:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                    362:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                    363:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                    364:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                    365:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                    366:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                    367:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                    368:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                    369:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                    370:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                    371:        2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
                    372:        2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
                    373:        5,     6,     7,     8,     9,    10,    11,    12,    13,    14,
                    374:       15,    16,    17,    18,    19,    20,    21,    22,    23,    24,
                    375:       25,    26,    27,    28,    29,    30,    31,    32,    33,    44
                    376: };
1.105     paf       377: 
1.112     paf       378: #if YYDEBUG
                    379: /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
                    380:    YYRHS.  */
1.114     misha     381: static const unsigned short int yyprhs[] =
1.112     paf       382: {
                    383:        0,     0,     3,     5,     7,     9,    12,    14,    16,    18,
1.115     misha     384:       23,    25,    27,    29,    32,    35,    37,    39,    40,    49,
                    385:       51,    53,    57,    59,    61,    63,    67,    69,    71,    73,
                    386:       75,    77,    80,    82,    84,    86,    88,    90,    92,    95,
                    387:       98,   100,   104,   106,   108,   110,   113,   115,   118,   122,
                    388:      124,   126,   128,   130,   133,   136,   138,   140,   142,   143,
                    389:      144,   150,   154,   158,   160,   162,   164,   166,   168,   170,
                    390:      173,   175,   176,   177,   184,   186,   188,   191,   193,   195,
                    391:      197,   198,   199,   205,   209,   213,   215,   219,   221,   225,
                    392:      227,   231,   233,   235,   237,   239,   241,   243,   245,   248,
                    393:      250,   253,   256,   258,   260,   263,   265,   267,   269,   271,
                    394:      274,   277,   278,   279,   285,   287,   289,   292,   295,   297,
                    395:      299,   302,   305,   307,   309,   311,   313,   315,   317,   321,
                    396:      325,   329,   332,   335,   338,   341,   344,   347,   350,   353,
                    397:      357,   361,   365,   369,   373,   377,   381,   385,   389,   393,
                    398:      397,   401,   405,   409,   413,   417,   421,   425,   429,   433,
                    399:      437,   441,   445,   449,   453,   457,   461,   463,   465,   467,
                    400:      468,   470,   472
1.109     paf       401: };
1.105     paf       402: 
1.112     paf       403: /* YYRHS -- A `-1'-separated list of the rules' RHS. */
1.114     misha     404: static const short int yyrhs[] =
1.112     paf       405: {
                    406:       63,     0,    -1,    65,    -1,    64,    -1,    66,    -1,    64,
1.115     misha     407:       66,    -1,    79,    -1,    67,    -1,    72,    -1,    47,     4,
                    408:       48,    68,    -1,   150,    -1,    69,    -1,    70,    -1,    69,
                    409:       70,    -1,    71,    48,    -1,   150,    -1,     4,    -1,    -1,
                    410:       47,     4,    75,    74,    78,    48,    73,    79,    -1,   150,
                    411:       -1,    75,    -1,    49,    76,    50,    -1,   150,    -1,    77,
                    412:       -1,     4,    -1,    77,    51,     4,    -1,   150,    -1,     4,
                    413:       -1,   150,    -1,    80,    -1,    81,    -1,    80,    81,    -1,
                    414:      146,    -1,    82,    -1,    83,    -1,    91,    -1,   106,    -1,
                    415:       84,    -1,    52,    85,    -1,    87,     3,    -1,    86,    -1,
                    416:       53,    87,    54,    -1,    88,    -1,    89,    -1,    90,    -1,
                    417:      139,    90,    -1,   129,    -1,   126,   129,    -1,    52,    92,
                    418:       96,    -1,    93,    -1,    94,    -1,    95,    -1,   125,    -1,
                    419:       55,   125,    -1,   139,   125,    -1,    97,    -1,   100,    -1,
                    420:      101,    -1,    -1,    -1,    49,    98,   102,    99,    50,    -1,
                    421:       56,   142,    57,    -1,    53,    79,    54,    -1,   147,    -1,
                    422:        4,    -1,   103,    -1,   104,    -1,   105,    -1,    82,    -1,
                    423:       81,    80,    -1,   107,    -1,    -1,    -1,    58,   108,   110,
                    424:      109,   111,     3,    -1,    87,    -1,   112,    -1,   111,   112,
                    425:       -1,   113,    -1,   116,    -1,   117,    -1,    -1,    -1,    49,
                    426:      114,   118,   115,    50,    -1,    56,   119,    57,    -1,    53,
                    427:      120,    54,    -1,   121,    -1,   118,    51,   121,    -1,   122,
                    428:       -1,   119,    51,   122,    -1,   123,    -1,   120,    51,   123,
                    429:       -1,   124,    -1,   142,    -1,    79,    -1,   147,    -1,     4,
                    430:       -1,   103,    -1,   130,    -1,   126,   130,    -1,   127,    -1,
                    431:      126,   127,    -1,   128,    55,    -1,   130,    -1,   130,    -1,
                    432:        4,     5,    -1,     4,    -1,   131,    -1,   132,    -1,   133,
                    433:       -1,    52,   136,    -1,     4,   137,    -1,    -1,    -1,    49,
                    434:      134,    80,   135,    50,    -1,     4,    -1,   138,    -1,   137,
                    435:      138,    -1,    52,   136,    -1,   140,    -1,   141,    -1,     4,
                    436:       59,    -1,   140,    59,    -1,   143,    -1,   144,    -1,   148,
                    437:       -1,   149,    -1,    84,    -1,   107,    -1,    60,   145,    60,
                    438:       -1,    61,   145,    61,    -1,    56,   143,    57,    -1,    39,
                    439:      143,    -1,    38,   143,    -1,    45,   143,    -1,    46,   143,
                    440:       -1,    27,   143,    -1,    28,   143,    -1,    29,   143,    -1,
                    441:       30,   143,    -1,   143,    39,   143,    -1,   143,    38,   143,
                    442:       -1,   143,    40,   143,    -1,   143,    41,   143,    -1,   143,
                    443:       43,   143,    -1,   143,    42,   143,    -1,   143,    19,   143,
                    444:       -1,   143,    20,   143,    -1,   143,    37,   143,    -1,   143,
                    445:       36,   143,    -1,   143,    14,   143,    -1,   143,    11,   143,
                    446:       -1,   143,    12,   143,    -1,   143,    13,   143,    -1,   143,
                    447:       34,   143,    -1,   143,    35,   143,    -1,   143,    15,   143,
                    448:       -1,   143,    16,   143,    -1,   143,    17,   143,    -1,   143,
                    449:       18,   143,    -1,   143,    21,   143,    -1,   143,    22,   143,
                    450:       -1,   143,    23,   143,    -1,   143,    24,   143,    -1,   143,
                    451:       25,   143,    -1,   143,    26,   143,    -1,   143,    31,   143,
                    452:       -1,     4,    -1,    79,    -1,     4,    -1,    -1,    32,    -1,
                    453:       33,    -1,    -1
1.108     paf       454: };
1.1       parser    455: 
1.112     paf       456: /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
1.114     misha     457: static const unsigned short int yyrline[] =
1.112     paf       458: {
1.131     misha     459:        0,   132,   132,   139,   141,   141,   142,   144,   144,   146,
                    460:      247,   247,   248,   248,   249,   250,   250,   252,   252,   302,
                    461:      302,   303,   304,   304,   305,   305,   307,   307,   311,   311,
1.138   ! misha     462:      313,   313,   314,   314,   315,   315,   315,   319,   353,   354,
        !           463:      354,   355,   357,   358,   359,   417,   418,   418,   422,   435,
        !           464:      436,   437,   438,   455,   460,   463,   464,   465,   467,   470,
        !           465:      467,   478,   486,   493,   494,   495,   497,   503,   504,   504,
        !           466:      508,   519,   522,   519,   550,   552,   552,   554,   555,   556,
        !           467:      558,   561,   558,   564,   565,   567,   568,   571,   572,   575,
        !           468:      576,   578,   581,   595,   600,   601,   602,   607,   607,   609,
        !           469:      609,   610,   611,   619,   624,   627,   628,   629,   630,   632,
        !           470:      636,   645,   648,   645,   656,   661,   661,   662,   668,   669,
        !           471:      671,   688,   700,   702,   703,   704,   705,   706,   707,   708,
        !           472:      709,   711,   712,   713,   714,   715,   716,   717,   718,   720,
        !           473:      721,   722,   723,   724,   725,   726,   727,   728,   729,   730,
        !           474:      731,   732,   733,   734,   735,   736,   737,   738,   739,   740,
        !           475:      741,   742,   743,   744,   745,   746,   749,   754,   775,   780,
        !           476:      781,   782,   784
1.106     paf       477: };
1.109     paf       478: #endif
1.1       parser    479: 
1.112     paf       480: #if YYDEBUG || YYERROR_VERBOSE
                    481: /* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
                    482:    First, the terminals, then, starting at YYNTOKENS, nonterminals. */
                    483: static const char *const yytname[] =
                    484: {
1.113     paf       485:   "$end", "error", "$undefined", "EON", "STRING", "BOGUS",
                    486:   "BAD_STRING_COMPARISON_OPERATOR", "BAD_HEX_LITERAL",
                    487:   "BAD_METHOD_DECL_START", "BAD_METHOD_PARAMETER_NAME_CHARACTER",
                    488:   "BAD_NONWHITESPACE_CHARACTER_IN_EXPLICIT_RESULT_MODE", "\"&&\"",
                    489:   "\"||\"", "\"!||\"", "\"!|\"", "\"<=\"", "\">=\"", "\"==\"", "\"!=\"",
                    490:   "\"<<\"", "\">>\"", "\"lt\"", "\"gt\"", "\"le\"", "\"ge\"", "\"eq\"",
                    491:   "\"ne\"", "\"def\"", "\"in\"", "\"-f\"", "\"-d\"", "\"is\"", "\"true\"",
                    492:   "\"false\"", "'<'", "'>'", "'|'", "'&'", "'+'", "'-'", "'*'", "'/'",
                    493:   "'\\\\'", "'%'", "NUNARY", "'~'", "'!'", "'@'", "'\\n'", "'['", "']'",
                    494:   "';'", "'$'", "'{'", "'}'", "'.'", "'('", "')'", "'^'", "':'", "'\"'",
                    495:   "'''", "$accept", "all", "methods", "one_big_piece", "method",
                    496:   "control_method", "maybe_control_strings", "control_strings",
1.115     misha     497:   "control_string", "maybe_string", "code_method", "@1",
1.113     paf       498:   "maybe_bracketed_strings", "bracketed_maybe_strings", "maybe_strings",
                    499:   "strings", "maybe_comment", "maybe_codes", "codes", "code", "action",
                    500:   "get", "get_value", "get_name_value", "name_in_curly_rdive",
                    501:   "name_without_curly_rdive", "name_without_curly_rdive_read",
                    502:   "name_without_curly_rdive_class", "name_without_curly_rdive_code", "put",
                    503:   "name_expr_wdive", "name_expr_wdive_root", "name_expr_wdive_write",
1.115     misha     504:   "name_expr_wdive_class", "construct", "construct_square", "@2", "@3",
1.113     paf       505:   "construct_round", "construct_curly", "any_constructor_code_value",
                    506:   "constructor_code_value", "constructor_code",
1.115     misha     507:   "codes__excluding_sole_str_literal", "call", "call_value", "@4", "@5",
                    508:   "call_name", "store_params", "store_param", "store_square_param", "@6",
                    509:   "@7", "store_round_param", "store_curly_param", "store_code_param_parts",
1.113     paf       510:   "store_expr_param_parts", "store_curly_param_parts",
                    511:   "store_code_param_part", "store_expr_param_part",
                    512:   "store_curly_param_part", "code_param_value", "name_expr_dive_code",
                    513:   "name_path", "name_step", "name_advance1", "name_advance2",
                    514:   "name_expr_value", "name_expr_subvar_value",
1.115     misha     515:   "name_expr_with_subvar_value", "name_square_code_value", "@8", "@9",
1.113     paf       516:   "subvar_ref_name_rdive", "subvar_get_writes", "subvar__get_write",
                    517:   "class_prefix", "class_static_prefix", "class_constructor_prefix",
                    518:   "expr_value", "expr", "double_or_STRING", "string_inside_quotes_value",
1.112     paf       519:   "write_string", "void_value", "true_value", "false_value", "empty", 0
1.1       parser    520: };
1.106     paf       521: #endif
1.1       parser    522: 
1.112     paf       523: # ifdef YYPRINT
                    524: /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
                    525:    token YYLEX-NUM.  */
1.114     misha     526: static const unsigned short int yytoknum[] =
1.112     paf       527: {
                    528:        0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
                    529:      265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
                    530:      275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
                    531:      285,   286,   287,   288,    60,    62,   124,    38,    43,    45,
                    532:       42,    47,    92,    37,   289,   126,    33,    64,    10,    91,
                    533:       93,    59,    36,   123,   125,    46,    40,    41,    94,    58,
                    534:       34,    39
                    535: };
                    536: # endif
1.109     paf       537: 
1.112     paf       538: /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
                    539: static const unsigned char yyr1[] =
                    540: {
                    541:        0,    62,    63,    63,    64,    64,    65,    66,    66,    67,
1.115     misha     542:       68,    68,    69,    69,    70,    71,    71,    73,    72,    74,
                    543:       74,    75,    76,    76,    77,    77,    78,    78,    79,    79,
                    544:       80,    80,    81,    81,    82,    82,    82,    83,    84,    85,
                    545:       85,    86,    87,    87,    88,    89,    90,    90,    91,    92,
                    546:       92,    92,    93,    94,    95,    96,    96,    96,    98,    99,
                    547:       97,   100,   101,   102,   102,   102,   103,   104,   105,   105,
                    548:      106,   108,   109,   107,   110,   111,   111,   112,   112,   112,
                    549:      114,   115,   113,   116,   117,   118,   118,   119,   119,   120,
                    550:      120,   121,   122,   123,   124,   124,   124,   125,   125,   126,
                    551:      126,   127,   128,   129,   129,   130,   130,   130,   130,   131,
                    552:      132,   134,   135,   133,   136,   137,   137,   138,   139,   139,
                    553:      140,   141,   142,   143,   143,   143,   143,   143,   143,   143,
                    554:      143,   143,   143,   143,   143,   143,   143,   143,   143,   143,
                    555:      143,   143,   143,   143,   143,   143,   143,   143,   143,   143,
                    556:      143,   143,   143,   143,   143,   143,   143,   143,   143,   143,
                    557:      143,   143,   143,   143,   143,   143,   144,   145,   146,   147,
                    558:      148,   149,   150
1.1       parser    559: };
                    560: 
1.112     paf       561: /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
                    562: static const unsigned char yyr2[] =
                    563: {
                    564:        0,     2,     1,     1,     1,     2,     1,     1,     1,     4,
1.115     misha     565:        1,     1,     1,     2,     2,     1,     1,     0,     8,     1,
                    566:        1,     3,     1,     1,     1,     3,     1,     1,     1,     1,
                    567:        1,     2,     1,     1,     1,     1,     1,     1,     2,     2,
                    568:        1,     3,     1,     1,     1,     2,     1,     2,     3,     1,
                    569:        1,     1,     1,     2,     2,     1,     1,     1,     0,     0,
                    570:        5,     3,     3,     1,     1,     1,     1,     1,     1,     2,
                    571:        1,     0,     0,     6,     1,     1,     2,     1,     1,     1,
                    572:        0,     0,     5,     3,     3,     1,     3,     1,     3,     1,
                    573:        3,     1,     1,     1,     1,     1,     1,     1,     2,     1,
                    574:        2,     2,     1,     1,     2,     1,     1,     1,     1,     2,
                    575:        2,     0,     0,     5,     1,     1,     2,     2,     1,     1,
                    576:        2,     2,     1,     1,     1,     1,     1,     1,     3,     3,
                    577:        3,     2,     2,     2,     2,     2,     2,     2,     2,     3,
1.112     paf       578:        3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
                    579:        3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
1.115     misha     580:        3,     3,     3,     3,     3,     3,     1,     1,     1,     0,
                    581:        1,     1,     0
1.108     paf       582: };
1.106     paf       583: 
1.112     paf       584: /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
                    585:    STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
                    586:    means the default is an error.  */
                    587: static const unsigned char yydefact[] =
                    588: {
1.115     misha     589:      172,   168,     0,     0,    71,     0,     3,     2,     4,     7,
                    590:        8,     6,    29,    30,    33,    34,    37,    35,    36,    70,
                    591:       32,    28,     0,   105,   111,     0,     0,     0,    38,    40,
                    592:        0,    42,    43,    44,     0,    49,    50,    51,    52,     0,
                    593:       99,     0,    46,    97,   106,   107,   108,     0,   118,   119,
                    594:        0,     1,     5,    31,   172,   172,   172,   104,     0,   120,
                    595:      110,   115,     0,   114,   109,     0,     0,   103,     0,   105,
                    596:       53,     0,    97,    39,    58,   172,     0,    48,    55,    56,
                    597:       57,   105,   100,    47,    98,   101,    45,    54,   121,    74,
                    598:       72,    16,     9,    11,    12,     0,    10,    24,     0,    23,
                    599:       22,   172,    20,    19,   117,   116,   112,    41,    98,   169,
                    600:        0,   166,     0,     0,     0,     0,   170,   171,     0,     0,
                    601:        0,     0,     0,     0,   172,   172,   126,   127,     0,   122,
                    602:      123,   124,   125,     0,    13,    15,    14,    21,     0,    27,
                    603:        0,    26,     0,   168,     0,    33,    59,    65,    66,    67,
                    604:       63,    62,   135,   136,   137,   138,   132,   131,   133,   134,
                    605:        0,   167,     0,     0,    61,     0,     0,     0,     0,     0,
1.112     paf       606:        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
                    607:        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
1.115     misha     608:        0,     0,    80,   172,     0,     0,    75,    77,    78,    79,
                    609:       25,    17,   113,    69,     0,   130,   128,   129,   150,   151,
                    610:      152,   149,   155,   156,   157,   158,   145,   146,   159,   160,
                    611:      161,   162,   163,   164,   165,   153,   154,   148,   147,   140,
                    612:      139,   141,   142,   144,   143,   169,    93,     0,    89,     0,
                    613:       87,    92,    73,    76,   172,    60,   168,    96,    81,    85,
                    614:       91,    94,   172,    84,     0,    83,    18,   169,     0,    90,
                    615:       88,    86,    82
1.1       parser    616: };
                    617: 
1.112     paf       618: /* YYDEFGOTO[NTERM-NUM]. */
1.114     misha     619: static const short int yydefgoto[] =
1.112     paf       620: {
                    621:       -1,     5,     6,     7,     8,     9,    92,    93,    94,    95,
1.115     misha     622:       10,   244,   101,    56,    98,    99,   140,   161,    12,    13,
                    623:       14,    15,   126,    28,    29,    30,    31,    32,    33,    17,
                    624:       34,    35,    36,    37,    77,    78,   109,   204,    79,    80,
                    625:      146,   247,   148,   149,    18,   127,    50,   133,    90,   195,
                    626:      196,   197,   235,   258,   198,   199,   248,   239,   237,   249,
                    627:      240,   238,   250,    38,    66,    40,    41,    42,    67,    44,
                    628:       45,    46,    62,   142,    64,    60,    61,    68,    48,    49,
                    629:      241,   129,   130,   162,    20,   251,   131,   132,    21
1.105     paf       630: };
1.1       parser    631: 
1.112     paf       632: /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
                    633:    STATE-NUM.  */
1.115     misha     634: #define YYPACT_NINF -107
1.114     misha     635: static const short int yypact[] =
1.112     paf       636: {
1.115     misha     637:       14,  -107,    13,    45,  -107,    28,   -15,  -107,  -107,  -107,
                    638:     -107,  -107,    21,  -107,  -107,  -107,  -107,  -107,  -107,  -107,
                    639:     -107,  -107,    73,    19,  -107,    50,     6,    44,  -107,  -107,
                    640:       87,  -107,  -107,  -107,   -34,  -107,  -107,  -107,  -107,    65,
                    641:     -107,    48,  -107,     5,  -107,  -107,  -107,    65,    24,  -107,
                    642:        6,  -107,  -107,  -107,    88,   109,    74,  -107,    50,  -107,
                    643:       76,  -107,    21,  -107,  -107,    86,    65,   101,    65,    76,
                    644:     -107,    44,   101,  -107,  -107,    21,     7,  -107,  -107,  -107,
                    645:     -107,    18,  -107,  -107,     5,  -107,  -107,  -107,  -107,  -107,
                    646:     -107,  -107,  -107,     9,  -107,    94,    99,  -107,    93,   112,
                    647:     -107,   146,  -107,  -107,  -107,  -107,    21,  -107,   101,    29,
                    648:      110,  -107,     7,     7,     7,     7,  -107,  -107,     7,     7,
                    649:        7,     7,    52,     7,    21,    21,  -107,  -107,   113,   323,
                    650:     -107,  -107,  -107,    92,  -107,  -107,  -107,  -107,   165,  -107,
                    651:      144,  -107,   147,   149,    21,    80,  -107,  -107,  -107,  -107,
                    652:     -107,  -107,    96,    96,    96,    96,  -107,  -107,  -107,  -107,
                    653:      276,  -107,   138,   139,  -107,     7,     7,     7,     7,     7,
                    654:        7,     7,     7,     7,     7,     7,     7,     7,     7,     7,
                    655:        7,     7,     7,     7,     7,     7,     7,     7,     7,     7,
                    656:        7,     7,  -107,    21,     7,    35,  -107,  -107,  -107,  -107,
                    657:     -107,  -107,  -107,    21,   154,  -107,  -107,  -107,   419,   389,
                    658:      356,   284,   135,   135,   148,   148,   191,   191,   135,   135,
                    659:      135,   135,   148,   148,    96,   135,   135,   182,   427,   140,
                    660:      140,  -107,  -107,  -107,  -107,    37,  -107,    31,  -107,   -30,
                    661:     -107,  -107,  -107,  -107,    21,  -107,   108,  -107,   155,  -107,
                    662:     -107,  -107,    21,  -107,     7,  -107,  -107,    37,   161,  -107,
                    663:     -107,  -107,  -107
1.1       parser    664: };
                    665: 
1.112     paf       666: /* YYPGOTO[NTERM-NUM].  */
1.114     misha     667: static const short int yypgoto[] =
1.112     paf       668: {
1.115     misha     669:     -107,  -107,  -107,  -107,   206,  -107,  -107,  -107,   124,  -107,
                    670:     -107,  -107,  -107,   170,  -107,  -107,  -107,     1,   -58,    -7,
                    671:     -106,  -107,     0,  -107,  -107,    -6,  -107,  -107,   -21,  -107,
                    672:     -107,  -107,  -107,  -107,  -107,  -107,  -107,  -107,  -107,  -107,
                    673:     -107,   118,  -107,  -107,  -107,     2,  -107,  -107,  -107,  -107,
                    674:       43,  -107,  -107,  -107,  -107,  -107,  -107,  -107,  -107,   -17,
                    675:      -13,   -16,  -107,   -18,     4,    41,  -107,   -23,     3,  -107,
                    676:     -107,  -107,  -107,  -107,   181,  -107,   183,   239,  -107,  -107,
                    677:      171,    95,  -107,   123,  -107,   142,  -107,  -107,    64
1.1       parser    678: };
                    679: 
1.112     paf       680: /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
                    681:    positive, shift that token.  If negative, reduce the rule which
                    682:    number is the opposite.  If zero, do what YYDEFACT says.
                    683:    If YYTABLE_NINF, syntax error.  */
1.115     misha     684: #define YYTABLE_NINF -173
1.114     misha     685: static const short int yytable[] =
1.112     paf       686: {
1.115     misha     687:       16,    11,    19,   145,   106,    53,    43,    39,  -103,    70,
                    688:       23,   111,    16,    91,    19,    74,    83,    22,     1,    75,
                    689:       65,   254,    76,    57,    57,     1,    86,   255,    51,    87,
                    690:       72,    71,     2,   143,   112,   113,   114,   115,   242,   116,
                    691:      117,   246,    84,    83,    89,   118,   119,    86,    69,    23,
                    692:       43,    39,   120,   121,    63,    24,    23,  -172,    25,   122,
                    693:     -102,     2,    16,   123,    19,     4,     3,   124,   125,    81,
                    694:       58,    58,     4,     3,   108,    16,   110,    19,    59,     4,
                    695:       82,     3,   252,    88,   192,   253,   203,     4,   193,     3,
                    696:       73,   194,    91,    24,    24,     4,    25,    25,    26,    53,
                    697:       27,    24,   144,    85,    25,    26,    16,    82,    19,    16,
                    698:      168,    19,    82,    97,    24,   173,   174,    25,    96,   100,
                    699:      103,    54,    55,    55,    16,    16,    19,    19,    58,   145,
                    700:      -68,   -68,   184,   185,   186,   187,   188,   189,   190,   191,
                    701:      107,   192,   136,   137,    16,   193,    19,   -15,   194,   168,
                    702:      139,   145,   171,   172,   173,   174,  -102,   135,   -95,   -95,
                    703:      179,   180,   168,   138,   151,   141,   181,   173,   174,   200,
                    704:      164,   184,   185,   186,   187,   188,   189,   190,   191,   181,
                    705:      188,   189,   190,   191,   184,   185,   186,   187,   188,   189,
                    706:      190,   191,   201,    16,   236,    19,    53,   202,   206,   -64,
                    707:      207,   173,   174,    16,   245,    19,   257,   152,   153,   154,
                    708:      155,   262,    52,   156,   157,   158,   159,   134,   160,   185,
                    709:      186,   187,   188,   189,   190,   191,   102,   147,   144,   186,
                    710:      187,   188,   189,   190,   191,    16,   259,    19,   243,   104,
                    711:      261,   260,    47,   105,    16,   256,    19,   128,   163,     0,
                    712:      144,   150,    16,   236,    19,     0,     0,    16,     0,    19,
                    713:      208,   209,   210,   211,   212,   213,   214,   215,   216,   217,
                    714:      218,   219,   220,   221,   222,   223,   224,   225,   226,   227,
                    715:      228,   229,   230,   231,   232,   233,   234,   165,   166,   167,
                    716:      168,   169,   170,   171,   172,   173,   174,   175,   176,   177,
                    717:      178,   179,   180,   173,   174,     0,     0,   181,     0,     0,
                    718:      182,   183,   184,   185,   186,   187,   188,   189,   190,   191,
                    719:      184,   185,   186,   187,   188,   189,   190,   191,     0,     0,
                    720:        0,     0,     0,   205,   165,   166,   167,   168,   169,   170,
                    721:      171,   172,   173,   174,   175,   176,   177,   178,   179,   180,
                    722:        0,     0,     0,     0,   181,     0,     0,   182,   183,   184,
                    723:      185,   186,   187,   188,   189,   190,   191,   165,   166,     0,
                    724:      168,   169,   170,   171,   172,   173,   174,   175,   176,   177,
                    725:      178,   179,   180,     0,     0,     0,     0,   181,     0,     0,
                    726:      182,   183,   184,   185,   186,   187,   188,   189,   190,   191,
                    727:      165,     0,     0,   168,   169,   170,   171,   172,   173,   174,
                    728:      175,   176,   177,   178,   179,   180,     0,     0,     0,     0,
                    729:      181,     0,     0,   182,   183,   184,   185,   186,   187,   188,
                    730:      189,   190,   191,   168,   169,   170,   171,   172,   173,   174,
                    731:      175,   176,   177,   178,   179,   180,   173,   174,     0,     0,
                    732:      181,     0,     0,   182,   183,   184,   185,   186,   187,   188,
                    733:      189,   190,   191,     0,     0,   186,   187,   188,   189,   190,
1.112     paf       734:      191
1.1       parser    735: };
                    736: 
1.114     misha     737: static const short int yycheck[] =
1.112     paf       738: {
1.115     misha     739:        0,     0,     0,   109,    62,    12,     3,     3,     3,    27,
                    740:        4,     4,    12,     4,    12,    49,    39,     4,     4,    53,
                    741:       26,    51,    56,     5,     5,     4,    47,    57,     0,    47,
                    742:       27,    27,    47,     4,    27,    28,    29,    30,     3,    32,
                    743:       33,     4,    39,    66,    50,    38,    39,    68,     4,     4,
                    744:       47,    47,    45,    46,     4,    49,     4,    48,    52,    52,
                    745:       55,    47,    62,    56,    62,    58,    52,    60,    61,     4,
                    746:       52,    52,    58,    52,    71,    75,    75,    75,    59,    58,
                    747:       39,    52,    51,    59,    49,    54,   144,    58,    53,    52,
                    748:        3,    56,     4,    49,    49,    58,    52,    52,    53,   106,
                    749:       55,    49,   109,    55,    52,    53,   106,    66,   106,   109,
                    750:       14,   109,    71,     4,    49,    19,    20,    52,    54,    55,
                    751:       56,    48,    49,    49,   124,   125,   124,   125,    52,   235,
                    752:       50,    51,    36,    37,    38,    39,    40,    41,    42,    43,
                    753:       54,    49,    48,    50,   144,    53,   144,    48,    56,    14,
                    754:        4,   257,    17,    18,    19,    20,    55,    93,    50,    51,
                    755:       25,    26,    14,    51,    54,   101,    31,    19,    20,     4,
                    756:       57,    36,    37,    38,    39,    40,    41,    42,    43,    31,
                    757:       40,    41,    42,    43,    36,    37,    38,    39,    40,    41,
                    758:       42,    43,    48,   193,   193,   193,   203,    50,    60,    50,
                    759:       61,    19,    20,   203,    50,   203,    51,   112,   113,   114,
                    760:      115,    50,     6,   118,   119,   120,   121,    93,   123,    37,
                    761:       38,    39,    40,    41,    42,    43,    56,   109,   235,    38,
                    762:       39,    40,    41,    42,    43,   235,   252,   235,   195,    58,
                    763:      257,   254,     3,    60,   244,   244,   244,    76,   125,    -1,
                    764:      257,   109,   252,   252,   252,    -1,    -1,   257,    -1,   257,
                    765:      165,   166,   167,   168,   169,   170,   171,   172,   173,   174,
                    766:      175,   176,   177,   178,   179,   180,   181,   182,   183,   184,
                    767:      185,   186,   187,   188,   189,   190,   191,    11,    12,    13,
                    768:       14,    15,    16,    17,    18,    19,    20,    21,    22,    23,
                    769:       24,    25,    26,    19,    20,    -1,    -1,    31,    -1,    -1,
                    770:       34,    35,    36,    37,    38,    39,    40,    41,    42,    43,
                    771:       36,    37,    38,    39,    40,    41,    42,    43,    -1,    -1,
                    772:       -1,    -1,    -1,    57,    11,    12,    13,    14,    15,    16,
                    773:       17,    18,    19,    20,    21,    22,    23,    24,    25,    26,
                    774:       -1,    -1,    -1,    -1,    31,    -1,    -1,    34,    35,    36,
                    775:       37,    38,    39,    40,    41,    42,    43,    11,    12,    -1,
                    776:       14,    15,    16,    17,    18,    19,    20,    21,    22,    23,
                    777:       24,    25,    26,    -1,    -1,    -1,    -1,    31,    -1,    -1,
                    778:       34,    35,    36,    37,    38,    39,    40,    41,    42,    43,
                    779:       11,    -1,    -1,    14,    15,    16,    17,    18,    19,    20,
                    780:       21,    22,    23,    24,    25,    26,    -1,    -1,    -1,    -1,
                    781:       31,    -1,    -1,    34,    35,    36,    37,    38,    39,    40,
                    782:       41,    42,    43,    14,    15,    16,    17,    18,    19,    20,
                    783:       21,    22,    23,    24,    25,    26,    19,    20,    -1,    -1,
                    784:       31,    -1,    -1,    34,    35,    36,    37,    38,    39,    40,
                    785:       41,    42,    43,    -1,    -1,    38,    39,    40,    41,    42,
1.112     paf       786:       43
1.1       parser    787: };
                    788: 
1.112     paf       789: /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
                    790:    symbol of state STATE-NUM.  */
                    791: static const unsigned char yystos[] =
                    792: {
                    793:        0,     4,    47,    52,    58,    63,    64,    65,    66,    67,
1.115     misha     794:       72,    79,    80,    81,    82,    83,    84,    91,   106,   107,
                    795:      146,   150,     4,     4,    49,    52,    53,    55,    85,    86,
                    796:       87,    88,    89,    90,    92,    93,    94,    95,   125,   126,
                    797:      127,   128,   129,   130,   131,   132,   133,   139,   140,   141,
                    798:      108,     0,    66,    81,    48,    49,    75,     5,    52,    59,
                    799:      137,   138,   134,     4,   136,    87,   126,   130,   139,     4,
                    800:      125,   126,   130,     3,    49,    53,    56,    96,    97,   100,
                    801:      101,     4,   127,   129,   130,    55,    90,   125,    59,    87,
                    802:      110,     4,    68,    69,    70,    71,   150,     4,    76,    77,
                    803:      150,    74,    75,   150,   136,   138,    80,    54,   130,    98,
                    804:       79,     4,    27,    28,    29,    30,    32,    33,    38,    39,
                    805:       45,    46,    52,    56,    60,    61,    84,   107,   142,   143,
                    806:      144,   148,   149,   109,    70,   150,    48,    50,    51,     4,
                    807:       78,   150,   135,     4,    81,    82,   102,   103,   104,   105,
                    808:      147,    54,   143,   143,   143,   143,   143,   143,   143,   143,
                    809:      143,    79,   145,   145,    57,    11,    12,    13,    14,    15,
1.112     paf       810:       16,    17,    18,    19,    20,    21,    22,    23,    24,    25,
                    811:       26,    31,    34,    35,    36,    37,    38,    39,    40,    41,
1.115     misha     812:       42,    43,    49,    53,    56,   111,   112,   113,   116,   117,
                    813:        4,    48,    50,    80,    99,    57,    60,    61,   143,   143,
                    814:      143,   143,   143,   143,   143,   143,   143,   143,   143,   143,
                    815:      143,   143,   143,   143,   143,   143,   143,   143,   143,   143,
                    816:      143,   143,   143,   143,   143,   114,    79,   120,   123,   119,
                    817:      122,   142,     3,   112,    73,    50,     4,   103,   118,   121,
                    818:      124,   147,    51,    54,    51,    57,    79,    51,   115,   123,
                    819:      122,   121,    50
1.1       parser    820: };
1.109     paf       821: 
1.112     paf       822: #if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__)
                    823: # define YYSIZE_T __SIZE_TYPE__
                    824: #endif
                    825: #if ! defined (YYSIZE_T) && defined (size_t)
                    826: # define YYSIZE_T size_t
                    827: #endif
                    828: #if ! defined (YYSIZE_T)
                    829: # if defined (__STDC__) || defined (__cplusplus)
                    830: #  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
                    831: #  define YYSIZE_T size_t
                    832: # endif
                    833: #endif
                    834: #if ! defined (YYSIZE_T)
                    835: # define YYSIZE_T unsigned int
1.1       parser    836: #endif
1.109     paf       837: 
1.1       parser    838: #define yyerrok                (yyerrstatus = 0)
                    839: #define yyclearin      (yychar = YYEMPTY)
1.112     paf       840: #define YYEMPTY                (-2)
1.1       parser    841: #define YYEOF          0
1.112     paf       842: 
1.1       parser    843: #define YYACCEPT       goto yyacceptlab
1.112     paf       844: #define YYABORT                goto yyabortlab
1.113     paf       845: #define YYERROR                goto yyerrorlab
1.112     paf       846: 
                    847: 
                    848: /* Like YYERROR except do call yyerror.  This remains here temporarily
                    849:    to ease the transition to the new meaning of YYERROR, for GCC.
1.1       parser    850:    Once GCC version 2 has supplanted version 1, this can go.  */
1.112     paf       851: 
1.1       parser    852: #define YYFAIL         goto yyerrlab
1.112     paf       853: 
1.1       parser    854: #define YYRECOVERING()  (!!yyerrstatus)
1.112     paf       855: 
                    856: #define YYBACKUP(Token, Value)                                 \
1.1       parser    857: do                                                             \
                    858:   if (yychar == YYEMPTY && yylen == 1)                         \
1.112     paf       859:     {                                                          \
                    860:       yychar = (Token);                                                \
                    861:       yylval = (Value);                                                \
                    862:       yytoken = YYTRANSLATE (yychar);                          \
1.1       parser    863:       YYPOPSTACK;                                              \
                    864:       goto yybackup;                                           \
                    865:     }                                                          \
                    866:   else                                                         \
1.112     paf       867:     {                                                          \
                    868:       yyerror ("syntax error: cannot back up");\
                    869:       YYERROR;                                                 \
                    870:     }                                                          \
1.1       parser    871: while (0)
                    872: 
                    873: #define YYTERROR       1
                    874: #define YYERRCODE      256
                    875: 
1.112     paf       876: /* YYLLOC_DEFAULT -- Compute the default location (before the actions
                    877:    are run).  */
                    878: 
                    879: #ifndef YYLLOC_DEFAULT
1.113     paf       880: # define YYLLOC_DEFAULT(Current, Rhs, N)               \
                    881:    ((Current).first_line   = (Rhs)[1].first_line,      \
                    882:     (Current).first_column = (Rhs)[1].first_column,    \
                    883:     (Current).last_line    = (Rhs)[N].last_line,       \
                    884:     (Current).last_column  = (Rhs)[N].last_column)
1.109     paf       885: #endif
1.108     paf       886: 
1.112     paf       887: /* YYLEX -- calling `yylex' with the right arguments.  */
                    888: 
1.109     paf       889: #ifdef YYLEX_PARAM
1.112     paf       890: # define YYLEX yylex (&yylval, YYLEX_PARAM)
1.109     paf       891: #else
1.112     paf       892: # define YYLEX yylex (&yylval)
1.106     paf       893: #endif
1.112     paf       894: 
                    895: /* Enable debugging if requested.  */
                    896: #if YYDEBUG
                    897: 
                    898: # ifndef YYFPRINTF
                    899: #  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
                    900: #  define YYFPRINTF fprintf
                    901: # endif
                    902: 
                    903: # define YYDPRINTF(Args)                       \
                    904: do {                                           \
                    905:   if (yydebug)                                 \
                    906:     YYFPRINTF Args;                            \
                    907: } while (0)
                    908: 
                    909: # define YYDSYMPRINT(Args)                     \
                    910: do {                                           \
                    911:   if (yydebug)                                 \
                    912:     yysymprint Args;                           \
                    913: } while (0)
                    914: 
                    915: # define YYDSYMPRINTF(Title, Token, Value, Location)           \
                    916: do {                                                           \
                    917:   if (yydebug)                                                 \
                    918:     {                                                          \
                    919:       YYFPRINTF (stderr, "%s ", Title);                                \
                    920:       yysymprint (stderr,                                      \
                    921:                   Token, Value);       \
                    922:       YYFPRINTF (stderr, "\n");                                        \
                    923:     }                                                          \
                    924: } while (0)
                    925: 
                    926: /*------------------------------------------------------------------.
                    927: | yy_stack_print -- Print the state stack from its BOTTOM up to its |
1.113     paf       928: | TOP (included).                                                   |
1.112     paf       929: `------------------------------------------------------------------*/
                    930: 
                    931: #if defined (__STDC__) || defined (__cplusplus)
                    932: static void
1.114     misha     933: yy_stack_print (short int *bottom, short int *top)
1.106     paf       934: #else
1.112     paf       935: static void
                    936: yy_stack_print (bottom, top)
1.114     misha     937:     short int *bottom;
                    938:     short int *top;
1.1       parser    939: #endif
1.112     paf       940: {
                    941:   YYFPRINTF (stderr, "Stack now");
                    942:   for (/* Nothing. */; bottom <= top; ++bottom)
                    943:     YYFPRINTF (stderr, " %d", *bottom);
                    944:   YYFPRINTF (stderr, "\n");
                    945: }
1.108     paf       946: 
1.112     paf       947: # define YY_STACK_PRINT(Bottom, Top)                           \
                    948: do {                                                           \
                    949:   if (yydebug)                                                 \
                    950:     yy_stack_print ((Bottom), (Top));                          \
                    951: } while (0)
1.108     paf       952: 
                    953: 
1.112     paf       954: /*------------------------------------------------.
                    955: | Report that the YYRULE is going to be reduced.  |
                    956: `------------------------------------------------*/
1.108     paf       957: 
1.112     paf       958: #if defined (__STDC__) || defined (__cplusplus)
                    959: static void
                    960: yy_reduce_print (int yyrule)
                    961: #else
                    962: static void
                    963: yy_reduce_print (yyrule)
                    964:     int yyrule;
1.1       parser    965: #endif
1.112     paf       966: {
                    967:   int yyi;
                    968:   unsigned int yylno = yyrline[yyrule];
                    969:   YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ",
                    970:              yyrule - 1, yylno);
                    971:   /* Print the symbols being reduced, and their result.  */
                    972:   for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++)
                    973:     YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]);
                    974:   YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]);
                    975: }
1.105     paf       976: 
1.112     paf       977: # define YY_REDUCE_PRINT(Rule)         \
                    978: do {                                   \
                    979:   if (yydebug)                         \
                    980:     yy_reduce_print (Rule);            \
                    981: } while (0)
                    982: 
                    983: /* Nonzero means print parse trace.  It is left uninitialized so that
                    984:    multiple parsers can coexist.  */
                    985: int yydebug;
                    986: #else /* !YYDEBUG */
                    987: # define YYDPRINTF(Args)
                    988: # define YYDSYMPRINT(Args)
                    989: # define YYDSYMPRINTF(Title, Token, Value, Location)
                    990: # define YY_STACK_PRINT(Bottom, Top)
                    991: # define YY_REDUCE_PRINT(Rule)
                    992: #endif /* !YYDEBUG */
1.1       parser    993: 
                    994: 
1.112     paf       995: /* YYINITDEPTH -- initial size of the parser's stacks.  */
1.1       parser    996: #ifndef        YYINITDEPTH
1.112     paf       997: # define YYINITDEPTH 200
1.1       parser    998: #endif
                    999: 
1.112     paf      1000: /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
                   1001:    if the built-in stack extension method is used).
                   1002: 
                   1003:    Do not make this value too large; the results are undefined if
                   1004:    SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH)
                   1005:    evaluated with infinite-precision integer arithmetic.  */
1.1       parser   1006: 
1.113     paf      1007: #if defined (YYMAXDEPTH) && YYMAXDEPTH == 0
1.112     paf      1008: # undef YYMAXDEPTH
1.1       parser   1009: #endif
                   1010: 
                   1011: #ifndef YYMAXDEPTH
1.112     paf      1012: # define YYMAXDEPTH 10000
1.1       parser   1013: #endif
1.112     paf      1014: 
1.1       parser   1015: 
                   1016: 
1.112     paf      1017: #if YYERROR_VERBOSE
                   1018: 
                   1019: # ifndef yystrlen
                   1020: #  if defined (__GLIBC__) && defined (_STRING_H)
                   1021: #   define yystrlen strlen
                   1022: #  else
                   1023: /* Return the length of YYSTR.  */
                   1024: static YYSIZE_T
                   1025: #   if defined (__STDC__) || defined (__cplusplus)
                   1026: yystrlen (const char *yystr)
                   1027: #   else
                   1028: yystrlen (yystr)
                   1029:      const char *yystr;
                   1030: #   endif
                   1031: {
                   1032:   register const char *yys = yystr;
                   1033: 
                   1034:   while (*yys++ != '\0')
                   1035:     continue;
                   1036: 
                   1037:   return yys - yystr - 1;
                   1038: }
                   1039: #  endif
                   1040: # endif
                   1041: 
                   1042: # ifndef yystpcpy
                   1043: #  if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE)
                   1044: #   define yystpcpy stpcpy
                   1045: #  else
                   1046: /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
                   1047:    YYDEST.  */
                   1048: static char *
                   1049: #   if defined (__STDC__) || defined (__cplusplus)
                   1050: yystpcpy (char *yydest, const char *yysrc)
                   1051: #   else
                   1052: yystpcpy (yydest, yysrc)
                   1053:      char *yydest;
                   1054:      const char *yysrc;
                   1055: #   endif
                   1056: {
                   1057:   register char *yyd = yydest;
                   1058:   register const char *yys = yysrc;
                   1059: 
                   1060:   while ((*yyd++ = *yys++) != '\0')
                   1061:     continue;
1.105     paf      1062: 
1.112     paf      1063:   return yyd - 1;
1.105     paf      1064: }
1.112     paf      1065: #  endif
                   1066: # endif
                   1067: 
                   1068: #endif /* !YYERROR_VERBOSE */
                   1069: 
                   1070: 
1.105     paf      1071: 
1.112     paf      1072: #if YYDEBUG
                   1073: /*--------------------------------.
                   1074: | Print this symbol on YYOUTPUT.  |
                   1075: `--------------------------------*/
1.1       parser   1076: 
1.112     paf      1077: #if defined (__STDC__) || defined (__cplusplus)
1.105     paf      1078: static void
1.112     paf      1079: yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep)
                   1080: #else
                   1081: static void
                   1082: yysymprint (yyoutput, yytype, yyvaluep)
                   1083:     FILE *yyoutput;
                   1084:     int yytype;
                   1085:     YYSTYPE *yyvaluep;
                   1086: #endif
1.1       parser   1087: {
1.112     paf      1088:   /* Pacify ``unused variable'' warnings.  */
                   1089:   (void) yyvaluep;
                   1090: 
                   1091:   if (yytype < YYNTOKENS)
                   1092:     {
                   1093:       YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
                   1094: # ifdef YYPRINT
                   1095:       YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
                   1096: # endif
                   1097:     }
                   1098:   else
                   1099:     YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
1.105     paf      1100: 
1.112     paf      1101:   switch (yytype)
                   1102:     {
                   1103:       default:
                   1104:         break;
                   1105:     }
                   1106:   YYFPRINTF (yyoutput, ")");
1.1       parser   1107: }
                   1108: 
1.112     paf      1109: #endif /* ! YYDEBUG */
                   1110: /*-----------------------------------------------.
                   1111: | Release the memory associated to this symbol.  |
                   1112: `-----------------------------------------------*/
                   1113: 
                   1114: #if defined (__STDC__) || defined (__cplusplus)
                   1115: static void
                   1116: yydestruct (int yytype, YYSTYPE *yyvaluep)
                   1117: #else
                   1118: static void
                   1119: yydestruct (yytype, yyvaluep)
                   1120:     int yytype;
                   1121:     YYSTYPE *yyvaluep;
1.1       parser   1122: #endif
1.112     paf      1123: {
                   1124:   /* Pacify ``unused variable'' warnings.  */
                   1125:   (void) yyvaluep;
                   1126: 
                   1127:   switch (yytype)
                   1128:     {
                   1129: 
                   1130:       default:
                   1131:         break;
                   1132:     }
                   1133: }
1.1       parser   1134: 
                   1135: 
1.112     paf      1136: /* Prevent warnings from -Wmissing-prototypes.  */
1.1       parser   1137: 
                   1138: #ifdef YYPARSE_PARAM
1.112     paf      1139: # if defined (__STDC__) || defined (__cplusplus)
                   1140: int yyparse (void *YYPARSE_PARAM);
                   1141: # else
                   1142: int yyparse ();
                   1143: # endif
                   1144: #else /* ! YYPARSE_PARAM */
                   1145: #if defined (__STDC__) || defined (__cplusplus)
                   1146: int yyparse (void);
                   1147: #else
                   1148: int yyparse ();
                   1149: #endif
                   1150: #endif /* ! YYPARSE_PARAM */
                   1151: 
                   1152: 
                   1153: 
                   1154: 
                   1155: 
                   1156: 
                   1157: /*----------.
                   1158: | yyparse.  |
                   1159: `----------*/
1.1       parser   1160: 
                   1161: #ifdef YYPARSE_PARAM
1.112     paf      1162: # if defined (__STDC__) || defined (__cplusplus)
                   1163: int yyparse (void *YYPARSE_PARAM)
                   1164: # else
                   1165: int yyparse (YYPARSE_PARAM)
                   1166:   void *YYPARSE_PARAM;
                   1167: # endif
                   1168: #else /* ! YYPARSE_PARAM */
                   1169: #if defined (__STDC__) || defined (__cplusplus)
                   1170: int
                   1171: yyparse (void)
1.1       parser   1172: #else
1.112     paf      1173: int
                   1174: yyparse ()
                   1175: 
1.1       parser   1176: #endif
                   1177: #endif
1.112     paf      1178: {
                   1179:   /* The lookahead symbol.  */
                   1180: int yychar;
                   1181: 
                   1182: /* The semantic value of the lookahead symbol.  */
                   1183: YYSTYPE yylval;
                   1184: 
                   1185: /* Number of syntax errors so far.  */
                   1186: int yynerrs;
1.109     paf      1187: 
1.1       parser   1188:   register int yystate;
                   1189:   register int yyn;
1.112     paf      1190:   int yyresult;
                   1191:   /* Number of tokens to shift before error messages enabled.  */
                   1192:   int yyerrstatus;
                   1193:   /* Lookahead token as an internal (translated) token number.  */
                   1194:   int yytoken = 0;
                   1195: 
                   1196:   /* Three stacks and their tools:
                   1197:      `yyss': related to states,
                   1198:      `yyvs': related to semantic values,
                   1199:      `yyls': related to locations.
                   1200: 
                   1201:      Refer to the stacks thru separate pointers, to allow yyoverflow
                   1202:      to reallocate them elsewhere.  */
                   1203: 
                   1204:   /* The state stack.  */
1.114     misha    1205:   short int yyssa[YYINITDEPTH];
                   1206:   short int *yyss = yyssa;
                   1207:   register short int *yyssp;
1.112     paf      1208: 
                   1209:   /* The semantic value stack.  */
                   1210:   YYSTYPE yyvsa[YYINITDEPTH];
                   1211:   YYSTYPE *yyvs = yyvsa;
1.106     paf      1212:   register YYSTYPE *yyvsp;
1.1       parser   1213: 
                   1214: 
1.109     paf      1215: 
1.1       parser   1216: #define YYPOPSTACK   (yyvsp--, yyssp--)
                   1217: 
1.112     paf      1218:   YYSIZE_T yystacksize = YYINITDEPTH;
1.1       parser   1219: 
1.112     paf      1220:   /* The variables used to return semantic value and location from the
                   1221:      action routines.  */
                   1222:   YYSTYPE yyval;
1.1       parser   1223: 
                   1224: 
1.112     paf      1225:   /* When reducing, the number of symbols on the RHS of the reduced
                   1226:      rule.  */
1.1       parser   1227:   int yylen;
                   1228: 
1.112     paf      1229:   YYDPRINTF ((stderr, "Starting parse\n"));
1.1       parser   1230: 
                   1231:   yystate = 0;
                   1232:   yyerrstatus = 0;
                   1233:   yynerrs = 0;
                   1234:   yychar = YYEMPTY;            /* Cause a token to be read.  */
                   1235: 
                   1236:   /* Initialize stack pointers.
                   1237:      Waste one element of value and location stack
                   1238:      so that they stay on the same level as the state stack.
                   1239:      The wasted elements are never initialized.  */
                   1240: 
1.112     paf      1241:   yyssp = yyss;
1.1       parser   1242:   yyvsp = yyvs;
                   1243: 
1.114     misha    1244: 
1.112     paf      1245:   goto yysetstate;
                   1246: 
                   1247: /*------------------------------------------------------------.
                   1248: | yynewstate -- Push a new state, which is found in yystate.  |
                   1249: `------------------------------------------------------------*/
                   1250:  yynewstate:
                   1251:   /* In all cases, when you get here, the value and location stacks
                   1252:      have just been pushed. so pushing a state here evens the stacks.
                   1253:      */
                   1254:   yyssp++;
1.105     paf      1255: 
1.112     paf      1256:  yysetstate:
                   1257:   *yyssp = yystate;
1.108     paf      1258: 
1.112     paf      1259:   if (yyss + yystacksize - 1 <= yyssp)
1.109     paf      1260:     {
1.1       parser   1261:       /* Get the current used size of the three stacks, in elements.  */
1.112     paf      1262:       YYSIZE_T yysize = yyssp - yyss + 1;
1.1       parser   1263: 
                   1264: #ifdef yyoverflow
1.112     paf      1265:       {
                   1266:        /* Give user a chance to reallocate the stack. Use copies of
                   1267:           these so that the &'s don't force the real ones into
                   1268:           memory.  */
                   1269:        YYSTYPE *yyvs1 = yyvs;
1.114     misha    1270:        short int *yyss1 = yyss;
1.112     paf      1271: 
                   1272: 
                   1273:        /* Each stack pointer address is followed by the size of the
                   1274:           data in use in that stack, in bytes.  This used to be a
                   1275:           conditional around just the two extra args, but that might
                   1276:           be undefined if yyoverflow is a macro.  */
                   1277:        yyoverflow ("parser stack overflow",
                   1278:                    &yyss1, yysize * sizeof (*yyssp),
                   1279:                    &yyvs1, yysize * sizeof (*yyvsp),
                   1280: 
                   1281:                    &yystacksize);
                   1282: 
                   1283:        yyss = yyss1;
                   1284:        yyvs = yyvs1;
                   1285:       }
1.1       parser   1286: #else /* no yyoverflow */
1.112     paf      1287: # ifndef YYSTACK_RELOCATE
                   1288:       goto yyoverflowlab;
                   1289: # else
1.1       parser   1290:       /* Extend the stack our own way.  */
1.112     paf      1291:       if (YYMAXDEPTH <= yystacksize)
                   1292:        goto yyoverflowlab;
1.1       parser   1293:       yystacksize *= 2;
1.112     paf      1294:       if (YYMAXDEPTH < yystacksize)
1.1       parser   1295:        yystacksize = YYMAXDEPTH;
1.112     paf      1296: 
                   1297:       {
1.114     misha    1298:        short int *yyss1 = yyss;
1.112     paf      1299:        union yyalloc *yyptr =
                   1300:          (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
                   1301:        if (! yyptr)
                   1302:          goto yyoverflowlab;
                   1303:        YYSTACK_RELOCATE (yyss);
                   1304:        YYSTACK_RELOCATE (yyvs);
                   1305: 
                   1306: #  undef YYSTACK_RELOCATE
                   1307:        if (yyss1 != yyssa)
                   1308:          YYSTACK_FREE (yyss1);
                   1309:       }
                   1310: # endif
1.1       parser   1311: #endif /* no yyoverflow */
                   1312: 
1.112     paf      1313:       yyssp = yyss + yysize - 1;
                   1314:       yyvsp = yyvs + yysize - 1;
                   1315: 
1.108     paf      1316: 
1.112     paf      1317:       YYDPRINTF ((stderr, "Stack size increased to %lu\n",
                   1318:                  (unsigned long int) yystacksize));
1.105     paf      1319: 
1.112     paf      1320:       if (yyss + yystacksize - 1 <= yyssp)
1.1       parser   1321:        YYABORT;
                   1322:     }
                   1323: 
1.112     paf      1324:   YYDPRINTF ((stderr, "Entering state %d\n", yystate));
1.1       parser   1325: 
                   1326:   goto yybackup;
1.112     paf      1327: 
                   1328: /*-----------.
                   1329: | yybackup.  |
                   1330: `-----------*/
                   1331: yybackup:
1.1       parser   1332: 
                   1333: /* Do appropriate processing given the current state.  */
                   1334: /* Read a lookahead token if we need one and don't already have one.  */
                   1335: /* yyresume: */
                   1336: 
                   1337:   /* First try to decide what to do without reference to lookahead token.  */
                   1338: 
                   1339:   yyn = yypact[yystate];
1.112     paf      1340:   if (yyn == YYPACT_NINF)
1.1       parser   1341:     goto yydefault;
                   1342: 
                   1343:   /* Not known => get a lookahead token if don't already have one.  */
                   1344: 
1.112     paf      1345:   /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
1.1       parser   1346:   if (yychar == YYEMPTY)
                   1347:     {
1.112     paf      1348:       YYDPRINTF ((stderr, "Reading a token: "));
1.1       parser   1349:       yychar = YYLEX;
                   1350:     }
                   1351: 
1.112     paf      1352:   if (yychar <= YYEOF)
1.1       parser   1353:     {
1.112     paf      1354:       yychar = yytoken = YYEOF;
                   1355:       YYDPRINTF ((stderr, "Now at end of input.\n"));
1.1       parser   1356:     }
                   1357:   else
                   1358:     {
1.112     paf      1359:       yytoken = YYTRANSLATE (yychar);
                   1360:       YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc);
1.1       parser   1361:     }
                   1362: 
1.112     paf      1363:   /* If the proper action on seeing token YYTOKEN is to reduce or to
                   1364:      detect an error, take that action.  */
                   1365:   yyn += yytoken;
                   1366:   if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
1.1       parser   1367:     goto yydefault;
                   1368:   yyn = yytable[yyn];
1.112     paf      1369:   if (yyn <= 0)
1.1       parser   1370:     {
1.112     paf      1371:       if (yyn == 0 || yyn == YYTABLE_NINF)
1.1       parser   1372:        goto yyerrlab;
                   1373:       yyn = -yyn;
                   1374:       goto yyreduce;
                   1375:     }
                   1376: 
                   1377:   if (yyn == YYFINAL)
                   1378:     YYACCEPT;
                   1379: 
                   1380:   /* Shift the lookahead token.  */
1.112     paf      1381:   YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken]));
1.1       parser   1382: 
                   1383:   /* Discard the token being shifted unless it is eof.  */
                   1384:   if (yychar != YYEOF)
                   1385:     yychar = YYEMPTY;
                   1386: 
                   1387:   *++yyvsp = yylval;
                   1388: 
1.112     paf      1389: 
                   1390:   /* Count tokens shifted since error; after three, turn off error
                   1391:      status.  */
                   1392:   if (yyerrstatus)
                   1393:     yyerrstatus--;
1.1       parser   1394: 
                   1395:   yystate = yyn;
                   1396:   goto yynewstate;
                   1397: 
1.112     paf      1398: 
                   1399: /*-----------------------------------------------------------.
                   1400: | yydefault -- do the default action for the current state.  |
                   1401: `-----------------------------------------------------------*/
1.109     paf      1402: yydefault:
1.1       parser   1403:   yyn = yydefact[yystate];
                   1404:   if (yyn == 0)
                   1405:     goto yyerrlab;
1.112     paf      1406:   goto yyreduce;
                   1407: 
1.105     paf      1408: 
1.112     paf      1409: /*-----------------------------.
                   1410: | yyreduce -- Do a reduction.  |
                   1411: `-----------------------------*/
1.1       parser   1412: yyreduce:
1.112     paf      1413:   /* yyn is the number of a rule to reduce with.  */
1.1       parser   1414:   yylen = yyr2[yyn];
1.109     paf      1415: 
1.112     paf      1416:   /* If YYLEN is nonzero, implement the default value of the action:
                   1417:      `$$ = $1'.
1.109     paf      1418: 
1.112     paf      1419:      Otherwise, the following line sets YYVAL to garbage.
                   1420:      This behavior is undocumented and Bison
                   1421:      users should not rely upon it.  Assigning to YYVAL
                   1422:      unconditionally makes the parser a bit smaller, and it avoids a
                   1423:      GCC warning that YYVAL may be used uninitialized.  */
                   1424:   yyval = yyvsp[1-yylen];
1.106     paf      1425: 
1.1       parser   1426: 
1.112     paf      1427:   YY_REDUCE_PRINT (yyn);
                   1428:   switch (yyn)
                   1429:     {
                   1430:         case 2:
1.131     misha    1431: #line 132 "compile.y"
1.112     paf      1432:     {
1.84      paf      1433:        Method& method=*new Method(Method::CT_ANY,
1.1       parser   1434:                0, 0, /*min, max numbered_params_count*/
                   1435:                0/*param_names*/, 0/*local_names*/, 
                   1436:                yyvsp[0]/*parser_code*/, 0/*native_code*/);
1.84      paf      1437:        PC.cclass->add_method(PC.alias_method(main_method_name), method);
1.112     paf      1438: ;}
                   1439:     break;
                   1440: 
                   1441:   case 9:
1.131     misha    1442: #line 147 "compile.y"
1.112     paf      1443:     {
1.84      paf      1444:        const String& command=*LA2S(*yyvsp[-2]);
1.1       parser   1445:        YYSTYPE strings_code=yyvsp[0];
1.84      paf      1446:        if(strings_code->count()<1*OPERATIONS_PER_OPVALUE) {
1.1       parser   1447:                strcpy(PC.error, "@");
                   1448:                strcat(PC.error, command.cstr());
                   1449:                strcat(PC.error, " is empty");
                   1450:                YYERROR;
                   1451:        }
                   1452:        if(command==CLASS_NAME) {
1.84      paf      1453:                if(strings_code->count()==1*OPERATIONS_PER_OPVALUE) {
1.1       parser   1454:                        // new class' name
1.84      paf      1455:                        const String& name=*LA2S(*strings_code);
1.1       parser   1456:                        // creating the class
1.84      paf      1457:                        VStateless_class* cclass=new VClass;
1.119     misha    1458:                        PC.cclass_new=cclass;
                   1459:                        PC.cclass_new->set_name(name);
1.1       parser   1460:                } else {
1.84      paf      1461:                        strcpy(PC.error, "@"CLASS_NAME" must contain only one line with class name (contains more then one)");
1.1       parser   1462:                        YYERROR;
                   1463:                }
                   1464:        } else if(command==USE_CONTROL_METHOD_NAME) {
1.84      paf      1465:                for(size_t i=0; i<strings_code->count(); i+=OPERATIONS_PER_OPVALUE) 
                   1466:                        PC.request.use_file(PC.request.main_class, *LA2S(*strings_code, i));
1.1       parser   1467:        } else if(command==BASE_NAME) {
1.119     misha    1468:                if(PC.append){
                   1469:                        strcpy(PC.error, "can't set base while appending methods to class '");
                   1470:                        strncat(PC.error, PC.cclass->name().cstr(), MAX_STRING/2);
                   1471:                        strcat(PC.error, "'");
                   1472:                        YYERROR;
                   1473:                }
                   1474:                PC.class_add();
1.59      paf      1475:                if(PC.cclass->base_class()) { // already changed from default?
1.1       parser   1476:                        strcpy(PC.error, "class already have a base '");
1.119     misha    1477:                        strncat(PC.error, PC.cclass->base_class()->name().cstr(), MAX_STRING/2);
1.1       parser   1478:                        strcat(PC.error, "'");
                   1479:                        YYERROR;
                   1480:                }
1.84      paf      1481:                if(strings_code->count()==1*OPERATIONS_PER_OPVALUE) {
                   1482:                        const String& base_name=*LA2S(*strings_code);
                   1483:                        if(Value* base_class_value=PC.request.classes().get(base_name)) {
                   1484:                                // @CLASS == @BASE sanity check
                   1485:                                if(VStateless_class *base_class=base_class_value->get_class()) {
                   1486:                                        if(PC.cclass==base_class) {
                   1487:                                                strcpy(PC.error, "@"CLASS_NAME" equals @"BASE_NAME);
                   1488:                                                YYERROR;
                   1489:                                        }
                   1490:                                        PC.cclass->get_class()->set_base(base_class);
                   1491:                                } else { // they asked to derive from a class without methods ['env' & co]
                   1492:                                        strcpy(PC.error, base_name.cstr());
                   1493:                                        strcat(PC.error, ": you can not derive from this class in @"BASE_NAME);
                   1494:                                        YYERROR;
                   1495:                                }
                   1496:                        } else {
1.1       parser   1497:                                strcpy(PC.error, base_name.cstr());
                   1498:                                strcat(PC.error, ": undefined class in @"BASE_NAME);
                   1499:                                YYERROR;
                   1500:                        }
                   1501:                } else {
                   1502:                        strcpy(PC.error, "@"BASE_NAME" must contain sole name");
                   1503:                        YYERROR;
                   1504:                }
1.116     misha    1505:        } else if(command==OPTIONS_CONTROL_METHOD_NAME) {
1.118     misha    1506:                for(size_t i=0; i<strings_code->count(); i+=OPERATIONS_PER_OPVALUE) {
                   1507:                        const String& option=*LA2S(*strings_code, i);
1.119     misha    1508:                        if(option==OPTION_ALL_VARS_LOCAL_NAME){
                   1509:                                PC.set_all_vars_local();
1.123     misha    1510:                        } else if(option==OPTION_PARTIAL_CLASS){
                   1511:                                if(PC.cclass_new){
                   1512:                                        if(VStateless_class* existed=PC.get_existed_class(PC.cclass_new)){
                   1513:                                                if(!PC.reuse_existed_class(existed)){
                   1514:                                                        strcpy(PC.error, "can't append methods to '");
                   1515:                                                        strncat(PC.error, PC.cclass_new->name().cstr(), MAX_STRING/2);
                   1516:                                                        strcat(PC.error, "' - the class wasn't marked as partial");
                   1517:                                                        YYERROR;
                   1518:                                                }
1.119     misha    1519:                                        } else {
1.123     misha    1520:                                                // mark new class as partial. we can add methods to it later.
                   1521:                                                PC.cclass_new->set_partial();
1.119     misha    1522:                                        }
1.123     misha    1523:                                } else {
                   1524:                                        strcpy(PC.error, "'"OPTION_PARTIAL_CLASS"' option should be used straight after @"CLASS_NAME);
1.119     misha    1525:                                        YYERROR;
                   1526:                                }
1.118     misha    1527:                        } else {
1.119     misha    1528:                                strcpy(PC.error, "'");
                   1529:                                strncat(PC.error, option.cstr(), MAX_STRING/2);
                   1530:                                strcat(PC.error, "' invalid option. valid options are "
1.123     misha    1531:                                        "'"OPTION_PARTIAL_CLASS"' and '"OPTION_ALL_VARS_LOCAL_NAME"'");
1.118     misha    1532:                                YYERROR;
1.116     misha    1533:                        }
                   1534:                }
1.1       parser   1535:        } else {
                   1536:                strcpy(PC.error, "'");
                   1537:                strncat(PC.error, command.cstr(), MAX_STRING/2);
                   1538:                strcat(PC.error, "' invalid special name. valid names are "
1.116     misha    1539:                        "'"CLASS_NAME"', '"USE_CONTROL_METHOD_NAME"', '"BASE_NAME"' and '"OPTIONS_CONTROL_METHOD_NAME"'.");
1.1       parser   1540:                YYERROR;
                   1541:        }
1.112     paf      1542: ;}
                   1543:     break;
                   1544: 
                   1545:   case 13:
1.131     misha    1546: #line 248 "compile.y"
1.112     paf      1547:     { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;}
                   1548:     break;
                   1549: 
                   1550:   case 17:
1.131     misha    1551: #line 252 "compile.y"
1.112     paf      1552:     { 
1.119     misha    1553:        PC.class_add();
1.96      paf      1554:        PC.explicit_result=false;
1.1       parser   1555: 
1.115     misha    1556:        YYSTYPE params_names_code=yyvsp[-3];
1.84      paf      1557:        ArrayString* params_names=0;
                   1558:        if(int size=params_names_code->count()) {
                   1559:                params_names=new ArrayString;
                   1560:                for(int i=0; i<size; i+=OPERATIONS_PER_OPVALUE)
                   1561:                        *params_names+=LA2S(*params_names_code, i);
1.1       parser   1562:        }
                   1563: 
1.115     misha    1564:        YYSTYPE locals_names_code=yyvsp[-2];
1.84      paf      1565:        ArrayString* locals_names=0;
1.116     misha    1566:        bool all_vars_local=false;
1.84      paf      1567:        if(int size=locals_names_code->count()) {
                   1568:                locals_names=new ArrayString;
1.96      paf      1569:                for(int i=0; i<size; i+=OPERATIONS_PER_OPVALUE) {
                   1570:                        const String* local_name=LA2S(*locals_names_code, i);
                   1571:                        if(*local_name==RESULT_VAR_NAME)
                   1572:                                PC.explicit_result=true;
1.119     misha    1573:                        else if(*local_name==OPTION_ALL_VARS_LOCAL_NAME)
1.116     misha    1574:                                all_vars_local=true;
1.96      paf      1575:                        else
                   1576:                                *locals_names+=local_name;
                   1577:                }
1.1       parser   1578:        }
1.124     misha    1579:        if(!all_vars_local && PC.cclass && PC.cclass->is_vars_local())
1.116     misha    1580:                all_vars_local=true;
1.1       parser   1581: 
1.96      paf      1582:        Method* method=new Method(
1.84      paf      1583:                //name, 
1.1       parser   1584:                Method::CT_ANY,
                   1585:                0, 0/*min,max numbered_params_count*/, 
                   1586:                params_names, locals_names, 
1.116     misha    1587:                0/*to be filled later in next {} */, 0, all_vars_local);
1.114     misha    1588: 
1.96      paf      1589:        *reinterpret_cast<Method**>(&yyval)=method;
                   1590: 
                   1591:        // todo: check [][;result;]
1.112     paf      1592: ;}
                   1593:     break;
                   1594: 
1.115     misha    1595:   case 18:
1.131     misha    1596: #line 292 "compile.y"
1.115     misha    1597:     {
1.124     misha    1598:                Method& method=*reinterpret_cast<Method*>(yyvsp[-1]);
                   1599:                // fill in the code
                   1600:                method.parser_code=yyvsp[0];
                   1601: 
                   1602:                // register in class
                   1603:                const String& name=*LA2S(*yyvsp[-6]);
                   1604:                PC.cclass->add_method(PC.alias_method(name), method);
1.115     misha    1605: ;}
                   1606:     break;
                   1607: 
                   1608:   case 21:
1.131     misha    1609: #line 303 "compile.y"
1.114     misha    1610:     {yyval=yyvsp[-1];}
1.112     paf      1611:     break;
                   1612: 
1.115     misha    1613:   case 25:
1.131     misha    1614: #line 305 "compile.y"
1.112     paf      1615:     { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]) ;}
                   1616:     break;
                   1617: 
1.115     misha    1618:   case 31:
1.131     misha    1619: #line 313 "compile.y"
1.112     paf      1620:     { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;}
                   1621:     break;
                   1622: 
1.115     misha    1623:   case 37:
1.131     misha    1624: #line 319 "compile.y"
1.112     paf      1625:     {
1.131     misha    1626:        yyval=N();
                   1627:        YYSTYPE code=yyvsp[0];
1.138   ! misha    1628: 
1.128     misha    1629: #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT
1.132     misha    1630:        if(!maybe_change_first_opcode(*code, OP::OP_VALUE__GET_ELEMENT, /*=>*/OP::OP_VALUE__GET_ELEMENT__WRITE))
1.131     misha    1631: #endif
1.132     misha    1632: 
1.138   ! misha    1633: #ifdef OPTIMIZE_BYTECODE_GET_SELF_ELEMENT
        !          1634:        if(!maybe_change_first_opcode(*code, OP::OP_WITH_SELF__VALUE__GET_ELEMENT, /*=>*/OP::OP_WITH_SELF__VALUE__GET_ELEMENT__WRITE))
        !          1635: #endif
        !          1636: 
1.132     misha    1637: #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT
1.137     misha    1638:                if(
                   1639:                        code->count()!=5
                   1640:                        || !maybe_change_first_opcode(*code, OP::OP_GET_OBJECT_ELEMENT, /*=>*/OP::OP_GET_OBJECT_ELEMENT__WRITE)
                   1641:                )
1.128     misha    1642: #endif
1.132     misha    1643: 
                   1644: #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT
1.137     misha    1645:                if(
                   1646:                        code->count()!=5
                   1647:                        || !maybe_change_first_opcode(*code, OP::OP_GET_OBJECT_VAR_ELEMENT, /*=>*/OP::OP_GET_OBJECT_VAR_ELEMENT__WRITE)
                   1648:                )
1.131     misha    1649: #endif
1.137     misha    1650:                {
                   1651:                        changetail_or_append(*code, 
                   1652:                                OP::OP_GET_ELEMENT, false,  /*=>*/OP::OP_GET_ELEMENT__WRITE,
                   1653:                                /*or */OP::OP_WRITE_VALUE
                   1654:                                ); /* value=pop; wcontext.write(value) */
                   1655:                }
1.132     misha    1656: 
1.131     misha    1657:        P(*yyval, *code);
1.112     paf      1658: ;}
                   1659:     break;
                   1660: 
1.115     misha    1661:   case 38:
1.138   ! misha    1662: #line 353 "compile.y"
1.112     paf      1663:     { yyval=yyvsp[0] ;}
                   1664:     break;
                   1665: 
1.115     misha    1666:   case 41:
1.138   ! misha    1667: #line 355 "compile.y"
1.112     paf      1668:     { yyval=yyvsp[-1] ;}
                   1669:     break;
                   1670: 
1.115     misha    1671:   case 44:
1.138   ! misha    1672: #line 359 "compile.y"
1.112     paf      1673:     {
1.84      paf      1674:        yyval=N(); 
1.131     misha    1675:        YYSTYPE diving_code=yyvsp[0];
1.84      paf      1676:        const String* first_name=LA2S(*diving_code);
1.132     misha    1677:        size_t count=diving_code->count();
1.131     misha    1678:        // self.xxx... => xxx...
1.84      paf      1679:        // OP_VALUE+origin+string+OP_GET_ELEMENT+... -> OP_WITH_SELF+...
1.1       parser   1680:        if(first_name && *first_name==SELF_ELEMENT_NAME) {
1.138   ! misha    1681: #ifdef OPTIMIZE_BYTECODE_GET_SELF_ELEMENT
        !          1682:                if(maybe_make_with_self_get_element(*yyval, *diving_code, count)){
        !          1683:                        // optimization for $self.field and ^self.method
        !          1684:                } else
        !          1685: #endif
        !          1686:                        {
        !          1687:                                O(*yyval, OP::OP_WITH_SELF); /* stack: starting context */
        !          1688:                                P(*yyval, *diving_code, 
        !          1689:                                        /* skip over... */
        !          1690:                                        count>=4?4/*OP_VALUE+origin+string+OP_GET_ELEMENTx*/:3/*OP::OP_+origin+string*/);
        !          1691:                        }
1.132     misha    1692:        }
                   1693: 
                   1694: #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_ELEMENT
1.133     misha    1695:        else if(maybe_make_get_object_element(*yyval, *diving_code, count)){
1.138   ! misha    1696:                // optimization for $object.field + ^object.method[
1.132     misha    1697:        }
1.131     misha    1698: #endif
1.132     misha    1699: 
                   1700: #ifdef OPTIMIZE_BYTECODE_GET_OBJECT_VAR_ELEMENT
1.133     misha    1701:        else if(maybe_make_get_object_var_element(*yyval, *diving_code, count)){
1.138   ! misha    1702:                // optimization for $object.$var
1.132     misha    1703:        }
1.131     misha    1704: #endif
1.132     misha    1705: 
                   1706: #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT
                   1707:        else if(count==4){ // optimization
                   1708:                O(*yyval,
                   1709:                        (PC.in_call_value)
                   1710:                        ? OP::OP_VALUE__GET_ELEMENT_OR_OPERATOR // ^object[ : OP_VALUE+origin+string+OP_GET_ELEMENT => OP_VALUE__GET_ELEMENT_OR_OPERATOR+origin+string
                   1711:                        : OP::OP_VALUE__GET_ELEMENT             // $object  : OP_VALUE+origin+string+OP_GET_ELEMENT => OP_VALUE__GET_ELEMENT+origin+string
                   1712:                );
                   1713:                P(*yyval, *diving_code, 1/*offset*/, 2/*limit*/); // copy origin+value
                   1714:        } else {
                   1715:                O(*yyval, OP::OP_WITH_READ); /* stack: starting context */
                   1716:                P(*yyval, *diving_code);
                   1717:        }
1.126     misha    1718: #else
1.132     misha    1719:        else {
1.122     misha    1720:                O(*yyval, OP::OP_WITH_READ); /* stack: starting context */
1.37      paf      1721: 
1.131     misha    1722:                // ^if OP_ELEMENT => ^if OP_ELEMENT_OR_OPERATOR
                   1723:                // optimized OP_VALUE+origin+string+OP_GET_ELEMENT. => OP_VALUE+origin+string+OP_GET_ELEMENT_OR_OPERATOR.
1.132     misha    1724:                if(PC.in_call_value && count==4)
                   1725:                        diving_code->put(count-1, OP::OP_GET_ELEMENT_OR_OPERATOR);
1.84      paf      1726:                P(*yyval, *diving_code);
1.132     misha    1727:        }
1.126     misha    1728: #endif
1.1       parser   1729:        /* diving code; stack: current context */
1.112     paf      1730: ;}
                   1731:     break;
                   1732: 
1.115     misha    1733:   case 45:
1.138   ! misha    1734: #line 417 "compile.y"
1.112     paf      1735:     { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;}
                   1736:     break;
                   1737: 
1.115     misha    1738:   case 47:
1.138   ! misha    1739: #line 418 "compile.y"
1.112     paf      1740:     { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;}
                   1741:     break;
                   1742: 
1.115     misha    1743:   case 48:
1.138   ! misha    1744: #line 422 "compile.y"
1.112     paf      1745:     {
1.134     misha    1746:        yyval=N();
1.137     misha    1747: #ifdef OPTIMIZE_BYTECODE_CONSTRUCT
                   1748:        if(maybe_optimize_construct(*yyval, *yyvsp[-1], *yyvsp[0])){
                   1749:                // $a(expr), $.a(expr), $a[value], $.a[value]
1.134     misha    1750:        } else 
                   1751: #endif
                   1752:        {
                   1753:                P(*yyval, *yyvsp[-1]); /* stack: context,name */
                   1754:                P(*yyval, *yyvsp[0]); /* stack: context,name,constructor_value */
                   1755:        }
1.112     paf      1756: ;}
                   1757:     break;
                   1758: 
1.115     misha    1759:   case 52:
1.138   ! misha    1760: #line 438 "compile.y"
1.112     paf      1761:     {
1.84      paf      1762:        yyval=N();
1.131     misha    1763:        YYSTYPE diving_code=yyvsp[0];
1.84      paf      1764:        const String* first_name=LA2S(*diving_code);
1.131     misha    1765:        // $self.xxx... => $xxx...
                   1766:        // OP_VALUE+origin+string+OP_GET_ELEMENT+... => OP_WITH_SELF+...
1.1       parser   1767:        if(first_name && *first_name==SELF_ELEMENT_NAME) {
1.122     misha    1768:                O(*yyval, OP::OP_WITH_SELF); /* stack: starting context */
1.84      paf      1769:                P(*yyval, *diving_code, 
1.1       parser   1770:                        /* skip over... */
1.122     misha    1771:                        diving_code->count()>=4?4/*OP::OP_VALUE+origin+string+OP::OP_GET_ELEMENTx*/:3/*OP::OP_+origin+string*/);
1.1       parser   1772:        } else {
1.122     misha    1773:                O(*yyval, OP::OP_WITH_ROOT); /* stack: starting context */
1.84      paf      1774:                P(*yyval, *diving_code);
1.1       parser   1775:        }
                   1776:        /* diving code; stack: current context */
1.112     paf      1777: ;}
                   1778:     break;
                   1779: 
1.115     misha    1780:   case 53:
1.138   ! misha    1781: #line 455 "compile.y"
1.112     paf      1782:     {
1.84      paf      1783:        yyval=N(); 
1.122     misha    1784:        O(*yyval, OP::OP_WITH_WRITE); /* stack: starting context */
1.84      paf      1785:        P(*yyval, *yyvsp[0]); /* diving code; stack: context,name */
1.112     paf      1786: ;}
                   1787:     break;
                   1788: 
1.115     misha    1789:   case 54:
1.138   ! misha    1790: #line 460 "compile.y"
1.112     paf      1791:     { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;}
                   1792:     break;
                   1793: 
1.115     misha    1794:   case 58:
1.138   ! misha    1795: #line 467 "compile.y"
1.112     paf      1796:     {
1.100     paf      1797:        // allow $result_or_other_variable[ letters here any time ]
1.99      paf      1798:        *reinterpret_cast<bool*>(&yyval)=PC.explicit_result; PC.explicit_result=false;
1.112     paf      1799: ;}
                   1800:     break;
                   1801: 
1.115     misha    1802:   case 59:
1.138   ! misha    1803: #line 470 "compile.y"
1.112     paf      1804:     {
1.106     paf      1805:        PC.explicit_result=*reinterpret_cast<bool*>(&yyvsp[-1]);
1.112     paf      1806: ;}
                   1807:     break;
                   1808: 
1.115     misha    1809:   case 60:
1.138   ! misha    1810: #line 472 "compile.y"
1.112     paf      1811:     {
1.1       parser   1812:        // stack: context, name
1.99      paf      1813:        yyval=yyvsp[-2]; // stack: context, name, value
1.122     misha    1814:        O(*yyval, OP::OP_CONSTRUCT_VALUE); /* value=pop; name=pop; context=pop; construct(context,name,value) */
1.112     paf      1815: ;}
                   1816:     break;
                   1817: 
1.115     misha    1818:   case 61:
1.138   ! misha    1819: #line 478 "compile.y"
1.112     paf      1820:     { 
1.84      paf      1821:        yyval=N(); 
1.122     misha    1822:        O(*yyval, OP::OP_PREPARE_TO_EXPRESSION);
1.1       parser   1823:        // stack: context, name
1.84      paf      1824:        P(*yyval, *yyvsp[-1]); // stack: context, name, value
1.122     misha    1825:        O(*yyval, OP::OP_CONSTRUCT_EXPR); /* value=pop->as_expr_result; name=pop; context=pop; construct(context,name,value) */
1.112     paf      1826: ;}
                   1827:     break;
                   1828: 
1.115     misha    1829:   case 62:
1.138   ! misha    1830: #line 486 "compile.y"
1.112     paf      1831:     {
1.1       parser   1832:        // stack: context, name
1.84      paf      1833:        yyval=N(); 
1.122     misha    1834:        OA(*yyval, OP::OP_CURLY_CODE__CONSTRUCT, yyvsp[-1]); /* code=pop; name=pop; context=pop; construct(context,name,junction(code)) */
1.112     paf      1835: ;}
                   1836:     break;
                   1837: 
1.115     misha    1838:   case 66:
1.138   ! misha    1839: #line 497 "compile.y"
1.112     paf      1840:     {
1.84      paf      1841:        yyval=N(); 
1.122     misha    1842:        OA(*yyval, OP::OP_OBJECT_POOL, yyvsp[0]); /* stack: empty write context */
1.47      paf      1843:        /* some code that writes to that context */
                   1844:        /* context=pop; stack: context.value() */
1.112     paf      1845: ;}
                   1846:     break;
                   1847: 
1.115     misha    1848:   case 69:
1.138   ! misha    1849: #line 504 "compile.y"
1.112     paf      1850:     { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;}
                   1851:     break;
                   1852: 
1.115     misha    1853:   case 70:
1.138   ! misha    1854: #line 508 "compile.y"
1.112     paf      1855:     {
1.131     misha    1856: #ifdef OPTIMIZE_BYTECODE_CUT_REM_OPERATOR
                   1857:        if((*yyvsp[0]).count())
                   1858: #endif
                   1859:        {
                   1860:                yyval=yyvsp[0]; /* stack: value */
                   1861:                changetail_or_append(*yyval, 
                   1862:                        OP::OP_CALL, true,  /*=>*/ OP::OP_CALL__WRITE,
                   1863:                        /*or */OP::OP_WRITE_VALUE); /* value=pop; wcontext.write(value) */
                   1864:        }
1.112     paf      1865: ;}
                   1866:     break;
                   1867: 
1.115     misha    1868:   case 71:
1.138   ! misha    1869: #line 519 "compile.y"
1.112     paf      1870:     { 
1.39      paf      1871:                                        PC.in_call_value=true; 
1.112     paf      1872:                        ;}
                   1873:     break;
                   1874: 
1.115     misha    1875:   case 72:
1.138   ! misha    1876: #line 522 "compile.y"
1.112     paf      1877:     {
1.39      paf      1878:                                PC.in_call_value=false;
1.112     paf      1879:                        ;}
                   1880:     break;
                   1881: 
1.115     misha    1882:   case 73:
1.138   ! misha    1883: #line 525 "compile.y"
1.112     paf      1884:     { /* ^field.$method{vasya} */
1.131     misha    1885: #ifdef OPTIMIZE_BYTECODE_CUT_REM_OPERATOR
1.135     misha    1886: #ifdef OPTIMIZE_BYTECODE_GET_ELEMENT
1.131     misha    1887:        const String* operator_name=LA2S(*yyvsp[-3], 0, OP::OP_VALUE__GET_ELEMENT_OR_OPERATOR);
1.135     misha    1888: #else
                   1889:        const String* operator_name=LA2S(*yyvsp[-3], 1);
                   1890: #endif
1.131     misha    1891:        if(operator_name && *operator_name == REM_OPERATOR_NAME){
                   1892:                yyval=N();
                   1893:        } else 
                   1894: #endif
                   1895:                {
                   1896:                        yyval=yyvsp[-3]; /* with_xxx,diving code; stack: context,method_junction */
1.1       parser   1897: 
1.131     misha    1898:                        YYSTYPE params_code=yyvsp[-1];
                   1899:                        if(params_code->count()==3) { // probably [] case. [OP::OP_VALUE+origin+Void]
                   1900:                                if(Value* value=LA2V(*params_code)) // it is OP_VALUE+origin+value?
                   1901:                                        if(value->is_void()) // value is VVoid?
                   1902:                                                params_code=0; // ^zzz[] case. don't append lone empty param.
                   1903:                        }
                   1904:                        /* stack: context, method_junction */
                   1905:                        OA(*yyval, OP::OP_CALL, params_code); // method_frame=make frame(pop junction); ncontext=pop; call(ncontext,method_frame) stack: value
                   1906:                }
1.112     paf      1907: ;}
                   1908:     break;
                   1909: 
1.115     misha    1910:   case 76:
1.138   ! misha    1911: #line 552 "compile.y"
1.112     paf      1912:     { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;}
                   1913:     break;
                   1914: 
1.115     misha    1915:   case 80:
1.138   ! misha    1916: #line 558 "compile.y"
1.112     paf      1917:     {
1.100     paf      1918:        // allow ^call[ letters here any time ]
1.98      paf      1919:        *reinterpret_cast<bool*>(&yyval)=PC.explicit_result; PC.explicit_result=false;
1.112     paf      1920: ;}
                   1921:     break;
                   1922: 
1.115     misha    1923:   case 81:
1.138   ! misha    1924: #line 561 "compile.y"
1.112     paf      1925:     {
1.106     paf      1926:        PC.explicit_result=*reinterpret_cast<bool*>(&yyvsp[-1]);
1.112     paf      1927: ;}
                   1928:     break;
                   1929: 
1.115     misha    1930:   case 82:
1.138   ! misha    1931: #line 563 "compile.y"
1.112     paf      1932:     {yyval=yyvsp[-2];}
                   1933:     break;
                   1934: 
1.115     misha    1935:   case 83:
1.138   ! misha    1936: #line 564 "compile.y"
1.112     paf      1937:     {yyval=yyvsp[-1];}
                   1938:     break;
                   1939: 
1.115     misha    1940:   case 84:
1.138   ! misha    1941: #line 565 "compile.y"
1.112     paf      1942:     {yyval=yyvsp[-1];}
                   1943:     break;
                   1944: 
1.115     misha    1945:   case 86:
1.138   ! misha    1946: #line 568 "compile.y"
1.112     paf      1947:     { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]) ;}
                   1948:     break;
                   1949: 
1.115     misha    1950:   case 88:
1.138   ! misha    1951: #line 572 "compile.y"
1.112     paf      1952:     { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]) ;}
                   1953:     break;
                   1954: 
1.115     misha    1955:   case 90:
1.138   ! misha    1956: #line 576 "compile.y"
1.112     paf      1957:     { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]) ;}
                   1958:     break;
                   1959: 
1.115     misha    1960:   case 91:
1.138   ! misha    1961: #line 578 "compile.y"
1.112     paf      1962:     {
1.1       parser   1963:        yyval=yyvsp[0];
1.112     paf      1964: ;}
                   1965:     break;
                   1966: 
1.115     misha    1967:   case 92:
1.138   ! misha    1968: #line 581 "compile.y"
1.112     paf      1969:     {
1.104     paf      1970:        YYSTYPE expr_code=yyvsp[0];
1.106     paf      1971:        if(expr_code->count()==3
1.127     misha    1972:                && (*expr_code)[0].code==OP::OP_VALUE) { // optimizing (double/bool/incidently 'string' too) case. [OP::OP_VALUE+origin+Double]. no evaluating
1.104     paf      1973:                yyval=expr_code; 
                   1974:        } else {
1.131     misha    1975:                YYSTYPE code=N();
1.122     misha    1976:                O(*code, OP::OP_PREPARE_TO_EXPRESSION);
1.104     paf      1977:                P(*code, *expr_code);
1.122     misha    1978:                O(*code, OP::OP_WRITE_EXPR_RESULT);
1.104     paf      1979:                yyval=N(); 
1.122     misha    1980:                OA(*yyval, OP::OP_EXPR_CODE__STORE_PARAM, code);
1.104     paf      1981:        }
1.112     paf      1982: ;}
                   1983:     break;
                   1984: 
1.115     misha    1985:   case 93:
1.138   ! misha    1986: #line 595 "compile.y"
1.112     paf      1987:     {
1.84      paf      1988:        yyval=N(); 
1.122     misha    1989:        OA(*yyval, OP::OP_CURLY_CODE__STORE_PARAM, yyvsp[0]);
1.112     paf      1990: ;}
                   1991:     break;
                   1992: 
1.115     misha    1993:   case 98:
1.138   ! misha    1994: #line 607 "compile.y"
1.112     paf      1995:     { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;}
                   1996:     break;
                   1997: 
1.115     misha    1998:   case 100:
1.138   ! misha    1999: #line 609 "compile.y"
1.112     paf      2000:     { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;}
                   2001:     break;
                   2002: 
1.115     misha    2003:   case 102:
1.138   ! misha    2004: #line 611 "compile.y"
1.112     paf      2005:     {
1.33      paf      2006:        // we know that name_advance1 not called from ^xxx context
                   2007:        // so we'll not check for operator call possibility as we do in name_advance2
                   2008: 
1.1       parser   2009:        /* stack: context */
                   2010:        yyval=yyvsp[0]; /* stack: context,name */
1.122     misha    2011:        O(*yyval, OP::OP_GET_ELEMENT); /* name=pop; context=pop; stack: context.get_element(name) */
1.112     paf      2012: ;}
                   2013:     break;
                   2014: 
1.115     misha    2015:   case 103:
1.138   ! misha    2016: #line 619 "compile.y"
1.112     paf      2017:     {
1.1       parser   2018:        /* stack: context */
                   2019:        yyval=yyvsp[0]; /* stack: context,name */
1.122     misha    2020:        O(*yyval, OP::OP_GET_ELEMENT); /* name=pop; context=pop; stack: context.get_element(name) */
1.112     paf      2021: ;}
                   2022:     break;
                   2023: 
1.115     misha    2024:   case 109:
1.138   ! misha    2025: #line 632 "compile.y"
1.112     paf      2026:     {
1.1       parser   2027:        yyval=yyvsp[0];
1.122     misha    2028:        O(*yyval, OP::OP_GET_ELEMENT);
1.112     paf      2029: ;}
                   2030:     break;
                   2031: 
1.115     misha    2032:   case 110:
1.138   ! misha    2033: #line 636 "compile.y"
1.112     paf      2034:     {
1.131     misha    2035:        YYSTYPE code;
1.47      paf      2036:        {
1.84      paf      2037:                change_string_literal_to_write_string_literal(*(code=yyvsp[-1]));
                   2038:                P(*code, *yyvsp[0]);
1.47      paf      2039:        }
1.84      paf      2040:        yyval=N(); 
1.122     misha    2041:        OA(*yyval, OP::OP_STRING_POOL, code);
1.112     paf      2042: ;}
                   2043:     break;
                   2044: 
1.115     misha    2045:   case 111:
1.138   ! misha    2046: #line 645 "compile.y"
1.112     paf      2047:     {
1.100     paf      2048:        // allow $result_or_other_variable[ letters here any time ]
                   2049:        *reinterpret_cast<bool*>(&yyval)=PC.explicit_result; PC.explicit_result=false;
1.112     paf      2050: ;}
                   2051:     break;
                   2052: 
1.115     misha    2053:   case 112:
1.138   ! misha    2054: #line 648 "compile.y"
1.112     paf      2055:     {
1.101     paf      2056:        PC.explicit_result=*reinterpret_cast<bool*>(&yyvsp[-1]);
1.112     paf      2057: ;}
                   2058:     break;
                   2059: 
1.115     misha    2060:   case 113:
1.138   ! misha    2061: #line 650 "compile.y"
1.112     paf      2062:     {
1.84      paf      2063:        yyval=N(); 
1.122     misha    2064:        OA(*yyval, OP::OP_OBJECT_POOL, yyvsp[-2]); /* stack: empty write context */
1.47      paf      2065:        /* some code that writes to that context */
                   2066:        /* context=pop; stack: context.value() */
1.112     paf      2067: ;}
                   2068:     break;
                   2069: 
1.115     misha    2070:   case 114:
1.138   ! misha    2071: #line 656 "compile.y"
1.112     paf      2072:     {
1.84      paf      2073:        yyval=N(); 
1.122     misha    2074:        O(*yyval, OP::OP_WITH_READ);
1.84      paf      2075:        P(*yyval, *yyvsp[0]);
1.112     paf      2076: ;}
                   2077:     break;
                   2078: 
1.115     misha    2079:   case 116:
1.138   ! misha    2080: #line 661 "compile.y"
1.112     paf      2081:     { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;}
                   2082:     break;
                   2083: 
1.115     misha    2084:   case 117:
1.138   ! misha    2085: #line 662 "compile.y"
1.112     paf      2086:     {
1.1       parser   2087:        yyval=yyvsp[0];
1.122     misha    2088:        O(*yyval, OP::OP_GET_ELEMENT__WRITE);
1.112     paf      2089: ;}
                   2090:     break;
                   2091: 
1.115     misha    2092:   case 120:
1.138   ! misha    2093: #line 671 "compile.y"
1.112     paf      2094:     {
1.1       parser   2095:        yyval=yyvsp[-1]; // stack: class name string
1.84      paf      2096:        if(*LA2S(*yyval) == BASE_NAME) { // pseudo BASE class
                   2097:                if(VStateless_class* base=PC.cclass->base_class()) {
                   2098:                        change_string_literal_value(*yyval, base->name());
1.61      paf      2099:                } else {
                   2100:                        strcpy(PC.error, "no base class declared");
                   2101:                        YYERROR;
                   2102:                }
                   2103:        }
1.126     misha    2104: #ifdef OPTIMIZE_BYTECODE_GET_CLASS
1.131     misha    2105:        // optimized OP_VALUE+origin+string+OP_GET_CLASS => OP_VALUE__GET_CLASS+origin+string
1.138   ! misha    2106:        maybe_change_first_opcode(*yyval, OP::OP_VALUE, OP::OP_VALUE__GET_CLASS)
1.126     misha    2107: #else
1.122     misha    2108:        O(*yyval, OP::OP_GET_CLASS);
1.126     misha    2109: #endif
1.112     paf      2110: ;}
                   2111:     break;
                   2112: 
1.115     misha    2113:   case 121:
1.138   ! misha    2114: #line 688 "compile.y"
1.112     paf      2115:     {
1.1       parser   2116:        yyval=yyvsp[-1];
1.39      paf      2117:        if(!PC.in_call_value) {
1.1       parser   2118:                strcpy(PC.error, ":: not allowed here");
                   2119:                YYERROR;
                   2120:        }
1.122     misha    2121:        O(*yyval, OP::OP_PREPARE_TO_CONSTRUCT_OBJECT);
1.112     paf      2122: ;}
                   2123:     break;
                   2124: 
1.115     misha    2125:   case 128:
1.138   ! misha    2126: #line 707 "compile.y"
1.114     misha    2127:     { yyval = yyvsp[-1] ;}
                   2128:     break;
                   2129: 
1.115     misha    2130:   case 129:
1.138   ! misha    2131: #line 708 "compile.y"
1.112     paf      2132:     { yyval = yyvsp[-1] ;}
                   2133:     break;
                   2134: 
1.115     misha    2135:   case 130:
1.138   ! misha    2136: #line 709 "compile.y"
1.114     misha    2137:     { yyval = yyvsp[-1]; ;}
1.112     paf      2138:     break;
                   2139: 
1.115     misha    2140:   case 131:
1.138   ! misha    2141: #line 711 "compile.y"
1.122     misha    2142:     { yyval=yyvsp[0];  O(*yyval, OP::OP_NEG) ;}
1.112     paf      2143:     break;
                   2144: 
1.115     misha    2145:   case 132:
1.138   ! misha    2146: #line 712 "compile.y"
1.114     misha    2147:     { yyval=yyvsp[0] ;}
1.112     paf      2148:     break;
                   2149: 
1.115     misha    2150:   case 133:
1.138   ! misha    2151: #line 713 "compile.y"
1.122     misha    2152:     { yyval=yyvsp[0];   O(*yyval, OP::OP_INV) ;}
1.112     paf      2153:     break;
                   2154: 
1.115     misha    2155:   case 134:
1.138   ! misha    2156: #line 714 "compile.y"
1.122     misha    2157:     { yyval=yyvsp[0];  O(*yyval, OP::OP_NOT) ;}
1.112     paf      2158:     break;
                   2159: 
1.115     misha    2160:   case 135:
1.138   ! misha    2161: #line 715 "compile.y"
1.122     misha    2162:     { yyval=yyvsp[0];  O(*yyval, OP::OP_DEF) ;}
1.112     paf      2163:     break;
                   2164: 
1.115     misha    2165:   case 136:
1.138   ! misha    2166: #line 716 "compile.y"
1.122     misha    2167:     { yyval=yyvsp[0];  O(*yyval, OP::OP_IN) ;}
1.112     paf      2168:     break;
                   2169: 
1.115     misha    2170:   case 137:
1.138   ! misha    2171: #line 717 "compile.y"
1.122     misha    2172:     { yyval=yyvsp[0];  O(*yyval, OP::OP_FEXISTS) ;}
1.112     paf      2173:     break;
                   2174: 
1.115     misha    2175:   case 138:
1.138   ! misha    2176: #line 718 "compile.y"
1.122     misha    2177:     { yyval=yyvsp[0];  O(*yyval, OP::OP_DEXISTS) ;}
1.112     paf      2178:     break;
                   2179: 
1.115     misha    2180:   case 139:
1.138   ! misha    2181: #line 720 "compile.y"
1.122     misha    2182:     {  yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP::OP_SUB) ;}
1.112     paf      2183:     break;
                   2184: 
1.115     misha    2185:   case 140:
1.138   ! misha    2186: #line 721 "compile.y"
1.122     misha    2187:     { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP::OP_ADD) ;}
1.112     paf      2188:     break;
                   2189: 
1.115     misha    2190:   case 141:
1.138   ! misha    2191: #line 722 "compile.y"
1.122     misha    2192:     { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP::OP_MUL) ;}
1.112     paf      2193:     break;
                   2194: 
1.115     misha    2195:   case 142:
1.138   ! misha    2196: #line 723 "compile.y"
1.122     misha    2197:     { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP::OP_DIV) ;}
1.112     paf      2198:     break;
                   2199: 
1.115     misha    2200:   case 143:
1.138   ! misha    2201: #line 724 "compile.y"
1.122     misha    2202:     { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP::OP_MOD) ;}
1.112     paf      2203:     break;
                   2204: 
1.115     misha    2205:   case 144:
1.138   ! misha    2206: #line 725 "compile.y"
1.122     misha    2207:     { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP::OP_INTDIV) ;}
1.112     paf      2208:     break;
                   2209: 
1.115     misha    2210:   case 145:
1.138   ! misha    2211: #line 726 "compile.y"
1.122     misha    2212:     { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP::OP_BIN_SL) ;}
1.112     paf      2213:     break;
                   2214: 
1.115     misha    2215:   case 146:
1.138   ! misha    2216: #line 727 "compile.y"
1.122     misha    2217:     { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP::OP_BIN_SR) ;}
1.112     paf      2218:     break;
                   2219: 
1.115     misha    2220:   case 147:
1.138   ! misha    2221: #line 728 "compile.y"
1.122     misha    2222:     { yyval=yyvsp[-2];         P(*yyval, *yyvsp[0]);  O(*yyval, OP::OP_BIN_AND) ;}
1.112     paf      2223:     break;
                   2224: 
1.115     misha    2225:   case 148:
1.138   ! misha    2226: #line 729 "compile.y"
1.122     misha    2227:     { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP::OP_BIN_OR) ;}
1.112     paf      2228:     break;
                   2229: 
1.115     misha    2230:   case 149:
1.138   ! misha    2231: #line 730 "compile.y"
1.122     misha    2232:     { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP::OP_BIN_XOR) ;}
1.112     paf      2233:     break;
                   2234: 
1.115     misha    2235:   case 150:
1.138   ! misha    2236: #line 731 "compile.y"
1.122     misha    2237:     { yyval=yyvsp[-2];  OA(*yyval, OP::OP_NESTED_CODE, yyvsp[0]);  O(*yyval, OP::OP_LOG_AND) ;}
1.112     paf      2238:     break;
                   2239: 
1.115     misha    2240:   case 151:
1.138   ! misha    2241: #line 732 "compile.y"
1.122     misha    2242:     { yyval=yyvsp[-2];  OA(*yyval, OP::OP_NESTED_CODE, yyvsp[0]);  O(*yyval, OP::OP_LOG_OR) ;}
1.112     paf      2243:     break;
                   2244: 
1.115     misha    2245:   case 152:
1.138   ! misha    2246: #line 733 "compile.y"
1.122     misha    2247:     { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP::OP_LOG_XOR) ;}
1.112     paf      2248:     break;
                   2249: 
1.115     misha    2250:   case 153:
1.138   ! misha    2251: #line 734 "compile.y"
1.122     misha    2252:     { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP::OP_NUM_LT) ;}
1.112     paf      2253:     break;
                   2254: 
1.115     misha    2255:   case 154:
1.138   ! misha    2256: #line 735 "compile.y"
1.122     misha    2257:     { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP::OP_NUM_GT) ;}
1.112     paf      2258:     break;
                   2259: 
1.115     misha    2260:   case 155:
1.138   ! misha    2261: #line 736 "compile.y"
1.122     misha    2262:     { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP::OP_NUM_LE) ;}
1.112     paf      2263:     break;
                   2264: 
1.115     misha    2265:   case 156:
1.138   ! misha    2266: #line 737 "compile.y"
1.122     misha    2267:     { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP::OP_NUM_GE) ;}
1.112     paf      2268:     break;
                   2269: 
1.115     misha    2270:   case 157:
1.138   ! misha    2271: #line 738 "compile.y"
1.122     misha    2272:     { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP::OP_NUM_EQ) ;}
1.112     paf      2273:     break;
                   2274: 
1.115     misha    2275:   case 158:
1.138   ! misha    2276: #line 739 "compile.y"
1.122     misha    2277:     { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP::OP_NUM_NE) ;}
1.112     paf      2278:     break;
                   2279: 
1.115     misha    2280:   case 159:
1.138   ! misha    2281: #line 740 "compile.y"
1.122     misha    2282:     { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP::OP_STR_LT) ;}
1.112     paf      2283:     break;
                   2284: 
1.115     misha    2285:   case 160:
1.138   ! misha    2286: #line 741 "compile.y"
1.122     misha    2287:     { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP::OP_STR_GT) ;}
1.112     paf      2288:     break;
                   2289: 
1.115     misha    2290:   case 161:
1.138   ! misha    2291: #line 742 "compile.y"
1.122     misha    2292:     { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP::OP_STR_LE) ;}
1.112     paf      2293:     break;
                   2294: 
1.115     misha    2295:   case 162:
1.138   ! misha    2296: #line 743 "compile.y"
1.122     misha    2297:     { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP::OP_STR_GE) ;}
1.112     paf      2298:     break;
                   2299: 
1.115     misha    2300:   case 163:
1.138   ! misha    2301: #line 744 "compile.y"
1.122     misha    2302:     { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP::OP_STR_EQ) ;}
1.112     paf      2303:     break;
                   2304: 
1.115     misha    2305:   case 164:
1.138   ! misha    2306: #line 745 "compile.y"
1.122     misha    2307:     { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP::OP_STR_NE) ;}
1.112     paf      2308:     break;
                   2309: 
1.115     misha    2310:   case 165:
1.138   ! misha    2311: #line 746 "compile.y"
1.122     misha    2312:     { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP::OP_IS) ;}
1.112     paf      2313:     break;
                   2314: 
1.115     misha    2315:   case 166:
1.138   ! misha    2316: #line 749 "compile.y"
1.112     paf      2317:     {
1.131     misha    2318:        // optimized OP_STRING => OP_VALUE for doubles
1.104     paf      2319:        maybe_change_string_literal_to_double_literal(*(yyval=yyvsp[0]));
1.112     paf      2320: ;}
                   2321:     break;
                   2322: 
1.115     misha    2323:   case 167:
1.138   ! misha    2324: #line 754 "compile.y"
1.112     paf      2325:     {
1.131     misha    2326: #ifdef OPTIMIZE_BYTECODE_STRING_POOL
                   2327:        // it brakes ^if(" 09 "){...}
                   2328:        YYSTYPE code=yyvsp[0];
                   2329:        yyval=N();
1.132     misha    2330:        if(code->count()==3 && maybe_change_first_opcode(*code, OP::OP_STRING__WRITE, OP::OP_VALUE)){
1.131     misha    2331:                // optimized OP_STRING__WRITE+origin+value => OP_VALUE+origin+value without starting OP_STRING_POOL
                   2332:                P(*yyval, *code);
                   2333:        } else {
                   2334:                OA(*yyval, OP::OP_STRING_POOL, code); /* stack: empty write context */
                   2335:        }
                   2336: #else
1.84      paf      2337:        yyval=N();
1.122     misha    2338:        OA(*yyval, OP::OP_STRING_POOL, yyvsp[0]); /* stack: empty write context */
1.131     misha    2339: #endif
1.47      paf      2340:        /* some code that writes to that context */
                   2341:        /* context=pop; stack: context.get_string() */
1.112     paf      2342: ;}
                   2343:     break;
                   2344: 
1.115     misha    2345:   case 168:
1.138   ! misha    2346: #line 775 "compile.y"
1.112     paf      2347:     {
1.131     misha    2348:        // optimized OP_STRING+OP_WRITE_VALUE => OP_STRING__WRITE
1.97      paf      2349:        change_string_literal_to_write_string_literal(*(yyval=yyvsp[0]))
1.112     paf      2350: ;}
                   2351:     break;
                   2352: 
1.115     misha    2353:   case 169:
1.138   ! misha    2354: #line 780 "compile.y"
1.112     paf      2355:     { yyval=VL(/*we know that we will not change it*/const_cast<VVoid*>(&vvoid), 0, 0, 0) ;}
                   2356:     break;
                   2357: 
1.115     misha    2358:   case 170:
1.138   ! misha    2359: #line 781 "compile.y"
1.112     paf      2360:     { yyval = VL(/*we know that we will not change it*/const_cast<VBool*>(&vtrue), 0, 0, 0) ;}
                   2361:     break;
                   2362: 
1.115     misha    2363:   case 171:
1.138   ! misha    2364: #line 782 "compile.y"
1.112     paf      2365:     { yyval = VL(/*we know that we will not change it*/const_cast<VBool*>(&vfalse), 0, 0, 0) ;}
                   2366:     break;
                   2367: 
1.115     misha    2368:   case 172:
1.138   ! misha    2369: #line 784 "compile.y"
1.112     paf      2370:     { yyval=N() ;}
                   2371:     break;
                   2372: 
                   2373: 
                   2374:     }
                   2375: 
1.114     misha    2376: /* Line 1010 of yacc.c.  */
1.138   ! misha    2377: #line 2378 "compile.tab.C"
1.1       parser   2378: 
                   2379:   yyvsp -= yylen;
                   2380:   yyssp -= yylen;
                   2381: 
1.112     paf      2382: 
                   2383:   YY_STACK_PRINT (yyss, yyssp);
1.1       parser   2384: 
                   2385:   *++yyvsp = yyval;
                   2386: 
                   2387: 
1.112     paf      2388:   /* Now `shift' the result of the reduction.  Determine what state
                   2389:      that goes to, based on the state we popped back to and the rule
                   2390:      number reduced by.  */
1.1       parser   2391: 
                   2392:   yyn = yyr1[yyn];
                   2393: 
1.112     paf      2394:   yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
                   2395:   if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
1.1       parser   2396:     yystate = yytable[yystate];
                   2397:   else
1.112     paf      2398:     yystate = yydefgoto[yyn - YYNTOKENS];
1.1       parser   2399: 
                   2400:   goto yynewstate;
                   2401: 
                   2402: 
1.112     paf      2403: /*------------------------------------.
                   2404: | yyerrlab -- here on detecting error |
                   2405: `------------------------------------*/
                   2406: yyerrlab:
                   2407:   /* If not already recovering from an error, report this error.  */
                   2408:   if (!yyerrstatus)
1.1       parser   2409:     {
                   2410:       ++yynerrs;
1.112     paf      2411: #if YYERROR_VERBOSE
1.1       parser   2412:       yyn = yypact[yystate];
                   2413: 
1.112     paf      2414:       if (YYPACT_NINF < yyn && yyn < YYLAST)
1.1       parser   2415:        {
1.112     paf      2416:          YYSIZE_T yysize = 0;
                   2417:          int yytype = YYTRANSLATE (yychar);
                   2418:          const char* yyprefix;
                   2419:          char *yymsg;
                   2420:          int yyx;
                   2421: 
                   2422:          /* Start YYX at -YYN if negative to avoid negative indexes in
                   2423:             YYCHECK.  */
                   2424:          int yyxbegin = yyn < 0 ? -yyn : 0;
                   2425: 
                   2426:          /* Stay within bounds of both yycheck and yytname.  */
                   2427:          int yychecklim = YYLAST - yyn;
                   2428:          int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
                   2429:          int yycount = 0;
                   2430: 
                   2431:          yyprefix = ", expecting ";
                   2432:          for (yyx = yyxbegin; yyx < yyxend; ++yyx)
                   2433:            if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
                   2434:              {
                   2435:                yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]);
                   2436:                yycount += 1;
                   2437:                if (yycount == 5)
                   2438:                  {
                   2439:                    yysize = 0;
                   2440:                    break;
                   2441:                  }
                   2442:              }
                   2443:          yysize += (sizeof ("syntax error, unexpected ")
                   2444:                     + yystrlen (yytname[yytype]));
                   2445:          yymsg = (char *) YYSTACK_ALLOC (yysize);
                   2446:          if (yymsg != 0)
1.1       parser   2447:            {
1.112     paf      2448:              char *yyp = yystpcpy (yymsg, "syntax error, unexpected ");
                   2449:              yyp = yystpcpy (yyp, yytname[yytype]);
1.1       parser   2450: 
1.112     paf      2451:              if (yycount < 5)
1.1       parser   2452:                {
1.112     paf      2453:                  yyprefix = ", expecting ";
                   2454:                  for (yyx = yyxbegin; yyx < yyxend; ++yyx)
                   2455:                    if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
1.1       parser   2456:                      {
1.112     paf      2457:                        yyp = yystpcpy (yyp, yyprefix);
                   2458:                        yyp = yystpcpy (yyp, yytname[yyx]);
                   2459:                        yyprefix = " or ";
1.1       parser   2460:                      }
                   2461:                }
1.112     paf      2462:              yyerror (yymsg);
                   2463:              YYSTACK_FREE (yymsg);
1.1       parser   2464:            }
                   2465:          else
1.112     paf      2466:            yyerror ("syntax error; also virtual memory exhausted");
1.1       parser   2467:        }
                   2468:       else
                   2469: #endif /* YYERROR_VERBOSE */
1.112     paf      2470:        yyerror ("syntax error");
1.1       parser   2471:     }
                   2472: 
1.112     paf      2473: 
1.1       parser   2474: 
                   2475:   if (yyerrstatus == 3)
                   2476:     {
1.112     paf      2477:       /* If just tried and failed to reuse lookahead token after an
                   2478:         error, discard it.  */
1.109     paf      2479: 
1.113     paf      2480:       if (yychar <= YYEOF)
1.112     paf      2481:         {
1.113     paf      2482:           /* If at end of input, pop the error token,
                   2483:             then the rest of the stack, then return failure.  */
                   2484:          if (yychar == YYEOF)
                   2485:             for (;;)
                   2486:               {
                   2487:                 YYPOPSTACK;
                   2488:                 if (yyssp == yyss)
                   2489:                   YYABORT;
                   2490:                 YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
                   2491:                 yydestruct (yystos[*yyssp], yyvsp);
                   2492:               }
1.112     paf      2493:         }
1.113     paf      2494:       else
                   2495:        {
                   2496:          YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc);
                   2497:          yydestruct (yytoken, &yylval);
                   2498:          yychar = YYEMPTY;
1.1       parser   2499: 
1.113     paf      2500:        }
1.106     paf      2501:     }
1.1       parser   2502: 
1.112     paf      2503:   /* Else will try to reuse lookahead token after shifting the error
                   2504:      token.  */
                   2505:   goto yyerrlab1;
1.109     paf      2506: 
1.1       parser   2507: 
1.113     paf      2508: /*---------------------------------------------------.
                   2509: | yyerrorlab -- error raised explicitly by YYERROR.  |
                   2510: `---------------------------------------------------*/
                   2511: yyerrorlab:
                   2512: 
                   2513: #ifdef __GNUC__
                   2514:   /* Pacify GCC when the user code never invokes YYERROR and the label
                   2515:      yyerrorlab therefore never appears in user code.  */
                   2516:   if (0)
                   2517:      goto yyerrorlab;
                   2518: #endif
                   2519: 
                   2520:   yyvsp -= yylen;
                   2521:   yyssp -= yylen;
                   2522:   yystate = *yyssp;
                   2523:   goto yyerrlab1;
                   2524: 
                   2525: 
                   2526: /*-------------------------------------------------------------.
                   2527: | yyerrlab1 -- common code for both syntax error and YYERROR.  |
                   2528: `-------------------------------------------------------------*/
1.112     paf      2529: yyerrlab1:
                   2530:   yyerrstatus = 3;     /* Each real token shifted decrements this.  */
1.1       parser   2531: 
1.112     paf      2532:   for (;;)
1.109     paf      2533:     {
1.112     paf      2534:       yyn = yypact[yystate];
                   2535:       if (yyn != YYPACT_NINF)
                   2536:        {
                   2537:          yyn += YYTERROR;
                   2538:          if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
                   2539:            {
                   2540:              yyn = yytable[yyn];
                   2541:              if (0 < yyn)
                   2542:                break;
                   2543:            }
                   2544:        }
1.1       parser   2545: 
1.112     paf      2546:       /* Pop the current state because it cannot handle the error token.  */
                   2547:       if (yyssp == yyss)
                   2548:        YYABORT;
1.1       parser   2549: 
1.112     paf      2550:       YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp);
                   2551:       yydestruct (yystos[yystate], yyvsp);
1.113     paf      2552:       YYPOPSTACK;
                   2553:       yystate = *yyssp;
1.112     paf      2554:       YY_STACK_PRINT (yyss, yyssp);
1.1       parser   2555:     }
                   2556: 
                   2557:   if (yyn == YYFINAL)
                   2558:     YYACCEPT;
                   2559: 
1.112     paf      2560:   YYDPRINTF ((stderr, "Shifting error token, "));
1.1       parser   2561: 
                   2562:   *++yyvsp = yylval;
1.112     paf      2563: 
1.1       parser   2564: 
                   2565:   yystate = yyn;
                   2566:   goto yynewstate;
                   2567: 
                   2568: 
1.112     paf      2569: /*-------------------------------------.
                   2570: | yyacceptlab -- YYACCEPT comes here.  |
                   2571: `-------------------------------------*/
                   2572: yyacceptlab:
                   2573:   yyresult = 0;
                   2574:   goto yyreturn;
                   2575: 
                   2576: /*-----------------------------------.
                   2577: | yyabortlab -- YYABORT comes here.  |
                   2578: `-----------------------------------*/
                   2579: yyabortlab:
                   2580:   yyresult = 1;
                   2581:   goto yyreturn;
                   2582: 
                   2583: #ifndef yyoverflow
                   2584: /*----------------------------------------------.
                   2585: | yyoverflowlab -- parser overflow comes here.  |
                   2586: `----------------------------------------------*/
                   2587: yyoverflowlab:
                   2588:   yyerror ("parser stack overflow");
                   2589:   yyresult = 2;
                   2590:   /* Fall through.  */
                   2591: #endif
                   2592: 
                   2593: yyreturn:
                   2594: #ifndef yyoverflow
                   2595:   if (yyss != yyssa)
                   2596:     YYSTACK_FREE (yyss);
1.1       parser   2597: #endif
1.112     paf      2598:   return yyresult;
1.1       parser   2599: }
1.112     paf      2600: 
                   2601: 
1.138   ! misha    2602: #line 786 "compile.y"
1.1       parser   2603: 
                   2604: #endif
                   2605: 
                   2606: /*
                   2607:        000$111(2222)00 
                   2608:                000$111{3333}00
                   2609:        $,^: push,=0
                   2610:        1:( { break=pop
                   2611:        2:( )  pop
                   2612:        3:{ }  pop
                   2613: 
                   2614:        000^111(2222)4444{33333}4000
                   2615:        $,^: push,=0
                   2616:        1:( { break=pop
                   2617:        2:( )=4
                   2618:        3:{ }=4
                   2619:                4:[^({]=pop
                   2620: */
                   2621: 
1.84      paf      2622: inline void ungetc(Parse_control& pc, uint last_line_end_col) {
                   2623:        pc.source--;
                   2624:        if(pc.pos.col==0) {
                   2625:                --pc.pos.line; pc.pos.col=last_line_end_col;
                   2626:        } else
                   2627:                --pc.pos.col;
                   2628: 
                   2629: }
                   2630: static int yylex(YYSTYPE *lvalp, void *apc) {
                   2631:        register Parse_control& pc=*static_cast<Parse_control*>(apc);
                   2632: 
                   2633:        #define lexical_brackets_nestage pc.brackets_nestages[pc.ls_sp]
1.1       parser   2634:        #define RC {result=c; goto break2; }
                   2635: 
1.84      paf      2636:        register int c;
                   2637:        int result;
1.1       parser   2638:        
1.84      paf      2639:        if(pc.pending_state) {
                   2640:                result=pc.pending_state;
                   2641:                pc.pending_state=0;
1.1       parser   2642:                return result;
                   2643:        }
                   2644:        
1.84      paf      2645:        const char *begin=pc.source;
                   2646:        Pos begin_pos=pc.pos;
1.1       parser   2647:        const char *end;
                   2648:        int skip_analized=0;
                   2649:        while(true) {
1.84      paf      2650:                c=*(end=(pc.source++));
                   2651: //             fprintf(stderr, "\nchar: %c %02X; nestage: %d, sp=%d", c, c, lexical_brackets_nestage, pc.sp);
1.1       parser   2652: 
1.96      paf      2653:                if(c=='\n')
1.84      paf      2654:                        pc.pos_next_line();
1.96      paf      2655:                else
1.84      paf      2656:                        pc.pos_next_c(c);
1.96      paf      2657: //             fprintf(stderr, "\nchar: %c file(%d:%d)", c, pc.pos.line, pc.pos.col);
1.1       parser   2658: 
1.96      paf      2659:                if(pc.pos.col==0+1 && c=='@') {
1.84      paf      2660:                        if(pc.ls==LS_DEF_SPECIAL_BODY) {
1.31      paf      2661:                                // @SPECIAL
                   2662:                                // ...
                   2663:                                // @<here = 
1.84      paf      2664:                                pop_LS(pc); // exiting from LS_DEF_SPECIAL_BODY state
1.31      paf      2665:                        } // continuing checks
1.84      paf      2666:                        if(pc.ls==LS_USER) {
                   2667:                                push_LS(pc, LS_DEF_NAME);
1.20      parser   2668:                                RC;
1.31      paf      2669:                        } else // @ in first column inside some code [when could that be?]
1.20      parser   2670:                                result=BAD_METHOD_DECL_START;
                   2671:                        goto break2;
1.97      paf      2672:                }
                   2673:                if(c=='^') {
1.84      paf      2674:                        if(pc.ls==LS_METHOD_AFTER) {
1.75      paf      2675:                                // handle after-method situation
1.84      paf      2676:                                pop_LS(pc);
1.75      paf      2677:                                result=EON;
                   2678:                                skip_analized=-1; // return to punctuation afterwards to assure it's literality
                   2679:                                goto break2;
                   2680:                        }
1.84      paf      2681:                        switch(pc.ls) {
1.15      parser   2682: case LS_EXPRESSION_VAR_NAME_WITH_COLON:
                   2683: case LS_EXPRESSION_VAR_NAME_WITHOUT_COLON:
                   2684: case LS_VAR_NAME_SIMPLE_WITH_COLON:
                   2685: case LS_VAR_NAME_SIMPLE_WITHOUT_COLON:
                   2686: case LS_VAR_NAME_CURLY:
                   2687: case LS_METHOD_NAME:
1.66      paf      2688: case LS_USER_COMMENT:
1.15      parser   2689: case LS_DEF_COMMENT:
                   2690:        // no literals in names, please
                   2691:        break;
                   2692: default:
1.84      paf      2693:                        switch(*pc.source) {
1.10      parser   2694:                        // ^escaping some punctuators
1.121     misha    2695:                        case '^': case '$': case ';': case '@':
1.1       parser   2696:                        case '(': case ')':
                   2697:                        case '[': case ']':
                   2698:                        case '{': case '}':
1.23      parser   2699:                        case '"':  case ':':
1.1       parser   2700:                                if(end!=begin) {
1.84      paf      2701:                                        if(!pc.string_start)
                   2702:                                                pc.string_start=begin_pos;
1.1       parser   2703:                                        // append piece till ^
1.84      paf      2704:                                        pc.string.append_strdup_know_length(begin, end-begin);
1.1       parser   2705:                                }
                   2706:                                // reset piece 'begin' position & line
1.84      paf      2707:                                begin=pc.source; // ->punctuation
                   2708:                                begin_pos=pc.pos;
1.75      paf      2709:                                // skip over _ after ^
1.84      paf      2710:                                pc.source++;  pc.pos.col++;
1.75      paf      2711:                                // skip analysis = forced literal
                   2712:                                continue;
1.1       parser   2713: 
                   2714:                        // converting ^#HH into char(hex(HH))
                   2715:                        case '#':
                   2716:                                if(end!=begin) {
1.84      paf      2717:                                        if(!pc.string_start)
                   2718:                                                pc.string_start=begin_pos;
1.1       parser   2719:                                        // append piece till ^
1.84      paf      2720:                                        pc.string.append_strdup_know_length(begin, end-begin);
1.1       parser   2721:                                }
                   2722:                                // #HH ?
1.121     misha    2723:                                if(pc.source[1] && isxdigit(pc.source[1]) && pc.source[2] && isxdigit(pc.source[2])) {
1.110     paf      2724:                                        char c=(char)(
1.84      paf      2725:                                                hex_value[(unsigned char)pc.source[1]]*0x10+
1.110     paf      2726:                                                hex_value[(unsigned char)pc.source[2]]);
1.84      paf      2727:                                        if(c==0) {
1.1       parser   2728:                                                result=BAD_HEX_LITERAL;
                   2729:                                                goto break2; // wrong hex value[no ^#00 chars allowed]: bail out
                   2730:                                        }
                   2731:                                        // append char(hex(HH))
1.84      paf      2732:                                        pc.string.append(c);
1.1       parser   2733:                                        // skip over ^#HH
1.84      paf      2734:                                        pc.source+=3;
                   2735:                                        pc.pos.col+=3;
1.1       parser   2736:                                        // reset piece 'begin' position & line
1.84      paf      2737:                                        begin=pc.source; // ->after ^#HH
                   2738:                                        begin_pos=pc.pos;
1.75      paf      2739:                                        // skip analysis = forced literal
1.1       parser   2740:                                        continue;
                   2741:                                }
1.121     misha    2742:                                // just escaped char
                   2743:                                // reset piece 'begin' position & line
                   2744:                                begin=pc.source;
                   2745:                                begin_pos=pc.pos;
                   2746:                                // skip over _ after ^
                   2747:                                pc.source++;  pc.pos.col++;
                   2748:                                // skip analysis = forced literal
                   2749:                                continue;
1.1       parser   2750:                        }
1.15      parser   2751:                        break;
1.75      paf      2752:                        }
1.15      parser   2753:                }
1.1       parser   2754:                // #comment  start skipping
1.84      paf      2755:                if(c=='#' && pc.pos.col==1) {
1.1       parser   2756:                        if(end!=begin) {
1.84      paf      2757:                                if(!pc.string_start)
                   2758:                                        pc.string_start=begin_pos;
1.1       parser   2759:                                // append piece till #
1.84      paf      2760:                                pc.string.append_strdup_know_length(begin, end-begin);
1.1       parser   2761:                        }
                   2762:                        // fall into COMMENT lexical state [wait for \n]
1.84      paf      2763:                        push_LS(pc, LS_USER_COMMENT);
1.31      paf      2764:                        continue;
1.1       parser   2765:                }
1.84      paf      2766:                switch(pc.ls) {
1.1       parser   2767: 
                   2768:                // USER'S = NOT OURS
                   2769:                case LS_USER:
1.84      paf      2770:                case LS_NAME_SQUARE_PART: // name.[here].xxx
                   2771:                        if(pc.trim_bof)
1.1       parser   2772:                                switch(c) {
                   2773:                                case '\n': case ' ': case '\t':
1.84      paf      2774:                                        begin=pc.source;
                   2775:                                        begin_pos=pc.pos;
1.1       parser   2776:                                        continue; // skip it
                   2777:                                default:
1.84      paf      2778:                                        pc.trim_bof=false;
1.1       parser   2779:                                }
                   2780:                        switch(c) {
                   2781:                        case '$':
1.84      paf      2782:                                push_LS(pc, LS_VAR_NAME_SIMPLE_WITH_COLON);
1.1       parser   2783:                                RC;
                   2784:                        case '^':
1.84      paf      2785:                                push_LS(pc, LS_METHOD_NAME);
1.1       parser   2786:                                RC;
1.11      parser   2787:                        case ']':
1.84      paf      2788:                                if(pc.ls==LS_NAME_SQUARE_PART)
1.11      parser   2789:                                        if(--lexical_brackets_nestage==0) {// $name.[co<]?>de<]?>
1.84      paf      2790:                                                pop_LS(pc); // $name.[co<]>de<]!>
1.11      parser   2791:                                                RC;
                   2792:                                        }
1.3       parser   2793:                                break;
1.11      parser   2794:                        case '[': // $name.[co<[>de]
1.84      paf      2795:                                if(pc.ls==LS_NAME_SQUARE_PART)
1.11      parser   2796:                                        lexical_brackets_nestage++;
1.4       parser   2797:                                break;
1.1       parser   2798:                        }
1.97      paf      2799:                        if(pc.explicit_result && c)
                   2800:                                switch(c) {
                   2801:                                case '\n': case ' ': case '\t':
                   2802:                                        begin=pc.source;
                   2803:                                        begin_pos=pc.pos;
                   2804:                                        continue; // skip it
                   2805:                                default:
                   2806:                                        result=BAD_NONWHITESPACE_CHARACTER_IN_EXPLICIT_RESULT_MODE;
                   2807:                                        goto break2;
                   2808:                                }
1.1       parser   2809:                        break;
                   2810:                        
                   2811:                // #COMMENT
1.66      paf      2812:                case LS_USER_COMMENT:
1.1       parser   2813:                        if(c=='\n') {
                   2814:                                // skip comment
1.84      paf      2815:                                begin=pc.source;
                   2816:                                begin_pos=pc.pos;
1.1       parser   2817: 
1.84      paf      2818:                                pop_LS(pc);
1.1       parser   2819:                                continue;
                   2820:                        }
                   2821:                        break;
                   2822:                        
                   2823:                // STRING IN EXPRESSION
                   2824:                case LS_EXPRESSION_STRING_QUOTED:
                   2825:                case LS_EXPRESSION_STRING_APOSTROFED:
                   2826:                        switch(c) {
                   2827:                        case '"':
                   2828:                        case '\'':
                   2829:                                if(
1.84      paf      2830:                                        pc.ls == LS_EXPRESSION_STRING_QUOTED && c=='"' ||
                   2831:                                        pc.ls == LS_EXPRESSION_STRING_APOSTROFED && c=='\'') {
                   2832:                                        pop_LS(pc); //"abc". | 'abc'.
1.1       parser   2833:                                        RC;
                   2834:                                }
                   2835:                                break;
                   2836:                        case '$':
1.84      paf      2837:                                push_LS(pc, LS_VAR_NAME_SIMPLE_WITH_COLON);
1.1       parser   2838:                                RC;
                   2839:                        case '^':
1.84      paf      2840:                                push_LS(pc, LS_METHOD_NAME);
1.1       parser   2841:                                RC;
                   2842:                        }
                   2843:                        break;
                   2844: 
                   2845:                // METHOD DEFINITION
                   2846:                case LS_DEF_NAME:
                   2847:                        switch(c) {
                   2848:                        case '[':
1.84      paf      2849:                                pc.ls=LS_DEF_PARAMS;
1.1       parser   2850:                                RC;
                   2851:                        case '\n':
1.84      paf      2852:                                pc.ls=LS_DEF_SPECIAL_BODY;
1.1       parser   2853:                                RC;
                   2854:                        }
                   2855:                        break;
                   2856: 
                   2857:                case LS_DEF_PARAMS:
                   2858:                        switch(c) {
1.64      paf      2859:                        case '$': // common error
1.65      paf      2860:                                result=BAD_METHOD_PARAMETER_NAME_CHARACTER;
                   2861:                                goto break2;
1.1       parser   2862:                        case ';':
                   2863:                                RC;
                   2864:                        case ']':
1.84      paf      2865:                                pc.ls=*pc.source=='['?LS_DEF_LOCALS:LS_DEF_COMMENT;
1.1       parser   2866:                                RC;
                   2867:                        case '\n': // wrong. bailing out
1.84      paf      2868:                                pop_LS(pc);
1.1       parser   2869:                                RC;
                   2870:                        }
                   2871:                        break;
                   2872: 
                   2873:                case LS_DEF_LOCALS:
                   2874:                        switch(c) {
                   2875:                        case '[':
                   2876:                        case ';':
                   2877:                                RC;
                   2878:                        case ']':
1.84      paf      2879:                                pc.ls=LS_DEF_COMMENT;
1.1       parser   2880:                                RC;
                   2881:                        case '\n': // wrong. bailing out
1.84      paf      2882:                                pop_LS(pc);
1.1       parser   2883:                                RC;
                   2884:                        }
                   2885:                        break;
                   2886: 
                   2887:                case LS_DEF_COMMENT:
                   2888:                        if(c=='\n') {
1.84      paf      2889:                                pop_LS(pc);
1.1       parser   2890:                                RC;
                   2891:                        }
                   2892:                        break;
                   2893: 
                   2894:                case LS_DEF_SPECIAL_BODY:
1.31      paf      2895:                        if(c=='\n')
1.1       parser   2896:                                RC;
                   2897:                        break;
                   2898: 
                   2899:                // (EXPRESSION)
                   2900:                case LS_VAR_ROUND:
                   2901:                case LS_METHOD_ROUND:
                   2902:                        switch(c) {
                   2903:                        case ')':
                   2904:                                if(--lexical_brackets_nestage==0)
1.84      paf      2905:                                        if(pc.ls==LS_METHOD_ROUND) // method round param ended
                   2906:                                                pc.ls=LS_METHOD_AFTER; // look for method end
                   2907:                                        else // pc.ls==LS_VAR_ROUND // variable constructor ended
                   2908:                                                pop_LS(pc); // return to normal life
1.1       parser   2909:                                RC;
1.66      paf      2910:                        case '#': // comment start skipping
                   2911:                                if(end!=begin) {
1.84      paf      2912:                                        if(!pc.string_start)
                   2913:                                                pc.string_start=begin_pos;
1.66      paf      2914:                                        // append piece till #
1.84      paf      2915:                                        pc.string.append_strdup_know_length(begin, end-begin);
1.66      paf      2916:                                }
                   2917:                                // fall into COMMENT lexical state [wait for \n]
1.84      paf      2918:                                push_LS(pc, LS_EXPRESSION_COMMENT);
1.66      paf      2919:                                lexical_brackets_nestage=1;
                   2920:                                continue;
1.1       parser   2921:                        case '$':
1.84      paf      2922:                                push_LS(pc, LS_EXPRESSION_VAR_NAME_WITH_COLON);                         
1.1       parser   2923:                                RC;
                   2924:                        case '^':
1.84      paf      2925:                                push_LS(pc, LS_METHOD_NAME);
1.1       parser   2926:                                RC;
                   2927:                        case '(':
                   2928:                                lexical_brackets_nestage++;
                   2929:                                RC;
                   2930:                        case '-':
1.84      paf      2931:                                switch(*pc.source) {
1.1       parser   2932:                                case 'f': // -f
                   2933:                                        skip_analized=1;
                   2934:                                        result=FEXISTS;
                   2935:                                        goto break2;
                   2936:                                case 'd': // -d
                   2937:                                        skip_analized=1;
                   2938:                                        result=DEXISTS;
                   2939:                                        goto break2;
1.63      paf      2940:                                default: // minus
1.1       parser   2941:                                        result=c;
                   2942:                                        goto break2;
                   2943:                                }
                   2944:                                goto break2;
1.25      paf      2945:                        case '+': case '*': case '/': case '%': case '\\':
1.1       parser   2946:                        case '~':
                   2947:                        case ';':
                   2948:                                RC;
1.65      paf      2949:                        case '&': case '|':
1.84      paf      2950:                                if(*pc.source==c) { // && ||
1.65      paf      2951:                                        result=c=='&'?LAND:LOR;
1.1       parser   2952:                                        skip_analized=1;
                   2953:                                } else
                   2954:                                        result=c;
                   2955:                                goto break2;
1.65      paf      2956:                        case '!':
1.84      paf      2957:                                switch(pc.source[0]) { 
1.65      paf      2958:                                case '|': // !| !||
                   2959:                                        skip_analized=1;
1.84      paf      2960:                                        if(pc.source[1]=='|') {
1.65      paf      2961:                                                skip_analized++;
                   2962:                                                result=LXOR;
                   2963:                                        } else
                   2964:                                                result=NXOR;
                   2965:                                        goto break2;
                   2966:                                case '=': // !=
                   2967:                                        skip_analized=1;
                   2968:                                        result=NNE; 
                   2969:                                        goto break2;
                   2970:                                }
                   2971:                                RC;
1.67      paf      2972: 
                   2973:                        case '<': // <<, <=, <
1.84      paf      2974:                                switch(*pc.source) {
1.67      paf      2975:                                case '<': // <[<]
                   2976:                                        skip_analized=1; result=NSL; break;
                   2977:                                case '=': // <[=]
                   2978:                                        skip_analized=1; result=NLE; break;
                   2979:                                default: // <[]
                   2980:                                        result=c; break;
                   2981:                                }
                   2982:                                goto break2;
                   2983:                        case '>': // >>, >=, >
1.84      paf      2984:                                switch(*pc.source) {
1.67      paf      2985:                                case '>': // >[>]
                   2986:                                        skip_analized=1; result=NSR; break;
                   2987:                                case '=': // >[=]
                   2988:                                        skip_analized=1; result=NGE; break;
                   2989:                                default: // >[]
                   2990:                                        result=c; break;
                   2991:                                }
                   2992:                                goto break2;
                   2993:                        case '=': // ==
1.84      paf      2994:                                switch(*pc.source) {
1.67      paf      2995:                                case '=': // =[=]
                   2996:                                        skip_analized=1; result=NEQ; break;
                   2997:                                default: // =[]
                   2998:                                        result=c; break; // not used now
                   2999:                                }
1.1       parser   3000:                                goto break2;
1.67      paf      3001: 
1.1       parser   3002:                        case '"':
1.84      paf      3003:                                push_LS(pc, LS_EXPRESSION_STRING_QUOTED);
1.1       parser   3004:                                RC;
                   3005:                        case '\'':
1.84      paf      3006:                                push_LS(pc, LS_EXPRESSION_STRING_APOSTROFED);
1.1       parser   3007:                                RC;
                   3008:                        case 'l': case 'g': case 'e': case 'n':
                   3009:                                if(end==begin) // right after whitespace
1.84      paf      3010:                                        if(isspace(pc.source[1])) {
                   3011:                                                switch(*pc.source) {
1.1       parser   3012:                                                        //                                      case '?': // ok [and bad cases, yacc would bark at them]
                   3013:                                                case 't': // lt gt [et nt]
                   3014:                                                        result=c=='l'?SLT:c=='g'?SGT:BAD_STRING_COMPARISON_OPERATOR;
                   3015:                                                        skip_analized=1;
                   3016:                                                        goto break2;
                   3017:                                                case 'e': // le ge ne [ee]
                   3018:                                                        result=c=='l'?SLE:c=='g'?SGE:c=='n'?SNE:BAD_STRING_COMPARISON_OPERATOR;
                   3019:                                                        skip_analized=1;
                   3020:                                                        goto break2;
                   3021:                                                case 'q': // eq [lq gq nq]
                   3022:                                                        result=c=='e'?SEQ:BAD_STRING_COMPARISON_OPERATOR;
                   3023:                                                        skip_analized=1;
                   3024:                                                        goto break2;
                   3025:                                                }
                   3026:                                        }
                   3027:                                break;
                   3028:                        case 'i':
                   3029:                                if(end==begin) // right after whitespace
1.84      paf      3030:                                        if(isspace(pc.source[1])) {
                   3031:                                                switch(pc.source[0]) {
1.1       parser   3032:                                                case 'n': // in
                   3033:                                                        skip_analized=1;
                   3034:                                                        result=IN;
                   3035:                                                        goto break2;
                   3036:                                                case 's': // is
                   3037:                                                        skip_analized=1;
                   3038:                                                        result=IS;
                   3039:                                                        goto break2;
                   3040:                                                }
                   3041:                                        }
                   3042:                                break;
                   3043:                        case 'd':
                   3044:                                if(end==begin) // right after whitespace
1.84      paf      3045:                                        if(pc.source[0]=='e' && pc.source[1]=='f') { // def
1.118     misha    3046:                                                switch(pc.source[2]){
                   3047:                                                case ' ': case '\t': case '\n': case '"': case '\'': case '^': case '$': // non-quoted string without whitespace after 'def' is not allowed
                   3048:                                                        skip_analized=2;
                   3049:                                                        result=DEF;
                   3050:                                                        goto break2;
                   3051:                                                }
                   3052:                                                // error: incorrect char after 'def'
1.1       parser   3053:                                        }
                   3054:                                break;
1.107     paf      3055:                        case 't':
                   3056:                                if(end==begin) // right after whitespace
1.118     misha    3057:                                        if(pc.source[0]=='r' && pc.source[1]=='u' && pc.source[2]=='e') { // true
1.107     paf      3058:                                                skip_analized=3;
                   3059:                                                result=LITERAL_TRUE;
                   3060:                                                goto break2;
                   3061:                                        }
                   3062:                                break;
                   3063:                        case 'f':
                   3064:                                if(end==begin) // right after whitespace
1.118     misha    3065:                                        if(pc.source[0]=='a' && pc.source[1]=='l' && pc.source[2]=='s' && pc.source[3]=='e') { // false
1.107     paf      3066:                                                skip_analized=4;
                   3067:                                                result=LITERAL_FALSE;
                   3068:                                                goto break2;
                   3069:                                        }
                   3070:                                break;
1.1       parser   3071:                        case ' ': case '\t': case '\n':
                   3072:                                if(end!=begin) { // there were a string after previous operator?
                   3073:                                        result=0; // return that string
                   3074:                                        goto break2;
                   3075:                                }
                   3076:                                // that's a leading|traling space or after-operator-space
                   3077:                                // ignoring it
                   3078:                                // reset piece 'begin' position & line
1.84      paf      3079:                                begin=pc.source; // after whitespace char
                   3080:                                begin_pos=pc.pos;
1.1       parser   3081:                                continue;
                   3082:                        }
                   3083:                        break;
1.66      paf      3084:                case LS_EXPRESSION_COMMENT:
                   3085:                        if(c=='(')
                   3086:                                lexical_brackets_nestage++;
                   3087:                        
1.84      paf      3088:                        switch(*pc.source) {
1.66      paf      3089:                        case '\n': case ')':
1.84      paf      3090:                                if(*pc.source==')')
1.66      paf      3091:                                        if(--lexical_brackets_nestage!=0)
                   3092:                                                continue;
                   3093: 
                   3094:                                // skip comment
1.84      paf      3095:                                begin=pc.source;
                   3096:                                begin_pos=pc.pos;
1.66      paf      3097: 
1.84      paf      3098:                                pop_LS(pc);
1.66      paf      3099:                                continue;
                   3100:                        }
                   3101:                        break;
1.1       parser   3102: 
                   3103:                // VARIABLE GET/PUT/WITH
1.11      parser   3104:                case LS_VAR_NAME_SIMPLE_WITH_COLON: 
                   3105:                case LS_VAR_NAME_SIMPLE_WITHOUT_COLON:
                   3106:                case LS_EXPRESSION_VAR_NAME_WITH_COLON: 
                   3107:                case LS_EXPRESSION_VAR_NAME_WITHOUT_COLON:
                   3108:                        if(
1.84      paf      3109:                                pc.ls==LS_EXPRESSION_VAR_NAME_WITH_COLON ||
                   3110:                                pc.ls==LS_EXPRESSION_VAR_NAME_WITHOUT_COLON) {
1.41      paf      3111:                                // name in expr ends also before 
1.1       parser   3112:                                switch(c) {
1.41      paf      3113:                                // expression minus
1.1       parser   3114:                                case '-': 
1.41      paf      3115:                                // expression integer division
                   3116:                                case '\\':
1.84      paf      3117:                                        pop_LS(pc);
                   3118:                                        pc.ungetc();
1.1       parser   3119:                                        result=EON;
                   3120:                                        goto break2;
                   3121:                                }
                   3122:                        }
1.11      parser   3123:                        if(
1.84      paf      3124:                                pc.ls==LS_VAR_NAME_SIMPLE_WITHOUT_COLON ||
                   3125:                                pc.ls==LS_EXPRESSION_VAR_NAME_WITHOUT_COLON) {
1.1       parser   3126:                                // name already has ':', stop before next 
                   3127:                                switch(c) {
                   3128:                                case ':': 
1.84      paf      3129:                                        pop_LS(pc);
                   3130:                                        pc.ungetc();
1.1       parser   3131:                                        result=EON;
                   3132:                                        goto break2;
                   3133:                                }
                   3134:                        }
                   3135:                        switch(c) {
                   3136:                        case 0:
                   3137:                        case ' ': case '\t': case '\n':
                   3138:                        case ';':
                   3139:                        case ']': case '}': case ')': 
                   3140:                        case '"': case '\'':
                   3141:                        case '<': case '>':  // these stand for HTML brackets AND expression binary ops
                   3142:                        case '+': case '*': case '/': case '%': 
                   3143:                        case '&': case '|': 
                   3144:                        case '=': case '!':
                   3145:                        // common delimiters
1.62      paf      3146:                        case ',': case '?': case '#':
1.113     paf      3147:                        // mysql column separators
                   3148:                        case '`':
1.1       parser   3149:                        // before call
                   3150:                        case '^': 
1.84      paf      3151:                                pop_LS(pc);
                   3152:                                pc.ungetc();
1.1       parser   3153:                                result=EON;
                   3154:                                goto break2;
                   3155:                        case '[':
1.5       parser   3156:                                // $name.<[>code]
1.84      paf      3157:                                if(pc.pos.col>1/*not first column*/ && (
1.6       parser   3158:                                        end[-1]=='$'/*was start of get*/ ||
                   3159:                                        end[-1]==':'/*was class name delim */ ||
                   3160:                                        end[-1]=='.'/*was name delim */
1.5       parser   3161:                                        )) {
1.84      paf      3162:                                        push_LS(pc, LS_NAME_SQUARE_PART);
1.5       parser   3163:                                        lexical_brackets_nestage=1;
                   3164:                                        RC;
                   3165:                                }
1.84      paf      3166:                                pc.ls=LS_VAR_SQUARE;
1.1       parser   3167:                                lexical_brackets_nestage=1;
                   3168:                                RC;
                   3169:                        case '{':
                   3170:                                if(begin==end) { // ${name}, no need of EON, switching LS
1.84      paf      3171:                                        pc.ls=LS_VAR_NAME_CURLY; 
1.1       parser   3172:                                } else {
1.84      paf      3173:                                        pc.ls=LS_VAR_CURLY;
1.1       parser   3174:                                        lexical_brackets_nestage=1;
                   3175:                                }
                   3176: 
                   3177:                                RC;
                   3178:                        case '(':
1.84      paf      3179:                                pc.ls=LS_VAR_ROUND;
1.1       parser   3180:                                lexical_brackets_nestage=1;
                   3181:                                RC;
                   3182:                        case '.': // name part delim
                   3183:                        case '$': // name part subvar
1.3       parser   3184:                        case ':': // class<:>name
1.11      parser   3185:                                // go to _WITHOUT_COLON state variant...
1.84      paf      3186:                                if(pc.ls==LS_VAR_NAME_SIMPLE_WITH_COLON)
                   3187:                                        pc.ls=LS_VAR_NAME_SIMPLE_WITHOUT_COLON;
                   3188:                                else if(pc.ls==LS_EXPRESSION_VAR_NAME_WITH_COLON)
                   3189:                                        pc.ls=LS_EXPRESSION_VAR_NAME_WITHOUT_COLON;
1.11      parser   3190:                                // ...stop before next ':'
1.1       parser   3191:                                RC;
                   3192:                        }
                   3193:                        break;
                   3194: 
                   3195:                case LS_VAR_NAME_CURLY:
                   3196:                        switch(c) {
1.5       parser   3197:                        case '[':
1.11      parser   3198:                                // ${name.<[>code]}
1.84      paf      3199:                                push_LS(pc, LS_NAME_SQUARE_PART);
1.3       parser   3200:                                lexical_brackets_nestage=1;
                   3201:                                RC;
1.1       parser   3202:                        case '}': // ${name} finished, restoring LS
1.84      paf      3203:                                pop_LS(pc);
1.1       parser   3204:                                RC;
                   3205:                        case '.': // name part delim
                   3206:                        case '$': // name part subvar
                   3207:                        case ':': // ':name' or 'class:name'
                   3208:                                RC;
                   3209:                        }
                   3210:                        break;
                   3211: 
                   3212:                case LS_VAR_SQUARE:
                   3213:                        switch(c) {
                   3214:                        case '$':
1.84      paf      3215:                                push_LS(pc, LS_VAR_NAME_SIMPLE_WITH_COLON);
1.1       parser   3216:                                RC;
                   3217:                        case '^':
1.84      paf      3218:                                push_LS(pc, LS_METHOD_NAME);
1.1       parser   3219:                                RC;
                   3220:                        case ']':
                   3221:                                if(--lexical_brackets_nestage==0) {
1.84      paf      3222:                                        pop_LS(pc);
1.1       parser   3223:                                        RC;
                   3224:                                }
                   3225:                                break;
                   3226:                        case ';': // operator_or_fmt;value delim
                   3227:                                RC;
                   3228:                        case '[':
                   3229:                                lexical_brackets_nestage++;
                   3230:                                break;
                   3231:                        }
                   3232:                        break;
                   3233: 
                   3234:                case LS_VAR_CURLY:
                   3235:                        switch(c) {
                   3236:                        case '$':
1.84      paf      3237:                                push_LS(pc, LS_VAR_NAME_SIMPLE_WITH_COLON);
1.1       parser   3238:                                RC;
                   3239:                        case '^':
1.84      paf      3240:                                push_LS(pc, LS_METHOD_NAME);
1.1       parser   3241:                                RC;
                   3242:                        case '}':
                   3243:                                if(--lexical_brackets_nestage==0) {
1.84      paf      3244:                                        pop_LS(pc);
1.1       parser   3245:                                        RC;
                   3246:                                }
                   3247:                                break;
                   3248:                        case '{':
                   3249:                                lexical_brackets_nestage++;
                   3250:                                break;
                   3251:                        }
                   3252:                        break;
                   3253: 
                   3254:                // METHOD CALL
                   3255:                case LS_METHOD_NAME:
                   3256:                        switch(c) {
                   3257:                        case '[':
1.11      parser   3258:                                // ^name.<[>code].xxx
1.84      paf      3259:                                if(pc.pos.col>1/*not first column*/ && (
1.6       parser   3260:                                        end[-1]=='^'/*was start of call*/ || // never, ^[ is literal...
                   3261:                                        end[-1]==':'/*was class name delim */ ||
                   3262:                                        end[-1]=='.'/*was name delim */
1.5       parser   3263:                                        )) {
1.84      paf      3264:                                        push_LS(pc, LS_NAME_SQUARE_PART);
1.5       parser   3265:                                        lexical_brackets_nestage=1;
                   3266:                                        RC;
                   3267:                                }
1.84      paf      3268:                                pc.ls=LS_METHOD_SQUARE;
1.1       parser   3269:                                lexical_brackets_nestage=1;
                   3270:                                RC;
                   3271:                        case '{':
1.84      paf      3272:                                pc.ls=LS_METHOD_CURLY;
1.1       parser   3273:                                lexical_brackets_nestage=1;
                   3274:                                RC;
                   3275:                        case '(':
1.84      paf      3276:                                pc.ls=LS_METHOD_ROUND;
1.1       parser   3277:                                lexical_brackets_nestage=1;
                   3278:                                RC;
                   3279:                        case '.': // name part delim 
                   3280:                        case '$': // name part subvar
                   3281:                        case ':': // ':name' or 'class:name'
1.19      parser   3282:                        case '^': // ^abc^xxx wrong. bailing out
                   3283:                        case ']': case '}': case ')': // ^abc]}) wrong. bailing out
1.90      paf      3284:                        case ' ': // ^if ( wrong. bailing out
1.1       parser   3285:                                RC;
                   3286:                        }
                   3287:                        break;
                   3288: 
                   3289:                case LS_METHOD_SQUARE:
                   3290:                        switch(c) {
                   3291:                        case '$':
1.84      paf      3292:                                push_LS(pc, LS_VAR_NAME_SIMPLE_WITH_COLON);
1.1       parser   3293:                                RC;
                   3294:                        case '^':
1.84      paf      3295:                                push_LS(pc, LS_METHOD_NAME);
1.1       parser   3296:                                RC;
                   3297:                        case ';': // param delim
                   3298:                                RC;
                   3299:                        case ']':
                   3300:                                if(--lexical_brackets_nestage==0) {
1.84      paf      3301:                                        pc.ls=LS_METHOD_AFTER;
1.1       parser   3302:                                        RC;
                   3303:                                }
                   3304:                                break;
                   3305:                        case '[':
                   3306:                                lexical_brackets_nestage++;
                   3307:                                break;
                   3308:                        }
                   3309:                        break;
                   3310: 
                   3311:                case LS_METHOD_CURLY:
                   3312:                        switch(c) {
                   3313:                        case '$':
1.84      paf      3314:                                push_LS(pc, LS_VAR_NAME_SIMPLE_WITH_COLON);
1.1       parser   3315:                                RC;
                   3316:                        case '^':
1.84      paf      3317:                                push_LS(pc, LS_METHOD_NAME);
1.1       parser   3318:                                RC;
                   3319:                        case ';': // param delim
                   3320:                                RC;
                   3321:                        case '}':
                   3322:                                if(--lexical_brackets_nestage==0) {
1.84      paf      3323:                                        pc.ls=LS_METHOD_AFTER;
1.1       parser   3324:                                        RC;
                   3325:                                }
                   3326:                                break;
                   3327:                        case '{':
                   3328:                                lexical_brackets_nestage++;
                   3329:                                break;
                   3330:                        }
1.97      paf      3331:                        if(pc.explicit_result && c)
                   3332:                                switch(c) {
                   3333:                                case '\n': case ' ': case '\t':
                   3334:                                        begin=pc.source;
                   3335:                                        begin_pos=pc.pos;
                   3336:                                        continue; // skip it
                   3337:                                default:
                   3338:                                        result=BAD_NONWHITESPACE_CHARACTER_IN_EXPLICIT_RESULT_MODE;
                   3339:                                        goto break2;
                   3340:                                }
1.1       parser   3341:                        break;
                   3342: 
                   3343:                case LS_METHOD_AFTER:
                   3344:                        if(c=='[') {/* ][ }[ )[ */
1.84      paf      3345:                                pc.ls=LS_METHOD_SQUARE;
1.1       parser   3346:                                lexical_brackets_nestage=1;
                   3347:                                RC;
                   3348:                        }                                          
                   3349:                        if(c=='{') {/* ]{ }{ ){ */
1.84      paf      3350:                                pc.ls=LS_METHOD_CURLY;
1.1       parser   3351:                                lexical_brackets_nestage=1;
                   3352:                                RC;
                   3353:                        }                                          
                   3354:                        if(c=='(') {/* ]( }( )( */
1.84      paf      3355:                                pc.ls=LS_METHOD_ROUND;
1.1       parser   3356:                                lexical_brackets_nestage=1;
                   3357:                                RC;
                   3358:                        }                                          
1.84      paf      3359:                        pop_LS(pc);
                   3360:                        pc.ungetc();
1.1       parser   3361:                        result=EON;
                   3362:                        goto break2;
                   3363:                }
                   3364:                if(c==0) {
                   3365:                        result=-1;
                   3366:                        break;
                   3367:                }
                   3368:        }
                   3369: 
                   3370: break2:
                   3371:        if(end!=begin) { // there is last piece?
                   3372:                if((c=='@' || c==0) && end[-1]=='\n') { // we are before LS_DEF_NAME or EOF?
                   3373:                        // strip last \n
                   3374:                        end--;
                   3375:                        if(end!=begin && end[-1]=='\n') // allow one empty line before LS_DEF_NAME
                   3376:                                end--;
                   3377:                }
1.84      paf      3378:                if(end!=begin && pc.ls!=LS_USER_COMMENT) { // last piece still alive and not comment?
                   3379:                        if(!pc.string_start)
                   3380:                                pc.string_start=begin_pos;
1.1       parser   3381:                        // append it
1.84      paf      3382:                        pc.string.append_strdup_know_length(begin, end-begin);
1.1       parser   3383:                }
                   3384:        }
1.84      paf      3385:        if(!pc.string.is_empty()) { // something accumulated?
                   3386:                // create STRING value: array of OP_VALUE+origin+vstring
                   3387:                *lvalp=VL(
                   3388:                        new VString(*new String(pc.string, String::L_CLEAN)),
                   3389:                        pc.file_no, pc.string_start.line, pc.string_start.col);
1.1       parser   3390:                // new pieces storage
1.84      paf      3391:                pc.string.clear();
                   3392:                pc.string_start.clear();
1.1       parser   3393:                // make current result be pending for next call, return STRING for now
1.84      paf      3394:                pc.pending_state=result;  result=STRING;
1.1       parser   3395:        }
                   3396:        if(skip_analized) {
1.84      paf      3397:                pc.source+=skip_analized;  pc.pos.col+=skip_analized;
1.1       parser   3398:        }
                   3399:        return result;
                   3400: }
                   3401: 
1.84      paf      3402: static int real_yyerror(Parse_control *pc, char *s) {  // Called by yyparse on error
1.10      parser   3403:           strncpy(PC.error, s, MAX_STRING);
1.1       parser   3404:           return 1;
                   3405: }
                   3406: 
                   3407: static void yyprint(FILE *file, int type, YYSTYPE value) {
                   3408:        if(type==STRING)
1.84      paf      3409:                fprintf(file, " \"%s\"", LA2S(*value)->cstr());
1.1       parser   3410: }
1.112     paf      3411: 
                   3412: 

E-mail: