aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--AST.cpp8
-rw-r--r--AST.h10
-rw-r--r--ASTForward.h2
-rw-r--r--ASTPrinter.cpp4
-rw-r--r--ASTPrinter.h4
-rw-r--r--ASTVisitor.h8
-rw-r--r--AST_accept.h4
-rw-r--r--Parser.cpp6
-rw-r--r--Parser.h2
-rw-r--r--Types.cpp2
10 files changed, 25 insertions, 25 deletions
diff --git a/AST.cpp b/AST.cpp
index 65dc57e5..cdc1f6cb 100644
--- a/AST.cpp
+++ b/AST.cpp
@@ -206,7 +206,7 @@ vector<pair<FixedHash<4>, FunctionTypePointer>> const& ContractDefinition::getIn
return *m_interfaceFunctionList;
}
-TypePointer EnumDeclaration::getType(ContractDefinition const*) const
+TypePointer EnumvValue::getType(ContractDefinition const*) const
{
// LTODO: How to get the parent EnumDefinition and return its type here?
return nullptr;
@@ -263,8 +263,8 @@ void StructDefinition::checkRecursion() const
void EnumDefinition::checkValidityOfMembers() const
{
- vector<ASTPointer<EnumDeclaration>> members(getMembers());
- auto compareDecls = [](ASTPointer<EnumDeclaration> a, ASTPointer<EnumDeclaration> b)
+ vector<ASTPointer<EnumvValue>> members(getMembers());
+ auto compareDecls = [](ASTPointer<EnumvValue> a, ASTPointer<EnumvValue> b)
{
return a->getName() < b->getName();
};
@@ -283,7 +283,7 @@ TypePointer EnumDefinition::getType(ContractDefinition const*) const
unsigned int EnumDefinition::getMemberValue(ASTString const& _member) const
{
unsigned int index = 0;
- for (ASTPointer<EnumDeclaration> const& decl: m_members)
+ for (ASTPointer<EnumvValue> const& decl: m_members)
{
if (decl->getName() == _member)
return index;
diff --git a/AST.h b/AST.h
index fdbbcd5b..11dfef59 100644
--- a/AST.h
+++ b/AST.h
@@ -168,10 +168,10 @@ private:
/**
* Declaration of an Enum Value
*/
-class EnumDeclaration : public Declaration
+class EnumvValue : public Declaration
{
public:
- EnumDeclaration(Location const& _location,
+ EnumvValue(Location const& _location,
ASTPointer<ASTString> const& _name):
Declaration(_location, _name) {}
@@ -339,12 +339,12 @@ class EnumDefinition: public Declaration
public:
EnumDefinition(Location const& _location,
ASTPointer<ASTString> const& _name,
- std::vector<ASTPointer<EnumDeclaration>> const& _members):
+ std::vector<ASTPointer<EnumvValue>> const& _members):
Declaration(_location, _name), m_members(_members) {}
virtual void accept(ASTVisitor& _visitor) override;
virtual void accept(ASTConstVisitor& _visitor) const override;
- std::vector<ASTPointer<EnumDeclaration>> const& getMembers() const { return m_members; }
+ std::vector<ASTPointer<EnumvValue>> const& getMembers() const { return m_members; }
virtual TypePointer getType(ContractDefinition const*) const override;
@@ -356,7 +356,7 @@ public:
private:
- std::vector<ASTPointer<EnumDeclaration>> m_members;
+ std::vector<ASTPointer<EnumvValue>> m_members;
};
/**
diff --git a/ASTForward.h b/ASTForward.h
index a0a6f683..3370e88a 100644
--- a/ASTForward.h
+++ b/ASTForward.h
@@ -41,7 +41,7 @@ class ContractDefinition;
class InheritanceSpecifier;
class StructDefinition;
class EnumDefinition;
-class EnumDeclaration;
+class EnumvValue;
class ParameterList;
class FunctionDefinition;
class VariableDeclaration;
diff --git a/ASTPrinter.cpp b/ASTPrinter.cpp
index b655d309..dd66bf0d 100644
--- a/ASTPrinter.cpp
+++ b/ASTPrinter.cpp
@@ -77,7 +77,7 @@ bool ASTPrinter::visit(EnumDefinition const& _node)
return goDeeper();
}
-bool ASTPrinter::visit(EnumDeclaration const& _node)
+bool ASTPrinter::visit(EnumvValue const& _node)
{
writeLine("EnumValue \"" + _node.getName() + "\"");
return goDeeper();
@@ -364,7 +364,7 @@ void ASTPrinter::endVisit(EnumDefinition const&)
m_indentation--;
}
-void ASTPrinter::endVisit(EnumDeclaration const&)
+void ASTPrinter::endVisit(EnumvValue const&)
{
m_indentation--;
}
diff --git a/ASTPrinter.h b/ASTPrinter.h
index a306e90b..dda2f1c4 100644
--- a/ASTPrinter.h
+++ b/ASTPrinter.h
@@ -47,7 +47,7 @@ public:
bool visit(InheritanceSpecifier const& _node) override;
bool visit(StructDefinition const& _node) override;
bool visit(EnumDefinition const& _node) override;
- bool visit(EnumDeclaration const& _node) override;
+ bool visit(EnumvValue const& _node) override;
bool visit(ParameterList const& _node) override;
bool visit(FunctionDefinition const& _node) override;
bool visit(VariableDeclaration const& _node) override;
@@ -88,7 +88,7 @@ public:
void endVisit(InheritanceSpecifier const&) override;
void endVisit(StructDefinition const&) override;
void endVisit(EnumDefinition const&) override;
- void endVisit(EnumDeclaration const&) override;
+ void endVisit(EnumvValue const&) override;
void endVisit(ParameterList const&) override;
void endVisit(FunctionDefinition const&) override;
void endVisit(VariableDeclaration const&) override;
diff --git a/ASTVisitor.h b/ASTVisitor.h
index 10882757..392da761 100644
--- a/ASTVisitor.h
+++ b/ASTVisitor.h
@@ -48,7 +48,7 @@ public:
virtual bool visit(InheritanceSpecifier&) { return true; }
virtual bool visit(StructDefinition&) { return true; }
virtual bool visit(EnumDefinition&) { return true; }
- virtual bool visit(EnumDeclaration&) { return true; }
+ virtual bool visit(EnumvValue&) { return true; }
virtual bool visit(ParameterList&) { return true; }
virtual bool visit(FunctionDefinition&) { return true; }
virtual bool visit(VariableDeclaration&) { return true; }
@@ -91,7 +91,7 @@ public:
virtual void endVisit(InheritanceSpecifier&) { }
virtual void endVisit(StructDefinition&) { }
virtual void endVisit(EnumDefinition&) { }
- virtual void endVisit(EnumDeclaration&) { }
+ virtual void endVisit(EnumvValue&) { }
virtual void endVisit(ParameterList&) { }
virtual void endVisit(FunctionDefinition&) { }
virtual void endVisit(VariableDeclaration&) { }
@@ -138,7 +138,7 @@ public:
virtual bool visit(InheritanceSpecifier const&) { return true; }
virtual bool visit(StructDefinition const&) { return true; }
virtual bool visit(EnumDefinition const&) { return true; }
- virtual bool visit(EnumDeclaration const&) { return true; }
+ virtual bool visit(EnumvValue const&) { return true; }
virtual bool visit(ParameterList const&) { return true; }
virtual bool visit(FunctionDefinition const&) { return true; }
virtual bool visit(VariableDeclaration const&) { return true; }
@@ -181,7 +181,7 @@ public:
virtual void endVisit(InheritanceSpecifier const&) { }
virtual void endVisit(StructDefinition const&) { }
virtual void endVisit(EnumDefinition const&) { }
- virtual void endVisit(EnumDeclaration const&) { }
+ virtual void endVisit(EnumvValue const&) { }
virtual void endVisit(ParameterList const&) { }
virtual void endVisit(FunctionDefinition const&) { }
virtual void endVisit(VariableDeclaration const&) { }
diff --git a/AST_accept.h b/AST_accept.h
index 78c2f8c5..e6877d93 100644
--- a/AST_accept.h
+++ b/AST_accept.h
@@ -121,13 +121,13 @@ void EnumDefinition::accept(ASTConstVisitor& _visitor) const
_visitor.endVisit(*this);
}
-void EnumDeclaration::accept(ASTVisitor& _visitor)
+void EnumvValue::accept(ASTVisitor& _visitor)
{
_visitor.visit(*this);
_visitor.endVisit(*this);
}
-void EnumDeclaration::accept(ASTConstVisitor& _visitor) const
+void EnumvValue::accept(ASTConstVisitor& _visitor) const
{
_visitor.visit(*this);
_visitor.endVisit(*this);
diff --git a/Parser.cpp b/Parser.cpp
index 59c360a4..3e077261 100644
--- a/Parser.cpp
+++ b/Parser.cpp
@@ -266,12 +266,12 @@ ASTPointer<StructDefinition> Parser::parseStructDefinition()
return nodeFactory.createNode<StructDefinition>(name, members);
}
-ASTPointer<EnumDeclaration> Parser::parseEnumDeclaration()
+ASTPointer<EnumvValue> Parser::parseEnumDeclaration()
{
ASTNodeFactory nodeFactory(*this);
ASTPointer<ASTString> name = expectIdentifierToken();
nodeFactory.markEndPosition();
- return nodeFactory.createNode<EnumDeclaration>(name);
+ return nodeFactory.createNode<EnumvValue>(name);
}
ASTPointer<EnumDefinition> Parser::parseEnumDefinition()
@@ -279,7 +279,7 @@ ASTPointer<EnumDefinition> Parser::parseEnumDefinition()
ASTNodeFactory nodeFactory(*this);
expectToken(Token::Enum);
ASTPointer<ASTString> name = expectIdentifierToken();
- vector<ASTPointer<EnumDeclaration>> members;
+ vector<ASTPointer<EnumvValue>> members;
expectToken(Token::LBrace);
while (m_scanner->getCurrentToken() != Token::RBrace)
diff --git a/Parser.h b/Parser.h
index 734bdd57..44b14da0 100644
--- a/Parser.h
+++ b/Parser.h
@@ -62,7 +62,7 @@ private:
ASTPointer<FunctionDefinition> parseFunctionDefinition(ASTString const* _contractName);
ASTPointer<StructDefinition> parseStructDefinition();
ASTPointer<EnumDefinition> parseEnumDefinition();
- ASTPointer<EnumDeclaration> parseEnumDeclaration();
+ ASTPointer<EnumvValue> parseEnumDeclaration();
ASTPointer<VariableDeclaration> parseVariableDeclaration(VarDeclParserOptions const& _options = VarDeclParserOptions());
ASTPointer<ModifierDefinition> parseModifierDefinition();
ASTPointer<EventDefinition> parseEventDefinition();
diff --git a/Types.cpp b/Types.cpp
index 709002ba..df62773a 100644
--- a/Types.cpp
+++ b/Types.cpp
@@ -952,7 +952,7 @@ MemberList const& TypeType::getMembers() const
else if (m_actualType->getCategory() == Category::Enum)
{
EnumDefinition const& enumDef = dynamic_cast<EnumType const&>(*m_actualType).getEnumDefinition();
- for (ASTPointer<EnumDeclaration> const& enumValue: enumDef.getMembers())
+ for (ASTPointer<EnumvValue> const& enumValue: enumDef.getMembers())
members.insert(make_pair(enumValue->getName(), make_shared<EnumType>(enumDef)));
m_members.reset(new MemberList(members));
}