diff options
author | Christian <c@ethdev.com> | 2014-12-06 00:29:20 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2014-12-08 19:49:03 +0800 |
commit | 41b8d7b7f1221c6caae142a6833228ccd098ef5b (patch) | |
tree | 7ca2f85bb0a03db17a835d9a3b36da8e67266abb /ASTPrinter.cpp | |
parent | 260a1529a758fb7b75840e05d8c0be18975ff3b2 (diff) | |
download | dexon-solidity-41b8d7b7f1221c6caae142a6833228ccd098ef5b.tar.gz dexon-solidity-41b8d7b7f1221c6caae142a6833228ccd098ef5b.tar.zst dexon-solidity-41b8d7b7f1221c6caae142a6833228ccd098ef5b.zip |
Const functions for ASTVisitor and const ASTPrinter.
Diffstat (limited to 'ASTPrinter.cpp')
-rw-r--r-- | ASTPrinter.cpp | 126 |
1 files changed, 63 insertions, 63 deletions
diff --git a/ASTPrinter.cpp b/ASTPrinter.cpp index 3d09fd9a..eddb5134 100644 --- a/ASTPrinter.cpp +++ b/ASTPrinter.cpp @@ -30,7 +30,7 @@ namespace dev namespace solidity { -ASTPrinter::ASTPrinter(ASTNode& _ast, string const& _source): +ASTPrinter::ASTPrinter(ASTNode const& _ast, string const& _source): m_indentation(0), m_source(_source), m_ast(&_ast) { } @@ -43,35 +43,35 @@ void ASTPrinter::print(ostream& _stream) } -bool ASTPrinter::visit(ImportDirective& _node) +bool ASTPrinter::visit(ImportDirective const& _node) { writeLine("ImportDirective \"" + _node.getIdentifier() + "\""); printSourcePart(_node); return goDeeper(); } -bool ASTPrinter::visit(ContractDefinition& _node) +bool ASTPrinter::visit(ContractDefinition const& _node) { writeLine("ContractDefinition \"" + _node.getName() + "\""); printSourcePart(_node); return goDeeper(); } -bool ASTPrinter::visit(StructDefinition& _node) +bool ASTPrinter::visit(StructDefinition const& _node) { writeLine("StructDefinition \"" + _node.getName() + "\""); printSourcePart(_node); return goDeeper(); } -bool ASTPrinter::visit(ParameterList& _node) +bool ASTPrinter::visit(ParameterList const& _node) { writeLine("ParameterList"); printSourcePart(_node); return goDeeper(); } -bool ASTPrinter::visit(FunctionDefinition& _node) +bool ASTPrinter::visit(FunctionDefinition const& _node) { writeLine("FunctionDefinition \"" + _node.getName() + "\"" + (_node.isPublic() ? " - public" : "") + @@ -80,112 +80,112 @@ bool ASTPrinter::visit(FunctionDefinition& _node) return goDeeper(); } -bool ASTPrinter::visit(VariableDeclaration& _node) +bool ASTPrinter::visit(VariableDeclaration const& _node) { writeLine("VariableDeclaration \"" + _node.getName() + "\""); printSourcePart(_node); return goDeeper(); } -bool ASTPrinter::visit(TypeName& _node) +bool ASTPrinter::visit(TypeName const& _node) { writeLine("TypeName"); printSourcePart(_node); return goDeeper(); } -bool ASTPrinter::visit(ElementaryTypeName& _node) +bool ASTPrinter::visit(ElementaryTypeName const& _node) { writeLine(string("ElementaryTypeName ") + Token::toString(_node.getTypeName())); printSourcePart(_node); return goDeeper(); } -bool ASTPrinter::visit(UserDefinedTypeName& _node) +bool ASTPrinter::visit(UserDefinedTypeName const& _node) { writeLine("UserDefinedTypeName \"" + _node.getName() + "\""); printSourcePart(_node); return goDeeper(); } -bool ASTPrinter::visit(Mapping& _node) +bool ASTPrinter::visit(Mapping const& _node) { writeLine("Mapping"); printSourcePart(_node); return goDeeper(); } -bool ASTPrinter::visit(Statement& _node) +bool ASTPrinter::visit(Statement const& _node) { writeLine("Statement"); printSourcePart(_node); return goDeeper(); } -bool ASTPrinter::visit(Block& _node) +bool ASTPrinter::visit(Block const& _node) { writeLine("Block"); printSourcePart(_node); return goDeeper(); } -bool ASTPrinter::visit(IfStatement& _node) +bool ASTPrinter::visit(IfStatement const& _node) { writeLine("IfStatement"); printSourcePart(_node); return goDeeper(); } -bool ASTPrinter::visit(BreakableStatement& _node) +bool ASTPrinter::visit(BreakableStatement const& _node) { writeLine("BreakableStatement"); printSourcePart(_node); return goDeeper(); } -bool ASTPrinter::visit(WhileStatement& _node) +bool ASTPrinter::visit(WhileStatement const& _node) { writeLine("WhileStatement"); printSourcePart(_node); return goDeeper(); } -bool ASTPrinter::visit(Continue& _node) +bool ASTPrinter::visit(Continue const& _node) { writeLine("Continue"); printSourcePart(_node); return goDeeper(); } -bool ASTPrinter::visit(Break& _node) +bool ASTPrinter::visit(Break const& _node) { writeLine("Break"); printSourcePart(_node); return goDeeper(); } -bool ASTPrinter::visit(Return& _node) +bool ASTPrinter::visit(Return const& _node) { writeLine("Return"); printSourcePart(_node); return goDeeper(); } -bool ASTPrinter::visit(VariableDefinition& _node) +bool ASTPrinter::visit(VariableDefinition const& _node) { writeLine("VariableDefinition"); printSourcePart(_node); return goDeeper(); } -bool ASTPrinter::visit(ExpressionStatement& _node) +bool ASTPrinter::visit(ExpressionStatement const& _node) { writeLine("ExpressionStatement"); printSourcePart(_node); return goDeeper(); } -bool ASTPrinter::visit(Expression& _node) +bool ASTPrinter::visit(Expression const& _node) { writeLine("Expression"); printType(_node); @@ -193,7 +193,7 @@ bool ASTPrinter::visit(Expression& _node) return goDeeper(); } -bool ASTPrinter::visit(Assignment& _node) +bool ASTPrinter::visit(Assignment const& _node) { writeLine(string("Assignment using operator ") + Token::toString(_node.getAssignmentOperator())); printType(_node); @@ -201,7 +201,7 @@ bool ASTPrinter::visit(Assignment& _node) return goDeeper(); } -bool ASTPrinter::visit(UnaryOperation& _node) +bool ASTPrinter::visit(UnaryOperation const& _node) { writeLine(string("UnaryOperation (") + (_node.isPrefixOperation() ? "prefix" : "postfix") + ") " + Token::toString(_node.getOperator())); @@ -210,7 +210,7 @@ bool ASTPrinter::visit(UnaryOperation& _node) return goDeeper(); } -bool ASTPrinter::visit(BinaryOperation& _node) +bool ASTPrinter::visit(BinaryOperation const& _node) { writeLine(string("BinaryOperation using operator ") + Token::toString(_node.getOperator())); printType(_node); @@ -218,7 +218,7 @@ bool ASTPrinter::visit(BinaryOperation& _node) return goDeeper(); } -bool ASTPrinter::visit(FunctionCall& _node) +bool ASTPrinter::visit(FunctionCall const& _node) { writeLine("FunctionCall"); printType(_node); @@ -226,7 +226,7 @@ bool ASTPrinter::visit(FunctionCall& _node) return goDeeper(); } -bool ASTPrinter::visit(MemberAccess& _node) +bool ASTPrinter::visit(MemberAccess const& _node) { writeLine("MemberAccess to member " + _node.getMemberName()); printType(_node); @@ -234,7 +234,7 @@ bool ASTPrinter::visit(MemberAccess& _node) return goDeeper(); } -bool ASTPrinter::visit(IndexAccess& _node) +bool ASTPrinter::visit(IndexAccess const& _node) { writeLine("IndexAccess"); printType(_node); @@ -242,7 +242,7 @@ bool ASTPrinter::visit(IndexAccess& _node) return goDeeper(); } -bool ASTPrinter::visit(PrimaryExpression& _node) +bool ASTPrinter::visit(PrimaryExpression const& _node) { writeLine("PrimaryExpression"); printType(_node); @@ -250,7 +250,7 @@ bool ASTPrinter::visit(PrimaryExpression& _node) return goDeeper(); } -bool ASTPrinter::visit(Identifier& _node) +bool ASTPrinter::visit(Identifier const& _node) { writeLine(string("Identifier ") + _node.getName()); printType(_node); @@ -258,7 +258,7 @@ bool ASTPrinter::visit(Identifier& _node) return goDeeper(); } -bool ASTPrinter::visit(ElementaryTypeNameExpression& _node) +bool ASTPrinter::visit(ElementaryTypeNameExpression const& _node) { writeLine(string("ElementaryTypeNameExpression ") + Token::toString(_node.getTypeToken())); printType(_node); @@ -266,7 +266,7 @@ bool ASTPrinter::visit(ElementaryTypeNameExpression& _node) return goDeeper(); } -bool ASTPrinter::visit(Literal& _node) +bool ASTPrinter::visit(Literal const& _node) { char const* tokenString = Token::toString(_node.getToken()); if (!tokenString) @@ -277,157 +277,157 @@ bool ASTPrinter::visit(Literal& _node) return goDeeper(); } -void ASTPrinter::endVisit(ImportDirective&) +void ASTPrinter::endVisit(ImportDirective const&) { m_indentation--; } -void ASTPrinter::endVisit(ContractDefinition&) +void ASTPrinter::endVisit(ContractDefinition const&) { m_indentation--; } -void ASTPrinter::endVisit(StructDefinition&) +void ASTPrinter::endVisit(StructDefinition const&) { m_indentation--; } -void ASTPrinter::endVisit(ParameterList&) +void ASTPrinter::endVisit(ParameterList const&) { m_indentation--; } -void ASTPrinter::endVisit(FunctionDefinition&) +void ASTPrinter::endVisit(FunctionDefinition const&) { m_indentation--; } -void ASTPrinter::endVisit(VariableDeclaration&) +void ASTPrinter::endVisit(VariableDeclaration const&) { m_indentation--; } -void ASTPrinter::endVisit(TypeName&) +void ASTPrinter::endVisit(TypeName const&) { m_indentation--; } -void ASTPrinter::endVisit(ElementaryTypeName&) +void ASTPrinter::endVisit(ElementaryTypeName const&) { m_indentation--; } -void ASTPrinter::endVisit(UserDefinedTypeName&) +void ASTPrinter::endVisit(UserDefinedTypeName const&) { m_indentation--; } -void ASTPrinter::endVisit(Mapping&) +void ASTPrinter::endVisit(Mapping const&) { m_indentation--; } -void ASTPrinter::endVisit(Statement&) +void ASTPrinter::endVisit(Statement const&) { m_indentation--; } -void ASTPrinter::endVisit(Block&) +void ASTPrinter::endVisit(Block const&) { m_indentation--; } -void ASTPrinter::endVisit(IfStatement&) +void ASTPrinter::endVisit(IfStatement const&) { m_indentation--; } -void ASTPrinter::endVisit(BreakableStatement&) +void ASTPrinter::endVisit(BreakableStatement const&) { m_indentation--; } -void ASTPrinter::endVisit(WhileStatement&) +void ASTPrinter::endVisit(WhileStatement const&) { m_indentation--; } -void ASTPrinter::endVisit(Continue&) +void ASTPrinter::endVisit(Continue const&) { m_indentation--; } -void ASTPrinter::endVisit(Break&) +void ASTPrinter::endVisit(Break const&) { m_indentation--; } -void ASTPrinter::endVisit(Return&) +void ASTPrinter::endVisit(Return const&) { m_indentation--; } -void ASTPrinter::endVisit(VariableDefinition&) +void ASTPrinter::endVisit(VariableDefinition const&) { m_indentation--; } -void ASTPrinter::endVisit(ExpressionStatement&) +void ASTPrinter::endVisit(ExpressionStatement const&) { m_indentation--; } -void ASTPrinter::endVisit(Expression&) +void ASTPrinter::endVisit(Expression const&) { m_indentation--; } -void ASTPrinter::endVisit(Assignment&) +void ASTPrinter::endVisit(Assignment const&) { m_indentation--; } -void ASTPrinter::endVisit(UnaryOperation&) +void ASTPrinter::endVisit(UnaryOperation const&) { m_indentation--; } -void ASTPrinter::endVisit(BinaryOperation&) +void ASTPrinter::endVisit(BinaryOperation const&) { m_indentation--; } -void ASTPrinter::endVisit(FunctionCall&) +void ASTPrinter::endVisit(FunctionCall const&) { m_indentation--; } -void ASTPrinter::endVisit(MemberAccess&) +void ASTPrinter::endVisit(MemberAccess const&) { m_indentation--; } -void ASTPrinter::endVisit(IndexAccess&) +void ASTPrinter::endVisit(IndexAccess const&) { m_indentation--; } -void ASTPrinter::endVisit(PrimaryExpression&) +void ASTPrinter::endVisit(PrimaryExpression const&) { m_indentation--; } -void ASTPrinter::endVisit(Identifier&) +void ASTPrinter::endVisit(Identifier const&) { m_indentation--; } -void ASTPrinter::endVisit(ElementaryTypeNameExpression&) +void ASTPrinter::endVisit(ElementaryTypeNameExpression const&) { m_indentation--; } -void ASTPrinter::endVisit(Literal&) +void ASTPrinter::endVisit(Literal const&) { m_indentation--; } |