--- parser3/src/main/compile.tab.C 2003/03/21 14:49:00 1.81.2.13.2.9 +++ parser3/src/main/compile.tab.C 2003/04/02 14:16:18 1.81.2.13.2.20 @@ -43,7 +43,7 @@ Copyright (c) 2001, 2003 ArtLebedev Group (http://www.artlebedev.com) Author: Alexander Petrosyan (http://design.ru/paf) - $Id: compile.tab.C,v 1.81.2.13.2.9 2003/03/21 14:49:00 paf Exp $ + $Id: compile.tab.C,v 1.81.2.13.2.20 2003/04/02 14:16:18 paf Exp $ */ /** @@ -1073,7 +1073,7 @@ case 8: YYERROR; } } else if(command==USE_CONTROL_METHOD_NAME) { - for(int i=0; icount(); i+=2) + for(size_t i=0; icount(); i+=2) PC.request.use_file(PC.request.main_class, *LA2S(*strings_code, i)); } else if(command==BASE_NAME) { if(PC.cclass->base_class()) { // already changed from default? @@ -1125,7 +1125,7 @@ case 16: const String& name=*LA2S(*yyvsp[-5]); YYSTYPE params_names_code=yyvsp[-4]; - ArrayString* params_names; + ArrayString* params_names=0; if(int size=params_names_code->count()) { params_names=new ArrayString; for(int i=0; icount()) { locals_names=new ArrayString; for(int i=0; i ^if ELEMENT_OR_OPERATOR // OP_VALUE+string+OP_GET_ELEMENT. -> OP_VALUE+string+OP_GET_ELEMENT_OR_OPERATOR. if(PC.in_call_value && diving_code->count()==3) - (*diving_code)[2].code=OP_GET_ELEMENT_OR_OPERATOR; + diving_code->put(2, OP_GET_ELEMENT_OR_OPERATOR); P(*yyval, *diving_code); } /* diving code; stack: current context */ @@ -1462,7 +1462,7 @@ case 113: #line 499 "compile.y" { yyval=yyvsp[-1]; // stack: class name string - if(*LA2S(*yyval) == BASE_NAME) { // pseude BASE class + if(*LA2S(*yyval) == BASE_NAME) { // pseudo BASE class if(VStateless_class* base=PC.cclass->base_class()) { change_string_literal_value(*yyval, base->name()); } else { @@ -1662,7 +1662,7 @@ case 158: break;} case 159: #line 588 "compile.y" -{ yyval=VL(new VVoid()) ; +{ yyval=VL(new VVoid(), 0, 0, 0) ; break;} case 160: #line 589 "compile.y" @@ -1979,7 +1979,7 @@ default: case '"': case ':': if(end!=begin) { // append piece till ^ - PC.string.append(begin, end-begin); + PC.string.append_strdup(begin, end-begin); } // reset piece 'begin' position & line begin=PC.source; // ->punctuation @@ -1993,7 +1993,7 @@ default: case '#': if(end!=begin) { // append piece till ^ - PC.string.append(begin, end-begin); + PC.string.append_strdup(begin, end-begin); } // #HH ? if(PC.source[0]=='#' && PC.source[1] && PC.source[2]) { @@ -2024,7 +2024,7 @@ default: if(c=='#' && PC.col==1) { if(end!=begin) { // append piece till # - PC.string.append(begin, end-begin); + PC.string.append_strdup(begin, end-begin); } // fall into COMMENT lexical state [wait for \n] push_LS(PC, LS_USER_COMMENT); @@ -2167,7 +2167,7 @@ default: case '#': // comment start skipping if(end!=begin) { // append piece till # - PC.string.append(begin, end-begin); + PC.string.append_strdup(begin, end-begin); } // fall into COMMENT lexical state [wait for \n] push_LS(PC, LS_EXPRESSION_COMMENT); @@ -2599,12 +2599,14 @@ break2: } if(end!=begin && PC.ls!=LS_USER_COMMENT) { // last piece still alive and not comment? // append it - PC.string.append(begin, end-begin); + PC.string.append_strdup(begin, end-begin); } } - if(PC.string!=CORD_EMPTY) { // something accumulated? + if(!PC.string.is_empty()) { // something accumulated? // create STRING value: array of OP_VALUE+vstring - *lvalp=VL(new VString(*new String(PC.string, String::L_CLEAN))); + *lvalp=VL( + new VString(*new String(PC.string, String::L_CLEAN)), + PC.file_no, PC.line, PC.col); // new pieces storage PC.string.clear(); // make current result be pending for next call, return STRING for now