nsbaci 1.0
Loading...
Searching...
No Matches
nsbaci::compiler::CompilerResult Struct Reference

Result of a compilation operation. More...

#include <compiler.h>

Inheritance diagram for nsbaci::compiler::CompilerResult:
Collaboration diagram for nsbaci::compiler::CompilerResult:

Public Member Functions

 CompilerResult ()
 Default constructor creates a successful empty result.
 CompilerResult (std::vector< nsbaci::Error > errs)
 Constructs a failed result from a vector of errors.
 CompilerResult (nsbaci::Error error)
 Constructs a failed result from a single error.
 CompilerResult (CompilerResult &&) noexcept=default
CompilerResultoperator= (CompilerResult &&) noexcept=default
 CompilerResult (const CompilerResult &)=default
CompilerResultoperator= (const CompilerResult &)=default
Public Member Functions inherited from nsbaci::BaseResult
 BaseResult ()
 Default constructor creates a successful result.
 BaseResult (std::vector< nsbaci::Error > errs)
 Constructs a result from a vector of errors.
 BaseResult (nsbaci::Error error)
 Constructs a failed result from a single error.
 BaseResult (BaseResult &&) noexcept=default
BaseResultoperator= (BaseResult &&) noexcept=default
 BaseResult (const BaseResult &)=default
BaseResultoperator= (const BaseResult &)=default

Public Attributes

InstructionStream instructions
 Generated p-code instructions.
nsbaci::types::SymbolTable symbols
 Symbol table from compilation.
Public Attributes inherited from nsbaci::BaseResult
bool ok
 True if the operation succeeded.
std::vector< nsbaci::Errorerrors
 Errors encountered (empty if ok is true).

Detailed Description

Result of a compilation operation.

Contains the outcome of a compilation attempt including success/failure status, any error messages, and on success, the generated instruction stream and symbol table.

Note
On failure, the instructions and symbols fields should not be used.

Constructor & Destructor Documentation

◆ CompilerResult() [1/2]

nsbaci::compiler::CompilerResult::CompilerResult ( std::vector< nsbaci::Error > errs)
inlineexplicit

Constructs a failed result from a vector of errors.

Parameters
errsVector of compilation errors.
Here is the call graph for this function:

◆ CompilerResult() [2/2]

nsbaci::compiler::CompilerResult::CompilerResult ( nsbaci::Error error)
inlineexplicit

Constructs a failed result from a single error.

Parameters
errorThe compilation error.
Here is the call graph for this function:

The documentation for this struct was generated from the following file: