mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Add Builtin AST node
This commit is contained in:
parent
8304aca1c1
commit
13abd0c9eb
@ -2596,6 +2596,35 @@ private:
|
|||||||
std::variant<Token, ASTPointer<IdentifierPath>> m_name;
|
std::variant<Token, ASTPointer<IdentifierPath>> m_name;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class Builtin: public Expression
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Builtin(
|
||||||
|
int64_t _id,
|
||||||
|
SourceLocation _location,
|
||||||
|
ASTPointer<ASTString> _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<ASTString> m_nameParameter;
|
||||||
|
SourceLocation m_nameParameterLocation;
|
||||||
|
};
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -105,6 +105,7 @@ class TypeClassDefinition;
|
|||||||
class TypeClassInstantiation;
|
class TypeClassInstantiation;
|
||||||
class TypeClassName;
|
class TypeClassName;
|
||||||
class TypeDefinition;
|
class TypeDefinition;
|
||||||
|
class Builtin;
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
class VariableScope;
|
class VariableScope;
|
||||||
|
@ -115,6 +115,7 @@ public:
|
|||||||
virtual bool visit(TypeClassInstantiation& _node) { return visitNode(_node); }
|
virtual bool visit(TypeClassInstantiation& _node) { return visitNode(_node); }
|
||||||
virtual bool visit(TypeDefinition& _node) { return visitNode(_node); }
|
virtual bool visit(TypeDefinition& _node) { return visitNode(_node); }
|
||||||
virtual bool visit(TypeClassName& _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); }
|
virtual void endVisit(SourceUnit& _node) { endVisitNode(_node); }
|
||||||
@ -178,6 +179,7 @@ public:
|
|||||||
virtual void endVisit(TypeClassInstantiation& _node) { endVisitNode(_node); }
|
virtual void endVisit(TypeClassInstantiation& _node) { endVisitNode(_node); }
|
||||||
virtual void endVisit(TypeDefinition& _node) { endVisitNode(_node); }
|
virtual void endVisit(TypeDefinition& _node) { endVisitNode(_node); }
|
||||||
virtual void endVisit(TypeClassName& _node) { endVisitNode(_node); }
|
virtual void endVisit(TypeClassName& _node) { endVisitNode(_node); }
|
||||||
|
virtual void endVisit(Builtin& _node) { endVisitNode(_node); }
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -263,6 +265,7 @@ public:
|
|||||||
virtual bool visit(TypeClassInstantiation const& _node) { return visitNode(_node); }
|
virtual bool visit(TypeClassInstantiation const& _node) { return visitNode(_node); }
|
||||||
virtual bool visit(TypeDefinition 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(TypeClassName const& _node) { return visitNode(_node); }
|
||||||
|
virtual bool visit(Builtin const& _node) { return visitNode(_node); }
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
virtual void endVisit(SourceUnit const& _node) { endVisitNode(_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(TypeClassInstantiation const& _node) { endVisitNode(_node); }
|
||||||
virtual void endVisit(TypeDefinition const& _node) { endVisitNode(_node); }
|
virtual void endVisit(TypeDefinition const& _node) { endVisitNode(_node); }
|
||||||
virtual void endVisit(TypeClassName const& _node) { endVisitNode(_node); }
|
virtual void endVisit(TypeClassName const& _node) { endVisitNode(_node); }
|
||||||
|
virtual void endVisit(Builtin const& _node) { endVisitNode(_node); }
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -1128,6 +1128,18 @@ void TypeClassName::accept(ASTConstVisitor& _visitor) const
|
|||||||
}
|
}
|
||||||
_visitor.endVisit(*this);
|
_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);
|
||||||
|
}
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user