#ifndef PARSECONTEXT_H #define PARSECONTEXT_H #include "sourceerror.h" #include #include class SourceFile { std::string fileName; std::string source; std::vector lineOffsets; public: // qqq source je CIJELI comdel fajl, // za inicijalizaciju source se koristi std::move, a možda treba biti referenca??? SourceFile(std::string fileName, std::string source); const std::string& getFileName() const; const std::string getLine(unsigned line) const; void addLineOffset(unsigned offset); }; class ParseContext { std::string applicationDir; std::vector fileMap; public: ParseContext(); unsigned addFile(const std::string& fileName, const std::string& source); SourceFile& getFile(unsigned file); void formatError(const SourceError &sourceError, std::ostream &stream, const std::string& ErrorOrWarning); }; #endif // PARSECONTEXT_H