summaryrefslogtreecommitdiff
path: root/src/keyword-list.h
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2002-11-22 14:19:08 +0000
committerBruno Haible <bruno@clisp.org>2002-11-22 14:19:08 +0000
commit9fa6cbdde51fb80315b527d54ab14e112ab18adf (patch)
tree7a0c2216302f89c61f7bd81a940bca4828e841e3 /src/keyword-list.h
parent32f5ea88cf437049ce568b4dfa5e53c3baf83180 (diff)
downloadgperf-9fa6cbdde51fb80315b527d54ab14e112ab18adf.tar.gz
Let the input module see only Keyword, not KeywordExt.
Diffstat (limited to 'src/keyword-list.h')
-rw-r--r--src/keyword-list.h28
1 files changed, 21 insertions, 7 deletions
diff --git a/src/keyword-list.h b/src/keyword-list.h
index 0a3f5d3..18a7158 100644
--- a/src/keyword-list.h
+++ b/src/keyword-list.h
@@ -27,19 +27,33 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111, USA. */
#include "keyword.h"
/* List node of a linear list of Keyword. */
-class KeywordExt_List {
+class Keyword_List
+{
public:
/* Constructor. */
- KeywordExt_List (KeywordExt *car);
+ Keyword_List (Keyword *car);
/* Access to first element of list. */
- KeywordExt * first () { return _car; }
+ Keyword * first () { return _car; }
/* Access to next element of list. */
- KeywordExt_List *& rest () { return _cdr; }
+ Keyword_List *& rest () { return _cdr; }
+
+protected:
+ Keyword_List * _cdr;
+ Keyword * const _car;
+};
+
+/* List node of a linear list of KeywordExt. */
+class KeywordExt_List : public Keyword_List
+{
+public:
+ /* Unused constructor. */
+ KeywordExt_List (KeywordExt *car);
-private:
- KeywordExt_List * _cdr;
- KeywordExt * const _car;
+ /* Access to first element of list. */
+ KeywordExt * first () { return static_cast<KeywordExt*>(_car); }
+ /* Access to next element of list. */
+ KeywordExt_List *& rest () { return static_cast<KeywordExt_List*>(_cdr); }
};
#endif