diff --git a/ASTJsonConverter.cpp b/ASTJsonConverter.cpp index be89de924..122b1c0d1 100644 --- a/ASTJsonConverter.cpp +++ b/ASTJsonConverter.cpp @@ -151,12 +151,6 @@ bool ASTJsonConverter::visit(Mapping const&) return true; } -bool ASTJsonConverter::visit(Statement const&) -{ - addJsonNode("Statement", {}, true); - return true; -} - bool ASTJsonConverter::visit(Block const&) { addJsonNode("Block", {}, true); @@ -169,11 +163,6 @@ bool ASTJsonConverter::visit(IfStatement const&) return true; } -bool ASTJsonConverter::visit(BreakableStatement const&) -{ - return true; -} - bool ASTJsonConverter::visit(WhileStatement const&) { addJsonNode("WhileStatement", {}, true); @@ -216,17 +205,6 @@ bool ASTJsonConverter::visit(ExpressionStatement const&) return true; } -bool ASTJsonConverter::visit(Expression const& _node) -{ - addJsonNode( - "Expression", - { make_pair("type", getType(_node)), - make_pair("lvalue", boost::lexical_cast(_node.isLValue())) }, - true - ); - return true; -} - bool ASTJsonConverter::visit(Assignment const& _node) { addJsonNode("Assignment", @@ -285,11 +263,6 @@ bool ASTJsonConverter::visit(IndexAccess const& _node) return true; } -bool ASTJsonConverter::visit(PrimaryExpression const&) -{ - return true; -} - bool ASTJsonConverter::visit(Identifier const& _node) { addJsonNode("Identifier", @@ -358,11 +331,6 @@ void ASTJsonConverter::endVisit(Mapping const&) { } -void ASTJsonConverter::endVisit(Statement const&) -{ - goUp(); -} - void ASTJsonConverter::endVisit(Block const&) { goUp(); @@ -373,10 +341,6 @@ void ASTJsonConverter::endVisit(IfStatement const&) goUp(); } -void ASTJsonConverter::endVisit(BreakableStatement const&) -{ -} - void ASTJsonConverter::endVisit(WhileStatement const&) { goUp(); @@ -410,11 +374,6 @@ void ASTJsonConverter::endVisit(ExpressionStatement const&) goUp(); } -void ASTJsonConverter::endVisit(Expression const&) -{ - goUp(); -} - void ASTJsonConverter::endVisit(Assignment const&) { goUp(); @@ -450,10 +409,6 @@ void ASTJsonConverter::endVisit(IndexAccess const&) goUp(); } -void ASTJsonConverter::endVisit(PrimaryExpression const&) -{ -} - void ASTJsonConverter::endVisit(Identifier const&) { } diff --git a/ASTJsonConverter.h b/ASTJsonConverter.h index 56502ab3c..aaa54f7fd 100644 --- a/ASTJsonConverter.h +++ b/ASTJsonConverter.h @@ -56,10 +56,8 @@ public: bool visit(ElementaryTypeName const& _node) override; bool visit(UserDefinedTypeName const& _node) override; bool visit(Mapping const& _node) override; - bool visit(Statement const& _node) override; bool visit(Block const& _node) override; bool visit(IfStatement const& _node) override; - bool visit(BreakableStatement const& _node) override; bool visit(WhileStatement const& _node) override; bool visit(ForStatement const& _node) override; bool visit(Continue const& _node) override; @@ -67,7 +65,6 @@ public: bool visit(Return const& _node) override; bool visit(VariableDeclarationStatement const& _node) override; bool visit(ExpressionStatement const& _node) override; - bool visit(Expression const& _node) override; bool visit(Assignment const& _node) override; bool visit(UnaryOperation const& _node) override; bool visit(BinaryOperation const& _node) override; @@ -75,7 +72,6 @@ public: bool visit(NewExpression const& _node) override; bool visit(MemberAccess const& _node) override; bool visit(IndexAccess const& _node) override; - bool visit(PrimaryExpression const& _node) override; bool visit(Identifier const& _node) override; bool visit(ElementaryTypeNameExpression const& _node) override; bool visit(Literal const& _node) override; @@ -90,10 +86,8 @@ public: void endVisit(ElementaryTypeName const&) override; void endVisit(UserDefinedTypeName const&) override; void endVisit(Mapping const&) override; - void endVisit(Statement const&) override; void endVisit(Block const&) override; void endVisit(IfStatement const&) override; - void endVisit(BreakableStatement const&) override; void endVisit(WhileStatement const&) override; void endVisit(ForStatement const&) override; void endVisit(Continue const&) override; @@ -101,7 +95,6 @@ public: void endVisit(Return const&) override; void endVisit(VariableDeclarationStatement const&) override; void endVisit(ExpressionStatement const&) override; - void endVisit(Expression const&) override; void endVisit(Assignment const&) override; void endVisit(UnaryOperation const&) override; void endVisit(BinaryOperation const&) override; @@ -109,7 +102,6 @@ public: void endVisit(NewExpression const&) override; void endVisit(MemberAccess const&) override; void endVisit(IndexAccess const&) override; - void endVisit(PrimaryExpression const&) override; void endVisit(Identifier const&) override; void endVisit(ElementaryTypeNameExpression const&) override; void endVisit(Literal const&) override; diff --git a/ASTPrinter.cpp b/ASTPrinter.cpp index d0b27b317..713059d38 100644 --- a/ASTPrinter.cpp +++ b/ASTPrinter.cpp @@ -162,13 +162,6 @@ bool ASTPrinter::visit(ArrayTypeName const& _node) return goDeeper(); } -bool ASTPrinter::visit(Statement const& _node) -{ - writeLine("Statement"); - printSourcePart(_node); - return goDeeper(); -} - bool ASTPrinter::visit(Block const& _node) { writeLine("Block"); @@ -190,13 +183,6 @@ bool ASTPrinter::visit(IfStatement const& _node) return goDeeper(); } -bool ASTPrinter::visit(BreakableStatement const& _node) -{ - writeLine("BreakableStatement"); - printSourcePart(_node); - return goDeeper(); -} - bool ASTPrinter::visit(WhileStatement const& _node) { writeLine("WhileStatement"); @@ -246,14 +232,6 @@ bool ASTPrinter::visit(ExpressionStatement const& _node) return goDeeper(); } -bool ASTPrinter::visit(Expression const& _node) -{ - writeLine("Expression"); - printType(_node); - printSourcePart(_node); - return goDeeper(); -} - bool ASTPrinter::visit(Assignment const& _node) { writeLine(string("Assignment using operator ") + Token::toString(_node.getAssignmentOperator())); @@ -311,14 +289,6 @@ bool ASTPrinter::visit(IndexAccess const& _node) return goDeeper(); } -bool ASTPrinter::visit(PrimaryExpression const& _node) -{ - writeLine("PrimaryExpression"); - printType(_node); - printSourcePart(_node); - return goDeeper(); -} - bool ASTPrinter::visit(Identifier const& _node) { writeLine(string("Identifier ") + _node.getName()); @@ -431,11 +401,6 @@ void ASTPrinter::endVisit(ArrayTypeName const&) m_indentation--; } -void ASTPrinter::endVisit(Statement const&) -{ - m_indentation--; -} - void ASTPrinter::endVisit(Block const&) { m_indentation--; @@ -451,11 +416,6 @@ void ASTPrinter::endVisit(IfStatement const&) m_indentation--; } -void ASTPrinter::endVisit(BreakableStatement const&) -{ - m_indentation--; -} - void ASTPrinter::endVisit(WhileStatement const&) { m_indentation--; @@ -491,11 +451,6 @@ void ASTPrinter::endVisit(ExpressionStatement const&) m_indentation--; } -void ASTPrinter::endVisit(Expression const&) -{ - m_indentation--; -} - void ASTPrinter::endVisit(Assignment const&) { m_indentation--; @@ -531,11 +486,6 @@ void ASTPrinter::endVisit(IndexAccess const&) m_indentation--; } -void ASTPrinter::endVisit(PrimaryExpression const&) -{ - m_indentation--; -} - void ASTPrinter::endVisit(Identifier const&) { m_indentation--; diff --git a/ASTPrinter.h b/ASTPrinter.h index a1797383c..9494bf8cb 100644 --- a/ASTPrinter.h +++ b/ASTPrinter.h @@ -59,11 +59,9 @@ public: bool visit(UserDefinedTypeName const& _node) override; bool visit(Mapping const& _node) override; bool visit(ArrayTypeName const& _node) override; - bool visit(Statement const& _node) override; bool visit(Block const& _node) override; bool visit(PlaceholderStatement const& _node) override; bool visit(IfStatement const& _node) override; - bool visit(BreakableStatement const& _node) override; bool visit(WhileStatement const& _node) override; bool visit(ForStatement const& _node) override; bool visit(Continue const& _node) override; @@ -71,7 +69,6 @@ public: bool visit(Return const& _node) override; bool visit(VariableDeclarationStatement const& _node) override; bool visit(ExpressionStatement const& _node) override; - bool visit(Expression const& _node) override; bool visit(Assignment const& _node) override; bool visit(UnaryOperation const& _node) override; bool visit(BinaryOperation const& _node) override; @@ -79,7 +76,6 @@ public: bool visit(NewExpression const& _node) override; bool visit(MemberAccess const& _node) override; bool visit(IndexAccess const& _node) override; - bool visit(PrimaryExpression const& _node) override; bool visit(Identifier const& _node) override; bool visit(ElementaryTypeNameExpression const& _node) override; bool visit(Literal const& _node) override; @@ -101,11 +97,9 @@ public: void endVisit(UserDefinedTypeName const&) override; void endVisit(Mapping const&) override; void endVisit(ArrayTypeName const&) override; - void endVisit(Statement const&) override; void endVisit(Block const&) override; void endVisit(PlaceholderStatement const&) override; void endVisit(IfStatement const&) override; - void endVisit(BreakableStatement const&) override; void endVisit(WhileStatement const&) override; void endVisit(ForStatement const&) override; void endVisit(Continue const&) override; @@ -113,7 +107,6 @@ public: void endVisit(Return const&) override; void endVisit(VariableDeclarationStatement const&) override; void endVisit(ExpressionStatement const&) override; - void endVisit(Expression const&) override; void endVisit(Assignment const&) override; void endVisit(UnaryOperation const&) override; void endVisit(BinaryOperation const&) override; @@ -121,7 +114,6 @@ public: void endVisit(NewExpression const&) override; void endVisit(MemberAccess const&) override; void endVisit(IndexAccess const&) override; - void endVisit(PrimaryExpression const&) override; void endVisit(Identifier const&) override; void endVisit(ElementaryTypeNameExpression const&) override; void endVisit(Literal const&) override; diff --git a/ASTVisitor.h b/ASTVisitor.h index 3eeb9c456..2028579c7 100644 --- a/ASTVisitor.h +++ b/ASTVisitor.h @@ -41,7 +41,6 @@ namespace solidity class ASTVisitor { public: - virtual bool visit(ASTNode&) { return true; } virtual bool visit(SourceUnit&) { return true; } virtual bool visit(ImportDirective&) { return true; } virtual bool visit(ContractDefinition&) { return true; } @@ -60,11 +59,9 @@ public: virtual bool visit(UserDefinedTypeName&) { return true; } virtual bool visit(Mapping&) { return true; } virtual bool visit(ArrayTypeName&) { return true; } - virtual bool visit(Statement&) { return true; } virtual bool visit(Block&) { return true; } virtual bool visit(PlaceholderStatement&) { return true; } virtual bool visit(IfStatement&) { return true; } - virtual bool visit(BreakableStatement&) { return true; } virtual bool visit(WhileStatement&) { return true; } virtual bool visit(ForStatement&) { return true; } virtual bool visit(Continue&) { return true; } @@ -72,7 +69,6 @@ public: virtual bool visit(Return&) { return true; } virtual bool visit(VariableDeclarationStatement&) { return true; } virtual bool visit(ExpressionStatement&) { return true; } - virtual bool visit(Expression&) { return true; } virtual bool visit(Assignment&) { return true; } virtual bool visit(UnaryOperation&) { return true; } virtual bool visit(BinaryOperation&) { return true; } @@ -80,12 +76,10 @@ public: virtual bool visit(NewExpression&) { return true; } virtual bool visit(MemberAccess&) { return true; } virtual bool visit(IndexAccess&) { return true; } - virtual bool visit(PrimaryExpression&) { return true; } virtual bool visit(Identifier&) { return true; } virtual bool visit(ElementaryTypeNameExpression&) { return true; } virtual bool visit(Literal&) { return true; } - virtual void endVisit(ASTNode&) { } virtual void endVisit(SourceUnit&) { } virtual void endVisit(ImportDirective&) { } virtual void endVisit(ContractDefinition&) { } @@ -104,11 +98,9 @@ public: virtual void endVisit(UserDefinedTypeName&) { } virtual void endVisit(Mapping&) { } virtual void endVisit(ArrayTypeName&) { } - virtual void endVisit(Statement&) { } virtual void endVisit(Block&) { } virtual void endVisit(PlaceholderStatement&) { } virtual void endVisit(IfStatement&) { } - virtual void endVisit(BreakableStatement&) { } virtual void endVisit(WhileStatement&) { } virtual void endVisit(ForStatement&) { } virtual void endVisit(Continue&) { } @@ -116,7 +108,6 @@ public: virtual void endVisit(Return&) { } virtual void endVisit(VariableDeclarationStatement&) { } virtual void endVisit(ExpressionStatement&) { } - virtual void endVisit(Expression&) { } virtual void endVisit(Assignment&) { } virtual void endVisit(UnaryOperation&) { } virtual void endVisit(BinaryOperation&) { } @@ -124,7 +115,6 @@ public: virtual void endVisit(NewExpression&) { } virtual void endVisit(MemberAccess&) { } virtual void endVisit(IndexAccess&) { } - virtual void endVisit(PrimaryExpression&) { } virtual void endVisit(Identifier&) { } virtual void endVisit(ElementaryTypeNameExpression&) { } virtual void endVisit(Literal&) { } @@ -133,7 +123,6 @@ public: class ASTConstVisitor { public: - virtual bool visit(ASTNode const&) { return true; } virtual bool visit(SourceUnit const&) { return true; } virtual bool visit(ImportDirective const&) { return true; } virtual bool visit(ContractDefinition const&) { return true; } @@ -152,11 +141,9 @@ public: virtual bool visit(UserDefinedTypeName const&) { return true; } virtual bool visit(Mapping const&) { return true; } virtual bool visit(ArrayTypeName const&) { return true; } - virtual bool visit(Statement const&) { return true; } virtual bool visit(Block const&) { return true; } virtual bool visit(PlaceholderStatement const&) { return true; } virtual bool visit(IfStatement const&) { return true; } - virtual bool visit(BreakableStatement const&) { return true; } virtual bool visit(WhileStatement const&) { return true; } virtual bool visit(ForStatement const&) { return true; } virtual bool visit(Continue const&) { return true; } @@ -164,7 +151,6 @@ public: virtual bool visit(Return const&) { return true; } virtual bool visit(VariableDeclarationStatement const&) { return true; } virtual bool visit(ExpressionStatement const&) { return true; } - virtual bool visit(Expression const&) { return true; } virtual bool visit(Assignment const&) { return true; } virtual bool visit(UnaryOperation const&) { return true; } virtual bool visit(BinaryOperation const&) { return true; } @@ -172,12 +158,10 @@ public: virtual bool visit(NewExpression const&) { return true; } virtual bool visit(MemberAccess const&) { return true; } virtual bool visit(IndexAccess const&) { return true; } - virtual bool visit(PrimaryExpression const&) { return true; } virtual bool visit(Identifier const&) { return true; } virtual bool visit(ElementaryTypeNameExpression const&) { return true; } virtual bool visit(Literal const&) { return true; } - virtual void endVisit(ASTNode const&) { } virtual void endVisit(SourceUnit const&) { } virtual void endVisit(ImportDirective const&) { } virtual void endVisit(ContractDefinition const&) { } @@ -196,11 +180,9 @@ public: virtual void endVisit(UserDefinedTypeName const&) { } virtual void endVisit(Mapping const&) { } virtual void endVisit(ArrayTypeName const&) { } - virtual void endVisit(Statement const&) { } virtual void endVisit(Block const&) { } virtual void endVisit(PlaceholderStatement const&) { } virtual void endVisit(IfStatement const&) { } - virtual void endVisit(BreakableStatement const&) { } virtual void endVisit(WhileStatement const&) { } virtual void endVisit(ForStatement const&) { } virtual void endVisit(Continue const&) { } @@ -208,7 +190,6 @@ public: virtual void endVisit(Return const&) { } virtual void endVisit(VariableDeclarationStatement const&) { } virtual void endVisit(ExpressionStatement const&) { } - virtual void endVisit(Expression const&) { } virtual void endVisit(Assignment const&) { } virtual void endVisit(UnaryOperation const&) { } virtual void endVisit(BinaryOperation const&) { } @@ -216,7 +197,6 @@ public: virtual void endVisit(NewExpression const&) { } virtual void endVisit(MemberAccess const&) { } virtual void endVisit(IndexAccess const&) { } - virtual void endVisit(PrimaryExpression const&) { } virtual void endVisit(Identifier const&) { } virtual void endVisit(ElementaryTypeNameExpression const&) { } virtual void endVisit(Literal const&) { }