util/dsymtable.hh
changeset 721 5dc33058e041
parent 350 2c3c4dc34979
child 722 b051d19d2442
equal deleted inserted replaced
720:f637ac331a68 721:5dc33058e041
    75   typedef typename base_t::const_iterator const_iterator;
    75   typedef typename base_t::const_iterator const_iterator;
    76   typedef typename base_t::reverse_iterator reverse_iterator;
    76   typedef typename base_t::reverse_iterator reverse_iterator;
    77   typedef typename base_t::const_reverse_iterator const_reverse_iterator;
    77   typedef typename base_t::const_reverse_iterator const_reverse_iterator;
    78 
    78 
    79   private:
    79   private:
    80     void reset(void); /* clear all entries... */
       
    81     const char *symbol_to_string(const symbol_c *symbol);
    80     const char *symbol_to_string(const symbol_c *symbol);
    82 
    81 
    83   public:
    82   public:
    84     dsymtable_c(void) {};
    83     dsymtable_c(void) {};
    85 
    84 
       
    85     void reset(void); /* clear all entries... */
       
    86     
    86     void insert(const char *identifier_str, value_t value);
    87     void insert(const char *identifier_str, value_t value);
    87     void insert(const symbol_c *symbol, value_t value);
    88     void insert(const symbol_c *symbol, value_t value);
    88 
    89 
    89     /* Determine how many entries are associated to key identifier_str */ 
    90     /* Determine how many entries are associated to key identifier_str */ 
    90     /* returns:
    91     /* returns: 0 if no entry is found, 1 if 1 entry is found, ..., n if n entries are found */
    91      *         0: if no entry is found
    92     int count(const char *identifier_str)    {return _base.count(identifier_str);}
    92      *         1: if 1 entry is found
    93     int count(const symbol_c *symbol)        {return count(symbol_to_string(symbol));}
    93      *         2: if more than 1 entry is found 
       
    94      */
       
    95     int multiplicity(const char *identifier_str);
       
    96     int multiplicity(const symbol_c *symbol)        {return multiplicity(symbol_to_string(symbol));}
       
    97     
    94     
    98     /* Search for an entry. Will return end_value() if not found */
    95     /* Search for an entry. Will return end_value() if not found */
    99     value_t end_value(void) {return null_value;}
    96     value_t end_value(void)                          {return _base.end(); return null_value;}
   100     value_t find_value(const char *identifier_str);
    97     value_t find_value(const char *identifier_str);
   101     value_t find_value(const symbol_c *symbol)       {return find_value(symbol_to_string(symbol));}
    98     value_t find_value(const symbol_c *symbol)       {return find_value(symbol_to_string(symbol));}
   102 
    99 
   103     /* Search for an entry associated with identifier_str. Will return end() if not found */
   100     /* Search for an entry associated with identifier_str. Will return end() if not found */
   104     iterator find(const char *identifier_str)        {return _base.find(identifier_str);}
   101     iterator find(const char *identifier_str)        {return _base.find(identifier_str);}