git-svn-id: svn://svn.code.sf.net/p/bitchx/code/tags/ircii-pana-1.1-final@1 13b04d17-f746-0410-82c6-800466cd88b0
37 lines
1001 B
C++
37 lines
1001 B
C++
#ifndef _GNODE_H_
|
|
#define _GNODE_H_
|
|
|
|
#include <iostream.h>
|
|
|
|
class List;
|
|
|
|
void trim(char *text); // GOOD
|
|
|
|
// genericNode -- holds any lexical or phrase object
|
|
class genericNode {
|
|
public:
|
|
// constructor: pass it a string containing a lexical or phrase
|
|
// object in the format used in our lexicon.txt and grammar.txt
|
|
genericNode(char *obj); // GOOD
|
|
genericNode(char *word, List *features); // GOOD except feature doesn't copy
|
|
~genericNode();
|
|
|
|
friend ostream &operator<<(ostream &out_file, const genericNode &n); // GOOD
|
|
|
|
// GOOD: sort of.. this routine leaks memory because the lists for
|
|
// assignment it makes aren't properly deallocated upon unification failure
|
|
friend List *unify(genericNode &s, genericNode &g);
|
|
friend List *cmpFeatures(List &a, List &b);
|
|
List *lookupFeature(const char *name) const;
|
|
friend genericNode *substitute(genericNode *old, List *assign);
|
|
|
|
char *word(void); // GOOD
|
|
List *features(void);
|
|
|
|
private:
|
|
char *name;
|
|
List *featureList;
|
|
};
|
|
|
|
#endif
|