--- parser3/src/main/Attic/core.C 2001/02/12 11:44:42 1.3 +++ parser3/src/main/Attic/core.C 2001/02/13 11:24:25 1.5 @@ -1,19 +1,23 @@ void process(Pool& pool, Value& self, RContext& rcontext, WContext& wcontext, - StringIterator& code, char char_to_stop_before) { + String_iterator& code, char char_to_stop_before) { // $ on code? process_dollar(pool, rcontext, wcontext, code, char_to_stop_before); // ^ on code? process_bird(pool, rcontext, wcontext, code, char_to_stop_before); + + // TODO + // 1. случаи :: и this. в начале + // 2. вызовы статических методов } void process_dollar(Pool& pool, Value& self, RContext& rcontext, WContext& wcontext, - StringIterator& iter, char char_to_stop_before) { + String_iterator& iter, char char_to_stop_before) { // $name.field.subfield -- read // $name.field.subfield(constructor code) -- construct @@ -41,10 +45,11 @@ void process_dollar(Pool& pool, bool construct_mode=names_ended_before=='('; + // 'context' dive into dotted path, int steps=names.count(); + // if constructing then "excluding last .name" if(construct_mode) steps--; - // 'context' dive into dotted path, if constructing then "excluding last .name" for(int i=0; i(names.get[i]); Value *next_current=context->get_element(name); @@ -75,7 +80,7 @@ void process_dollar(Pool& pool, void process_bird(Pool& pool, Value& self, RContext& rcontext, WContext& wcontext, - StringIterator& iter, char char_to_stop_before) { + String_iterator& iter, char char_to_stop_before) { // ^name.field.subfield.method[..] -- plain call // ^name.field.subfield.method_ref[..] -- method ref call, when .get_method()!=0 @@ -107,10 +112,11 @@ void process_bird(Pool& pool, Value *value=context.get_element(name); if(!value) // failed: no element of that 'name' pool.exception().raise(name, "call: no method field found"); - method=value->get_method(); - if(!method) // failed: that field wasn't method_ref + Method_ref *method_ref=value->get_method_ref(); + if(!method_ref) // failed: that field wasn't method_ref pool.exception().raise(name, "call: this field is not a method reference"); - local_self=value->get_self(); + method=method_ref->method; + local_self=method_ref->self; }