libqasm
library for handling cQASM files
|
Addition operator. More...
Public Member Functions | |
Add (const One< Expression > &lhs=One< Expression >(), const One< Expression > &rhs=One< Expression >()) | |
Constructor. More... | |
void | find_reachable (::tree::base::PointerMap &map) const override |
Registers all reachable nodes with the given PointerMap. More... | |
void | check_complete (const ::tree::base::PointerMap &map) const override |
Returns whether this Add is complete/fully defined. More... | |
NodeType | type () const override |
Returns the NodeType of this node. More... | |
Add * | as_add () override |
Interprets this node to a node of type Add. More... | |
const Add * | as_add () const override |
Interprets this node to a node of type Add. More... | |
One< Node > | copy () const override |
Returns a shallow copy of this node. More... | |
One< Node > | clone () const override |
Returns a deep copy of this node. More... | |
bool | equals (const Node &rhs) const override |
Value-based equality operator. More... | |
bool | operator== (const Node &rhs) const override |
Pointer-based equality operator. More... | |
void | serialize (::tree::cbor::MapWriter &map, const ::tree::base::PointerMap &ids) const override |
Serializes this node to the given map. More... | |
![]() | |
ArithOp (const One< Expression > &lhs=One< Expression >(), const One< Expression > &rhs=One< Expression >()) | |
Constructor. More... | |
ArithOp * | as_arith_op () override |
Interprets this node to a node of type ArithOp. More... | |
const ArithOp * | as_arith_op () const override |
Interprets this node to a node of type ArithOp. More... | |
![]() | |
BinaryOp (const One< Expression > &lhs=One< Expression >(), const One< Expression > &rhs=One< Expression >()) | |
Constructor. More... | |
BinaryOp * | as_binary_op () override |
Interprets this node to a node of type BinaryOp. More... | |
const BinaryOp * | as_binary_op () const override |
Interprets this node to a node of type BinaryOp. More... | |
![]() | |
Expression * | as_expression () override |
Interprets this node to a node of type Expression. More... | |
const Expression * | as_expression () const override |
Interprets this node to a node of type Expression. More... | |
![]() | |
bool | operator!= (const Node &rhs) const |
Pointer-based inequality operator. More... | |
template<typename T > | |
T | visit (Visitor< T > &visitor) |
Visit this object. More... | |
void | dump (std::ostream &out=std::cout, int indent=0) |
Writes a debug dump of this node to the given stream. More... | |
void | dump_seq (std::ostream &out=std::cout, int indent=0) |
Alternate debug dump that represents links and node uniqueness via sequence number tags. More... | |
virtual Annotated * | as_annotated () |
Interprets this node to a node of type Annotated. More... | |
virtual const Annotated * | as_annotated () const |
Interprets this node to a node of type Annotated. More... | |
virtual AnnotationData * | as_annotation_data () |
Interprets this node to a node of type AnnotationData. More... | |
virtual const AnnotationData * | as_annotation_data () const |
Interprets this node to a node of type AnnotationData. More... | |
virtual Assignment * | as_assignment () |
Interprets this node to a node of type Assignment. More... | |
virtual const Assignment * | as_assignment () const |
Interprets this node to a node of type Assignment. More... | |
virtual BitwiseAnd * | as_bitwise_and () |
Interprets this node to a node of type BitwiseAnd. More... | |
virtual const BitwiseAnd * | as_bitwise_and () const |
Interprets this node to a node of type BitwiseAnd. More... | |
virtual BitwiseNot * | as_bitwise_not () |
Interprets this node to a node of type BitwiseNot. More... | |
virtual const BitwiseNot * | as_bitwise_not () const |
Interprets this node to a node of type BitwiseNot. More... | |
virtual BitwiseOp * | as_bitwise_op () |
Interprets this node to a node of type BitwiseOp. More... | |
virtual const BitwiseOp * | as_bitwise_op () const |
Interprets this node to a node of type BitwiseOp. More... | |
virtual BitwiseOr * | as_bitwise_or () |
Interprets this node to a node of type BitwiseOr. More... | |
virtual const BitwiseOr * | as_bitwise_or () const |
Interprets this node to a node of type BitwiseOr. More... | |
virtual BitwiseXor * | as_bitwise_xor () |
Interprets this node to a node of type BitwiseXor. More... | |
virtual const BitwiseXor * | as_bitwise_xor () const |
Interprets this node to a node of type BitwiseXor. More... | |
virtual BreakStatement * | as_break_statement () |
Interprets this node to a node of type BreakStatement. More... | |
virtual const BreakStatement * | as_break_statement () const |
Interprets this node to a node of type BreakStatement. More... | |
virtual Bundle * | as_bundle () |
Interprets this node to a node of type Bundle. More... | |
virtual const Bundle * | as_bundle () const |
Interprets this node to a node of type Bundle. More... | |
virtual CmpEq * | as_cmp_eq () |
Interprets this node to a node of type CmpEq. More... | |
virtual const CmpEq * | as_cmp_eq () const |
Interprets this node to a node of type CmpEq. More... | |
virtual CmpGe * | as_cmp_ge () |
Interprets this node to a node of type CmpGe. More... | |
virtual const CmpGe * | as_cmp_ge () const |
Interprets this node to a node of type CmpGe. More... | |
virtual CmpGt * | as_cmp_gt () |
Interprets this node to a node of type CmpGt. More... | |
virtual const CmpGt * | as_cmp_gt () const |
Interprets this node to a node of type CmpGt. More... | |
virtual CmpLe * | as_cmp_le () |
Interprets this node to a node of type CmpLe. More... | |
virtual const CmpLe * | as_cmp_le () const |
Interprets this node to a node of type CmpLe. More... | |
virtual CmpLt * | as_cmp_lt () |
Interprets this node to a node of type CmpLt. More... | |
virtual const CmpLt * | as_cmp_lt () const |
Interprets this node to a node of type CmpLt. More... | |
virtual CmpNe * | as_cmp_ne () |
Interprets this node to a node of type CmpNe. More... | |
virtual const CmpNe * | as_cmp_ne () const |
Interprets this node to a node of type CmpNe. More... | |
virtual CmpOp * | as_cmp_op () |
Interprets this node to a node of type CmpOp. More... | |
virtual const CmpOp * | as_cmp_op () const |
Interprets this node to a node of type CmpOp. More... | |
virtual ContinueStatement * | as_continue_statement () |
Interprets this node to a node of type ContinueStatement. More... | |
virtual const ContinueStatement * | as_continue_statement () const |
Interprets this node to a node of type ContinueStatement. More... | |
virtual Divide * | as_divide () |
Interprets this node to a node of type Divide. More... | |
virtual const Divide * | as_divide () const |
Interprets this node to a node of type Divide. More... | |
virtual ErroneousExpression * | as_erroneous_expression () |
Interprets this node to a node of type ErroneousExpression. More... | |
virtual const ErroneousExpression * | as_erroneous_expression () const |
Interprets this node to a node of type ErroneousExpression. More... | |
virtual ErroneousProgram * | as_erroneous_program () |
Interprets this node to a node of type ErroneousProgram. More... | |
virtual const ErroneousProgram * | as_erroneous_program () const |
Interprets this node to a node of type ErroneousProgram. More... | |
virtual ErroneousStatement * | as_erroneous_statement () |
Interprets this node to a node of type ErroneousStatement. More... | |
virtual const ErroneousStatement * | as_erroneous_statement () const |
Interprets this node to a node of type ErroneousStatement. More... | |
virtual ExpressionList * | as_expression_list () |
Interprets this node to a node of type ExpressionList. More... | |
virtual const ExpressionList * | as_expression_list () const |
Interprets this node to a node of type ExpressionList. More... | |
virtual FloatLiteral * | as_float_literal () |
Interprets this node to a node of type FloatLiteral. More... | |
virtual const FloatLiteral * | as_float_literal () const |
Interprets this node to a node of type FloatLiteral. More... | |
virtual ForLoop * | as_for_loop () |
Interprets this node to a node of type ForLoop. More... | |
virtual const ForLoop * | as_for_loop () const |
Interprets this node to a node of type ForLoop. More... | |
virtual ForeachLoop * | as_foreach_loop () |
Interprets this node to a node of type ForeachLoop. More... | |
virtual const ForeachLoop * | as_foreach_loop () const |
Interprets this node to a node of type ForeachLoop. More... | |
virtual FunctionCall * | as_function_call () |
Interprets this node to a node of type FunctionCall. More... | |
virtual const FunctionCall * | as_function_call () const |
Interprets this node to a node of type FunctionCall. More... | |
virtual Identifier * | as_identifier () |
Interprets this node to a node of type Identifier. More... | |
virtual const Identifier * | as_identifier () const |
Interprets this node to a node of type Identifier. More... | |
virtual IfElse * | as_if_else () |
Interprets this node to a node of type IfElse. More... | |
virtual const IfElse * | as_if_else () const |
Interprets this node to a node of type IfElse. More... | |
virtual IfElseBranch * | as_if_else_branch () |
Interprets this node to a node of type IfElseBranch. More... | |
virtual const IfElseBranch * | as_if_else_branch () const |
Interprets this node to a node of type IfElseBranch. More... | |
virtual Index * | as_index () |
Interprets this node to a node of type Index. More... | |
virtual const Index * | as_index () const |
Interprets this node to a node of type Index. More... | |
virtual IndexEntry * | as_index_entry () |
Interprets this node to a node of type IndexEntry. More... | |
virtual const IndexEntry * | as_index_entry () const |
Interprets this node to a node of type IndexEntry. More... | |
virtual IndexItem * | as_index_item () |
Interprets this node to a node of type IndexItem. More... | |
virtual const IndexItem * | as_index_item () const |
Interprets this node to a node of type IndexItem. More... | |
virtual IndexList * | as_index_list () |
Interprets this node to a node of type IndexList. More... | |
virtual const IndexList * | as_index_list () const |
Interprets this node to a node of type IndexList. More... | |
virtual IndexRange * | as_index_range () |
Interprets this node to a node of type IndexRange. More... | |
virtual const IndexRange * | as_index_range () const |
Interprets this node to a node of type IndexRange. More... | |
virtual Instruction * | as_instruction () |
Interprets this node to a node of type Instruction. More... | |
virtual const Instruction * | as_instruction () const |
Interprets this node to a node of type Instruction. More... | |
virtual IntDivide * | as_int_divide () |
Interprets this node to a node of type IntDivide. More... | |
virtual const IntDivide * | as_int_divide () const |
Interprets this node to a node of type IntDivide. More... | |
virtual IntegerLiteral * | as_integer_literal () |
Interprets this node to a node of type IntegerLiteral. More... | |
virtual const IntegerLiteral * | as_integer_literal () const |
Interprets this node to a node of type IntegerLiteral. More... | |
virtual JsonLiteral * | as_json_literal () |
Interprets this node to a node of type JsonLiteral. More... | |
virtual const JsonLiteral * | as_json_literal () const |
Interprets this node to a node of type JsonLiteral. More... | |
virtual LogicalAnd * | as_logical_and () |
Interprets this node to a node of type LogicalAnd. More... | |
virtual const LogicalAnd * | as_logical_and () const |
Interprets this node to a node of type LogicalAnd. More... | |
virtual LogicalNot * | as_logical_not () |
Interprets this node to a node of type LogicalNot. More... | |
virtual const LogicalNot * | as_logical_not () const |
Interprets this node to a node of type LogicalNot. More... | |
virtual LogicalOp * | as_logical_op () |
Interprets this node to a node of type LogicalOp. More... | |
virtual const LogicalOp * | as_logical_op () const |
Interprets this node to a node of type LogicalOp. More... | |
virtual LogicalOr * | as_logical_or () |
Interprets this node to a node of type LogicalOr. More... | |
virtual const LogicalOr * | as_logical_or () const |
Interprets this node to a node of type LogicalOr. More... | |
virtual LogicalXor * | as_logical_xor () |
Interprets this node to a node of type LogicalXor. More... | |
virtual const LogicalXor * | as_logical_xor () const |
Interprets this node to a node of type LogicalXor. More... | |
virtual Mapping * | as_mapping () |
Interprets this node to a node of type Mapping. More... | |
virtual const Mapping * | as_mapping () const |
Interprets this node to a node of type Mapping. More... | |
virtual MatrixLiteral * | as_matrix_literal () |
Interprets this node to a node of type MatrixLiteral. More... | |
virtual const MatrixLiteral * | as_matrix_literal () const |
Interprets this node to a node of type MatrixLiteral. More... | |
virtual Modulo * | as_modulo () |
Interprets this node to a node of type Modulo. More... | |
virtual const Modulo * | as_modulo () const |
Interprets this node to a node of type Modulo. More... | |
virtual Multiply * | as_multiply () |
Interprets this node to a node of type Multiply. More... | |
virtual const Multiply * | as_multiply () const |
Interprets this node to a node of type Multiply. More... | |
virtual Negate * | as_negate () |
Interprets this node to a node of type Negate. More... | |
virtual const Negate * | as_negate () const |
Interprets this node to a node of type Negate. More... | |
virtual Power * | as_power () |
Interprets this node to a node of type Power. More... | |
virtual const Power * | as_power () const |
Interprets this node to a node of type Power. More... | |
virtual Program * | as_program () |
Interprets this node to a node of type Program. More... | |
virtual const Program * | as_program () const |
Interprets this node to a node of type Program. More... | |
virtual RepeatUntilLoop * | as_repeat_until_loop () |
Interprets this node to a node of type RepeatUntilLoop. More... | |
virtual const RepeatUntilLoop * | as_repeat_until_loop () const |
Interprets this node to a node of type RepeatUntilLoop. More... | |
virtual Root * | as_root () |
Interprets this node to a node of type Root. More... | |
virtual const Root * | as_root () const |
Interprets this node to a node of type Root. More... | |
virtual ShiftLeft * | as_shift_left () |
Interprets this node to a node of type ShiftLeft. More... | |
virtual const ShiftLeft * | as_shift_left () const |
Interprets this node to a node of type ShiftLeft. More... | |
virtual ShiftOp * | as_shift_op () |
Interprets this node to a node of type ShiftOp. More... | |
virtual const ShiftOp * | as_shift_op () const |
Interprets this node to a node of type ShiftOp. More... | |
virtual ShiftRightArith * | as_shift_right_arith () |
Interprets this node to a node of type ShiftRightArith. More... | |
virtual const ShiftRightArith * | as_shift_right_arith () const |
Interprets this node to a node of type ShiftRightArith. More... | |
virtual ShiftRightLogic * | as_shift_right_logic () |
Interprets this node to a node of type ShiftRightLogic. More... | |
virtual const ShiftRightLogic * | as_shift_right_logic () const |
Interprets this node to a node of type ShiftRightLogic. More... | |
virtual Statement * | as_statement () |
Interprets this node to a node of type Statement. More... | |
virtual const Statement * | as_statement () const |
Interprets this node to a node of type Statement. More... | |
virtual StatementList * | as_statement_list () |
Interprets this node to a node of type StatementList. More... | |
virtual const StatementList * | as_statement_list () const |
Interprets this node to a node of type StatementList. More... | |
virtual StringLiteral * | as_string_literal () |
Interprets this node to a node of type StringLiteral. More... | |
virtual const StringLiteral * | as_string_literal () const |
Interprets this node to a node of type StringLiteral. More... | |
virtual Structured * | as_structured () |
Interprets this node to a node of type Structured. More... | |
virtual const Structured * | as_structured () const |
Interprets this node to a node of type Structured. More... | |
virtual Subcircuit * | as_subcircuit () |
Interprets this node to a node of type Subcircuit. More... | |
virtual const Subcircuit * | as_subcircuit () const |
Interprets this node to a node of type Subcircuit. More... | |
virtual Subtract * | as_subtract () |
Interprets this node to a node of type Subtract. More... | |
virtual const Subtract * | as_subtract () const |
Interprets this node to a node of type Subtract. More... | |
virtual TernaryCond * | as_ternary_cond () |
Interprets this node to a node of type TernaryCond. More... | |
virtual const TernaryCond * | as_ternary_cond () const |
Interprets this node to a node of type TernaryCond. More... | |
virtual UnaryOp * | as_unary_op () |
Interprets this node to a node of type UnaryOp. More... | |
virtual const UnaryOp * | as_unary_op () const |
Interprets this node to a node of type UnaryOp. More... | |
virtual Variables * | as_variables () |
Interprets this node to a node of type Variables. More... | |
virtual const Variables * | as_variables () const |
Interprets this node to a node of type Variables. More... | |
virtual Version * | as_version () |
Interprets this node to a node of type Version. More... | |
virtual const Version * | as_version () const |
Interprets this node to a node of type Version. More... | |
virtual WhileLoop * | as_while_loop () |
Interprets this node to a node of type WhileLoop. More... | |
virtual const WhileLoop * | as_while_loop () const |
Interprets this node to a node of type WhileLoop. More... | |
template<> | |
void | visit (Visitor< void > &visitor) |
Visit this object. More... | |
template<> | |
void | visit (Visitor< void > &visitor) |
Visit this object. More... | |
template<> | |
void | visit (Visitor< void > &visitor) |
Visit this object. More... | |
template<> | |
void | visit (Visitor< void > &visitor) |
Visit this object. More... | |
template<> | |
void | visit (Visitor< void > &visitor) |
Visit this object. More... | |
template<> | |
void | visit (Visitor< void > &visitor) |
Visit this object. More... | |
template<> | |
void | visit (Visitor< void > &visitor) |
Visit this object. More... | |
Static Public Member Functions | |
static std::shared_ptr< Add > | deserialize (const ::tree::cbor::MapReader &map, ::tree::base::IdentifierMap &ids) |
Deserializes the given node. More... | |
![]() | |
static std::shared_ptr< ArithOp > | deserialize (const ::tree::cbor::MapReader &map, ::tree::base::IdentifierMap &ids) |
Deserializes the given node. More... | |
![]() | |
static std::shared_ptr< BinaryOp > | deserialize (const ::tree::cbor::MapReader &map, ::tree::base::IdentifierMap &ids) |
Deserializes the given node. More... | |
![]() | |
static std::shared_ptr< Expression > | deserialize (const ::tree::cbor::MapReader &map, ::tree::base::IdentifierMap &ids) |
Deserializes the given node. More... | |
![]() | |
static std::shared_ptr< Node > | deserialize (const ::tree::cbor::MapReader &map, ::tree::base::IdentifierMap &ids) |
Deserializes the given node. More... | |
Protected Member Functions | |
void | visit_internal (VisitorBase &visitor, void *retval) override |
Helper method for visiting nodes. More... | |
Additional Inherited Members | |
![]() | |
One< Expression > | lhs |
The left-hand side of the expression. More... | |
One< Expression > | rhs |
The right-hand side of the expression. More... | |
Addition operator.
Definition at line 1421 of file cqasm-v1-ast-gen.hpp.
#include <cqasm-v1-ast-gen.hpp>
cqasm::v1::ast::Add::Add | ( | const One< Expression > & | lhs = One<Expression>() , |
const One< Expression > & | rhs = One<Expression>() |
||
) |
Constructor.
Definition at line 1408 of file cqasm-v1-ast-gen.cpp.
|
override |
Registers all reachable nodes with the given PointerMap.
Definition at line 1415 of file cqasm-v1-ast-gen.cpp.
|
override |
Returns whether this Add
is complete/fully defined.
Definition at line 1424 of file cqasm-v1-ast-gen.cpp.
|
overridevirtual |
Returns the NodeType
of this node.
Implements cqasm::v1::ast::Node.
Definition at line 1433 of file cqasm-v1-ast-gen.cpp.
|
overrideprotectedvirtual |
Helper method for visiting nodes.
Implements cqasm::v1::ast::Node.
Definition at line 1440 of file cqasm-v1-ast-gen.cpp.
|
overridevirtual |
Interprets this node to a node of type Add.
Returns null if it has the wrong type.
Reimplemented from cqasm::v1::ast::Node.
Definition at line 1448 of file cqasm-v1-ast-gen.cpp.
|
overridevirtual |
Interprets this node to a node of type Add.
Returns null if it has the wrong type.
Reimplemented from cqasm::v1::ast::Node.
Definition at line 1456 of file cqasm-v1-ast-gen.cpp.
Returns a shallow copy of this node.
Implements cqasm::v1::ast::Node.
Definition at line 1463 of file cqasm-v1-ast-gen.cpp.
Returns a deep copy of this node.
Implements cqasm::v1::ast::Node.
Definition at line 1470 of file cqasm-v1-ast-gen.cpp.
|
overridevirtual |
Value-based equality operator.
Ignores annotations!
Implements cqasm::v1::ast::Node.
Definition at line 1480 of file cqasm-v1-ast-gen.cpp.
|
overridevirtual |
Pointer-based equality operator.
Implements cqasm::v1::ast::Node.
Definition at line 1491 of file cqasm-v1-ast-gen.cpp.
|
overridevirtual |
Serializes this node to the given map.
Implements cqasm::v1::ast::Node.
Definition at line 1502 of file cqasm-v1-ast-gen.cpp.
|
static |
Deserializes the given node.
Writes a debug dump of this node to the given stream.
Definition at line 1520 of file cqasm-v1-ast-gen.cpp.