Diff for /parser3/src/main/compile.tab.C between versions 1.81.2.13.2.27 and 1.89

version 1.81.2.13.2.27, 2003/04/03 12:40:52 version 1.89, 2003/09/25 09:15:02
Line 79 Line 79
 // defines  // defines
   
 #define USE_CONTROL_METHOD_NAME "USE"  #define USE_CONTROL_METHOD_NAME "USE"
 #define TAB_SIZE 8  
   
 // forwards  // forwards
   
Line 217  static const short yyrhs[] = {    62, Line 216  static const short yyrhs[] = {    62,
   
 #if YYDEBUG != 0  #if YYDEBUG != 0
 static const short yyrline[] = { 0,  static const short yyrline[] = { 0,
    122,   130,   132,   132,   133,   135,   135,   137,   209,   209,     121,   129,   131,   131,   132,   134,   134,   136,   208,   208,
    210,   210,   211,   212,   212,   214,   243,   243,   244,   245,     209,   209,   210,   211,   211,   213,   242,   242,   243,   244,
    245,   246,   246,   248,   248,   252,   252,   254,   254,   255,     244,   245,   245,   247,   247,   251,   251,   253,   253,   254,
    255,   256,   256,   256,   260,   267,   268,   268,   269,   270,     254,   255,   255,   255,   259,   266,   267,   267,   268,   269,
    272,   273,   295,   296,   296,   300,   304,   306,   307,   308,     271,   272,   294,   295,   295,   299,   303,   305,   306,   307,
    325,   330,   332,   334,   335,   337,   343,   351,   357,   359,     324,   329,   331,   333,   334,   336,   342,   350,   356,   358,
    360,   362,   368,   369,   369,   373,   379,   382,   385,   398,     359,   361,   367,   368,   368,   372,   378,   381,   384,   397,
    400,   400,   401,   403,   404,   406,   407,   408,   409,   411,     399,   399,   400,   402,   403,   405,   406,   407,   408,   410,
    413,   415,   417,   419,   421,   425,   429,   433,   435,   436,     412,   414,   416,   418,   420,   424,   428,   432,   434,   435,
    438,   447,   447,   449,   449,   450,   451,   459,   464,   466,     437,   446,   446,   448,   448,   449,   450,   458,   463,   465,
    468,   469,   470,   472,   476,   485,   491,   496,   496,   497,     467,   468,   469,   471,   475,   484,   490,   495,   495,   496,
    502,   504,   506,   518,   530,   535,   537,   538,   539,   540,     501,   503,   505,   517,   529,   534,   536,   537,   538,   539,
    541,   543,   544,   545,   546,   547,   548,   549,   550,   552,     540,   542,   543,   544,   545,   546,   547,   548,   549,   551,
    553,   554,   555,   556,   557,   558,   559,   560,   561,   562,     552,   553,   554,   555,   556,   557,   558,   559,   560,   561,
    563,   564,   565,   566,   567,   568,   569,   570,   571,   572,     562,   563,   564,   565,   566,   567,   568,   569,   570,   571,
    573,   574,   575,   576,   577,   578,   581,   590,   595,   596     572,   573,   574,   575,   576,   577,   580,   589,   594,   595
 };  };
 #endif  #endif
   
Line 772  yyparse(YYPARSE_PARAM_ARG) Line 771  yyparse(YYPARSE_PARAM_ARG)
   
 #ifdef YYPURE  #ifdef YYPURE
   int yychar;    int yychar;
   YYSTYPE yylval;    YYSTYPE yylval=0; /*paf:calm down, vc7 warning level 4*/
   int yynerrs;    int yynerrs;
 #ifdef YYLSP_NEEDED  #ifdef YYLSP_NEEDED
   YYLTYPE yylloc;    YYLTYPE yylloc;
 #endif  #endif
 #endif  #endif
   
   YYSTYPE yyval;                /*  the variable used to return         */    YYSTYPE yyval=0; /*paf:calm down, vc7 warning level 4*/               /*  the variable used to return         */
                                 /*  semantic values from the action     */                                  /*  semantic values from the action     */
                                 /*  routines                            */                                  /*  routines                            */
   
Line 1039  yyreduce: Line 1038  yyreduce:
   switch (yyn) {    switch (yyn) {
   
 case 1:  case 1:
 #line 123 "compile.y"  #line 122 "compile.y"
 {  {
         Method& method=*new Method(Method::CT_ANY,          Method& method=*new Method(Method::CT_ANY,
                 0, 0, /*min, max numbered_params_count*/                  0, 0, /*min, max numbered_params_count*/
Line 1049  case 1: Line 1048  case 1:
 ;  ;
     break;}      break;}
 case 8:  case 8:
 #line 138 "compile.y"  #line 137 "compile.y"
 {  {
         const String& command=*LA2S(*yyvsp[-2]);          const String& command=*LA2S(*yyvsp[-2]);
         YYSTYPE strings_code=yyvsp[0];          YYSTYPE strings_code=yyvsp[0];
         if(strings_code->count()<1*2) {          if(strings_code->count()<1*OPERATIONS_PER_OPVALUE) {
                 strcpy(PC.error, "@");                  strcpy(PC.error, "@");
                 strcat(PC.error, command.cstr());                  strcat(PC.error, command.cstr());
                 strcat(PC.error, " is empty");                  strcat(PC.error, " is empty");
Line 1066  case 8: Line 1065  case 8:
                         strcat(PC.error, "'");                          strcat(PC.error, "'");
                         YYERROR;                          YYERROR;
                 }                  }
                 if(strings_code->count()==1*2) {                  if(strings_code->count()==1*OPERATIONS_PER_OPVALUE) {
                         // new class' name                          // new class' name
                         const String& name=*LA2S(*strings_code);                          const String& name=*LA2S(*strings_code);
                         // creating the class                          // creating the class
Line 1076  case 8: Line 1075  case 8:
                         // append to request's classes                          // append to request's classes
                         PC.request.classes().put(name, cclass);                          PC.request.classes().put(name, cclass);
                 } else {                  } else {
                         strcpy(PC.error, "@"CLASS_NAME" must contain sole name");                          strcpy(PC.error, "@"CLASS_NAME" must contain only one line with class name (contains more then one)");
                         YYERROR;                          YYERROR;
                 }                  }
         } else if(command==USE_CONTROL_METHOD_NAME) {          } else if(command==USE_CONTROL_METHOD_NAME) {
                 for(size_t i=0; i<strings_code->count(); i+=2)                   for(size_t i=0; i<strings_code->count(); i+=OPERATIONS_PER_OPVALUE) 
                         PC.request.use_file(PC.request.main_class, *LA2S(*strings_code, i));                          PC.request.use_file(PC.request.main_class, *LA2S(*strings_code, i));
         } else if(command==BASE_NAME) {          } else if(command==BASE_NAME) {
                 if(PC.cclass->base_class()) { // already changed from default?                  if(PC.cclass->base_class()) { // already changed from default?
Line 1089  case 8: Line 1088  case 8:
                         strcat(PC.error, "'");                          strcat(PC.error, "'");
                         YYERROR;                          YYERROR;
                 }                  }
                 if(strings_code->count()==1*2) {                  if(strings_code->count()==1*OPERATIONS_PER_OPVALUE) {
                         const String& base_name=*LA2S(*strings_code);                          const String& base_name=*LA2S(*strings_code);
                         if(Value* base_class_value=PC.request.classes().get(base_name)) {                          if(Value* base_class_value=PC.request.classes().get(base_name)) {
                                 // @CLASS == @BASE sanity check                                  // @CLASS == @BASE sanity check
Line 1123  case 8: Line 1122  case 8:
 ;  ;
     break;}      break;}
 case 12:  case 12:
 #line 210 "compile.y"  #line 209 "compile.y"
 { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;  { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;
     break;}      break;}
 case 16:  case 16:
 #line 215 "compile.y"  #line 214 "compile.y"
 {  {
         const String& name=*LA2S(*yyvsp[-5]);          const String& name=*LA2S(*yyvsp[-5]);
   
Line 1135  case 16: Line 1134  case 16:
         ArrayString* params_names=0;          ArrayString* params_names=0;
         if(int size=params_names_code->count()) {          if(int size=params_names_code->count()) {
                 params_names=new ArrayString;                  params_names=new ArrayString;
                 for(int i=0; i<size; i+=2)                  for(int i=0; i<size; i+=OPERATIONS_PER_OPVALUE)
                         *params_names+=LA2S(*params_names_code, i);                          *params_names+=LA2S(*params_names_code, i);
         }          }
   
Line 1143  case 16: Line 1142  case 16:
         ArrayString* locals_names=0;          ArrayString* locals_names=0;
         if(int size=locals_names_code->count()) {          if(int size=locals_names_code->count()) {
                 locals_names=new ArrayString;                  locals_names=new ArrayString;
                 for(int i=0; i<size; i+=2)                  for(int i=0; i<size; i+=OPERATIONS_PER_OPVALUE)
                         *locals_names+=LA2S(*locals_names_code, i);                          *locals_names+=LA2S(*locals_names_code, i);
         }          }
   
Line 1157  case 16: Line 1156  case 16:
 ;  ;
     break;}      break;}
 case 19:  case 19:
 #line 244 "compile.y"  #line 243 "compile.y"
 {yyval=yyvsp[-1];  {yyval=yyvsp[-1];
     break;}      break;}
 case 23:  case 23:
 #line 246 "compile.y"  #line 245 "compile.y"
 { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]) ;  { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]) ;
     break;}      break;}
 case 29:  case 29:
 #line 254 "compile.y"  #line 253 "compile.y"
 { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;  { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;
     break;}      break;}
 case 35:  case 35:
 #line 260 "compile.y"  #line 259 "compile.y"
 {  {
         yyval=yyvsp[0]; /* stack: resulting value */           yyval=yyvsp[0]; /* stack: resulting value */ 
         changetail_or_append(*yyval,           changetail_or_append(*yyval, 
Line 1179  case 35: Line 1178  case 35:
 ;  ;
     break;}      break;}
 case 36:  case 36:
 #line 267 "compile.y"  #line 266 "compile.y"
 { yyval=yyvsp[0] ;  { yyval=yyvsp[0] ;
     break;}      break;}
 case 39:  case 39:
 #line 269 "compile.y"  #line 268 "compile.y"
 { yyval=yyvsp[-1] ;  { yyval=yyvsp[-1] ;
     break;}      break;}
 case 42:  case 42:
 #line 273 "compile.y"  #line 272 "compile.y"
 {  {
         yyval=N();           yyval=N(); 
         ArrayOperation* diving_code=yyvsp[0];          ArrayOperation* diving_code=yyvsp[0];
         const String* first_name=LA2S(*diving_code);          const String* first_name=LA2S(*diving_code);
         // self.xxx... -> xxx...          // self.xxx... -> xxx...
         // OP_VALUE+string+OP_GET_ELEMENT+... -> OP_WITH_SELF+...          // OP_VALUE+origin+string+OP_GET_ELEMENT+... -> OP_WITH_SELF+...
         if(first_name && *first_name==SELF_ELEMENT_NAME) {          if(first_name && *first_name==SELF_ELEMENT_NAME) {
                 O(*yyval, OP_WITH_SELF); /* stack: starting context */                  O(*yyval, OP_WITH_SELF); /* stack: starting context */
                 P(*yyval, *diving_code,                   P(*yyval, *diving_code, 
                         /* skip over... */                          /* skip over... */
                         diving_code->count()>=3?3/*OP_VALUE+string+OP_GET_ELEMENTx*/:2/*OP_+string*/);                          diving_code->count()>=4?4/*OP_VALUE+origin+string+OP_GET_ELEMENTx*/:3/*OP_+origin+string*/);
         } else {          } else {
                 O(*yyval, OP_WITH_READ); /* stack: starting context */                  O(*yyval, OP_WITH_READ); /* stack: starting context */
   
                 // ^if ELEMENT -> ^if ELEMENT_OR_OPERATOR                  // ^if ELEMENT -> ^if ELEMENT_OR_OPERATOR
                 // OP_VALUE+string+OP_GET_ELEMENT. -> OP_VALUE+string+OP_GET_ELEMENT_OR_OPERATOR.                  // OP_VALUE+origin+string+OP_GET_ELEMENT. -> OP_VALUE+origin+string+OP_GET_ELEMENT_OR_OPERATOR.
                 if(PC.in_call_value && diving_code->count()==3)                  if(PC.in_call_value && diving_code->count()==4)
                         diving_code->put(2, OP_GET_ELEMENT_OR_OPERATOR);                          diving_code->put(4-1, OP_GET_ELEMENT_OR_OPERATOR);
                 P(*yyval, *diving_code);                  P(*yyval, *diving_code);
         }          }
         /* diving code; stack: current context */          /* diving code; stack: current context */
 ;  ;
     break;}      break;}
 case 43:  case 43:
 #line 295 "compile.y"  #line 294 "compile.y"
 { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;  { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;
     break;}      break;}
 case 45:  case 45:
 #line 296 "compile.y"  #line 295 "compile.y"
 { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;  { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;
     break;}      break;}
 case 46:  case 46:
 #line 300 "compile.y"  #line 299 "compile.y"
 {  {
         yyval=yyvsp[-1]; /* stack: context,name */          yyval=yyvsp[-1]; /* stack: context,name */
         P(*yyval, *yyvsp[0]); /* stack: context,name,constructor_value */          P(*yyval, *yyvsp[0]); /* stack: context,name,constructor_value */
 ;  ;
     break;}      break;}
 case 50:  case 50:
 #line 308 "compile.y"  #line 307 "compile.y"
 {  {
         yyval=N();          yyval=N();
         ArrayOperation* diving_code=yyvsp[0];          ArrayOperation* diving_code=yyvsp[0];
         const String* first_name=LA2S(*diving_code);          const String* first_name=LA2S(*diving_code);
         // $self.xxx... -> $xxx...          // $self.xxx... -> $xxx...
         // OP_VALUE+string+OP_GET_ELEMENT+... -> OP_WITH_SELF+...          // OP_VALUE+origin+string+OP_GET_ELEMENT+... -> OP_WITH_SELF+...
         if(first_name && *first_name==SELF_ELEMENT_NAME) {          if(first_name && *first_name==SELF_ELEMENT_NAME) {
                 O(*yyval, OP_WITH_SELF); /* stack: starting context */                  O(*yyval, OP_WITH_SELF); /* stack: starting context */
                 P(*yyval, *diving_code,                   P(*yyval, *diving_code, 
                         /* skip over... */                          /* skip over... */
                         diving_code->count()>=3?3/*OP_VALUE+string+OP_GET_ELEMENTx*/:2/*OP_+string*/);                          diving_code->count()>=4?4/*OP_VALUE+origin+string+OP_GET_ELEMENTx*/:3/*OP_+origin+string*/);
         } else {          } else {
                 O(*yyval, OP_WITH_ROOT); /* stack: starting context */                  O(*yyval, OP_WITH_ROOT); /* stack: starting context */
                 P(*yyval, *diving_code);                  P(*yyval, *diving_code);
Line 1247  case 50: Line 1246  case 50:
 ;  ;
     break;}      break;}
 case 51:  case 51:
 #line 325 "compile.y"  #line 324 "compile.y"
 {  {
         yyval=N();           yyval=N(); 
         O(*yyval, OP_WITH_WRITE); /* stack: starting context */          O(*yyval, OP_WITH_WRITE); /* stack: starting context */
Line 1255  case 51: Line 1254  case 51:
 ;  ;
     break;}      break;}
 case 52:  case 52:
 #line 330 "compile.y"  #line 329 "compile.y"
 { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;  { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;
     break;}      break;}
 case 56:  case 56:
 #line 337 "compile.y"  #line 336 "compile.y"
 {  {
         // stack: context, name          // stack: context, name
         yyval=yyvsp[-1]; // stack: context, name, value          yyval=yyvsp[-1]; // stack: context, name, value
Line 1267  case 56: Line 1266  case 56:
 ;  ;
     break;}      break;}
 case 57:  case 57:
 #line 343 "compile.y"  #line 342 "compile.y"
 {   { 
         yyval=N();           yyval=N(); 
         O(*yyval, OP_PREPARE_TO_EXPRESSION);          O(*yyval, OP_PREPARE_TO_EXPRESSION);
Line 1277  case 57: Line 1276  case 57:
 ;  ;
     break;}      break;}
 case 58:  case 58:
 #line 351 "compile.y"  #line 350 "compile.y"
 {  {
         // stack: context, name          // stack: context, name
         yyval=N();           yyval=N(); 
Line 1285  case 58: Line 1284  case 58:
 ;  ;
     break;}      break;}
 case 62:  case 62:
 #line 362 "compile.y"  #line 361 "compile.y"
 {  {
         yyval=N();           yyval=N(); 
         OA(*yyval, OP_OBJECT_POOL, yyvsp[0]); /* stack: empty write context */          OA(*yyval, OP_OBJECT_POOL, yyvsp[0]); /* stack: empty write context */
Line 1294  case 62: Line 1293  case 62:
 ;  ;
     break;}      break;}
 case 65:  case 65:
 #line 369 "compile.y"  #line 368 "compile.y"
 { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;  { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;
     break;}      break;}
 case 66:  case 66:
 #line 373 "compile.y"  #line 372 "compile.y"
 {  {
         yyval=yyvsp[0]; /* stack: value */          yyval=yyvsp[0]; /* stack: value */
         changetail_or_append(*yyval,           changetail_or_append(*yyval, 
Line 1307  case 66: Line 1306  case 66:
 ;  ;
     break;}      break;}
 case 67:  case 67:
 #line 379 "compile.y"  #line 378 "compile.y"
 {   { 
                                         PC.in_call_value=true;                                           PC.in_call_value=true; 
                         ;                          ;
     break;}      break;}
 case 68:  case 68:
 #line 382 "compile.y"  #line 381 "compile.y"
 {  {
                                 PC.in_call_value=false;                                  PC.in_call_value=false;
                         ;                          ;
     break;}      break;}
 case 69:  case 69:
 #line 385 "compile.y"  #line 384 "compile.y"
 { /* ^field.$method{vasya} */  { /* ^field.$method{vasya} */
         yyval=yyvsp[-3]; /* with_xxx,diving code; stack: context,method_junction */          yyval=yyvsp[-3]; /* with_xxx,diving code; stack: context,method_junction */
   
         YYSTYPE params_code=yyvsp[-1];          YYSTYPE params_code=yyvsp[-1];
         if(params_code->count()==3) { // probably [] case. [OP_VALUE + Void + STORE_PARAM]          if(params_code->count()==4) { // probably [] case. [OP_VALUE+origin+Void+STORE_PARAM]
                 if(Value* value=LA2V(*params_code)) // it is OP_VALUE + value?                  if(Value* value=LA2V(*params_code)) // it is OP_VALUE+origin+value?
                         if(!value->is_defined()) // value is VVoid?                          if(!value->is_defined()) // value is VVoid?
                                 params_code=0; // ^zzz[] case. don't append lone empty param.                                  params_code=0; // ^zzz[] case. don't append lone empty param.
         }          }
Line 1334  case 69: Line 1333  case 69:
 ;  ;
     break;}      break;}
 case 72:  case 72:
 #line 400 "compile.y"  #line 399 "compile.y"
 { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;  { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;
     break;}      break;}
 case 76:  case 76:
 #line 406 "compile.y"  #line 405 "compile.y"
 {yyval=yyvsp[-1];  {yyval=yyvsp[-1];
     break;}      break;}
 case 77:  case 77:
 #line 407 "compile.y"  #line 406 "compile.y"
 {yyval=yyvsp[-1];  {yyval=yyvsp[-1];
     break;}      break;}
 case 78:  case 78:
 #line 408 "compile.y"  #line 407 "compile.y"
 {yyval=yyvsp[-1];  {yyval=yyvsp[-1];
     break;}      break;}
 case 80:  case 80:
 #line 411 "compile.y"  #line 410 "compile.y"
 { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]) ;  { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]) ;
     break;}      break;}
 case 82:  case 82:
 #line 415 "compile.y"  #line 414 "compile.y"
 { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]) ;  { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]) ;
     break;}      break;}
 case 84:  case 84:
 #line 419 "compile.y"  #line 418 "compile.y"
 { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]) ;  { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]) ;
     break;}      break;}
 case 85:  case 85:
 #line 421 "compile.y"  #line 420 "compile.y"
 {  {
         yyval=yyvsp[0];          yyval=yyvsp[0];
         O(*yyval, OP_STORE_PARAM);          O(*yyval, OP_STORE_PARAM);
 ;  ;
     break;}      break;}
 case 86:  case 86:
 #line 425 "compile.y"  #line 424 "compile.y"
 {  {
         yyval=N();           yyval=N(); 
         OA(*yyval, OP_EXPR_CODE__STORE_PARAM, yyvsp[0]);          OA(*yyval, OP_EXPR_CODE__STORE_PARAM, yyvsp[0]);
 ;  ;
     break;}      break;}
 case 87:  case 87:
 #line 429 "compile.y"  #line 428 "compile.y"
 {  {
         yyval=N();           yyval=N(); 
         OA(*yyval, OP_CURLY_CODE__STORE_PARAM, yyvsp[0]);          OA(*yyval, OP_CURLY_CODE__STORE_PARAM, yyvsp[0]);
 ;  ;
     break;}      break;}
 case 91:  case 91:
 #line 438 "compile.y"  #line 437 "compile.y"
 {  {
         yyval=N();           yyval=N(); 
         O(*yyval, OP_PREPARE_TO_EXPRESSION);          O(*yyval, OP_PREPARE_TO_EXPRESSION);
Line 1392  case 91: Line 1391  case 91:
 ;  ;
     break;}      break;}
 case 93:  case 93:
 #line 447 "compile.y"  #line 446 "compile.y"
 { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;  { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;
     break;}      break;}
 case 95:  case 95:
 #line 449 "compile.y"  #line 448 "compile.y"
 { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;  { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;
     break;}      break;}
 case 97:  case 97:
 #line 451 "compile.y"  #line 450 "compile.y"
 {  {
         // we know that name_advance1 not called from ^xxx context          // we know that name_advance1 not called from ^xxx context
         // so we'll not check for operator call possibility as we do in name_advance2          // so we'll not check for operator call possibility as we do in name_advance2
Line 1411  case 97: Line 1410  case 97:
 ;  ;
     break;}      break;}
 case 98:  case 98:
 #line 459 "compile.y"  #line 458 "compile.y"
 {  {
         /* stack: context */          /* stack: context */
         yyval=yyvsp[0]; /* stack: context,name */          yyval=yyvsp[0]; /* stack: context,name */
Line 1419  case 98: Line 1418  case 98:
 ;  ;
     break;}      break;}
 case 104:  case 104:
 #line 472 "compile.y"  #line 471 "compile.y"
 {  {
         yyval=yyvsp[0];          yyval=yyvsp[0];
         O(*yyval, OP_GET_ELEMENT);          O(*yyval, OP_GET_ELEMENT);
 ;  ;
     break;}      break;}
 case 105:  case 105:
 #line 476 "compile.y"  #line 475 "compile.y"
 {  {
         ArrayOperation* code;          ArrayOperation* code;
         {          {
Line 1438  case 105: Line 1437  case 105:
 ;  ;
     break;}      break;}
 case 106:  case 106:
 #line 485 "compile.y"  #line 484 "compile.y"
 {  {
         yyval=N();           yyval=N(); 
         OA(*yyval, OP_OBJECT_POOL, yyvsp[-1]); /* stack: empty write context */          OA(*yyval, OP_OBJECT_POOL, yyvsp[-1]); /* stack: empty write context */
Line 1447  case 106: Line 1446  case 106:
 ;  ;
     break;}      break;}
 case 107:  case 107:
 #line 491 "compile.y"  #line 490 "compile.y"
 {  {
         yyval=N();           yyval=N(); 
         O(*yyval, OP_WITH_READ);          O(*yyval, OP_WITH_READ);
Line 1455  case 107: Line 1454  case 107:
 ;  ;
     break;}      break;}
 case 109:  case 109:
 #line 496 "compile.y"  #line 495 "compile.y"
 { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;  { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;
     break;}      break;}
 case 110:  case 110:
 #line 497 "compile.y"  #line 496 "compile.y"
 {  {
         yyval=yyvsp[0];          yyval=yyvsp[0];
         O(*yyval, OP_GET_ELEMENT__WRITE);          O(*yyval, OP_GET_ELEMENT__WRITE);
 ;  ;
     break;}      break;}
 case 113:  case 113:
 #line 506 "compile.y"  #line 505 "compile.y"
 {  {
         yyval=yyvsp[-1]; // stack: class name string          yyval=yyvsp[-1]; // stack: class name string
         if(*LA2S(*yyval) == BASE_NAME) { // pseudo BASE class          if(*LA2S(*yyval) == BASE_NAME) { // pseudo BASE class
Line 1481  case 113: Line 1480  case 113:
 ;  ;
     break;}      break;}
 case 114:  case 114:
 #line 518 "compile.y"  #line 517 "compile.y"
 {  {
         yyval=yyvsp[-1];          yyval=yyvsp[-1];
         if(!PC.in_call_value) {          if(!PC.in_call_value) {
Line 1492  case 114: Line 1491  case 114:
 ;  ;
     break;}      break;}
 case 115:  case 115:
 #line 530 "compile.y"  #line 529 "compile.y"
 {  {
         // see OP_PREPARE_TO_EXPRESSION!!          // see OP_PREPARE_TO_EXPRESSION!!
         if((yyval=yyvsp[0])->count()==2) // only one string literal in there?          if((yyval=yyvsp[0])->count()==2) // only one string literal in there?
Line 1500  case 115: Line 1499  case 115:
 ;  ;
     break;}      break;}
 case 119:  case 119:
 #line 539 "compile.y"  #line 538 "compile.y"
 { yyval = yyvsp[-1]; ;  { yyval = yyvsp[-1]; ;
     break;}      break;}
 case 120:  case 120:
 #line 540 "compile.y"  #line 539 "compile.y"
 { yyval = yyvsp[-1]; ;  { yyval = yyvsp[-1]; ;
     break;}      break;}
 case 121:  case 121:
 #line 541 "compile.y"  #line 540 "compile.y"
 { yyval = yyvsp[-1]; ;  { yyval = yyvsp[-1]; ;
     break;}      break;}
 case 122:  case 122:
 #line 543 "compile.y"  #line 542 "compile.y"
 { yyval=yyvsp[0];  O(*yyval, OP_NEG) ;  { yyval=yyvsp[0];  O(*yyval, OP_NEG) ;
     break;}      break;}
 case 123:  case 123:
 #line 544 "compile.y"  #line 543 "compile.y"
 { yyval=yyvsp[0] ;  { yyval=yyvsp[0] ;
     break;}      break;}
 case 124:  case 124:
 #line 545 "compile.y"  #line 544 "compile.y"
 { yyval=yyvsp[0];        O(*yyval, OP_INV) ;  { yyval=yyvsp[0];        O(*yyval, OP_INV) ;
     break;}      break;}
 case 125:  case 125:
 #line 546 "compile.y"  #line 545 "compile.y"
 { yyval=yyvsp[0];  O(*yyval, OP_NOT) ;  { yyval=yyvsp[0];  O(*yyval, OP_NOT) ;
     break;}      break;}
 case 126:  case 126:
 #line 547 "compile.y"  #line 546 "compile.y"
 { yyval=yyvsp[0];  O(*yyval, OP_DEF) ;  { yyval=yyvsp[0];  O(*yyval, OP_DEF) ;
     break;}      break;}
 case 127:  case 127:
 #line 548 "compile.y"  #line 547 "compile.y"
 { yyval=yyvsp[0];  O(*yyval, OP_IN) ;  { yyval=yyvsp[0];  O(*yyval, OP_IN) ;
     break;}      break;}
 case 128:  case 128:
 #line 549 "compile.y"  #line 548 "compile.y"
 { yyval=yyvsp[0];  O(*yyval, OP_FEXISTS) ;  { yyval=yyvsp[0];  O(*yyval, OP_FEXISTS) ;
     break;}      break;}
 case 129:  case 129:
 #line 550 "compile.y"  #line 549 "compile.y"
 { yyval=yyvsp[0];  O(*yyval, OP_DEXISTS) ;  { yyval=yyvsp[0];  O(*yyval, OP_DEXISTS) ;
     break;}      break;}
 case 130:  case 130:
 #line 552 "compile.y"  #line 551 "compile.y"
 {       yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_SUB) ;  {       yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_SUB) ;
     break;}      break;}
 case 131:  case 131:
 #line 553 "compile.y"  #line 552 "compile.y"
 { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_ADD) ;  { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_ADD) ;
     break;}      break;}
 case 132:  case 132:
 #line 554 "compile.y"  #line 553 "compile.y"
 { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_MUL) ;  { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_MUL) ;
     break;}      break;}
 case 133:  case 133:
 #line 555 "compile.y"  #line 554 "compile.y"
 { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_DIV) ;  { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_DIV) ;
     break;}      break;}
 case 134:  case 134:
 #line 556 "compile.y"  #line 555 "compile.y"
 { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_MOD) ;  { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_MOD) ;
     break;}      break;}
 case 135:  case 135:
 #line 557 "compile.y"  #line 556 "compile.y"
 { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_INTDIV) ;  { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_INTDIV) ;
     break;}      break;}
 case 136:  case 136:
 #line 558 "compile.y"  #line 557 "compile.y"
 { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_BIN_SL) ;  { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_BIN_SL) ;
     break;}      break;}
 case 137:  case 137:
 #line 559 "compile.y"  #line 558 "compile.y"
 { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_BIN_SR) ;  { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_BIN_SR) ;
     break;}      break;}
 case 138:  case 138:
 #line 560 "compile.y"  #line 559 "compile.y"
 { yyval=yyvsp[-2];      P(*yyval, *yyvsp[0]);  O(*yyval, OP_BIN_AND) ;  { yyval=yyvsp[-2];      P(*yyval, *yyvsp[0]);  O(*yyval, OP_BIN_AND) ;
     break;}      break;}
 case 139:  case 139:
 #line 561 "compile.y"  #line 560 "compile.y"
 { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_BIN_OR) ;  { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_BIN_OR) ;
     break;}      break;}
 case 140:  case 140:
 #line 562 "compile.y"  #line 561 "compile.y"
 { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_BIN_XOR) ;  { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_BIN_XOR) ;
     break;}      break;}
 case 141:  case 141:
 #line 563 "compile.y"  #line 562 "compile.y"
 { yyval=yyvsp[-2];  OA(*yyval, OP_NESTED_CODE, yyvsp[0]);  O(*yyval, OP_LOG_AND) ;  { yyval=yyvsp[-2];  OA(*yyval, OP_NESTED_CODE, yyvsp[0]);  O(*yyval, OP_LOG_AND) ;
     break;}      break;}
 case 142:  case 142:
 #line 564 "compile.y"  #line 563 "compile.y"
 { yyval=yyvsp[-2];  OA(*yyval, OP_NESTED_CODE, yyvsp[0]);  O(*yyval, OP_LOG_OR) ;  { yyval=yyvsp[-2];  OA(*yyval, OP_NESTED_CODE, yyvsp[0]);  O(*yyval, OP_LOG_OR) ;
     break;}      break;}
 case 143:  case 143:
 #line 565 "compile.y"  #line 564 "compile.y"
 { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_LOG_XOR) ;  { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_LOG_XOR) ;
     break;}      break;}
 case 144:  case 144:
 #line 566 "compile.y"  #line 565 "compile.y"
 { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_NUM_LT) ;  { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_NUM_LT) ;
     break;}      break;}
 case 145:  case 145:
 #line 567 "compile.y"  #line 566 "compile.y"
 { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_NUM_GT) ;  { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_NUM_GT) ;
     break;}      break;}
 case 146:  case 146:
 #line 568 "compile.y"  #line 567 "compile.y"
 { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_NUM_LE) ;  { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_NUM_LE) ;
     break;}      break;}
 case 147:  case 147:
 #line 569 "compile.y"  #line 568 "compile.y"
 { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_NUM_GE) ;  { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_NUM_GE) ;
     break;}      break;}
 case 148:  case 148:
 #line 570 "compile.y"  #line 569 "compile.y"
 { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_NUM_EQ) ;  { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_NUM_EQ) ;
     break;}      break;}
 case 149:  case 149:
 #line 571 "compile.y"  #line 570 "compile.y"
 { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_NUM_NE) ;  { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_NUM_NE) ;
     break;}      break;}
 case 150:  case 150:
 #line 572 "compile.y"  #line 571 "compile.y"
 { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_STR_LT) ;  { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_STR_LT) ;
     break;}      break;}
 case 151:  case 151:
 #line 573 "compile.y"  #line 572 "compile.y"
 { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_STR_GT) ;  { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_STR_GT) ;
     break;}      break;}
 case 152:  case 152:
 #line 574 "compile.y"  #line 573 "compile.y"
 { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_STR_LE) ;  { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_STR_LE) ;
     break;}      break;}
 case 153:  case 153:
 #line 575 "compile.y"  #line 574 "compile.y"
 { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_STR_GE) ;  { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_STR_GE) ;
     break;}      break;}
 case 154:  case 154:
 #line 576 "compile.y"  #line 575 "compile.y"
 { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_STR_EQ) ;  { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_STR_EQ) ;
     break;}      break;}
 case 155:  case 155:
 #line 577 "compile.y"  #line 576 "compile.y"
 { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_STR_NE) ;  { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_STR_NE) ;
     break;}      break;}
 case 156:  case 156:
 #line 578 "compile.y"  #line 577 "compile.y"
 { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_IS) ;  { yyval=yyvsp[-2];  P(*yyval, *yyvsp[0]);  O(*yyval, OP_IS) ;
     break;}      break;}
 case 157:  case 157:
 #line 581 "compile.y"  #line 580 "compile.y"
 {  {
         yyval=N();          yyval=N();
         OA(*yyval, OP_STRING_POOL, yyvsp[0]); /* stack: empty write context */          OA(*yyval, OP_STRING_POOL, yyvsp[0]); /* stack: empty write context */
Line 1661  case 157: Line 1660  case 157:
 ;  ;
     break;}      break;}
 case 158:  case 158:
 #line 590 "compile.y"  #line 589 "compile.y"
 {  {
         // optimized from OP_STRING+OP_WRITE_VALUE to OP_STRING__WRITE          // optimized from OP_STRING+OP_WRITE_VALUE to OP_STRING__WRITE
         change_string_literal_to_write_string_literal(*(yyval=yyvsp[0]))          change_string_literal_to_write_string_literal(*(yyval=yyvsp[0]))
 ;  ;
     break;}      break;}
 case 159:  case 159:
 #line 595 "compile.y"  #line 594 "compile.y"
 { yyval=VL(new VVoid(), 0, 0, 0) ;  { yyval=VL(new VVoid(), 0, 0, 0) ;
     break;}      break;}
 case 160:  case 160:
 #line 596 "compile.y"  #line 595 "compile.y"
 { yyval=N() ;  { yyval=N() ;
     break;}      break;}
 }  }
Line 1897  yyerrhandle: Line 1896  yyerrhandle:
     }      }
   return 1;    return 1;
 }  }
 #line 598 "compile.y"  #line 597 "compile.y"
   
 #endif  #endif
   
Line 1951  static int yylex(YYSTYPE *lvalp, void *a Line 1950  static int yylex(YYSTYPE *lvalp, void *a
                 if(c=='\n') {                  if(c=='\n') {
                         pc.pos_next_line();                          pc.pos_next_line();
                 } else                  } else
                         pc.pos.col+=c=='\t'?TAB_SIZE:1;                          pc.pos_next_c(c);
   
                 if(c=='@' && pc.pos.col==0+1) {                  if(c=='@' && pc.pos.col==0+1) {
                         if(pc.ls==LS_DEF_SPECIAL_BODY) {                          if(pc.ls==LS_DEF_SPECIAL_BODY) {
Line 1997  default: Line 1996  default:
                                         if(!pc.string_start)                                          if(!pc.string_start)
                                                 pc.string_start=begin_pos;                                                  pc.string_start=begin_pos;
                                         // append piece till ^                                          // append piece till ^
                                         pc.string.append_strdup(begin, end-begin);                                          pc.string.append_strdup_know_length(begin, end-begin);
                                 }                                  }
                                 // reset piece 'begin' position & line                                  // reset piece 'begin' position & line
                                 begin=pc.source; // ->punctuation                                  begin=pc.source; // ->punctuation
Line 2013  default: Line 2012  default:
                                         if(!pc.string_start)                                          if(!pc.string_start)
                                                 pc.string_start=begin_pos;                                                  pc.string_start=begin_pos;
                                         // append piece till ^                                          // append piece till ^
                                         pc.string.append_strdup(begin, end-begin);                                          pc.string.append_strdup_know_length(begin, end-begin);
                                 }                                  }
                                 // #HH ?                                  // #HH ?
                                 if(pc.source[0]=='#' && pc.source[1] && pc.source[2]) {                                  if(pc.source[0]=='#' && pc.source[1] && pc.source[2]) {
Line 2046  default: Line 2045  default:
                                 if(!pc.string_start)                                  if(!pc.string_start)
                                         pc.string_start=begin_pos;                                          pc.string_start=begin_pos;
                                 // append piece till #                                  // append piece till #
                                 pc.string.append_strdup(begin, end-begin);                                  pc.string.append_strdup_know_length(begin, end-begin);
                         }                          }
                         // fall into COMMENT lexical state [wait for \n]                          // fall into COMMENT lexical state [wait for \n]
                         push_LS(pc, LS_USER_COMMENT);                          push_LS(pc, LS_USER_COMMENT);
Line 2191  default: Line 2190  default:
                                         if(!pc.string_start)                                          if(!pc.string_start)
                                                 pc.string_start=begin_pos;                                                  pc.string_start=begin_pos;
                                         // append piece till #                                          // append piece till #
                                         pc.string.append_strdup(begin, end-begin);                                          pc.string.append_strdup_know_length(begin, end-begin);
                                 }                                  }
                                 // fall into COMMENT lexical state [wait for \n]                                  // fall into COMMENT lexical state [wait for \n]
                                 push_LS(pc, LS_EXPRESSION_COMMENT);                                  push_LS(pc, LS_EXPRESSION_COMMENT);
Line 2625  break2: Line 2624  break2:
                         if(!pc.string_start)                          if(!pc.string_start)
                                 pc.string_start=begin_pos;                                  pc.string_start=begin_pos;
                         // append it                          // append it
                         pc.string.append_strdup(begin, end-begin);                          pc.string.append_strdup_know_length(begin, end-begin);
                 }                  }
         }          }
         if(!pc.string.is_empty()) { // something accumulated?          if(!pc.string.is_empty()) { // something accumulated?
                 // create STRING value: array of OP_VALUE+vstring                  // create STRING value: array of OP_VALUE+origin+vstring
                 *lvalp=VL(                  *lvalp=VL(
                         new VString(*new String(pc.string, String::L_CLEAN)),                          new VString(*new String(pc.string, String::L_CLEAN)),
                         pc.file_no, pc.string_start.line, pc.string_start.col);                          pc.file_no, pc.string_start.line, pc.string_start.col);

Removed from v.1.81.2.13.2.27  
changed lines
  Added in v.1.89


E-mail: