From c12866a467459f51e33252d5629edb8fbcd2201a Mon Sep 17 00:00:00 2001 From: Roberto Raggi Date: Thu, 2 Sep 2010 11:59:01 +0200 Subject: Merge CPlusPlus::NameId and CPlusPlus::Identifier. --- src/shared/cplusplus/Literals.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/shared/cplusplus/Literals.cpp') diff --git a/src/shared/cplusplus/Literals.cpp b/src/shared/cplusplus/Literals.cpp index d56f937c48..9d1bf65225 100644 --- a/src/shared/cplusplus/Literals.cpp +++ b/src/shared/cplusplus/Literals.cpp @@ -47,6 +47,7 @@ // THE SOFTWARE. #include "Literals.h" +#include "NameVisitor.h" #include #include #include @@ -69,7 +70,7 @@ Literal::Literal(const char *chars, unsigned size) Literal::~Literal() { delete[] _chars; } -bool Literal::isEqualTo(const Literal *other) const +bool Literal::equalTo(const Literal *other) const { if (! other) return false; @@ -212,3 +213,18 @@ Identifier::Identifier(const char *chars, unsigned size) Identifier::~Identifier() { } +void Identifier::accept0(NameVisitor *visitor) const +{ visitor->visit(this); } + +bool Identifier::isEqualTo(const Name *other) const +{ + if (this == other) + return true; + + else if (other) { + if (const Identifier *nameId = other->asNameId()) { + return equalTo(nameId); + } + } + return false; +} -- cgit v1.2.1