--- parser3/src/main/compile.y 2012/03/16 09:24:12 1.262 +++ parser3/src/main/compile.y 2013/07/16 15:10:03 1.264 @@ -8,7 +8,7 @@ */ -volatile const char * IDENT_COMPILE_Y = "$Id: compile.y,v 1.262 2012/03/16 09:24:12 moko Exp $"; +volatile const char * IDENT_COMPILE_Y = "$Id: compile.y,v 1.264 2013/07/16 15:10:03 moko Exp $"; /** @todo parser4: @@ -49,7 +49,7 @@ volatile const char * IDENT_COMPILE_Y = // forwards -static int real_yyerror(Parse_control* pc, char* s); +static int real_yyerror(Parse_control* pc, const char* s); static void yyprint(FILE* file, int type, YYSTYPE value); static int yylex(YYSTYPE* lvalp, void* pc); @@ -156,6 +156,7 @@ control_method: '@' STRING '\n' } if(command==CLASS_NAME) { if(strings_code->count()==1*OPERATIONS_PER_OPVALUE) { + PC.class_add(); // new class' name const String& name=LA2S(*strings_code)->trim(String::TRIM_END); // creating the class @@ -167,6 +168,7 @@ control_method: '@' STRING '\n' YYERROR; } } else if(command==USE_CONTROL_METHOD_NAME) { + PC.class_add(); for(size_t i=0; icount(); i+=OPERATIONS_PER_OPVALUE) PC.request.use_file(PC.request.main_class, LA2S(*strings_code, i)->trim(String::TRIM_END), PC.request.get_used_filename(PC.file_no)); } else if(command==BASE_NAME) { @@ -1609,7 +1611,7 @@ break2: return result; } -static int real_yyerror(Parse_control *pc, char *s) { // Called by yyparse on error +static int real_yyerror(Parse_control *pc, const char *s) { // Called by yyparse on error strncpy(PC.error, s, MAX_STRING); return 1; }