--- a/util/symtable.hh Fri Dec 26 09:39:18 2014 +0000
+++ b/util/symtable.hh Fri Dec 26 09:57:02 2014 +0000
@@ -42,7 +42,7 @@
-template<typename value_type, value_type null_value> class symtable_c {
+template<typename value_type> class symtable_c {
/* Case insensitive string compare copied from
* "The C++ Programming Language" - 3rd Edition
* by Bjarne Stroustrup, ISBN 0201889544.
@@ -86,30 +86,30 @@
void push(void); /* create new inner scope */
int pop(void); /* clear most inner scope */
- void set(const char *identifier_str, value_t value);
- void set(const symbol_c *symbol, value_t value);
- void insert(const char *identifier_str, value_t value);
- void insert(const symbol_c *symbol, value_t value);
+ void set(const char *identifier_str, value_t value); // Will change value associated to string if already in map. Will create new entry if string not in map.
+ void set(const symbol_c *symbol, value_t value); // Will change value associated to string if already in map. Will create new entry if string not in map.
+ void insert(const char *identifier_str, value_t value); // insert a new (string,value) pair. Give an error if string already in map associated to different value!
+ void insert(const symbol_c *symbol, value_t value); // insert a new (string,value) pair. Give an error if string already in map associated to different value!
- /* Search for an entry. Will return end_value() if not found */
- value_t end_value(void) {return null_value;}
- value_t find_value(const char *identifier_str);
- value_t find_value(const symbol_c *symbol);
+ /* Search for an entry. Will return end() if not found */
+ iterator end (void);
+ iterator find (const char *identifier_str);
+ iterator find (const symbol_c *symbol );
/* iterators ... */
/* NOTE: These member functions are incorrect, as the returned iterator will not iterate through the inner_scopes!! */
/* We simply comment it all out, as they are not currently needed! */
#if 0
- iterator find (const char *identifier_str) {return _base.find(identifier_str);}
- iterator begin() {return _base.begin();}
- const_iterator begin() const {return _base.begin();}
- iterator end() {return _base.end();}
- const_iterator end() const {return _base.end();}
- reverse_iterator rbegin() {return _base.rbegin();}
- const_reverse_iterator rbegin() const {return _base.rbegin();}
- reverse_iterator rend() {return _base.rend();}
- const_reverse_iterator rend() const {return _base.rend();}
+ iterator find (const char *identifier_str)
+ iterator begin()
+ const_iterator begin() const
+ iterator end()
+ const_iterator end() const
+ reverse_iterator rbegin()
+ const_reverse_iterator rbegin() const
+ reverse_iterator rend()
+ const_reverse_iterator rend() const
#endif
/* debuging function... */
void print(void);