Diff for /parser3/src/main/compile.tab.C between versions 1.81.2.3 and 1.81.2.13.2.5

version 1.81.2.3, 2003/01/31 12:10:45 version 1.81.2.13.2.5, 2003/03/20 14:19:09
Line 82  static int yylex(YYSTYPE *lvalp, void *p Line 82  static int yylex(YYSTYPE *lvalp, void *p
   
   
 // local convinient inplace typecast & var  // local convinient inplace typecast & var
   #undef PC
 #define PC  (*(parse_control *)pc)  #define PC  (*(parse_control *)pc)
   #undef POOL
 #define POOL  (*PC.pool)  #define POOL  (*PC.pool)
 #undef NEW  
 #define NEW new(POOL)  
 #ifndef DOXYGEN  #ifndef DOXYGEN
 #ifndef YYSTYPE  #ifndef YYSTYPE
 #define YYSTYPE int  #define YYSTYPE int
Line 210  static const short yyrhs[] = {    62, Line 210  static const short yyrhs[] = {    62,
   
 #if YYDEBUG != 0  #if YYDEBUG != 0
 static const short yyrline[] = { 0,  static const short yyrline[] = { 0,
    115,   123,   125,   125,   126,   128,   128,   130,   195,   195,     115,   123,   125,   125,   126,   128,   128,   130,   202,   202,
    196,   196,   197,   198,   198,   200,   229,   229,   230,   231,     203,   203,   204,   205,   205,   207,   236,   236,   237,   238,
    231,   232,   232,   234,   234,   238,   238,   240,   240,   241,     238,   239,   239,   241,   241,   245,   245,   247,   247,   248,
    241,   242,   242,   242,   246,   253,   254,   254,   255,   256,     248,   249,   249,   249,   253,   260,   261,   261,   262,   263,
    258,   259,   281,   282,   282,   286,   290,   292,   293,   294,     265,   266,   288,   289,   289,   293,   297,   299,   300,   301,
    311,   316,   318,   320,   321,   323,   329,   337,   343,   345,     318,   323,   325,   327,   328,   330,   336,   344,   350,   352,
    346,   348,   354,   355,   355,   359,   365,   368,   371,   384,     353,   355,   361,   362,   362,   366,   372,   375,   378,   391,
    386,   386,   387,   389,   390,   392,   393,   394,   395,   397,     393,   393,   394,   396,   397,   399,   400,   401,   402,   404,
    399,   401,   403,   405,   407,   411,   415,   419,   421,   422,     406,   408,   410,   412,   414,   418,   422,   426,   428,   429,
    424,   433,   433,   435,   435,   436,   437,   445,   450,   452,     431,   440,   440,   442,   442,   443,   444,   452,   457,   459,
    454,   455,   456,   458,   462,   471,   477,   482,   482,   483,     461,   462,   463,   465,   469,   478,   484,   489,   489,   490,
    488,   490,   492,   504,   516,   521,   523,   524,   525,   526,     495,   497,   499,   511,   523,   528,   530,   531,   532,   533,
    527,   529,   530,   531,   532,   533,   534,   535,   536,   538,     534,   536,   537,   538,   539,   540,   541,   542,   543,   545,
    539,   540,   541,   542,   543,   544,   545,   546,   547,   548,     546,   547,   548,   549,   550,   551,   552,   553,   554,   555,
    549,   550,   551,   552,   553,   554,   555,   556,   557,   558,     556,   557,   558,   559,   560,   561,   562,   563,   564,   565,
    559,   560,   561,   562,   563,   564,   567,   576,   581,   582     566,   567,   568,   569,   570,   571,   574,   583,   588,   589
 };  };
 #endif  #endif
   
   
 #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)  #if YYDEBUG != 0 || defined (YYERROR_VERBOSE)
   
 static const char * const yytname[] = {   "$","error","$undefined.","EON","STRING",  static const char*  const yytname[] = {   "$","error","$undefined.","EON","STRING",
 "BOGUS","BAD_STRING_COMPARISON_OPERATOR","BAD_HEX_LITERAL","BAD_METHOD_DECL_START",  "BOGUS","BAD_STRING_COMPARISON_OPERATOR","BAD_HEX_LITERAL","BAD_METHOD_DECL_START",
 "BAD_METHOD_PARAMETER_NAME_CHARACTER","BAD_MATH_OPERATOR_CHARACTER","\"&&\"",  "BAD_METHOD_PARAMETER_NAME_CHARACTER","BAD_MATH_OPERATOR_CHARACTER","\"&&\"",
 "\"||\"","\"!||\"","\"!|\"","\"<=\"","\">=\"","\"==\"","\"!=\"","\"<<\"","\">>\"",  "\"||\"","\"!||\"","\"!|\"","\"<=\"","\">=\"","\"==\"","\"!=\"","\"<<\"","\">>\"",
Line 1036  case 1: Line 1036  case 1:
 {  {
         MethodPtr method(new Method(main_method_name, Method::CT_ANY,          MethodPtr method(new Method(main_method_name, Method::CT_ANY,
                 0, 0, /*min, max numbered_params_count*/                  0, 0, /*min, max numbered_params_count*/
                 ArrayStringPtr(0)/*param_names*/, ArrayStringPtr(0)/*local_names*/,                   Array0/*param_names*/, Array0/*local_names*/, 
                 yyvsp[0]/*parser_code*/, 0/*native_code*/));                  yyvsp[0]/*parser_code*/, 0/*native_code*/));
         PC.cclass->add_method(main_method_name, method);          PC.cclass->add_method(main_method_name, method);
 ;  ;
Line 1044  case 1: Line 1044  case 1:
 case 8:  case 8:
 #line 131 "compile.y"  #line 131 "compile.y"
 {  {
         StringPtr 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*2) {
                 strcpy(PC.error, "@");                  strcpy(PC.error, "@");
Line 1061  case 8: Line 1061  case 8:
                 }                  }
                 if(strings_code->count()==1*2) {                  if(strings_code->count()==1*2) {
                         // new class' name                          // new class' name
                         StringPtr name=LA2S(*strings_code);                          const String& name=LA2S(*strings_code);
                         // creating the class                          // creating the class
                         PC.cclass=VStateless_classPtr(new VClass);                          VStateless_classPtr cclass(new VClass);  cclass->set_name(name);
                         PC.cclass->set_name(name);  
                         // append to request's classes                          // append to request's classes
                         PC.request->classes().put(name, PC.cclass);                          PC.request->classes().put(name, cclass);
                           // new methods go to that class
                           PC.cclass=cclass.get();
                 } else {                  } else {
                         strcpy(PC.error, "@"CLASS_NAME" must contain sole name");                          strcpy(PC.error, "@"CLASS_NAME" must contain sole name");
                         YYERROR;                          YYERROR;
                 }                  }
         } else if(*command==USE_CONTROL_METHOD_NAME) {          } else if(*command==USE_CONTROL_METHOD_NAME) {
                 for(int i=0; i<strings_code->count(); i+=2)                   for(int i=0; i<strings_code->count(); i+=2) 
                         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?
                         strcpy(PC.error, "class already have a base '");                          strcpy(PC.error, "class already have a base '");
Line 1082  case 8: Line 1083  case 8:
                         YYERROR;                          YYERROR;
                 }                  }
                 if(strings_code->count()==1*2) {                  if(strings_code->count()==1*2) {
                         StringPtr base_name=LA2S(*strings_code);                          const String& base_name=LA2S(*strings_code);
                         if(VStateless_classPtr base_class=PC.request->classes().get(base_name)) {                          if(ValuePtr base_class_value=PC.request->classes().get(base_name)) {
                                 // @CLASS == @BASE sanity check                                  // @CLASS == @BASE sanity check
                                 if(PC.cclass.get()==base_class.get()) {                                  if(VStateless_class *base_class=base_class_value->get_class()) {
                                         strcpy(PC.error, "@"CLASS_NAME" equals @"BASE_NAME);                                          if(PC.cclass==base_class) {
                                                   strcpy(PC.error, "@"CLASS_NAME" equals @"BASE_NAME);
                                                   YYERROR;
                                           }
                                           PC.cclass->get_class()->set_base(base_class);
                                   } else { // they asked to derive from a class without methods ['env' & co]
                                           strcpy(PC.error, base_name->cstr());
                                           strcat(PC.error, ": you can not derive from this class in @"BASE_NAME);
                                         YYERROR;                                          YYERROR;
                                 }                                  }
                                 PC.cclass->set_base(base_class);  
                         } else {                          } else {
                                 strcpy(PC.error, base_name->cstr());                                  strcpy(PC.error, base_name->cstr());
                                 strcat(PC.error, ": undefined class in @"BASE_NAME);                                  strcat(PC.error, ": undefined class in @"BASE_NAME);
Line 1109  case 8: Line 1116  case 8:
 ;  ;
     break;}      break;}
 case 12:  case 12:
 #line 196 "compile.y"  #line 203 "compile.y"
 { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;  { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;
     break;}      break;}
 case 16:  case 16:
 #line 201 "compile.y"  #line 208 "compile.y"
 {  {
         StringPtr name=LA2S(*yyvsp[-5]);          const String& name=LA2S(*yyvsp[-5]);
   
         YYSTYPE params_names_code=yyvsp[-4];          YYSTYPE params_names_code=yyvsp[-4];
         ArrayStringPtr params_names;          ArrayString& params_names;
         if(int size=params_names_code->count()) {          if(int size=params_names_code->count()) {
                 params_names=ArrayStringPtr(new ArrayString);                  params_names=ArrayString* (new ArrayString);
                 for(int i=0; i<size; i+=2)                  for(int i=0; i<size; i+=2)
                         *params_names+=LA2S(*params_names_code, i);                          *params_names+=LA2S(*params_names_code, i);
         }          }
   
         YYSTYPE locals_names_code=yyvsp[-3];          YYSTYPE locals_names_code=yyvsp[-3];
         ArrayStringPtr locals_names;          ArrayString& locals_names;
         if(int size=locals_names_code->count()) {          if(int size=locals_names_code->count()) {
                 locals_names=ArrayStringPtr(new ArrayString);                  locals_names=ArrayString* (new ArrayString);
                 for(int i=0; i<size; i+=2)                  for(int i=0; i<size; i+=2)
                         *locals_names+=LA2S(*locals_names_code, i);                          *locals_names+=LA2S(*locals_names_code, i);
         }          }
Line 1143  case 16: Line 1150  case 16:
 ;  ;
     break;}      break;}
 case 19:  case 19:
 #line 230 "compile.y"  #line 237 "compile.y"
 {yyval=yyvsp[-1];  {yyval=yyvsp[-1];
     break;}      break;}
 case 23:  case 23:
 #line 232 "compile.y"  #line 239 "compile.y"
 { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]) ;  { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]) ;
     break;}      break;}
 case 29:  case 29:
 #line 240 "compile.y"  #line 247 "compile.y"
 { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;  { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;
     break;}      break;}
 case 35:  case 35:
 #line 246 "compile.y"  #line 253 "compile.y"
 {  {
         yyval=yyvsp[0]; /* stack: resulting value */           yyval=yyvsp[0]; /* stack: resulting value */ 
         changetail_or_append(*yyval,           changetail_or_append(*yyval, 
Line 1165  case 35: Line 1172  case 35:
 ;  ;
     break;}      break;}
 case 36:  case 36:
 #line 253 "compile.y"  #line 260 "compile.y"
 { yyval=yyvsp[0] ;  { yyval=yyvsp[0] ;
     break;}      break;}
 case 39:  case 39:
 #line 255 "compile.y"  #line 262 "compile.y"
 { yyval=yyvsp[-1] ;  { yyval=yyvsp[-1] ;
     break;}      break;}
 case 42:  case 42:
 #line 259 "compile.y"  #line 266 "compile.y"
 {  {
         yyval=N();           yyval=N(); 
         ArrayOperationPtr diving_code=yyvsp[0];          ArrayOperationPtr diving_code=yyvsp[0];
         StringPtr 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+string+OP_GET_ELEMENT+... -> OP_WITH_SELF+...
         if(first_name && *first_name==SELF_ELEMENT_NAME) {          if(first_name && *first_name==SELF_ELEMENT_NAME) {
Line 1198  case 42: Line 1205  case 42:
 ;  ;
     break;}      break;}
 case 43:  case 43:
 #line 281 "compile.y"  #line 288 "compile.y"
 { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;  { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;
     break;}      break;}
 case 45:  case 45:
 #line 282 "compile.y"  #line 289 "compile.y"
 { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;  { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;
     break;}      break;}
 case 46:  case 46:
 #line 286 "compile.y"  #line 293 "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 294 "compile.y"  #line 301 "compile.y"
 {  {
         yyval=N();          yyval=N();
         ArrayOperationPtr diving_code=yyvsp[0];          ArrayOperationPtr diving_code=yyvsp[0];
         StringPtr 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+string+OP_GET_ELEMENT+... -> OP_WITH_SELF+...
         if(first_name && *first_name==SELF_ELEMENT_NAME) {          if(first_name && *first_name==SELF_ELEMENT_NAME) {
Line 1233  case 50: Line 1240  case 50:
 ;  ;
     break;}      break;}
 case 51:  case 51:
 #line 311 "compile.y"  #line 318 "compile.y"
 {  {
         yyval=N();           yyval=N(); 
         O(*yyval, OP_WITH_WRITE); /* stack: starting context */          O(*yyval, OP_WITH_WRITE); /* stack: starting context */
Line 1241  case 51: Line 1248  case 51:
 ;  ;
     break;}      break;}
 case 52:  case 52:
 #line 316 "compile.y"  #line 323 "compile.y"
 { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;  { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;
     break;}      break;}
 case 56:  case 56:
 #line 323 "compile.y"  #line 330 "compile.y"
 {  {
         // stack: context, name          // stack: context, name
         yyval=yyvsp[-1]; // stack: context, name, value          yyval=yyvsp[-1]; // stack: context, name, value
Line 1253  case 56: Line 1260  case 56:
 ;  ;
     break;}      break;}
 case 57:  case 57:
 #line 329 "compile.y"  #line 336 "compile.y"
 {   { 
         yyval=N();           yyval=N(); 
         O(*yyval, OP_PREPARE_TO_EXPRESSION);          O(*yyval, OP_PREPARE_TO_EXPRESSION);
Line 1263  case 57: Line 1270  case 57:
 ;  ;
     break;}      break;}
 case 58:  case 58:
 #line 337 "compile.y"  #line 344 "compile.y"
 {  {
         // stack: context, name          // stack: context, name
         yyval=N();           yyval=N(); 
Line 1271  case 58: Line 1278  case 58:
 ;  ;
     break;}      break;}
 case 62:  case 62:
 #line 348 "compile.y"  #line 355 "compile.y"
 {  {
         yyval=N();           yyval=N(); 
         OA(*yyval, OP_OBJECT_POOL, yyvsp[0]); /* stack: empty write context */          OA(*yyval, OP_OBJECT_yyvsp[0]); /* stack: empty write context */
         /* some code that writes to that context */          /* some code that writes to that context */
         /* context=pop; stack: context.value() */          /* context=pop; stack: context.value() */
 ;  ;
     break;}      break;}
 case 65:  case 65:
 #line 355 "compile.y"  #line 362 "compile.y"
 { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;  { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;
     break;}      break;}
 case 66:  case 66:
 #line 359 "compile.y"  #line 366 "compile.y"
 {  {
         yyval=yyvsp[0]; /* stack: value */          yyval=yyvsp[0]; /* stack: value */
         changetail_or_append(*yyval,           changetail_or_append(*yyval, 
Line 1293  case 66: Line 1300  case 66:
 ;  ;
     break;}      break;}
 case 67:  case 67:
 #line 365 "compile.y"  #line 372 "compile.y"
 {   { 
                                         PC.in_call_value=true;                                           PC.in_call_value=true; 
                         ;                          ;
     break;}      break;}
 case 68:  case 68:
 #line 368 "compile.y"  #line 375 "compile.y"
 {  {
                                 PC.in_call_value=false;                                  PC.in_call_value=false;
                         ;                          ;
     break;}      break;}
 case 69:  case 69:
 #line 371 "compile.y"  #line 378 "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 */
   
Line 1320  case 69: Line 1327  case 69:
 ;  ;
     break;}      break;}
 case 72:  case 72:
 #line 386 "compile.y"  #line 393 "compile.y"
 { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;  { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;
     break;}      break;}
 case 76:  case 76:
 #line 392 "compile.y"  #line 399 "compile.y"
 {yyval=yyvsp[-1];  {yyval=yyvsp[-1];
     break;}      break;}
 case 77:  case 77:
 #line 393 "compile.y"  #line 400 "compile.y"
 {yyval=yyvsp[-1];  {yyval=yyvsp[-1];
     break;}      break;}
 case 78:  case 78:
 #line 394 "compile.y"  #line 401 "compile.y"
 {yyval=yyvsp[-1];  {yyval=yyvsp[-1];
     break;}      break;}
 case 80:  case 80:
 #line 397 "compile.y"  #line 404 "compile.y"
 { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]) ;  { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]) ;
     break;}      break;}
 case 82:  case 82:
 #line 401 "compile.y"  #line 408 "compile.y"
 { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]) ;  { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]) ;
     break;}      break;}
 case 84:  case 84:
 #line 405 "compile.y"  #line 412 "compile.y"
 { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]) ;  { yyval=yyvsp[-2]; P(*yyval, *yyvsp[0]) ;
     break;}      break;}
 case 85:  case 85:
 #line 407 "compile.y"  #line 414 "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 411 "compile.y"  #line 418 "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 415 "compile.y"  #line 422 "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 424 "compile.y"  #line 431 "compile.y"
 {  {
         yyval=N();           yyval=N(); 
         O(*yyval, OP_PREPARE_TO_EXPRESSION);          O(*yyval, OP_PREPARE_TO_EXPRESSION);
Line 1378  case 91: Line 1385  case 91:
 ;  ;
     break;}      break;}
 case 93:  case 93:
 #line 433 "compile.y"  #line 440 "compile.y"
 { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;  { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;
     break;}      break;}
 case 95:  case 95:
 #line 435 "compile.y"  #line 442 "compile.y"
 { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;  { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;
     break;}      break;}
 case 97:  case 97:
 #line 437 "compile.y"  #line 444 "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 1397  case 97: Line 1404  case 97:
 ;  ;
     break;}      break;}
 case 98:  case 98:
 #line 445 "compile.y"  #line 452 "compile.y"
 {  {
         /* stack: context */          /* stack: context */
         yyval=yyvsp[0]; /* stack: context,name */          yyval=yyvsp[0]; /* stack: context,name */
Line 1405  case 98: Line 1412  case 98:
 ;  ;
     break;}      break;}
 case 104:  case 104:
 #line 458 "compile.y"  #line 465 "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 462 "compile.y"  #line 469 "compile.y"
 {  {
         ArrayOperationPtr code;          ArrayOperationPtr code;
         {          {
Line 1420  case 105: Line 1427  case 105:
                 P(*code, *yyvsp[0]);                  P(*code, *yyvsp[0]);
         }          }
         yyval=N();           yyval=N(); 
         OA(*yyval, OP_STRING_POOL, code);          OA(*yyval, OP_STRING_code);
 ;  ;
     break;}      break;}
 case 106:  case 106:
 #line 471 "compile.y"  #line 478 "compile.y"
 {  {
         yyval=N();           yyval=N(); 
         OA(*yyval, OP_OBJECT_POOL, yyvsp[-1]); /* stack: empty write context */          OA(*yyval, OP_OBJECT_yyvsp[-1]); /* stack: empty write context */
         /* some code that writes to that context */          /* some code that writes to that context */
         /* context=pop; stack: context.value() */          /* context=pop; stack: context.value() */
 ;  ;
     break;}      break;}
 case 107:  case 107:
 #line 477 "compile.y"  #line 484 "compile.y"
 {  {
         yyval=N();           yyval=N(); 
         O(*yyval, OP_WITH_READ);          O(*yyval, OP_WITH_READ);
Line 1441  case 107: Line 1448  case 107:
 ;  ;
     break;}      break;}
 case 109:  case 109:
 #line 482 "compile.y"  #line 489 "compile.y"
 { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;  { yyval=yyvsp[-1]; P(*yyval, *yyvsp[0]) ;
     break;}      break;}
 case 110:  case 110:
 #line 483 "compile.y"  #line 490 "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 492 "compile.y"  #line 499 "compile.y"
 {  {
         yyval=yyvsp[-1]; // stack: class name string          yyval=yyvsp[-1]; // stack: class name string
         if(*LA2S(*yyval) == BASE_NAME) { // pseude BASE class          if(*LA2S(*yyval) == BASE_NAME) { // pseude BASE class
                 if(VStateless_classPtr base=PC.cclass->base_class()) {                  if(VStateless_class* base=PC.cclass->base_class()) {
                         change_string_literal_value(*yyval, base->name());                          change_string_literal_value(*yyval, base->name());
                 } else {                  } else {
                         strcpy(PC.error, "no base class declared");                          strcpy(PC.error, "no base class declared");
Line 1467  case 113: Line 1474  case 113:
 ;  ;
     break;}      break;}
 case 114:  case 114:
 #line 504 "compile.y"  #line 511 "compile.y"
 {  {
         yyval=yyvsp[-1];          yyval=yyvsp[-1];
         if(!PC.in_call_value) {          if(!PC.in_call_value) {
Line 1478  case 114: Line 1485  case 114:
 ;  ;
     break;}      break;}
 case 115:  case 115:
 #line 516 "compile.y"  #line 523 "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 1486  case 115: Line 1493  case 115:
 ;  ;
     break;}      break;}
 case 119:  case 119:
 #line 525 "compile.y"  #line 532 "compile.y"
 { yyval = yyvsp[-1]; ;  { yyval = yyvsp[-1]; ;
     break;}      break;}
 case 120:  case 120:
 #line 526 "compile.y"  #line 533 "compile.y"
 { yyval = yyvsp[-1]; ;  { yyval = yyvsp[-1]; ;
     break;}      break;}
 case 121:  case 121:
 #line 527 "compile.y"  #line 534 "compile.y"
 { yyval = yyvsp[-1]; ;  { yyval = yyvsp[-1]; ;
     break;}      break;}
 case 122:  case 122:
 #line 529 "compile.y"  #line 536 "compile.y"
 { yyval=yyvsp[0];  O(*yyval, OP_NEG) ;  { yyval=yyvsp[0];  O(*yyval, OP_NEG) ;
     break;}      break;}
 case 123:  case 123:
 #line 530 "compile.y"  #line 537 "compile.y"
 { yyval=yyvsp[0] ;  { yyval=yyvsp[0] ;
     break;}      break;}
 case 124:  case 124:
 #line 531 "compile.y"  #line 538 "compile.y"
 { yyval=yyvsp[0];        O(*yyval, OP_INV) ;  { yyval=yyvsp[0];        O(*yyval, OP_INV) ;
     break;}      break;}
 case 125:  case 125:
 #line 532 "compile.y"  #line 539 "compile.y"
 { yyval=yyvsp[0];  O(*yyval, OP_NOT) ;  { yyval=yyvsp[0];  O(*yyval, OP_NOT) ;
     break;}      break;}
 case 126:  case 126:
 #line 533 "compile.y"  #line 540 "compile.y"
 { yyval=yyvsp[0];  O(*yyval, OP_DEF) ;  { yyval=yyvsp[0];  O(*yyval, OP_DEF) ;
     break;}      break;}
 case 127:  case 127:
 #line 534 "compile.y"  #line 541 "compile.y"
 { yyval=yyvsp[0];  O(*yyval, OP_IN) ;  { yyval=yyvsp[0];  O(*yyval, OP_IN) ;
     break;}      break;}
 case 128:  case 128:
 #line 535 "compile.y"  #line 542 "compile.y"
 { yyval=yyvsp[0];  O(*yyval, OP_FEXISTS) ;  { yyval=yyvsp[0];  O(*yyval, OP_FEXISTS) ;
     break;}      break;}
 case 129:  case 129:
 #line 536 "compile.y"  #line 543 "compile.y"
 { yyval=yyvsp[0];  O(*yyval, OP_DEXISTS) ;  { yyval=yyvsp[0];  O(*yyval, OP_DEXISTS) ;
     break;}      break;}
 case 130:  case 130:
 #line 538 "compile.y"  #line 545 "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 539 "compile.y"  #line 546 "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 540 "compile.y"  #line 547 "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 541 "compile.y"  #line 548 "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 542 "compile.y"  #line 549 "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 543 "compile.y"  #line 550 "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 544 "compile.y"  #line 551 "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 545 "compile.y"  #line 552 "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 546 "compile.y"  #line 553 "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 547 "compile.y"  #line 554 "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 548 "compile.y"  #line 555 "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 549 "compile.y"  #line 556 "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 550 "compile.y"  #line 557 "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 551 "compile.y"  #line 558 "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 552 "compile.y"  #line 559 "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 553 "compile.y"  #line 560 "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 554 "compile.y"  #line 561 "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 555 "compile.y"  #line 562 "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 556 "compile.y"  #line 563 "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 557 "compile.y"  #line 564 "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 558 "compile.y"  #line 565 "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 559 "compile.y"  #line 566 "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 560 "compile.y"  #line 567 "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 561 "compile.y"  #line 568 "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 562 "compile.y"  #line 569 "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 563 "compile.y"  #line 570 "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 564 "compile.y"  #line 571 "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 567 "compile.y"  #line 574 "compile.y"
 {  {
         yyval=N();          yyval=N();
         OA(*yyval, OP_STRING_POOL, yyvsp[0]); /* stack: empty write context */          OA(*yyval, OP_STRING_yyvsp[0]); /* stack: empty write context */
         /* some code that writes to that context */          /* some code that writes to that context */
         /* context=pop; stack: context.get_string() */          /* context=pop; stack: context.get_string() */
 ;  ;
     break;}      break;}
 case 158:  case 158:
 #line 576 "compile.y"  #line 583 "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 581 "compile.y"  #line 588 "compile.y"
 { yyval=VL(ValuePtr(new VVoid())) ;  { yyval=VL(ValuePtr(new VVoid())) ;
     break;}      break;}
 case 160:  case 160:
 #line 582 "compile.y"  #line 589 "compile.y"
 { yyval=N() ;  { yyval=N() ;
     break;}      break;}
 }  }
Line 1883  yyerrhandle: Line 1890  yyerrhandle:
     }      }
   return 1;    return 1;
 }  }
 #line 584 "compile.y"  #line 591 "compile.y"
   
 #endif  #endif
   
Line 1916  static int yylex(YYSTYPE *lvalp, void *p Line 1923  static int yylex(YYSTYPE *lvalp, void *p
                 return result;                  return result;
         }          }
                   
         const char *begin=PC.source;          const char* begin=PC.source;
         const char *end;          const char* end;
         int begin_line=PC.line;          int begin_line=PC.line;
         int skip_analized=0;          int skip_analized=0;
         while(true) {          while(true) {
Line 2596  break2: Line 2603  break2:
                         PC.string->APPEND_CLEAN(begin, end-begin, PC.file, begin_line/*, start_col*/);                          PC.string->APPEND_CLEAN(begin, end-begin, PC.file, begin_line/*, start_col*/);
                 }                  }
         }          }
         if(PC.string->size()) { // something accumulated?          if(PC.string->length()) { // something accumulated?
                 // create STRING value: array of OP_VALUE+vstring                  // create STRING value: array of OP_VALUE+vstring
                 *lvalp=VL(ValuePtr(new VString(PC.string)));                  *lvalp=VL(ValuePtr(new VString(PC.string)));
                 // new pieces storage                  // new pieces storage
                 PC.string=StringPtr(new String);                  PC.string=String* (new String);
                 // make current result be pending for next call, return STRING for now                  // make current result be pending for next call, return STRING for now
                 PC.pending_state=result;  result=STRING;                  PC.pending_state=result;  result=STRING;
         }          }
Line 2617  static int real_yyerror(parse_control *p Line 2624  static int real_yyerror(parse_control *p
   
 static void yyprint(FILE *file, int type, YYSTYPE value) {  static void yyprint(FILE *file, int type, YYSTYPE value) {
         if(type==STRING)          if(type==STRING)
                 fprintf(file, " \"%s\"", LA2S(*value)->cstr());                  fprintf(file, " \"%s\"", LA2S(*value)->cstr().get());
 }  }

Removed from v.1.81.2.3  
changed lines
  Added in v.1.81.2.13.2.5


E-mail: