top | up | prev | next

FunctionNode Class

Definition at line 18 of Function.hpp

Constructors

FunctionNode(NodeType nodeType_, const Span& span_)
FunctionNode(NodeType nodeType_, const Span& span_, Specifiers specifiers_, Node* returnTypeExpr_, const std::u32string& groupId_, Attributes* attributes_)
FunctionNode(const FunctionNode&) delete
FunctionNode(const Span& span_)
FunctionNode(const Span& span_, Specifiers specifiers_, Node* returnTypeExpr_, const std::u32string& groupId_, Attributes* 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
Attributes* 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<Attributes> 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_)

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


Declaration at line 22 of Function.hpp


FunctionNode Constructor

sngcm::ast::FunctionNode::FunctionNode(NodeType nodeType_, const Span& span_, Specifiers specifiers_, Node * returnTypeExpr_, const std::u32string& groupId_, Attributes * attributes_)

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


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_)

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


Declaration at line 21 of Function.hpp


FunctionNode Constructor

sngcm::ast::FunctionNode::FunctionNode(const Span& span_, Specifiers specifiers_, Node * returnTypeExpr_, const std::u32string& groupId_, Attributes * attributes_)

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


Declaration at line 23 of Function.hpp


Member Function Details

Accept Member Function

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

Definition at line 127 of Function.cpp :
128 {
129     visitor.Visit(*this);
130 }


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 221 of Function.cpp :
222 {
223     parameter->SetParent(this);
224     parameters.Add(parameter);
225 }


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 215 of Function.cpp :
216 {
217     templateParameter->SetParent(this);
218     templateParameters.Add(templateParameter);
219 }


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 37 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::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 84 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

Attributes * 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 173 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::ReadCompoundStatementNode , sngcm::ast::AstReader::ReadNode , sngcm::ast::AstReader::ReadSpan , sngcm::ast::AstReader::ReadSpecifiers , sngcm::ast::AstReader::ReadWhereConstraintNode , sngcm::ast::FunctionNode::Read , 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::FunctionNode::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 252 of Function.cpp :
253 {
254     body.reset(body_);
255     body->SetParent(this);
256 }


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 258 of Function.cpp :
259 {
260     bodySource.reset(bodySource_);
261     bodySource->SetParent(this);
262 }


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 246 of Function.cpp :
247 {
248     whereConstraint.reset(whereConstraint_);
249     whereConstraint->SetParent(this);
250 }


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 235 of Function.cpp :
236 {
237     returnTypeExpr.reset(returnTypeExpr_);
238     returnTypeExpr->SetParent(returnTypeExpr_);
239 }


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 241 of Function.cpp :
242 {
243     specifiers = specifiers_;
244 }


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 227 of Function.cpp :
228 {
229     if (bodySource && !body)
230     {
231         SetBody(bodySource.release());
232     }
233 }


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 132 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::Write , sngcm::ast::AstWriter::Write , sngcm::ast::FunctionNode::Write , 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::FunctionNode::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