libqasm
library for handling cQASM files
cqasm-v1-values.hpp
Go to the documentation of this file.
1 
7 #pragma once
8 
9 #include "cqasm-v1-ast.hpp"
10 #include "cqasm-v1-values-gen.hpp"
11 #include "cqasm-v1-types.hpp"
12 
13 namespace cqasm {
14 namespace v1 {
15 
20 namespace values {
21 
27 
32 
40 Value promote(const Value &value, const types::Type &type);
41 
45 types::Type type_of(const Value &value);
46 
50 types::Types types_of(const Values &values);
51 
56 void check_const(const Value &value);
57 
62 void check_const(const Values &values);
63 
67 std::ostream &operator<<(std::ostream &os, const Value &value);
68 
72 std::ostream &operator<<(std::ostream &os, const Values &values);
73 
74 } // namespace values
75 } // namespace v1
76 } // namespace cqasm
Defines the types for the cQASM abstract syntax tree, based on the classes from cqasm::tree.
types::Types types_of(const Values &values)
Returns the types of the given values.
std::ostream & operator<<(std::ostream &os, const Value &value)
Stream << overload for a single value.
types::Type type_of(const Value &value)
Returns the type of the given value.
Toplevel namespace with entry points for the new API.
tree::Any< Node > Values
Zero or more cQASM values.
Value promote(const Value &value, const types::Type &type)
Type-checks and (if necessary) promotes the given value to the given type.
Namespace for the "new" cQASM 1.x API.
tree::One< Node > Value
A cQASM value, either known at compile-time or an expression for something only known at runtime...
tree::One< TypeBase > Type
A cQASM type.
::tree::base::Any< T > Any
Definition: cqasm-tree.hpp:29
void check_const(const Value &value)
Throws an AnalysisError if the given value is not a constant, i.e.
tree::Any< TypeBase > Types
Zero or more cQASM types.
Header file for the various classes representing constants, references, and dynamic expressions in cQ...
::tree::base::One< T > One
Definition: cqasm-tree.hpp:26
Defines the types of values available within cQASM&#39;s type system, as well as some utility functions...