1
0
mirror of https://git.savannah.gnu.org/git/gperf.git synced 2025-12-02 13:09:22 +00:00

Let the input module see only Keyword, not KeywordExt.

This commit is contained in:
Bruno Haible
2002-11-22 14:19:08 +00:00
parent 32f5ea88cf
commit 9fa6cbdde5
6 changed files with 74 additions and 17 deletions

View File

@@ -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. */
Keyword_List (Keyword *car);
/* Access to first element of list. */
Keyword * first () { return _car; }
/* Access to next element of list. */
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);
/* Access to first element of list. */
KeywordExt * first () { return _car; }
KeywordExt * first () { return static_cast<KeywordExt*>(_car); }
/* Access to next element of list. */
KeywordExt_List *& rest () { return _cdr; }
private:
KeywordExt_List * _cdr;
KeywordExt * const _car;
KeywordExt_List *& rest () { return static_cast<KeywordExt_List*>(_cdr); }
};
#endif