Struct CCompileException#
Defined in File exception.h
Inheritance Relationships#
Base Type#
public sdv::idl::XCompileError
(Struct XCompileError)
Struct Documentation#
-
struct CCompileException : public sdv::idl::XCompileError#
Lexer exception.
Public Functions
-
CCompileException(const sdv::idl::XCompileError &rxCompileError)#
Copy the compile error.
- Parameters:
rxCompileError – [in] Reference to the compile error.
-
template<class ...TAdditionalReason>
explicit CCompileException(const char *szReason, TAdditionalReason... tAdditionalReasons)# Constructor without token and path. The parser might add the last used token.
Remark
The path can be added to the exception using the SetPath function.
- Parameters:
szReason – [in] Zero terminated string containing the reason of the exception. Must not be NULL.
tAdditionalReasons – [in] Optional other reasons.
-
template<class ...TAdditionalReason>
explicit CCompileException(const CToken &rtoken, const char *szReason, TAdditionalReason... tAdditionalReasons)# Constructor without path.
Remark
The path can be added to the exception using the SetPath function.
- Parameters:
rtoken – [in] Token in the source file that triggered the exception.
szReason – [in] Zero terminated string containing the reason of the exception. Must not be NULL.
tAdditionalReasons – [in] Optional other reasons.
-
template<class ...TAdditionalReason>
explicit CCompileException(const std::filesystem::path &rpath, const CToken &rtoken, const char *szReason, TAdditionalReason... tAdditionalReasons)# Constructor with path.
- Parameters:
rpath – [in] Reference to the source file path.
rtoken – [in] Token in the source file that triggered the exception.
szReason – [in] Zero terminated string containing the reason of the exception. Must not be NULL.
tAdditionalReasons – [in] Optional other reasons.
-
std::string GetPath() const#
Get the path.
- Returns:
Reference to the path of the file causing the exception (if there is one).
-
std::string GetReason() const#
Get the reason.
- Returns:
The explanatory text.
-
uint32_t GetLineNo() const#
Get the line number (starts at 1).
- Returns:
The line number or 0 when there is no specific code causing this error.
-
uint32_t GetColNo() const#
Get the column number (starts at 1).
- Returns:
The column number or 0 when there is no specific code causing this error.
-
std::string GetToken() const#
Get the token causing the compilation error.
- Returns:
The token string or an empty string when no specific code is causing this error.
-
std::string GetLine() const#
Get the line containing the error.
- Returns:
The line that contains the error or an empty string when no specific code is causiong this error.
Friends
- friend class CParser
-
CCompileException(const sdv::idl::XCompileError &rxCompileError)#