top | up | prev | next

Sources Class

Definition at line 80 of Sources.hpp

Constructors

Sources(Sources&&) delete
Sources(const Sources&) delete
Sources(const std::vector<std::string>& filePaths)

Member Functions

void AddSymbols(Module* module)
void BindTypes(Module* module)
int Count() const
std::string GetCCList(Module* module, const std::string& sourceFilePath, const std::string& ccText)
int GetNumberOfErrors()
void GetScopes(Module* module)
Source* GetSource(int i)
int GetSourceIndex(const std::string& filePath)
void MakeSourceIndexMap()
ParseResult Parse(Module* module)
ParseResult ParseSource(Module* module, const std::string& sourceFilePath, const std::u32string& sourceCode)
bool Synchronized()
Sources& operator=(Sources&&) delete
Sources& operator=(const Sources&) delete

Member Variables

std::map<std::string, int> sourceIndexMap
std::vector<std::unique_ptr<Source>> sources

Constructor Details

Sources Constructor

cmajor::symbols::Sources::Sources(Sources &&) delete

Definition at line 85 of Sources.hpp


Sources Constructor

cmajor::symbols::Sources::Sources(const Sources &) delete

Definition at line 84 of Sources.hpp


Sources Constructor

cmajor::symbols::Sources::Sources(const std::vector<std::string>& filePaths)

Definition at line 322 of Sources.cpp :
323 {
324     int n = filePaths.size();
325     for (int i = 0; i < n; ++i)
326     {
327         std::unique_ptr<Source> source(new Source(filePaths[i]));
328         sources.push_back(std::move(source));
329     }
330     MakeSourceIndexMap();
331 }


Declaration at line 83 of Sources.hpp


Member Function Details

AddSymbols Member Function

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

Definition at line 424 of Sources.cpp :
425 {
426     for (int i = 0; i < sources.size(); ++i)
427     {
428         Source* source = GetSource(i);
429         source->AddSymbols(module);
430     }
431 }


Declaration at line 93 of Sources.hpp

Calls: cmajor::symbols::Source::AddSymbols , cmajor::symbols::Sources::GetSource


BindTypes Member Function

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

Definition at line 442 of Sources.cpp :
443 {
444     for (int i = 0; i < sources.size(); ++i)
445     {
446         Source* source = GetSource(i);
447         source->BindTypes(module);
448     }
449 }


Declaration at line 95 of Sources.hpp

Calls: cmajor::symbols::Source::BindTypes , cmajor::symbols::Sources::GetSource


Count Member Function

int cmajor::symbols::Sources::Count() const

Definition at line 88 of Sources.hpp :
 88 { return sources.size(); }

Called by: cmajor::symbols::Sources::Parse


GetCCList Member Function

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

Definition at line 584 of Sources.cpp :
585 {
586     int index = GetSourceIndex(sourceFilePath);
587     if (index == -1)
588     {
589         throw std::runtime_error("source file path '" + sourceFilePath + "' not found");
590     }
591     Source* source = GetSource(index);
592     return source->GetCCList(moduleccText);
593 }


Declaration at line 99 of Sources.hpp

Calls: cmajor::symbols::Source::GetCCList , cmajor::symbols::Sources::GetSource , cmajor::symbols::Sources::GetSourceIndex


GetNumberOfErrors Member Function

int cmajor::symbols::Sources::GetNumberOfErrors()

Definition at line 451 of Sources.cpp :
452 {
453     int numberOfErrors = 0;
454     for (int i = 0; i < sources.size(); ++i)
455     {
456         Source* source = GetSource(i);
457         numberOfErrors += source->Errors().size();
458     }
459     return numberOfErrors;
460 }


Declaration at line 96 of Sources.hpp

Calls: cmajor::symbols::Source::Errors , cmajor::symbols::Sources::GetSource


GetScopes Member Function

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

Definition at line 433 of Sources.cpp :
434 {
435     for (int i = 0; i < sources.size(); ++i)
436     {
437         Source* source = GetSource(i);
438         source->GetScopes(module);
439     }
440 }


Declaration at line 94 of Sources.hpp

Calls: cmajor::symbols::Source::GetScopes , cmajor::symbols::Sources::GetSource


GetSource Member Function

Source * cmajor::symbols::Sources::GetSource(int i)

Definition at line 89 of Sources.hpp :
 89 { return sources[i].get(); }

Called by: cmajor::symbols::Sources::AddSymbols , cmajor::symbols::Sources::BindTypes , cmajor::symbols::Sources::GetCCList , cmajor::symbols::Sources::GetNumberOfErrors , cmajor::symbols::Sources::GetScopes , cmajor::symbols::Sources::ParseSource , cmajor::symbols::Sources::Synchronized


GetSourceIndex Member Function

int cmajor::symbols::Sources::GetSourceIndex(const std::string& filePath)

Definition at line 333 of Sources.cpp
Declaration at line 90 of Sources.hpp

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


MakeSourceIndexMap Member Function

void cmajor::symbols::Sources::MakeSourceIndexMap()

Definition at line 346 of Sources.cpp :
347 {
348     sourceIndexMap.clear();
349     int n = sources.size();
350     for (int i = 0; i < n; ++i)
351     {
352         Source* source = sources[i].get();
353         sourceIndexMap[source->FilePath()] = i;
354     }
355 }


Declaration at line 91 of Sources.hpp

Calls: cmajor::symbols::Source::FilePath

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


Parse Member Function

ParseResult cmajor::symbols::Sources::Parse(Module * module)

Definition at line 357 of Sources.cpp
Declaration at line 92 of Sources.hpp

Calls: cmajor::symbols::Exception::Message , cmajor::symbols::Module::Id , cmajor::symbols::Sources::Count


ParseSource Member Function

ParseResult cmajor::symbols::Sources::ParseSource(Module * module, const std::string& sourceFilePath, const std::u32string& sourceCode)

Definition at line 477 of Sources.cpp
Declaration at line 98 of Sources.hpp

Calls: cmajor::symbols::Exception::Message , cmajor::symbols::Module::Id , cmajor::symbols::Source::AddSymbols , cmajor::symbols::Source::BindTypes , cmajor::symbols::Source::CursorContainer , cmajor::symbols::Source::Errors , cmajor::symbols::Source::GetScopes , cmajor::symbols::Source::Parse , cmajor::symbols::Source::RemoveSymbols , cmajor::symbols::Source::SetContent , cmajor::symbols::Source::Synchronized , cmajor::symbols::Sources::GetSource , cmajor::symbols::Sources::GetSourceIndex , cmajor::symbols::Sources::MakeSourceIndexMap , cmajor::symbols::Symbol::FullName


Synchronized Member Function

bool cmajor::symbols::Sources::Synchronized()

Definition at line 462 of Sources.cpp
Declaration at line 97 of Sources.hpp

Calls: cmajor::symbols::Source::Synchronized , cmajor::symbols::Sources::GetSource


operator= Member Function

Sources & cmajor::symbols::Sources::operator=(Sources &&) delete

Definition at line 87 of Sources.hpp


operator= Member Function

Sources & cmajor::symbols::Sources::operator=(const Sources &) delete

Definition at line 86 of Sources.hpp


top | up | prev | next