diff --git a/libsolidity/ast/AST.h b/libsolidity/ast/AST.h index 4767f7c30..b9cc2118e 100644 --- a/libsolidity/ast/AST.h +++ b/libsolidity/ast/AST.h @@ -2596,6 +2596,35 @@ private: std::variant> m_name; }; +class Builtin: public Expression +{ +public: + Builtin( + int64_t _id, + SourceLocation _location, + ASTPointer _nameParameter, + SourceLocation _nameParameterLocation + ): + Expression(_id, std::move(_location)), + m_nameParameter(std::move(_nameParameter)), + m_nameParameterLocation(std::move(_nameParameterLocation)) + { + solAssert(m_nameParameter); + } + + void accept(ASTVisitor& _visitor) override; + void accept(ASTConstVisitor& _visitor) const override; + + bool experimentalSolidityOnly() const override { return true; } + + ASTString const& nameParameter() const { return *m_nameParameter; } + SourceLocation const& nameParameterLocation() const { return m_nameParameterLocation; } + +private: + ASTPointer m_nameParameter; + SourceLocation m_nameParameterLocation; +}; + /// @} } diff --git a/libsolidity/ast/ASTForward.h b/libsolidity/ast/ASTForward.h index f13b6e55d..f7c3d6023 100644 --- a/libsolidity/ast/ASTForward.h +++ b/libsolidity/ast/ASTForward.h @@ -105,6 +105,7 @@ class TypeClassDefinition; class TypeClassInstantiation; class TypeClassName; class TypeDefinition; +class Builtin; /// @} class VariableScope; diff --git a/libsolidity/ast/ASTVisitor.h b/libsolidity/ast/ASTVisitor.h index 959cd5dce..f9196d6b9 100644 --- a/libsolidity/ast/ASTVisitor.h +++ b/libsolidity/ast/ASTVisitor.h @@ -115,6 +115,7 @@ public: virtual bool visit(TypeClassInstantiation& _node) { return visitNode(_node); } virtual bool visit(TypeDefinition& _node) { return visitNode(_node); } virtual bool visit(TypeClassName& _node) { return visitNode(_node); } + virtual bool visit(Builtin& _node) { return visitNode(_node); } /// @} virtual void endVisit(SourceUnit& _node) { endVisitNode(_node); } @@ -178,6 +179,7 @@ public: virtual void endVisit(TypeClassInstantiation& _node) { endVisitNode(_node); } virtual void endVisit(TypeDefinition& _node) { endVisitNode(_node); } virtual void endVisit(TypeClassName& _node) { endVisitNode(_node); } + virtual void endVisit(Builtin& _node) { endVisitNode(_node); } /// @} protected: @@ -263,6 +265,7 @@ public: virtual bool visit(TypeClassInstantiation const& _node) { return visitNode(_node); } virtual bool visit(TypeDefinition const& _node) { return visitNode(_node); } virtual bool visit(TypeClassName const& _node) { return visitNode(_node); } + virtual bool visit(Builtin const& _node) { return visitNode(_node); } /// @} virtual void endVisit(SourceUnit const& _node) { endVisitNode(_node); } @@ -326,6 +329,7 @@ public: virtual void endVisit(TypeClassInstantiation const& _node) { endVisitNode(_node); } virtual void endVisit(TypeDefinition const& _node) { endVisitNode(_node); } virtual void endVisit(TypeClassName const& _node) { endVisitNode(_node); } + virtual void endVisit(Builtin const& _node) { endVisitNode(_node); } /// @} protected: diff --git a/libsolidity/ast/AST_accept.h b/libsolidity/ast/AST_accept.h index d0b5ad281..be9de64db 100644 --- a/libsolidity/ast/AST_accept.h +++ b/libsolidity/ast/AST_accept.h @@ -1128,6 +1128,18 @@ void TypeClassName::accept(ASTConstVisitor& _visitor) const } _visitor.endVisit(*this); } + +void Builtin::accept(ASTVisitor& _visitor) +{ + _visitor.visit(*this); + _visitor.endVisit(*this); +} + +void Builtin::accept(ASTConstVisitor& _visitor) const +{ + _visitor.visit(*this); + _visitor.endVisit(*this); +} /// @} }