top | up | prev | next

FunctionNode Class

Definition at line 18 of Function.hpp

Constructors

FunctionNode(NodeType nodeType_, const Span& span_, const boost::uuids::uuid& moduleId_)
FunctionNode(NodeType nodeType_, const Span& span_, const boost::uuids::uuid& moduleId_, Specifiers specifiers_, Node* returnTypeExpr_, const std::u32string& groupId_, AttributesNode* attributes_)
FunctionNode(const FunctionNode&) delete
FunctionNode(const Span& span_, const boost::uuids::uuid& moduleId_)
FunctionNode(const Span& span_, const boost::uuids::uuid& moduleId_, Specifiers specifiers_, Node* returnTypeExpr_, const std::u32string& groupId_, AttributesNode* attributes_)

Member Functions

void Accept(Visitor& visitor) override
void AddParameter(ParameterNode* parameter) override
void AddTemplateParameter(TemplateParameterNode* templateParameter) override
CompoundStatementNode* Body()
const CompoundStatementNode* Body() const
const CompoundStatementNode* BodySource() const
Node* Clone(CloneContext& cloneContext) const override
void CloneContent(FunctionNode* clone, CloneContext& cloneContext) const
AttributesNode* GetAttributes() const
Specifiers GetSpecifiers() const override
const std::u32string& GroupId() const
const Span& GroupIdSpan() const
bool IsFunctionNode() const override
bool IsProgramMain() const
const NodeList<ParameterNode>& Parameters() const
void Read(AstReader& reader) override
const Node* ReturnTypeExpr() const
Node* ReturnTypeExpr()
void SetBody(CompoundStatementNode* body_)
void SetBodySource(CompoundStatementNode* bodySource_)
void SetConstraint(WhereConstraintNode* whereConstraint_)
void SetGroupIdSpan(const Span& groupIdSpan_)
void SetProgramMain()
void SetReturnTypeExpr(Node* returnTypeExpr_)
void SetSpecifierSpan(const Span& specifierSpan_)
void SetSpecifiers(Specifiers specifiers_)
const Span& SpecifierSpan() const
void SwitchToBody()
const NodeList<TemplateParameterNode>& TemplateParameters() const
WhereConstraintNode* WhereConstraint()
const WhereConstraintNode* WhereConstraint() const
void Write(AstWriter& writer) override
FunctionNode& operator=(const FunctionNode&) delete

Member Variables

std::unique_ptr<AttributesNode> attributes
std::unique_ptr<CompoundStatementNode> body
std::unique_ptr<CompoundStatementNode> bodySource
std::u32string groupId
Span groupIdSpan
NodeList<ParameterNode> parameters
bool programMain
std::unique_ptr<Node> returnTypeExpr
Span specifierSpan
Specifiers specifiers
NodeList<TemplateParameterNode> templateParameters
std::unique_ptr<WhereConstraintNode> whereConstraint

Constructor Details

FunctionNode Constructor

sngcm::ast::FunctionNode::FunctionNode(NodeType nodeType_, const Span& span_, const boost::uuids::uuid& moduleId_)

Definition at line 16 of Function.cpp :
 16 : Node(nodeType_span_moduleId_)specifiers(Specifiers::none)returnTypeExpr()groupId()
 17 parameters()body()bodySource()programMain(false)
 18 {
 19 }


Declaration at line 22 of Function.hpp


FunctionNode Constructor

sngcm::ast::FunctionNode::FunctionNode(NodeType nodeType_, const Span& span_, const boost::uuids::uuid& moduleId_, Specifiers specifiers_, Node * returnTypeExpr_, const std::u32string& groupId_, AttributesNode * attributes_)

Definition at line 30 of Function.cpp :
 30 :
 31 Node(nodeType_span_moduleId_)specifiers(specifiers_)returnTypeExpr(returnTypeExpr_)groupId(groupId_)templateParameters()parameters()body()bodySource()attributes(attributes_)programMain(false)
 32 {
 33     if (returnTypeExpr)
 34     {
 35         returnTypeExpr->SetParent(this);
 36     }
 37 }


Declaration at line 24 of Function.hpp


FunctionNode Constructor

sngcm::ast::FunctionNode::FunctionNode(const FunctionNode &) delete

Definition at line 25 of Function.hpp


FunctionNode Constructor

sngcm::ast::FunctionNode::FunctionNode(const Span& span_, const boost::uuids::uuid& moduleId_)

Definition at line 11 of Function.cpp :
 11 : Node(NodeType::functionNodespan_moduleId_)specifiers(Specifiers::none)returnTypeExpr()groupId()
 12 parameters()body()bodySource()programMain(false)
 13 {
 14 }


Declaration at line 21 of Function.hpp


FunctionNode Constructor

sngcm::ast::FunctionNode::FunctionNode(const Span& span_, const boost::uuids::uuid& moduleId_, Specifiers specifiers_, Node * returnTypeExpr_, const std::u32string& groupId_, AttributesNode * attributes_)

Definition at line 21 of Function.cpp :
 21 :
 22 Node(NodeType::functionNodespan_moduleId_)specifiers(specifiers_)returnTypeExpr(returnTypeExpr_)groupId(groupId_)templateParameters()parameters()body()bodySource()attributes(attributes_)programMain(false)
 23 {
 24     if (returnTypeExpr)
 25     {
 26         returnTypeExpr->SetParent(this);
 27     }
 28 }


Declaration at line 23 of Function.hpp


Member Function Details

Accept Member Function

void sngcm::ast::FunctionNode::Accept(Visitor & visitor) override

Definition at line 130 of Function.cpp :
131 {
132     visitor.Visit(*this);
133 }


Declaration at line 30 of Function.hpp

Base class overridden functions: sngcm::ast::Node::Accept

Derived class overrides: sngcm::ast::ConstructorNode::Accept , sngcm::ast::ConversionFunctionNode::Accept , sngcm::ast::DestructorNode::Accept , sngcm::ast::MemberFunctionNode::Accept , sngcm::ast::StaticConstructorNode::Accept

Calls: sngcm::ast::Visitor::Visit


AddParameter Member Function

void sngcm::ast::FunctionNode::AddParameter(ParameterNode * parameter) override

Definition at line 224 of Function.cpp :
225 {
226     parameter->SetParent(this);
227     parameters.Add(parameter);
228 }


Declaration at line 34 of Function.hpp

Base class overridden functions: sngcm::ast::Node::AddParameter

Calls: sngcm::ast::Node::SetParent , sngcm::ast::NodeList::Add

Called by: sngcm::ast::FunctionNode::Clone , sngcm::ast::FunctionNode::CloneContent


AddTemplateParameter Member Function

void sngcm::ast::FunctionNode::AddTemplateParameter(TemplateParameterNode * templateParameter) override

Definition at line 218 of Function.cpp :
219 {
220     templateParameter->SetParent(this);
221     templateParameters.Add(templateParameter);
222 }


Declaration at line 33 of Function.hpp

Base class overridden functions: sngcm::ast::Node::AddTemplateParameter

Calls: sngcm::ast::Node::SetParent , sngcm::ast::NodeList::Add

Called by: sngcm::ast::FunctionNode::Clone , sngcm::ast::FunctionNode::CloneContent


Body Member Function

CompoundStatementNode * sngcm::ast::FunctionNode::Body()

Definition at line 48 of Function.hpp :
48 { return body.get(); }

Called by: sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit


Body Member Function

const CompoundStatementNode * sngcm::ast::FunctionNode::Body() const

Definition at line 47 of Function.hpp :
47 { return body.get(); }


BodySource Member Function

const CompoundStatementNode * sngcm::ast::FunctionNode::BodySource() const

Definition at line 50 of Function.hpp :
50 { return bodySource.get(); }


Clone Member Function

Node * sngcm::ast::FunctionNode::Clone(CloneContext & cloneContext) const override

Definition at line 39 of Function.cpp
Declaration at line 27 of Function.hpp

Base class overridden functions: sngcm::ast::Node::Clone

Derived class overrides: sngcm::ast::ConstructorNode::Clone , sngcm::ast::ConversionFunctionNode::Clone , sngcm::ast::DestructorNode::Clone , sngcm::ast::MemberFunctionNode::Clone , sngcm::ast::StaticConstructorNode::Clone

Calls: sngcm::ast::CloneContext::InstantiateClassNode , sngcm::ast::CloneContext::InstantiateFunctionNode , sngcm::ast::FunctionNode::AddParameter , sngcm::ast::FunctionNode::AddTemplateParameter , sngcm::ast::FunctionNode::Clone , sngcm::ast::FunctionNode::SetBody , sngcm::ast::FunctionNode::SetBodySource , sngcm::ast::FunctionNode::SetConstraint , sngcm::ast::FunctionNode::SetGroupIdSpan , sngcm::ast::FunctionNode::SetSpecifierSpan , sngcm::ast::Node::GetSpan , sngcm::ast::Node::ModuleId , sngcm::ast::NodeList::Count

Called by: sngcm::ast::FunctionNode::Clone , sngcm::ast::FunctionNode::CloneContent


CloneContent Member Function

void sngcm::ast::FunctionNode::CloneContent(FunctionNode * clone, CloneContext & cloneContext) const

Definition at line 86 of Function.cpp
Declaration at line 29 of Function.hpp

Calls: sngcm::ast::CloneContext::InstantiateClassNode , sngcm::ast::FunctionNode::AddParameter , sngcm::ast::FunctionNode::AddTemplateParameter , sngcm::ast::FunctionNode::Clone , sngcm::ast::FunctionNode::SetBody , sngcm::ast::FunctionNode::SetBodySource , sngcm::ast::FunctionNode::SetConstraint , sngcm::ast::FunctionNode::SetGroupIdSpan , sngcm::ast::FunctionNode::SetReturnTypeExpr , sngcm::ast::FunctionNode::SetSpecifierSpan , sngcm::ast::NodeList::Count

Called by: sngcm::ast::ConstructorNode::Clone , sngcm::ast::ConversionFunctionNode::Clone , sngcm::ast::DestructorNode::Clone , sngcm::ast::MemberFunctionNode::Clone , sngcm::ast::StaticConstructorNode::Clone


GetAttributes Member Function

AttributesNode * sngcm::ast::FunctionNode::GetAttributes() const

Definition at line 54 of Function.hpp :
54 { return attributes.get(); }

Called by: sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit


GetSpecifiers Member Function

Specifiers sngcm::ast::FunctionNode::GetSpecifiers() const override

Definition at line 36 of Function.hpp :
36 { return specifiers; }

Base class overridden functions: sngcm::ast::Node::GetSpecifiers

Called by: sngcm::ast::ConstructorNode::Clone , sngcm::ast::ConversionFunctionNode::IsConst , sngcm::ast::ConversionFunctionNode::SetConst , sngcm::ast::DestructorNode::Clone , sngcm::ast::MemberFunctionNode::IsConst , sngcm::ast::MemberFunctionNode::SetConst , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::StaticConstructorNode::Clone


GroupId Member Function

const std::u32string& sngcm::ast::FunctionNode::GroupId() const

Definition at line 39 of Function.hpp :
39 { return groupId; }

Called by: sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit


GroupIdSpan Member Function

const Span& sngcm::ast::FunctionNode::GroupIdSpan() const

Definition at line 58 of Function.hpp :
58 { return groupIdSpan; }


IsFunctionNode Member Function

bool sngcm::ast::FunctionNode::IsFunctionNode() const override

Definition at line 28 of Function.hpp :
28 { return true; }

Base class overridden functions: sngcm::ast::Node::IsFunctionNode


IsProgramMain Member Function

bool sngcm::ast::FunctionNode::IsProgramMain() const

Definition at line 52 of Function.hpp :
52 { return programMain; }


Parameters Member Function

const NodeList <ParameterNode >& sngcm::ast::FunctionNode::Parameters() const

Definition at line 41 of Function.hpp :
41 { return parameters; }

Called by: sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit


Read Member Function

void sngcm::ast::FunctionNode::Read(AstReader & reader) override

Definition at line 177 of Function.cpp
Declaration at line 32 of Function.hpp

Base class overridden functions: sngcm::ast::Node::Read

Derived class overrides: sngcm::ast::ConstructorNode::Read , sngcm::ast::DestructorNode::Read , sngcm::ast::StaticConstructorNode::Read

Calls: sngcm::ast::AstReader::GetBinaryReader , sngcm::ast::AstReader::ReadAttributesNode , sngcm::ast::AstReader::ReadCompoundStatementNode , sngcm::ast::AstReader::ReadNode , sngcm::ast::AstReader::ReadSpan , sngcm::ast::AstReader::ReadSpecifiers , sngcm::ast::AstReader::ReadWhereConstraintNode , sngcm::ast::Node::Read , sngcm::ast::Node::SetParent , sngcm::ast::NodeList::Read , sngcm::ast::NodeList::SetParent , soulng::util::BinaryReader::ReadBool , soulng::util::BinaryReader::ReadUtf32String

Called by: sngcm::ast::ConstructorNode::Read , sngcm::ast::DestructorNode::Read , sngcm::ast::StaticConstructorNode::Read


ReturnTypeExpr Member Function

const Node * sngcm::ast::FunctionNode::ReturnTypeExpr() const

Definition at line 37 of Function.hpp :
37 { return returnTypeExpr.get(); }


ReturnTypeExpr Member Function

Node * sngcm::ast::FunctionNode::ReturnTypeExpr()

Definition at line 38 of Function.hpp :
38 { return returnTypeExpr.get(); }

Called by: sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit


SetBody Member Function

void sngcm::ast::FunctionNode::SetBody(CompoundStatementNode * body_)

Definition at line 255 of Function.cpp :
256 {
257     body.reset(body_);
258     body->SetParent(this);
259 }


Declaration at line 49 of Function.hpp

Calls: sngcm::ast::Node::SetParent

Called by: sngcm::ast::FunctionNode::Clone , sngcm::ast::FunctionNode::CloneContent , sngcm::ast::FunctionNode::SwitchToBody


SetBodySource Member Function

void sngcm::ast::FunctionNode::SetBodySource(CompoundStatementNode * bodySource_)

Definition at line 261 of Function.cpp :
262 {
263     bodySource.reset(bodySource_);
264     bodySource->SetParent(this);
265 }


Declaration at line 51 of Function.hpp

Calls: sngcm::ast::Node::SetParent

Called by: sngcm::ast::FunctionNode::Clone , sngcm::ast::FunctionNode::CloneContent


SetConstraint Member Function

void sngcm::ast::FunctionNode::SetConstraint(WhereConstraintNode * whereConstraint_)

Definition at line 249 of Function.cpp :
250 {
251     whereConstraint.reset(whereConstraint_);
252     whereConstraint->SetParent(this);
253 }


Declaration at line 46 of Function.hpp

Calls: sngcm::ast::Node::SetParent

Called by: sngcm::ast::FunctionNode::Clone , sngcm::ast::FunctionNode::CloneContent


SetGroupIdSpan Member Function

void sngcm::ast::FunctionNode::SetGroupIdSpan(const Span& groupIdSpan_)

Definition at line 57 of Function.hpp :
57 { groupIdSpan = groupIdSpan_; }

Called by: sngcm::ast::FunctionNode::Clone , sngcm::ast::FunctionNode::CloneContent


SetProgramMain Member Function

void sngcm::ast::FunctionNode::SetProgramMain()

Definition at line 53 of Function.hpp :
53 { programMain = true; }


SetReturnTypeExpr Member Function

void sngcm::ast::FunctionNode::SetReturnTypeExpr(Node * returnTypeExpr_)

Definition at line 238 of Function.cpp :
239 {
240     returnTypeExpr.reset(returnTypeExpr_);
241     returnTypeExpr->SetParent(returnTypeExpr_);
242 }


Declaration at line 42 of Function.hpp

Calls: sngcm::ast::Node::SetParent

Called by: sngcm::ast::FunctionNode::CloneContent


SetSpecifierSpan Member Function

void sngcm::ast::FunctionNode::SetSpecifierSpan(const Span& specifierSpan_)

Definition at line 55 of Function.hpp :
55 { specifierSpan = specifierSpan_; }

Called by: sngcm::ast::FunctionNode::Clone , sngcm::ast::FunctionNode::CloneContent


SetSpecifiers Member Function

void sngcm::ast::FunctionNode::SetSpecifiers(Specifiers specifiers_)

Definition at line 244 of Function.cpp :
245 {
246     specifiers = specifiers_;
247 }


Declaration at line 45 of Function.hpp

Called by: sngcm::ast::ConversionFunctionNode::SetConst , sngcm::ast::MemberFunctionNode::SetConst


SpecifierSpan Member Function

const Span& sngcm::ast::FunctionNode::SpecifierSpan() const

Definition at line 56 of Function.hpp :
56 { return specifierSpan; }


SwitchToBody Member Function

void sngcm::ast::FunctionNode::SwitchToBody()

Definition at line 230 of Function.cpp :
231 {
232     if (bodySource && !body)
233     {
234         SetBody(bodySource.release());
235     }
236 }


Declaration at line 35 of Function.hpp

Calls: sngcm::ast::FunctionNode::SetBody


TemplateParameters Member Function

const NodeList <TemplateParameterNode >& sngcm::ast::FunctionNode::TemplateParameters() const

Definition at line 40 of Function.hpp :
40 { return templateParameters; }

Called by: sngcm::ast::SourceWriter::Visit


WhereConstraint Member Function

WhereConstraintNode * sngcm::ast::FunctionNode::WhereConstraint()

Definition at line 44 of Function.hpp :
44 { return whereConstraint.get(); }

Called by: sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::SourceWriter::Visit


WhereConstraint Member Function

const WhereConstraintNode * sngcm::ast::FunctionNode::WhereConstraint() const

Definition at line 43 of Function.hpp :
43 { return whereConstraint.get(); }


Write Member Function

void sngcm::ast::FunctionNode::Write(AstWriter & writer) override

Definition at line 135 of Function.cpp
Declaration at line 31 of Function.hpp

Base class overridden functions: sngcm::ast::Node::Write

Derived class overrides: sngcm::ast::ConstructorNode::Write , sngcm::ast::DestructorNode::Write , sngcm::ast::StaticConstructorNode::Write

Calls: sngcm::ast::AstWriter::GetBinaryWriter , sngcm::ast::AstWriter::SpanConversionModuleId , sngcm::ast::AstWriter::Write , sngcm::ast::AstWriter::Write , sngcm::ast::Node::ModuleId , sngcm::ast::Node::Write , sngcm::ast::NodeList::Write , soulng::util::BinaryWriter::Write , soulng::util::BinaryWriter::Write

Called by: sngcm::ast::ConstructorNode::Write , sngcm::ast::DestructorNode::Write , sngcm::ast::StaticConstructorNode::Write


operator= Member Function

FunctionNode & sngcm::ast::FunctionNode::operator=(const FunctionNode &) delete

Definition at line 26 of Function.hpp


top | up | prev | next