--- parser3/src/main/compile.y 2003/03/26 07:45:23 1.204.2.8.2.4 +++ parser3/src/main/compile.y 2003/04/02 14:16:18 1.204.2.8.2.8 @@ -5,7 +5,7 @@ Copyright (c) 2001, 2003 ArtLebedev Group (http://www.artlebedev.com) Author: Alexander Petrosyan (http://design.ru/paf) - $Id: compile.y,v 1.204.2.8.2.4 2003/03/26 07:45:23 paf Exp $ + $Id: compile.y,v 1.204.2.8.2.8 2003/04/02 14:16:18 paf Exp $ */ /** @@ -158,7 +158,7 @@ control_method: '@' STRING '\n' 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? @@ -280,7 +280,7 @@ name_without_curly_rdive_read: name_with // ^if ELEMENT -> ^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(*$$, *diving_code); } /* diving code; stack: current context */ @@ -498,7 +498,7 @@ class_prefix: ; class_static_prefix: STRING ':' { $$=$1; // stack: class name string - if(*LA2S(*$$) == BASE_NAME) { // pseude BASE class + if(*LA2S(*$$) == BASE_NAME) { // pseudo BASE class if(VStateless_class* base=PC.cclass->base_class()) { change_string_literal_value(*$$, base->name()); } else { @@ -585,7 +585,7 @@ write_string: STRING { change_string_literal_to_write_string_literal(*($$=$1)) }; -void_value: /* empty */ { $$=VL(new VVoid()) }; +void_value: /* empty */ { $$=VL(new VVoid(), 0, 0, 0) }; empty: /* empty */ { $$=N() }; %% @@ -676,7 +676,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 @@ -690,7 +690,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]) { @@ -721,7 +721,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); @@ -864,7 +864,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); @@ -1296,12 +1296,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.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