libqasm
library for handling cQASM files
Public Member Functions | Public Attributes | List of all members
cqasm::v1::analyzer::Scope Class Reference

Scope information. More...

Public Member Functions

 Scope (const resolver::MappingTable &mappings, const resolver::FunctionTable &functions, const resolver::InstructionTable &instruction_set)
 Creates the global scope. More...
 

Public Attributes

resolver::MappingTable mappings
 The mappings visible within this scope. More...
 
resolver::FunctionTable functions
 The functions visible within this scope. More...
 
resolver::InstructionTable instruction_set
 The instruction set visible within this scope. More...
 
tree::Maybe< semantic::Blockblock
 The block associated with this scope, if any. More...
 
bool within_loop
 Whether we're within at least one for, foreach, while, or repeat-until loop. More...
 

Detailed Description

Scope information.

Definition at line 161 of file cqasm-v1-analyzer.cpp.

Collaboration diagram for cqasm::v1::analyzer::Scope:
Collaboration graph
[legend]

Constructor & Destructor Documentation

◆ Scope()

cqasm::v1::analyzer::Scope::Scope ( const resolver::MappingTable mappings,
const resolver::FunctionTable functions,
const resolver::InstructionTable instruction_set 
)
inline

Creates the global scope.

Definition at line 197 of file cqasm-v1-analyzer.cpp.

Member Data Documentation

◆ mappings

resolver::MappingTable cqasm::v1::analyzer::Scope::mappings

The mappings visible within this scope.

Definition at line 167 of file cqasm-v1-analyzer.cpp.

◆ functions

resolver::FunctionTable cqasm::v1::analyzer::Scope::functions

The functions visible within this scope.

Definition at line 172 of file cqasm-v1-analyzer.cpp.

◆ instruction_set

resolver::InstructionTable cqasm::v1::analyzer::Scope::instruction_set

The instruction set visible within this scope.

Definition at line 177 of file cqasm-v1-analyzer.cpp.

◆ block

tree::Maybe<semantic::Block> cqasm::v1::analyzer::Scope::block

The block associated with this scope, if any.

If this is empty, this is the global scope, and the active block is that of the current subcircuit, which is lazily created when needed in case no subcircuit label is explicitly specified, and can thus not easily be populated here.

Definition at line 185 of file cqasm-v1-analyzer.cpp.

◆ within_loop

bool cqasm::v1::analyzer::Scope::within_loop

Whether we're within at least one for, foreach, while, or repeat-until loop.

This is a necessary condition for break and continue statements to be allowed.

Definition at line 192 of file cqasm-v1-analyzer.cpp.


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