top | up | prev | next

NewNode Class

Definition at line 510 of Expression.hpp

Constructors

NewNode(const Span& span_)
NewNode(const Span& span_, Node* typeExpr_)

Member Functions

void Accept(Visitor& visitor) override
void AddArgument(Node* argument) override
const NodeList<Node>& Arguments() const
Node* Clone(CloneContext& cloneContext) const override
void Read(AstReader& reader) override
std::string ToString() const override
const Node* TypeExpr() const
Node* TypeExpr()
void Write(AstWriter& writer) override

Member Variables

NodeList<Node> arguments
std::unique_ptr<Node> typeExpr

Constructor Details

NewNode Constructor

sngcm::ast::NewNode::NewNode(const Span& span_)

Definition at line 1187 of Expression.cpp :
1187 : Node(NodeType::newNodespan_)typeExpr()arguments()
1188 {
1189 }


Declaration at line 513 of Expression.hpp


NewNode Constructor

sngcm::ast::NewNode::NewNode(const Span& span_, Node * typeExpr_)

Definition at line 1191 of Expression.cpp :
1191 : Node(NodeType::newNodespan_)typeExpr(typeExpr_)arguments()
1192 {
1193     typeExpr->SetParent(this);
1194 }


Declaration at line 514 of Expression.hpp


Member Function Details

Accept Member Function

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

Definition at line 1208 of Expression.cpp :
1209 {
1210     visitor.Visit(*this);
1211 }


Declaration at line 516 of Expression.hpp

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

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


AddArgument Member Function

void sngcm::ast::NewNode::AddArgument(Node * argument) override

Definition at line 1229 of Expression.cpp :
1230 {
1231     argument->SetParent(this);
1232     arguments.Add(argument);
1233 }


Declaration at line 519 of Expression.hpp

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

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

Called by: sngcm::ast::NewNode::Clone


Arguments Member Function

const NodeList <Node >& sngcm::ast::NewNode::Arguments() const

Definition at line 522 of Expression.hpp :
522 { return arguments; }

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


Clone Member Function

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

Definition at line 1196 of Expression.cpp :
1197 {
1198     NewNode* clone = new NewNode(GetSpan()typeExpr->Clone(cloneContext));
1199     int n = arguments.Count();
1200     for (int i = 0; i < n; ++i)
1201     {
1202         Node* argument = arguments[i];
1203         clone->AddArgument(argument->Clone(cloneContext));
1204     }
1205     return clone;
1206 }


Declaration at line 515 of Expression.hpp

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

Calls: sngcm::ast::NewNode::AddArgument , sngcm::ast::NewNode::Clone , sngcm::ast::Node::Clone , sngcm::ast::Node::GetSpan , sngcm::ast::NodeList::Count

Called by: sngcm::ast::NewNode::Clone


Read Member Function

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

Definition at line 1220 of Expression.cpp :
1221 {
1222     Node::Read(reader);
1223     typeExpr.reset(reader.ReadNode());
1224     typeExpr->SetParent(this);
1225     arguments.Read(reader);
1226     arguments.SetParent(this);
1227 }


Declaration at line 518 of Expression.hpp

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

Calls: sngcm::ast::AstReader::ReadNode , sngcm::ast::Node::Read , sngcm::ast::Node::SetParent , sngcm::ast::NodeList::Read , sngcm::ast::NodeList::SetParent


ToString Member Function

std::string sngcm::ast::NewNode::ToString() const override

Definition at line 1235 of Expression.cpp
Declaration at line 523 of Expression.hpp

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

Calls: sngcm::ast::NewNode::ToString , sngcm::ast::NodeList::Count

Called by: sngcm::ast::NewNode::ToString


TypeExpr Member Function

const Node * sngcm::ast::NewNode::TypeExpr() const

Definition at line 520 of Expression.hpp :
520 { return typeExpr.get(); }


TypeExpr Member Function

Node * sngcm::ast::NewNode::TypeExpr()

Definition at line 521 of Expression.hpp :
521 { return typeExpr.get(); }

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


Write Member Function

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

Definition at line 1213 of Expression.cpp :
1214 {
1215     Node::Write(writer);
1216     writer.Write(typeExpr.get());
1217     arguments.Write(writer);
1218 }


Declaration at line 517 of Expression.hpp

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

Calls: sngcm::ast::Node::Write , sngcm::ast::NodeList::Write


top | up | prev | next