|
|
| version 1.147, 2001/07/24 12:26:22 | version 1.167, 2001/09/24 14:34:25 |
|---|---|
| Line 103 static int yylex(YYSTYPE *lvalp, void *p | Line 103 static int yylex(YYSTYPE *lvalp, void *p |
| %left NEG /* negation: unary - */ | %left NEG /* negation: unary - */ |
| %% | %% |
| all: | all: |
| one_big_piece { | one_big_piece { |
| Method& method=*NEW Method(POOL, | Method& method=*NEW Method(POOL, |
| *main_method_name, | *main_method_name, |
| Line 151 control_method: '@' STRING '\n' | Line 151 control_method: '@' STRING '\n' |
| } | } |
| } else if(command==USE_CONTROL_METHOD_NAME) { | } else if(command==USE_CONTROL_METHOD_NAME) { |
| for(int i=0; i<strings_code->size(); i+=2) | for(int i=0; i<strings_code->size(); i+=2) |
| PC.request->use_file( | PC.request->use_file(*LA2S(strings_code, i)); |
| PC.request->absolute(*LA2S(strings_code, i))); | |
| } else if(command==BASE_NAME) { | } else if(command==BASE_NAME) { |
| if(PC.cclass->base()) { // already changed from default? | if(PC.cclass->base()) { // already changed from default? |
| strcpy(PC.error, "class already have a base '"); | strcpy(PC.error, "class already have a base '"); |
| Line 234 maybe_codes: empty | codes; | Line 233 maybe_codes: empty | codes; |
| codes: code | codes code { $$=$1; P($$, $2) }; | codes: code | codes code { $$=$1; P($$, $2) }; |
| code: write_string | action; | code: write_string | action; |
| action: get | put | with | call; | action: get | put | call; |
| /* get */ | /* get */ |
| Line 242 get: get_value { | Line 241 get: get_value { |
| $$=$1; /* stack: resulting value */ | $$=$1; /* stack: resulting value */ |
| O($$, OP_WRITE_VALUE); /* value=pop; wcontext.write(value) */ | O($$, OP_WRITE_VALUE); /* value=pop; wcontext.write(value) */ |
| }; | }; |
| get_value: '$' get_name_value { $$=$2 } | get_value: '$' get_name_value { $$=$2 }; |
| get_name_value: name_without_curly_rdive EON | name_in_curly_rdive; | get_name_value: name_without_curly_rdive EON | name_in_curly_rdive; |
| name_in_curly_rdive: '{' name_without_curly_rdive '}' { $$=$2 }; | name_in_curly_rdive: '{' name_without_curly_rdive '}' { $$=$2 }; |
| name_without_curly_rdive: | name_without_curly_rdive: |
| name_without_curly_rdive_read | name_without_curly_rdive_read |
| | name_without_curly_rdive_root | |
| | name_without_curly_rdive_class; | | name_without_curly_rdive_class; |
| name_without_curly_rdive_read: name_without_curly_rdive_code { | name_without_curly_rdive_read: name_without_curly_rdive_code { |
| $$=N(POOL); | $$=N(POOL); |
| Line 264 name_without_curly_rdive_read: name_with | Line 262 name_without_curly_rdive_read: name_with |
| } | } |
| /* diving code; stack: current context */ | /* diving code; stack: current context */ |
| }; | }; |
| name_without_curly_rdive_root: ':' name_without_curly_rdive_code { | |
| $$=N(POOL); | |
| O($$, OP_WITH_ROOT); /* stack: starting context */ | |
| P($$, $2); /* diving code; stack: current context */ | |
| }; | |
| name_without_curly_rdive_class: class_prefix name_without_curly_rdive_code { $$=$1; P($$, $2) }; | name_without_curly_rdive_class: class_prefix name_without_curly_rdive_code { $$=$1; P($$, $2) }; |
| name_without_curly_rdive_code: name_advance2 | name_path name_advance2 { $$=$1; P($$, $2) }; | name_without_curly_rdive_code: name_advance2 | name_path name_advance2 { $$=$1; P($$, $2) }; |
| Line 279 put: '$' name_expr_wdive construct { | Line 272 put: '$' name_expr_wdive construct { |
| P($$, $3); /* stack: context,name,constructor_value */ | P($$, $3); /* stack: context,name,constructor_value */ |
| }; | }; |
| name_expr_wdive: | name_expr_wdive: |
| name_expr_wdive_write | name_expr_wdive_root |
| | name_expr_wdive_root | | name_expr_wdive_write |
| | name_expr_wdive_class; | | name_expr_wdive_class; |
| name_expr_wdive_write: name_expr_dive_code { | name_expr_wdive_root: name_expr_dive_code { |
| $$=N(POOL); | $$=N(POOL); |
| Array *diving_code=$1; | Array *diving_code=$1; |
| const String *first_name=LA2S(diving_code); | const String *first_name=LA2S(diving_code); |
| Line 292 name_expr_wdive_write: name_expr_dive_co | Line 285 name_expr_wdive_write: name_expr_dive_co |
| /* skip over... */ | /* skip over... */ |
| diving_code->size()>2?3/*OP_+string+get_element*/:2/*OP_+string*/); | diving_code->size()>2?3/*OP_+string+get_element*/:2/*OP_+string*/); |
| } else { | } else { |
| O($$, OP_WITH_WRITE); /* stack: starting context */ | O($$, OP_WITH_ROOT); /* stack: starting context */ |
| P($$, diving_code); | P($$, diving_code); |
| } | } |
| /* diving code; stack: current context */ | /* diving code; stack: current context */ |
| }; | }; |
| name_expr_wdive_root: ':' name_expr_dive_code { | name_expr_wdive_write: '.' name_expr_dive_code { |
| $$=N(POOL); | $$=N(POOL); |
| O($$, OP_WITH_ROOT); /* stack: starting context */ | O($$, OP_WITH_WRITE); /* stack: starting context */ |
| P($$, $2); /* diving code; stack: context,name */ | P($$, $2); /* diving code; stack: context,name */ |
| }; | }; |
| name_expr_wdive_class: class_prefix name_expr_dive_code { $$=$1; P($$, $2) }; | name_expr_wdive_class: class_prefix name_expr_dive_code { $$=$1; P($$, $2) }; |
| construct: construct_by_code | construct_by_expr; | construct: |
| construct_by_code: '[' any_constructor_code_value ']' { | construct_square |
| $$=$2; /* stack: context, name, value */ | | construct_round |
| | construct_curly | |
| ; | |
| construct_square: '[' any_constructor_code_value ']' { | |
| // stack: context, name | |
| $$=$2; // stack: context, name, value | |
| O($$, OP_CONSTRUCT_VALUE); /* value=pop; name=pop; context=pop; construct(context,name,value) */ | O($$, OP_CONSTRUCT_VALUE); /* value=pop; name=pop; context=pop; construct(context,name,value) */ |
| } | } |
| ; | ; |
| construct_by_expr: '(' expr_value ')' { | construct_round: '(' expr_value ')' { |
| $$=$2; /* stack: context, name, value */ | // stack: context, name |
| O($$, OP_CONSTRUCT_EXPR); /* value=pop; name=pop; context=pop; construct(context,name,value) */ | $$=$2; // stack: context, name, value |
| O($$, OP_CONSTRUCT_EXPR); /* value=pop->as_expr_result; name=pop; context=pop; construct(context,name,value) */ | |
| } | } |
| ; | ; |
| construct_curly: '{' maybe_codes '}' { | |
| // stack: context, name | |
| $$=N(POOL); | |
| CCA($$, $2); /* code=pop; name=pop; context=pop; construct(context,name,junction(code)) */ | |
| }; | |
| any_constructor_code_value: | any_constructor_code_value: |
| unknown_value /* optimized $var[] case */ | void_value /* optimized $var[] case */ |
| | STRING /* optimized $var[STRING] case */ | | STRING /* optimized $var[STRING] case */ |
| | constructor_code_value /* $var[something complex] */ | | constructor_code_value /* $var[something complex] */ |
| ; | ; |
| Line 335 call: call_value { | Line 340 call: call_value { |
| $$=$1; /* stack: value */ | $$=$1; /* stack: value */ |
| O($$, OP_WRITE_VALUE); /* value=pop; wcontext.write(value) */ | O($$, OP_WRITE_VALUE); /* value=pop; wcontext.write(value) */ |
| }; | }; |
| call_value: '^' call_name store_params EON { /* ^field.$method{vasya} */ | call_value: '^' { PC.object_constructor_allowed=true } |
| $$=$2; /* with_xxx,diving code; stack: context,method_junction */ | call_name { PC.object_constructor_allowed=false } |
| store_params EON { /* ^field.$method{vasya} */ | |
| $$=$3; /* with_xxx,diving code; stack: context,method_junction */ | |
| O($$, OP_GET_METHOD_FRAME); /* stack: context,method_frame */ | O($$, OP_GET_METHOD_FRAME); /* stack: context,method_frame */ |
| YYSTYPE params_code=$3; | YYSTYPE params_code=$5; |
| if(params_code->size()==3) // probably [] case. [OP_VALUE + Void + STORE_PARAM] | if(params_code->size()==3) // probably [] case. [OP_VALUE + Void + STORE_PARAM] |
| if(Value *value=LA2V(params_code)) // it is OP_VALUE + value? | if(Value *value=LA2V(params_code)) // it is OP_VALUE + value? |
| if(!value->is_defined()) // value is VVoid? | if(!value->is_defined()) // value is VVoid? |
| Line 385 store_curly_param_part: maybe_codes { | Line 392 store_curly_param_part: maybe_codes { |
| PCA($$, $1); | PCA($$, $1); |
| }; | }; |
| code_param_value: | code_param_value: |
| unknown_value /* optimized [;...] case */ | void_value /* optimized [;...] case */ |
| | STRING /* optimized [STRING] case */ | | STRING /* optimized [STRING] case */ |
| | constructor_code_value /* [something complex] */ | | constructor_code_value /* [something complex] */ |
| ; | ; |
| Line 415 name_advance2: name_expr_value { | Line 422 name_advance2: name_expr_value { |
| name_expr_value: | name_expr_value: |
| STRING /* subname_is_const */ | STRING /* subname_is_const */ |
| | name_expr_subvar_value /* $subname_is_var_value */ | | name_expr_subvar_value /* $subname_is_var_value */ |
| | name_expr_with_subvar_value /* xxx$part_of_subname_is_var_value[$...] */ | | name_expr_with_subvar_value /* xxx$part_of_subname_is_var_value */ |
| | name_square_code_value /* [codes] */ | |
| ; | ; |
| name_expr_subvar_value: '$' subvar_ref_name_rdive { | name_expr_subvar_value: '$' subvar_ref_name_rdive { |
| $$=$2; | $$=$2; |
| Line 429 name_expr_with_subvar_value: STRING subv | Line 437 name_expr_with_subvar_value: STRING subv |
| P($$, $2); | P($$, $2); |
| O($$, OP_REDUCE_EWPOOL); | O($$, OP_REDUCE_EWPOOL); |
| }; | }; |
| subvar_ref_name_rdive: subvar_ref_name_rdive_read | subvar_ref_name_rdive_root; | name_square_code_value: '[' codes ']' { |
| subvar_ref_name_rdive_read: STRING { | |
| $$=N(POOL); | $$=N(POOL); |
| O($$, OP_WITH_READ); | O($$, OP_CREATE_EWPOOL); |
| P($$, $1); | P($$, $2); |
| O($$, OP_REDUCE_EWPOOL); | |
| }; | }; |
| subvar_ref_name_rdive_root: ':' STRING { | subvar_ref_name_rdive: STRING { |
| $$=N(POOL); | $$=N(POOL); |
| O($$, OP_WITH_ROOT); | O($$, OP_WITH_READ); |
| P($$, $2); | P($$, $1); |
| }; | }; |
| subvar_get_writes: subvar__get_write | subvar_get_writes subvar__get_write { $$=$1; P($$, $2) }; | subvar_get_writes: subvar__get_write | subvar_get_writes subvar__get_write { $$=$1; P($$, $2) }; |
| subvar__get_write: '$' subvar_ref_name_rdive { | subvar__get_write: '$' subvar_ref_name_rdive { |
| Line 446 subvar__get_write: '$' subvar_ref_name_r | Line 454 subvar__get_write: '$' subvar_ref_name_r |
| O($$, OP_GET_ELEMENT__WRITE); | O($$, OP_GET_ELEMENT__WRITE); |
| }; | }; |
| class_prefix: STRING ':' { | class_prefix: |
| class_static_prefix | |
| | class_constructor_prefix | |
| ; | |
| class_static_prefix: STRING ':' { | |
| $$=$1; // stack: class name string | $$=$1; // stack: class name string |
| O($$, OP_GET_CLASS); | O($$, OP_GET_CLASS); |
| }; | }; |
| class_constructor_prefix: class_static_prefix ':' { | |
| $$=$1; | |
| /* with */ | if(!PC.object_constructor_allowed) { |
| strcpy(PC.error, ":: not allowed here"); | |
| with: '$' name_without_curly_rdive '{' maybe_codes '}' { | YYERROR; |
| $$=$2; | } |
| O($$, OP_CREATE_RWPOOL); | O($$, OP_PREPARE_TO_CONSTRUCT_OBJECT); |
| P($$, $4); | |
| O($$, OP_REDUCE_RWPOOL); | |
| O($$, OP_WRITE_VALUE); | |
| }; | }; |
| /* expr */ | /* expr */ |
| expr_value: expr { | expr_value: expr { |
| Line 477 expr: | Line 487 expr: |
| | '(' expr ')' { $$ = $2; } | | '(' expr ')' { $$ = $2; } |
| /* stack: operand // stack: @operand */ | /* stack: operand // stack: @operand */ |
| | '-' expr %prec NEG { $$=$2; O($$, OP_NEG) } | | '-' expr %prec NEG { $$=$2; O($$, OP_NEG) } |
| | '+' expr %prec NEG { $$=$2 } | |
| | '~' expr { $$=$2; O($$, OP_INV) } | | '~' expr { $$=$2; O($$, OP_INV) } |
| | '!' expr { $$=$2; O($$, OP_NOT) } | | '!' expr { $$=$2; O($$, OP_NOT) } |
| | "def" expr { $$=$2; O($$, OP_DEF) } | | "def" expr { $$=$2; O($$, OP_DEF) } |
| Line 524 write_string: STRING { | Line 535 write_string: STRING { |
| change_string_literal_to_write_string_literal($$=$1) | change_string_literal_to_write_string_literal($$=$1) |
| }; | }; |
| unknown_value: /* empty */ { $$=VL(NEW VVoid(POOL)) }; | void_value: /* empty */ { $$=VL(NEW VVoid(POOL)) }; |
| empty: /* empty */ { $$=N(POOL) }; | empty: /* empty */ { $$=N(POOL) }; |
| %% | %% |
| Line 565 static int yylex(YYSTYPE *lvalp, void *p | Line 576 static int yylex(YYSTYPE *lvalp, void *p |
| int skip_analized=0; | int skip_analized=0; |
| while(true) { | while(true) { |
| c=*(end=(PC.source++)); | c=*(end=(PC.source++)); |
| // fprintf(stderr, "\nchar: %c %02X; nestage: %d, sp=%d", c, c, lexical_brackets_nestage, PC.sp); | |
| if(c=='\n') { | if(c=='\n') { |
| PC.line++; | PC.line++; |
| Line 574 static int yylex(YYSTYPE *lvalp, void *p | Line 586 static int yylex(YYSTYPE *lvalp, void *p |
| if(c=='^' && PC.ls!=LS_COMMENT && PC.ls!=LS_DEF_COMMENT) | if(c=='^' && PC.ls!=LS_COMMENT && PC.ls!=LS_DEF_COMMENT) |
| switch(*PC.source) { | switch(*PC.source) { |
| // escaping: ^^ & co | // ^escaping some punctuators |
| case '^': case '$': case ';': | case '^': case '$': case ';': |
| case '(': case ')': | case '(': case ')': |
| case '[': case ']': | case '[': case ']': |
| Line 585 static int yylex(YYSTYPE *lvalp, void *p | Line 597 static int yylex(YYSTYPE *lvalp, void *p |
| PC.string->APPEND_CLEAN(begin, end-begin, PC.file, begin_line); | PC.string->APPEND_CLEAN(begin, end-begin, PC.file, begin_line); |
| } | } |
| // reset piece 'begin' position & line | // reset piece 'begin' position & line |
| begin=PC.source; // ^ | end=begin=PC.source; // ^ |
| begin_line=PC.line; | begin_line=PC.line; |
| // skip over ^ and _ | if(PC.ls==LS_METHOD_AFTER) { |
| PC.source++; PC.col++; | pop_LS(PC); |
| // skip analysis = forced literal | result=EON; |
| continue; | 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)) | // converting ^#HH into char(hex(HH)) |
| case '#': | case '#': |
| Line 633 static int yylex(YYSTYPE *lvalp, void *p | Line 652 static int yylex(YYSTYPE *lvalp, void *p |
| // USER'S = NOT OURS | // USER'S = NOT OURS |
| case LS_USER: | case LS_USER: |
| case LS_NAME_SQUARE_PART: // name.[here].xxx | |
| if(PC.trim_bof) | |
| switch(c) { | |
| case '\n': case ' ': case '\t': | |
| begin=PC.source; | |
| begin_line=PC.line; | |
| continue; // skip it | |
| default: | |
| PC.trim_bof=false; | |
| } | |
| switch(c) { | switch(c) { |
| case '$': | case '$': |
| push_LS(PC, LS_VAR_NAME_SIMPLE); | push_LS(PC, LS_VAR_NAME_SIMPLE_WITH_COLON); |
| RC; | RC; |
| case '^': | case '^': |
| push_LS(PC, LS_METHOD_NAME); | push_LS(PC, LS_METHOD_NAME); |
| RC; | RC; |
| case '@': | case '@': |
| if(PC.col==0+1) { | if(PC.col==0+1) { |
| if( | |
| PC.source[0]=='e' && | |
| PC.source[1]=='n' && | |
| PC.source[2]=='d' && | |
| PC.source[3]=='\n') { | |
| if(end!=begin) { | |
| // append piece till @ | |
| PC.string->APPEND_CLEAN(begin, end-begin, PC.file, begin_line); | |
| } | |
| PC.source+=3+1; begin=PC.source; | |
| PC.line++; begin_line=PC.line; | |
| continue; | |
| } | |
| push_LS(PC, LS_DEF_NAME); | push_LS(PC, LS_DEF_NAME); |
| RC; | RC; |
| } | } |
| break; | break; |
| 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 '[': // $name.[co<[>de] | |
| if(PC.ls==LS_NAME_SQUARE_PART) | |
| lexical_brackets_nestage++; | |
| break; | |
| } | } |
| break; | break; |
| Line 688 static int yylex(YYSTYPE *lvalp, void *p | Line 715 static int yylex(YYSTYPE *lvalp, void *p |
| } | } |
| break; | break; |
| case '$': | case '$': |
| push_LS(PC, LS_VAR_NAME_SIMPLE); | push_LS(PC, LS_VAR_NAME_SIMPLE_WITH_COLON); |
| RC; | RC; |
| case '^': | case '^': |
| push_LS(PC, LS_METHOD_NAME); | push_LS(PC, LS_METHOD_NAME); |
| Line 770 static int yylex(YYSTYPE *lvalp, void *p | Line 797 static int yylex(YYSTYPE *lvalp, void *p |
| pop_LS(PC); // return to normal life | pop_LS(PC); // return to normal life |
| RC; | RC; |
| case '$': | case '$': |
| push_LS(PC, LS_EXPRESSION_VAR_NAME); | push_LS(PC, LS_EXPRESSION_VAR_NAME_WITH_COLON); |
| RC; | RC; |
| case '^': | case '^': |
| push_LS(PC, LS_METHOD_NAME); | push_LS(PC, LS_METHOD_NAME); |
| Line 880 static int yylex(YYSTYPE *lvalp, void *p | Line 907 static int yylex(YYSTYPE *lvalp, void *p |
| break; | break; |
| // VARIABLE GET/PUT/WITH | // VARIABLE GET/PUT/WITH |
| case LS_VAR_NAME_SIMPLE: | case LS_VAR_NAME_SIMPLE_WITH_COLON: |
| case LS_EXPRESSION_VAR_NAME: | case LS_VAR_NAME_SIMPLE_WITHOUT_COLON: |
| case LS_VAR_NAME_NO_COLON: | case LS_EXPRESSION_VAR_NAME_WITH_COLON: |
| if(PC.ls==LS_EXPRESSION_VAR_NAME) { | case LS_EXPRESSION_VAR_NAME_WITHOUT_COLON: |
| if( | |
| PC.ls==LS_EXPRESSION_VAR_NAME_WITH_COLON || | |
| PC.ls==LS_EXPRESSION_VAR_NAME_WITHOUT_COLON) { | |
| // name in expr ends also before binary operators | // name in expr ends also before binary operators |
| switch(c) { | switch(c) { |
| case '-': | case '-': |
| Line 893 static int yylex(YYSTYPE *lvalp, void *p | Line 923 static int yylex(YYSTYPE *lvalp, void *p |
| goto break2; | goto break2; |
| } | } |
| } | } |
| if(PC.ls==LS_VAR_NAME_NO_COLON) { | if( |
| PC.ls==LS_VAR_NAME_SIMPLE_WITHOUT_COLON || | |
| PC.ls==LS_EXPRESSION_VAR_NAME_WITHOUT_COLON) { | |
| // name already has ':', stop before next | // name already has ':', stop before next |
| switch(c) { | switch(c) { |
| case ':': | case ':': |
| Line 914 static int yylex(YYSTYPE *lvalp, void *p | Line 946 static int yylex(YYSTYPE *lvalp, void *p |
| case '&': case '|': | case '&': case '|': |
| case '=': case '!': | case '=': case '!': |
| // common delimiters | // common delimiters |
| case ',': | case ',': case '?': |
| // before call | // before call |
| case '^': | case '^': |
| pop_LS(PC); | pop_LS(PC); |
| Line 922 static int yylex(YYSTYPE *lvalp, void *p | Line 954 static int yylex(YYSTYPE *lvalp, void *p |
| result=EON; | result=EON; |
| goto break2; | goto break2; |
| case '[': | case '[': |
| // $name.<[>code] | |
| if(PC.col>1/*not first column*/ && ( | |
| end[-1]=='$'/*was start of get*/ || | |
| end[-1]==':'/*was class name delim */ || | |
| end[-1]=='.'/*was name delim */ | |
| )) { | |
| push_LS(PC, LS_NAME_SQUARE_PART); | |
| lexical_brackets_nestage=1; | |
| RC; | |
| } | |
| PC.ls=LS_VAR_SQUARE; | PC.ls=LS_VAR_SQUARE; |
| lexical_brackets_nestage=1; | lexical_brackets_nestage=1; |
| RC; | RC; |
| Line 940 static int yylex(YYSTYPE *lvalp, void *p | Line 982 static int yylex(YYSTYPE *lvalp, void *p |
| RC; | RC; |
| case '.': // name part delim | case '.': // name part delim |
| case '$': // name part subvar | case '$': // name part subvar |
| case ':': // ':name' or 'class:name' | case ':': // class<:>name |
| PC.ls=LS_VAR_NAME_NO_COLON; // stop before next ':' | // go to _WITHOUT_COLON state variant... |
| if(PC.ls==LS_VAR_NAME_SIMPLE_WITH_COLON) | |
| PC.ls=LS_VAR_NAME_SIMPLE_WITHOUT_COLON; | |
| else if(PC.ls==LS_EXPRESSION_VAR_NAME_WITH_COLON) | |
| PC.ls=LS_EXPRESSION_VAR_NAME_WITHOUT_COLON; | |
| // ...stop before next ':' | |
| RC; | RC; |
| } | } |
| break; | break; |
| case LS_VAR_NAME_CURLY: | case LS_VAR_NAME_CURLY: |
| switch(c) { | switch(c) { |
| case '[': | |
| // ${name.<[>code]} | |
| push_LS(PC, LS_NAME_SQUARE_PART); | |
| lexical_brackets_nestage=1; | |
| RC; | |
| case '}': // ${name} finished, restoring LS | case '}': // ${name} finished, restoring LS |
| pop_LS(PC); | pop_LS(PC); |
| RC; | RC; |
| Line 961 static int yylex(YYSTYPE *lvalp, void *p | Line 1013 static int yylex(YYSTYPE *lvalp, void *p |
| case LS_VAR_SQUARE: | case LS_VAR_SQUARE: |
| switch(c) { | switch(c) { |
| case '$': | case '$': |
| push_LS(PC, LS_VAR_NAME_SIMPLE); | push_LS(PC, LS_VAR_NAME_SIMPLE_WITH_COLON); |
| RC; | RC; |
| case '^': | case '^': |
| push_LS(PC, LS_METHOD_NAME); | push_LS(PC, LS_METHOD_NAME); |
| Line 983 static int yylex(YYSTYPE *lvalp, void *p | Line 1035 static int yylex(YYSTYPE *lvalp, void *p |
| case LS_VAR_CURLY: | case LS_VAR_CURLY: |
| switch(c) { | switch(c) { |
| case '$': | case '$': |
| push_LS(PC, LS_VAR_NAME_SIMPLE); | push_LS(PC, LS_VAR_NAME_SIMPLE_WITH_COLON); |
| RC; | RC; |
| case '^': | case '^': |
| push_LS(PC, LS_METHOD_NAME); | push_LS(PC, LS_METHOD_NAME); |
| Line 1004 static int yylex(YYSTYPE *lvalp, void *p | Line 1056 static int yylex(YYSTYPE *lvalp, void *p |
| case LS_METHOD_NAME: | case LS_METHOD_NAME: |
| switch(c) { | switch(c) { |
| case '[': | case '[': |
| // ^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_NAME_SQUARE_PART); | |
| lexical_brackets_nestage=1; | |
| RC; | |
| } | |
| PC.ls=LS_METHOD_SQUARE; | PC.ls=LS_METHOD_SQUARE; |
| lexical_brackets_nestage=1; | lexical_brackets_nestage=1; |
| RC; | RC; |
| Line 1025 static int yylex(YYSTYPE *lvalp, void *p | Line 1087 static int yylex(YYSTYPE *lvalp, void *p |
| case LS_METHOD_SQUARE: | case LS_METHOD_SQUARE: |
| switch(c) { | switch(c) { |
| case '$': | case '$': |
| push_LS(PC, LS_VAR_NAME_SIMPLE); | push_LS(PC, LS_VAR_NAME_SIMPLE_WITH_COLON); |
| RC; | RC; |
| case '^': | case '^': |
| push_LS(PC, LS_METHOD_NAME); | push_LS(PC, LS_METHOD_NAME); |
| Line 1047 static int yylex(YYSTYPE *lvalp, void *p | Line 1109 static int yylex(YYSTYPE *lvalp, void *p |
| case LS_METHOD_CURLY: | case LS_METHOD_CURLY: |
| switch(c) { | switch(c) { |
| case '$': | case '$': |
| push_LS(PC, LS_VAR_NAME_SIMPLE); | push_LS(PC, LS_VAR_NAME_SIMPLE_WITH_COLON); |
| RC; | RC; |
| case '^': | case '^': |
| push_LS(PC, LS_METHOD_NAME); | push_LS(PC, LS_METHOD_NAME); |