absyntax_utils/search_varfb_instance_type.cc
changeset 202 da1a8186f86f
parent 181 38d6eb056260
child 226 29f8ffc203c1
equal deleted inserted replaced
201:e657008f43d0 202:da1a8186f86f
    44  * This class must be passed the scope within which the
    44  * This class must be passed the scope within which the
    45  * variable was declared, and the variable name...
    45  * variable was declared, and the variable name...
    46  */
    46  */
    47 
    47 
    48 
    48 
       
    49 /*
       
    50  * TODO: this code has a memory leak...
       
    51  *       We call 'new' in several locations, but bever get to 'delete' the object instances...
       
    52  */
    49 #include "absyntax_utils.hh"
    53 #include "absyntax_utils.hh"
    50 
    54 
    51 
    55 
    52 search_varfb_instance_type_c::search_varfb_instance_type_c(symbol_c *search_scope): search_var_instance_decl(search_scope) {
    56 search_varfb_instance_type_c::search_varfb_instance_type_c(symbol_c *search_scope): search_var_instance_decl(search_scope) {
    53   this->decompose_var_instance_name = NULL;
    57   this->decompose_var_instance_name = NULL;
    65    * variable declaration, for e.g., in window.point.x, this would be
    69    * variable declaration, for e.g., in window.point.x, this would be
    66    * window!
    70    * window!
    67    */
    71    */
    68   symbol_c *var_name_part = decompose_var_instance_name->next_part();
    72   symbol_c *var_name_part = decompose_var_instance_name->next_part();
    69   if (NULL == var_name_part) ERROR;
    73   if (NULL == var_name_part) ERROR;
    70   
    74 
    71   /* Now we try to find the variable instance declaration, to determine its type... */
    75   /* Now we try to find the variable instance declaration, to determine its type... */
    72   symbol_c *var_decl = search_var_instance_decl.get_decl(var_name_part);
    76   symbol_c *var_decl = search_var_instance_decl.get_decl(var_name_part);
    73   if (NULL == var_decl) {
    77   if (NULL == var_decl) {
    74     /* variable instance declaration not found! */
    78     /* variable instance declaration not found! */
    75       ERROR;
    79       ERROR;