--- parser3/src/main/compile.tab.C 2001/08/20 13:22:05 1.6 +++ parser3/src/main/compile.tab.C 2001/09/12 10:07:37 1.10.4.1 @@ -31,7 +31,7 @@ #line 8 "compile.y" -static char *RCSId="$Id: compile.tab.C,v 1.6 2001/08/20 13:22:05 parser Exp $"; +static char *RCSId="$Id: compile.tab.C,v 1.10.4.1 2001/09/12 10:07:37 parser Exp $"; /** @todo parser4: @@ -237,7 +237,7 @@ static const char * const yytname[] = { "store_code_param_part","store_expr_param_part","store_curly_param_part","code_param_value", "write_expr_value","name_expr_dive_code","name_path","name_step","name_advance1", "name_advance2","name_expr_value","name_expr_subvar_value","name_expr_with_subvar_value", -"name_curly_code_value","subvar_ref_name_rdive","subvar_get_writes","subvar__get_write", +"name_square_code_value","subvar_ref_name_rdive","subvar_get_writes","subvar__get_write", "class_prefix","class_static_prefix","class_constructor_prefix","expr_value", "expr","string_inside_quotes_value","write_string","void_value","empty", NULL }; @@ -1843,6 +1843,7 @@ static int yylex(YYSTYPE *lvalp, void *p int skip_analized=0; while(true) { c=*(end=(PC.source++)); +// fprintf(stderr, "\nchar: %c %02X; nestage: %d, sp=%d", c, c, lexical_brackets_nestage, PC.sp); if(c=='\n') { PC.line++; @@ -1852,7 +1853,7 @@ static int yylex(YYSTYPE *lvalp, void *p if(c=='^' && PC.ls!=LS_COMMENT && PC.ls!=LS_DEF_COMMENT) switch(*PC.source) { - // escaping: ^^ & co + // ^escaping some punctuators case '^': case '$': case ';': case '(': case ')': case '[': case ']': @@ -1863,12 +1864,19 @@ static int yylex(YYSTYPE *lvalp, void *p PC.string->APPEND_CLEAN(begin, end-begin, PC.file, begin_line); } // reset piece 'begin' position & line - begin=PC.source; // ^ + end=begin=PC.source; // ^ begin_line=PC.line; - // skip over ^ and _ - PC.source++; PC.col++; - // skip analysis = forced literal - continue; + if(PC.ls==LS_METHOD_AFTER) { + pop_LS(PC); + result=EON; + skip_analized=-1; // return to ^ afterwards to assure it's literality + goto break2; + } else { + // skip over _ after ^ + PC.source++; PC.col++; + // skip analysis = forced literal + continue; + } // converting ^#HH into char(hex(HH)) case '#': @@ -1911,6 +1919,7 @@ static int yylex(YYSTYPE *lvalp, void *p // USER'S = NOT OURS case LS_USER: + case LS_NAME_SQUARE_PART: // name.[here].xxx if(PC.trim_bof) switch(c) { case '\n': case ' ': case '\t': @@ -1933,14 +1942,16 @@ static int yylex(YYSTYPE *lvalp, void *p RC; } break; - case ']': // $name.(code<)> - if(--lexical_brackets_nestage==0) { - pop_LS(PC); - RC; - } + case ']': + if(PC.ls==LS_NAME_SQUARE_PART) + if(--lexical_brackets_nestage==0) {// $name.[co<]?>de<]?> + pop_LS(PC); // $name.[co<]>de<]!> + RC; + } break; - case '[': - lexical_brackets_nestage++; + case '[': // $name.[co<[>de] + if(PC.ls==LS_NAME_SQUARE_PART) + lexical_brackets_nestage++; break; } break; @@ -2211,7 +2222,7 @@ static int yylex(YYSTYPE *lvalp, void *p end[-1]==':'/*was class name delim */ || end[-1]=='.'/*was name delim */ )) { - push_LS(PC, LS_USER); + push_LS(PC, LS_NAME_SQUARE_PART); lexical_brackets_nestage=1; RC; } @@ -2242,8 +2253,8 @@ static int yylex(YYSTYPE *lvalp, void *p case LS_VAR_NAME_CURLY: switch(c) { case '[': - // ${name.<[>code)} - push_LS(PC, LS_USER); + // ${name.<[>code]} + push_LS(PC, LS_NAME_SQUARE_PART); lexical_brackets_nestage=1; RC; case '}': // ${name} finished, restoring LS @@ -2302,13 +2313,13 @@ static int yylex(YYSTYPE *lvalp, void *p case LS_METHOD_NAME: switch(c) { case '[': - // $name.<[>code) + // ^name.<[>code].xxx if(PC.col>1/*not first column*/ && ( end[-1]=='^'/*was start of call*/ || // never, ^[ is literal... end[-1]==':'/*was class name delim */ || end[-1]=='.'/*was name delim */ )) { - push_LS(PC, LS_USER); + push_LS(PC, LS_NAME_SQUARE_PART); lexical_brackets_nestage=1; RC; }