libqasm
library for handling cQASM files
Public Member Functions | Public Attributes | List of all members
cqasm::annotations::SourceLocation Class Reference

Source location annotation object, containing source file line numbers etc. More...

Public Member Functions

 SourceLocation (const std::string &filename, uint32_t first_line=0, uint32_t first_column=0, uint32_t last_line=0, uint32_t last_column=0)
 Constructs a source location object. More...
 
void expand_to_include (uint32_t line, uint32_t column=1)
 Expands the location range to contain the given location in the source file. More...
 

Public Attributes

std::string filename
 The name of the source file. More...
 
uint32_t first_line
 The first line of the range, or 0 if unknown. More...
 
uint32_t first_column
 The first column of the range, or 0 if unknown. More...
 
uint32_t last_line
 The last line of the range, or 0 if unknown. More...
 
uint32_t last_column
 The last column of the range, or 0 if unknown. More...
 

Detailed Description

Source location annotation object, containing source file line numbers etc.

Definition at line 19 of file cqasm-annotations.hpp.

#include <cqasm-annotations.hpp>

Collaboration diagram for cqasm::annotations::SourceLocation:
Collaboration graph
[legend]

Constructor & Destructor Documentation

◆ SourceLocation()

cqasm::annotations::SourceLocation::SourceLocation ( const std::string &  filename,
uint32_t  first_line = 0,
uint32_t  first_column = 0,
uint32_t  last_line = 0,
uint32_t  last_column = 0 
)

Constructs a source location object.

Definition at line 14 of file cqasm-annotations.cpp.

Member Function Documentation

◆ expand_to_include()

void cqasm::annotations::SourceLocation::expand_to_include ( uint32_t  line,
uint32_t  column = 1 
)

Expands the location range to contain the given location in the source file.

Definition at line 39 of file cqasm-annotations.cpp.

Member Data Documentation

◆ filename

std::string cqasm::annotations::SourceLocation::filename

The name of the source file.

Definition at line 25 of file cqasm-annotations.hpp.

◆ first_line

uint32_t cqasm::annotations::SourceLocation::first_line

The first line of the range, or 0 if unknown.

Definition at line 30 of file cqasm-annotations.hpp.

◆ first_column

uint32_t cqasm::annotations::SourceLocation::first_column

The first column of the range, or 0 if unknown.

Definition at line 35 of file cqasm-annotations.hpp.

◆ last_line

uint32_t cqasm::annotations::SourceLocation::last_line

The last line of the range, or 0 if unknown.

Definition at line 40 of file cqasm-annotations.hpp.

◆ last_column

uint32_t cqasm::annotations::SourceLocation::last_column

The last column of the range, or 0 if unknown.

Definition at line 45 of file cqasm-annotations.hpp.


The documentation for this class was generated from the following files: