top | up | prev | next

Source Class

Definition at line 31 of Sources.hpp

Constructors

Source(const std::string& filePath_)

Member Functions

void AddSymbol(Symbol* symbol)
void AddSymbols(Module* module)
void BindTypes(Module* module)
CompileUnitNode* CompileUnit()
const std::u32string& Content() const
ContainerSymbol* CursorContainer() const
const char32_t* End() const
const std::vector<std::string>& Errors() const
const std::string& FilePath() const
std::string GetCCList(Module* module, const std::string& ccText)
void GetScopes(Module* module)
std::vector<CCSymbolEntry> LookupSymbolsBeginningWith(const std::u32string& prefix)
void Parse(const boost::uuids::uuid& moduleId, int index)
void Read()
void RemoveSymbols()
void SetContent(const std::u32string& content_)
const char32_t* Start() const
bool Synchronized() const

Member Variables

std::vector<AliasNode*> aliasNodes
std::unique_ptr<CompileUnitNode> compileUnit
std::u32string content
ContainerSymbol* cursorContainer
ContainerScope* cursorScope
std::vector<std::string> errors
std::string filePath
std::unique_ptr<FileScope> fileScope
std::vector<NamespaceImportNode*> namespaceImports
std::vector<Symbol*> symbols
bool synchronized

Constructor Details

Source Constructor

cmajor::symbols::Source::Source(const std::string& filePath_)

Definition at line 72 of Sources.cpp :
 72 : filePath(filePath_)cursorScope(nullptr)cursorContainer(nullptr)synchronized(false)
 73 {
 74 }


Declaration at line 34 of Sources.hpp


Member Function Details

AddSymbol Member Function

void cmajor::symbols::Source::AddSymbol(Symbol * symbol)

Definition at line 115 of Sources.cpp :
116 {
117     symbols.push_back(symbol);
118 }


Declaration at line 46 of Sources.hpp

Called by: cmajor::symbols::SymbolCreatorVisitor::Visit , cmajor::symbols::SymbolCreatorVisitor::Visit , cmajor::symbols::SymbolCreatorVisitor::Visit , cmajor::symbols::SymbolCreatorVisitor::Visit , cmajor::symbols::SymbolCreatorVisitor::Visit , cmajor::symbols::SymbolCreatorVisitor::Visit , cmajor::symbols::SymbolCreatorVisitor::Visit , cmajor::symbols::SymbolCreatorVisitor::Visit , cmajor::symbols::SymbolCreatorVisitor::Visit , cmajor::symbols::SymbolCreatorVisitor::Visit


AddSymbols Member Function

void cmajor::symbols::Source::AddSymbols(Module * module)

Definition at line 120 of Sources.cpp
Declaration at line 47 of Sources.hpp

Calls: cmajor::symbols::Exception::Message , cmajor::symbols::Module::GetSymbolTable , cmajor::symbols::SymbolCreatorVisitor::SetEditMode , cmajor::symbols::SymbolCreatorVisitor::SetSource , cmajor::symbols::SymbolTable::AliasNodes , cmajor::symbols::SymbolTable::CursorContainer , cmajor::symbols::SymbolTable::NamespaceImports , cmajor::symbols::SymbolTable::ResetMainFunctionSymbol

Called by: cmajor::symbols::Sources::AddSymbols , cmajor::symbols::Sources::ParseSource


BindTypes Member Function

void cmajor::symbols::Source::BindTypes(Module * module)

Definition at line 217 of Sources.cpp
Declaration at line 50 of Sources.hpp

Calls: cmajor::symbols::Exception::Message

Called by: cmajor::symbols::Sources::BindTypes , cmajor::symbols::Sources::ParseSource


CompileUnit Member Function

CompileUnitNode * cmajor::symbols::Source::CompileUnit()

Definition at line 45 of Sources.hpp :
 45 { return compileUnit.get(); }


Content Member Function

const std::u32string& cmajor::symbols::Source::Content() const

Definition at line 38 of Sources.hpp :
 38 { return content; }


CursorContainer Member Function

ContainerSymbol * cmajor::symbols::Source::CursorContainer() const

Definition at line 44 of Sources.hpp :
 44 { return cursorContainer; }

Called by: cmajor::symbols::Sources::ParseSource


End Member Function

const char32_t * cmajor::symbols::Source::End() const

Definition at line 40 of Sources.hpp :
 40 { return content.c_str() + content.size(); }

Called by: cmajor::symbols::Source::Parse


Errors Member Function

const std::vector<std::string>& cmajor::symbols::Source::Errors() const

Definition at line 42 of Sources.hpp :
 42 { return errors; }

Called by: cmajor::symbols::Source::Parse , cmajor::symbols::Sources::GetNumberOfErrors , cmajor::symbols::Sources::ParseSource


FilePath Member Function

const std::string& cmajor::symbols::Source::FilePath() const

Definition at line 35 of Sources.hpp :
 35 { return filePath; }

Called by: cmajor::symbols::Source::Parse , cmajor::symbols::Sources::MakeSourceIndexMap


GetCCList Member Function

std::string cmajor::symbols::Source::GetCCList(Module * module, const std::string& ccText)

Definition at line 250 of Sources.cpp
Declaration at line 52 of Sources.hpp

Calls: cmajor::symbols::Source::LookupSymbolsBeginningWith , cmajor::symbols::Symbol::FunctionNoThrow , cmajor::symbols::Symbol::ToCCElement , sngxml::dom::Document::AppendChild , sngxml::dom::Document::Write , sngxml::dom::ParentNode::AppendChild

Called by: cmajor::symbols::Sources::GetCCList


GetScopes Member Function

void cmajor::symbols::Source::GetScopes(Module * module)

Definition at line 155 of Sources.cpp
Declaration at line 49 of Sources.hpp

Calls: cmajor::symbols::ContainerSymbol::GetContainerScope , cmajor::symbols::Exception::Message , cmajor::symbols::Module::GetSymbolTable , cmajor::symbols::SymbolTable::GlobalNs

Called by: cmajor::symbols::Sources::GetScopes , cmajor::symbols::Sources::ParseSource


LookupSymbolsBeginningWith Member Function

std::vector<CCSymbolEntry > cmajor::symbols::Source::LookupSymbolsBeginningWith(const std::u32string& prefix)

Definition at line 241 of Sources.cpp :
242 {
243     if (!cursorScope || !fileScope) return std::vector<CCSymbolEntry>();
244     std::vector<CCSymbolEntry> matches = cursorScope->LookupBeginWith(prefixScopeLookup::this_and_base_and_parent);
245     std::vector<CCSymbolEntry> m = fileScope->LookupBeginWith(prefix);
246     AddMatches(matchesm);
247     return matches;
248 }


Declaration at line 51 of Sources.hpp

Calls: cmajor::symbols::ContainerScope::LookupBeginWith

Called by: cmajor::symbols::Source::GetCCList


Parse Member Function

void cmajor::symbols::Source::Parse(const boost::uuids::uuid& moduleId, int index)

Definition at line 82 of Sources.cpp
Declaration at line 41 of Sources.hpp

Calls: cmajor::symbols::Source::End , cmajor::symbols::Source::Errors , cmajor::symbols::Source::FilePath , cmajor::symbols::Source::Start

Called by: cmajor::symbols::Sources::ParseSource


Read Member Function

void cmajor::symbols::Source::Read()

Definition at line 76 of Sources.cpp :
 77 {
 78     std::string str = ReadFile(filePath);
 79     content = ToUtf32(str);
 80 }


Declaration at line 36 of Sources.hpp


RemoveSymbols Member Function

void cmajor::symbols::Source::RemoveSymbols()

Definition at line 207 of Sources.cpp :
208 {
209     int n = symbols.size();
210     for (int i = n - 1; i >= 0; --i)
211     {
212         std::unique_ptr<Symbol> symbol = symbols[i]->RemoveFromParent();
213     }
214     symbols.clear();
215 }


Declaration at line 48 of Sources.hpp

Called by: cmajor::symbols::Sources::ParseSource


SetContent Member Function

void cmajor::symbols::Source::SetContent(const std::u32string& content_)

Definition at line 110 of Sources.cpp :
111 {
112     content = content_;
113 }


Declaration at line 37 of Sources.hpp

Called by: cmajor::symbols::Sources::ParseSource


Start Member Function

const char32_t * cmajor::symbols::Source::Start() const

Definition at line 39 of Sources.hpp :
 39 { return content.c_str(); }

Called by: cmajor::symbols::Source::Parse


Synchronized Member Function

bool cmajor::symbols::Source::Synchronized() const

Definition at line 43 of Sources.hpp :
 43 { return synchronized; }

Called by: cmajor::symbols::Sources::ParseSource , cmajor::symbols::Sources::Synchronized


top | up | prev | next