Merge CPlusPlus::NameId and CPlusPlus::Identifier.

This commit is contained in:
Roberto Raggi
2010-09-02 11:59:01 +02:00
parent 8b2eeb9c5f
commit c12866a467
25 changed files with 69 additions and 131 deletions

View File

@@ -51,7 +51,7 @@
#include "CPlusPlusForwardDeclarations.h"
#include "Token.h"
#include "Name.h"
namespace CPlusPlus {
@@ -78,7 +78,7 @@ public:
unsigned hashCode() const;
static unsigned hashCode(const char *chars, unsigned size);
bool isEqualTo(const Literal *other) const;
bool equalTo(const Literal *other) const;
private:
char *_chars;
@@ -126,11 +126,21 @@ private:
};
};
class CPLUSPLUS_EXPORT Identifier: public Literal
class CPLUSPLUS_EXPORT Identifier: public Literal, public Name
{
public:
Identifier(const char *chars, unsigned size);
virtual ~Identifier();
virtual const Identifier *identifier() const { return this; }
virtual bool isEqualTo(const Name *other) const;
virtual const Identifier *asNameId() const
{ return this; }
protected:
virtual void accept0(NameVisitor *visitor) const;
};
} // end of namespace CPlusPlus