top | up | prev | next

CompileUnitNode Class

Definition at line 13 of CompileUnit.hpp

Constructors

CompileUnitNode(const Span& span_, const boost::uuids::uuid& moduleId_)
CompileUnitNode(const Span& span_, const boost::uuids::uuid& moduleId_, const std::string& filePath_)

Member Functions

void Accept(Visitor& visitor) override
Node* Clone(CloneContext& cloneContext) const override
void ComputeLineStarts(const std::u32string& sourceFileContent)
const std::string& FilePath() const
int GetColumn(const Span& span) const override
const NamespaceNode* GlobalNs() const
NamespaceNode* GlobalNs()
const std::string& Hash() const
const std::string& Id()
bool IsProgramMainUnit() const
bool IsSynthesizedUnit() const
const std::vector<int32_t>& LineStarts()
void ResetGlobalNs(NamespaceNode* ns)
void SetHash(const std::string& hash_)
void SetProgramMainUnit()
void SetSynthesizedUnit()

Member Variables

std::string filePath
std::unique_ptr<NamespaceNode> globalNs
std::string hash
std::string id
bool isProgramMainUnit
bool isSynthesizedUnit
std::vector<int32_t> lineStarts

Constructor Details

CompileUnitNode Constructor

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

Definition at line 17 of CompileUnit.cpp :
 17 : Node(NodeType::compileUnitNodespan_moduleId_)globalNs()isSynthesizedUnit(false)isProgramMainUnit(false)
 18 {
 19 }


Declaration at line 16 of CompileUnit.hpp


CompileUnitNode Constructor

sngcm::ast::CompileUnitNode::CompileUnitNode(const Span& span_, const boost::uuids::uuid& moduleId_, const std::string& filePath_)

Definition at line 21 of CompileUnit.cpp :
 21 :
 22 Node(NodeType::compileUnitNodespan_moduleId_)filePath(filePath_)globalNs(new NamespaceNode(span_moduleId_new IdentifierNode(span_moduleId_U"")))isSynthesizedUnit(false)isProgramMainUnit(false)
 23 {
 24 }


Declaration at line 17 of CompileUnit.hpp


Member Function Details

Accept Member Function

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

Definition at line 33 of CompileUnit.cpp :
 34 {
 35     visitor.Visit(*this);
 36 }


Declaration at line 19 of CompileUnit.hpp

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

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


Clone Member Function

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

Definition at line 26 of CompileUnit.cpp :
 27 {
 28     CompileUnitNode* clone = new CompileUnitNode(GetSpan()ModuleId()filePath);
 29     clone->globalNs.reset(static_cast<NamespaceNode*>(globalNs->Clone(cloneContext)));
 30     return clone;
 31 }


Declaration at line 18 of CompileUnit.hpp

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

Calls: sngcm::ast::CompileUnitNode::Clone , sngcm::ast::Node::GetSpan , sngcm::ast::Node::ModuleId

Called by: sngcm::ast::CompileUnitNode::Clone


ComputeLineStarts Member Function

void sngcm::ast::CompileUnitNode::ComputeLineStarts(const std::u32string& sourceFileContent)

Definition at line 43 of CompileUnit.cpp
Declaration at line 24 of CompileUnit.hpp


FilePath Member Function

const std::string& sngcm::ast::CompileUnitNode::FilePath() const

Definition at line 20 of CompileUnit.hpp :
20 { return filePath; }


GetColumn Member Function

int sngcm::ast::CompileUnitNode::GetColumn(const Span& span) const override

Definition at line 62 of CompileUnit.cpp
Declaration at line 28 of CompileUnit.hpp


GlobalNs Member Function

const NamespaceNode * sngcm::ast::CompileUnitNode::GlobalNs() const

Definition at line 21 of CompileUnit.hpp :
21 { return globalNs.get(); }


GlobalNs Member Function

NamespaceNode * sngcm::ast::CompileUnitNode::GlobalNs()

Definition at line 22 of CompileUnit.hpp :
22 { return globalNs.get(); }

Called by: sngcm::ast::ClassMemberArranger::Visit , sngcm::ast::NamespaceCombiner::Visit , sngcm::ast::SourceWriter::Visit , sngcm::ast::UnnamedNamespaceProcessor::Visit


Hash Member Function

const std::string& sngcm::ast::CompileUnitNode::Hash() const

Definition at line 30 of CompileUnit.hpp :
30 { return hash; }


Id Member Function

const std::string& sngcm::ast::CompileUnitNode::Id()

Definition at line 83 of CompileUnit.cpp
Declaration at line 29 of CompileUnit.hpp


IsProgramMainUnit Member Function

bool sngcm::ast::CompileUnitNode::IsProgramMainUnit() const

Definition at line 32 of CompileUnit.hpp :
32 { return isProgramMainUnit; }


IsSynthesizedUnit Member Function

bool sngcm::ast::CompileUnitNode::IsSynthesizedUnit() const

Definition at line 27 of CompileUnit.hpp :
27 { return isSynthesizedUnit; }


LineStarts Member Function

const std::vector<int32_t>& sngcm::ast::CompileUnitNode::LineStarts()

Definition at line 25 of CompileUnit.hpp :
25 { return lineStarts; }


ResetGlobalNs Member Function

void sngcm::ast::CompileUnitNode::ResetGlobalNs(NamespaceNode * ns)

Definition at line 38 of CompileUnit.cpp :
 39 {
 40     globalNs.reset(ns);
 41 }


Declaration at line 23 of CompileUnit.hpp


SetHash Member Function

void sngcm::ast::CompileUnitNode::SetHash(const std::string& hash_)

Definition at line 31 of CompileUnit.hpp :
31 { hash = hash_; }


SetProgramMainUnit Member Function

void sngcm::ast::CompileUnitNode::SetProgramMainUnit()

Definition at line 33 of CompileUnit.hpp :
33 { isProgramMainUnit = true; }


SetSynthesizedUnit Member Function

void sngcm::ast::CompileUnitNode::SetSynthesizedUnit()

Definition at line 26 of CompileUnit.hpp :
26 { isSynthesizedUnit = true; }


top | up | prev | next