Diff for /parser3/src/classes/reflection.C between versions 1.40 and 1.42

version 1.40, 2016/03/31 21:46:20 version 1.42, 2016/05/24 15:42:43
Line 19  static const String method_type_parser(" Line 19  static const String method_type_parser("
 static const String method_call_type("call_type");  static const String method_call_type("call_type");
 static const String method_inherited("inherited");  static const String method_inherited("inherited");
 static const String method_overridden("overridden");  static const String method_overridden("overridden");
 static const String method_call_type_static("static");  
 static const String method_call_type_dynamic("dynamic");  
   
 static const String method_min_params("min_params");  static const String method_min_params("min_params");
 static const String method_max_params("max_params");  static const String method_max_params("max_params");
Line 58  static void _create(Request& r, MethodPa Line 56  static void _create(Request& r, MethodPa
                 throw Exception(PARSER_RUNTIME,                  throw Exception(PARSER_RUNTIME,
                         &constructor_name,                          &constructor_name,
                         "constructor must be declared in class '%s'",                          "constructor must be declared in class '%s'",
                         class_value->get_class()->name_cstr());                          class_value->type());
   
         Junction* junction=constructor_value->get_junction();          Junction* junction=constructor_value->get_junction();
         const Method* method=junction->method;          const Method* method=junction->method;
Line 70  static void _create(Request& r, MethodPa Line 68  static void _create(Request& r, MethodPa
                 if(method->call_type==Method::CT_STATIC)                  if(method->call_type==Method::CT_STATIC)
                         throw Exception(PARSER_RUNTIME,                          throw Exception(PARSER_RUNTIME,
                                 &constructor_name,                                  &constructor_name,
                                 "native method of class '%s' (%s) is not allowed to be called dynamically",                                  "native method of class '%s' is not allowed to be called dynamically",
                                 class_value->get_class()->name_cstr(),  
                                 class_value->type());                                  class_value->type());
   
                 if(nparams<method->min_numbered_params_count)                  if(nparams<method->min_numbered_params_count)
                         throw Exception(PARSER_RUNTIME,                          throw Exception(PARSER_RUNTIME,
                                 &constructor_name,                                  &constructor_name,
                                 "native method of class '%s' (%s) accepts minimum %d parameter(s) (%d passed)",                                  "native method of class '%s' accepts minimum %d parameter(s) (%d passed)",
                                 class_value->get_class()->name_cstr(),  
                                 class_value->type(),                                  class_value->type(),
                                 method->min_numbered_params_count,                                  method->min_numbered_params_count,
                                 nparams);                                  nparams);
Line 91  static void _create(Request& r, MethodPa Line 87  static void _create(Request& r, MethodPa
         if(nparams>max_params_count)          if(nparams>max_params_count)
                 throw Exception(PARSER_RUNTIME,                  throw Exception(PARSER_RUNTIME,
                         &constructor_name,                          &constructor_name,
                         "method of class '%s' (%s) accepts maximum %d parameter(s) (%d passed)",                          "method of class '%s' accepts maximum %d parameter(s) (%d passed)",
                         class_value->get_class()->name_cstr(),  
                         class_value->type(),                          class_value->type(),
                         max_params_count,                          max_params_count,
                         nparams);                          nparams);
Line 144  static Value* get_class(Value* value){ Line 139  static Value* get_class(Value* value){
   
 static const String* get_class_name(Value* value){  static const String* get_class_name(Value* value){
         if(VStateless_class* lclass=value->get_class())          if(VStateless_class* lclass=value->get_class())
                 return &lclass->name();                  return new String(lclass->type());
         else          else
                 // classes with fields only, like env & console                  // classes with fields only, like env & console
                 return new String(value->type());                  return new String(value->type());
Line 284  static void _method_info(Request& r, Met Line 279  static void _method_info(Request& r, Met
                 c=c->base()->get_class();                  c=c->base()->get_class();
                 while(c->base() && base_method==c->base()->get_method(method_name))                  while(c->base() && base_method==c->base()->get_method(method_name))
                         c=c->base()->get_class();                          c=c->base()->get_class();
                 hash->put((base_method==method) ? method_inherited : method_overridden, new VString(c->name()));                  hash->put((base_method==method) ? method_inherited : method_overridden, new VString(*new String(c->type())));
         }          }
   
         Value* call_type=0;          Value* call_type=0;
         switch(method->call_type){          switch(method->call_type){
                 case Method::CT_DYNAMIC:                  case Method::CT_DYNAMIC:
                         call_type=new VString(method_call_type_dynamic);                          call_type=new VString(Symbols::DYNAMIC_SYMBOL);
                         break;                          break;
                 case Method::CT_STATIC:                  case Method::CT_STATIC:
                         call_type=new VString(method_call_type_static);                          call_type=new VString(Symbols::STATIC_SYMBOL);
                         break;                          break;
                 case Method::CT_ANY:                  case Method::CT_ANY:
                         break;                          break;

Removed from v.1.40  
changed lines
  Added in v.1.42


E-mail: