libqasm
library for handling cQASM files
|
Visitor class that debug-dumps a tree to a stream. More...
Public Member Functions | |
Dumper (std::ostream &out, int indent=0, ::tree::base::PointerMap *ids=nullptr) | |
Construct a dumping visitor. More... | |
void | visit_node (Node &node) override |
Dumps a Node . More... | |
void | visit_annotated (Annotated &node) override |
Dumps a Annotated node. More... | |
void | visit_annotation_data (AnnotationData &node) override |
Dumps a AnnotationData node. More... | |
void | visit_block (Block &node) override |
Dumps a Block node. More... | |
void | visit_break_statement (BreakStatement &node) override |
Dumps a BreakStatement node. More... | |
void | visit_bundle (Bundle &node) override |
Dumps a Bundle node. More... | |
void | visit_bundle_ext (BundleExt &node) override |
Dumps a BundleExt node. More... | |
void | visit_continue_statement (ContinueStatement &node) override |
Dumps a ContinueStatement node. More... | |
void | visit_error_model (ErrorModel &node) override |
Dumps a ErrorModel node. More... | |
void | visit_for_loop (ForLoop &node) override |
Dumps a ForLoop node. More... | |
void | visit_foreach_loop (ForeachLoop &node) override |
Dumps a ForeachLoop node. More... | |
void | visit_goto_instruction (GotoInstruction &node) override |
Dumps a GotoInstruction node. More... | |
void | visit_if_else (IfElse &node) override |
Dumps a IfElse node. More... | |
void | visit_if_else_branch (IfElseBranch &node) override |
Dumps a IfElseBranch node. More... | |
void | visit_instruction (Instruction &node) override |
Dumps a Instruction node. More... | |
void | visit_instruction_base (InstructionBase &node) override |
Dumps a InstructionBase node. More... | |
void | visit_mapping (Mapping &node) override |
Dumps a Mapping node. More... | |
void | visit_program (Program &node) override |
Dumps a Program node. More... | |
void | visit_repeat_until_loop (RepeatUntilLoop &node) override |
Dumps a RepeatUntilLoop node. More... | |
void | visit_set_instruction (SetInstruction &node) override |
Dumps a SetInstruction node. More... | |
void | visit_statement (Statement &node) override |
Dumps a Statement node. More... | |
void | visit_structured (Structured &node) override |
Dumps a Structured node. More... | |
void | visit_subcircuit (Subcircuit &node) override |
Dumps a Subcircuit node. More... | |
void | visit_variable (Variable &node) override |
Dumps a Variable node. More... | |
void | visit_version (Version &node) override |
Dumps a Version node. More... | |
void | visit_while_loop (WhileLoop &node) override |
Dumps a WhileLoop node. More... | |
![]() | |
void | visit_annotated (Annotated &node) override |
Recursive traversal for Annotated nodes. More... | |
void | visit_annotation_data (AnnotationData &node) override |
Recursive traversal for AnnotationData nodes. More... | |
void | visit_break_statement (BreakStatement &node) override |
Recursive traversal for BreakStatement nodes. More... | |
void | visit_bundle (Bundle &node) override |
Recursive traversal for Bundle nodes. More... | |
void | visit_continue_statement (ContinueStatement &node) override |
Recursive traversal for ContinueStatement nodes. More... | |
void | visit_for_loop (ForLoop &node) override |
Recursive traversal for ForLoop nodes. More... | |
void | visit_foreach_loop (ForeachLoop &node) override |
Recursive traversal for ForeachLoop nodes. More... | |
void | visit_if_else (IfElse &node) override |
Recursive traversal for IfElse nodes. More... | |
void | visit_if_else_branch (IfElseBranch &node) override |
Recursive traversal for IfElseBranch nodes. More... | |
void | visit_instruction (Instruction &node) override |
Recursive traversal for Instruction nodes. More... | |
void | visit_mapping (Mapping &node) override |
Recursive traversal for Mapping nodes. More... | |
void | visit_program (Program &node) override |
Recursive traversal for Program nodes. More... | |
void | visit_repeat_until_loop (RepeatUntilLoop &node) override |
Recursive traversal for RepeatUntilLoop nodes. More... | |
void | visit_statement (Statement &node) override |
Recursive traversal for Statement nodes. More... | |
void | visit_structured (Structured &node) override |
Recursive traversal for Structured nodes. More... | |
void | visit_subcircuit (Subcircuit &node) override |
Recursive traversal for Subcircuit nodes. More... | |
void | visit_version (Version &node) override |
Recursive traversal for Version nodes. More... | |
void | visit_while_loop (WhileLoop &node) override |
Recursive traversal for WhileLoop nodes. More... | |
![]() | |
virtual void | visit_node (Node &node)=0 |
Fallback function for nodes of any type. More... | |
virtual void | visit_annotated (Annotated &node) |
Fallback function for Annotated nodes. More... | |
virtual void | visit_annotation_data (AnnotationData &node) |
Visitor function for AnnotationData nodes. More... | |
virtual void | visit_break_statement (BreakStatement &node) |
Visitor function for BreakStatement nodes. More... | |
virtual void | visit_bundle (Bundle &node) |
Visitor function for Bundle nodes. More... | |
virtual void | visit_continue_statement (ContinueStatement &node) |
Visitor function for ContinueStatement nodes. More... | |
virtual void | visit_for_loop (ForLoop &node) |
Visitor function for ForLoop nodes. More... | |
virtual void | visit_foreach_loop (ForeachLoop &node) |
Visitor function for ForeachLoop nodes. More... | |
virtual void | visit_if_else (IfElse &node) |
Visitor function for IfElse nodes. More... | |
virtual void | visit_if_else_branch (IfElseBranch &node) |
Visitor function for IfElseBranch nodes. More... | |
virtual void | visit_instruction (Instruction &node) |
Visitor function for Instruction nodes. More... | |
virtual void | visit_mapping (Mapping &node) |
Visitor function for Mapping nodes. More... | |
virtual void | visit_program (Program &node) |
Visitor function for Program nodes. More... | |
virtual void | visit_repeat_until_loop (RepeatUntilLoop &node) |
Visitor function for RepeatUntilLoop nodes. More... | |
virtual void | visit_statement (Statement &node) |
Fallback function for Statement nodes. More... | |
virtual void | visit_structured (Structured &node) |
Fallback function for Structured nodes. More... | |
virtual void | visit_subcircuit (Subcircuit &node) |
Visitor function for Subcircuit nodes. More... | |
virtual void | visit_version (Version &node) |
Visitor function for Version nodes. More... | |
virtual void | visit_while_loop (WhileLoop &node) |
Visitor function for WhileLoop nodes. More... | |
![]() | |
virtual | ~VisitorBase ()=default |
Virtual destructor for proper cleanup. More... | |
Protected Member Functions | |
void | write_indent () |
Writes the current indentation level's worth of spaces. More... | |
![]() | |
void | raw_visit_node (Node &node, void *retval) override |
Internal visitor function for nodes of any type. More... | |
void | raw_visit_node (Node &node, void *retval) |
Internal visitor function for nodes of any type. More... | |
void | raw_visit_node (Node &node, void *retval) |
Internal visitor function for nodes of any type. More... | |
void | raw_visit_annotated (Annotated &node, void *retval) override |
Internal visitor function for Annotated nodes. More... | |
void | raw_visit_annotated (Annotated &node, void *retval) |
Internal visitor function for Annotated nodes. More... | |
void | raw_visit_annotated (Annotated &node, void *retval) |
Internal visitor function for Annotated nodes. More... | |
void | raw_visit_annotation_data (AnnotationData &node, void *retval) override |
Internal visitor function for AnnotationData nodes. More... | |
void | raw_visit_annotation_data (AnnotationData &node, void *retval) |
Internal visitor function for AnnotationData nodes. More... | |
void | raw_visit_annotation_data (AnnotationData &node, void *retval) |
Internal visitor function for AnnotationData nodes. More... | |
void | raw_visit_block (Block &node, void *retval) override |
Internal visitor function for Block nodes. More... | |
void | raw_visit_block (Block &node, void *retval) |
Internal visitor function for Block nodes. More... | |
void | raw_visit_block (Block &node, void *retval) |
Internal visitor function for Block nodes. More... | |
void | raw_visit_break_statement (BreakStatement &node, void *retval) override |
Internal visitor function for BreakStatement nodes. More... | |
void | raw_visit_break_statement (BreakStatement &node, void *retval) |
Internal visitor function for BreakStatement nodes. More... | |
void | raw_visit_break_statement (BreakStatement &node, void *retval) |
Internal visitor function for BreakStatement nodes. More... | |
void | raw_visit_bundle (Bundle &node, void *retval) override |
Internal visitor function for Bundle nodes. More... | |
void | raw_visit_bundle (Bundle &node, void *retval) |
Internal visitor function for Bundle nodes. More... | |
void | raw_visit_bundle (Bundle &node, void *retval) |
Internal visitor function for Bundle nodes. More... | |
void | raw_visit_bundle_ext (BundleExt &node, void *retval) override |
Internal visitor function for BundleExt nodes. More... | |
void | raw_visit_bundle_ext (BundleExt &node, void *retval) |
Internal visitor function for BundleExt nodes. More... | |
void | raw_visit_bundle_ext (BundleExt &node, void *retval) |
Internal visitor function for BundleExt nodes. More... | |
void | raw_visit_continue_statement (ContinueStatement &node, void *retval) override |
Internal visitor function for ContinueStatement nodes. More... | |
void | raw_visit_continue_statement (ContinueStatement &node, void *retval) |
Internal visitor function for ContinueStatement nodes. More... | |
void | raw_visit_continue_statement (ContinueStatement &node, void *retval) |
Internal visitor function for ContinueStatement nodes. More... | |
void | raw_visit_error_model (ErrorModel &node, void *retval) override |
Internal visitor function for ErrorModel nodes. More... | |
void | raw_visit_error_model (ErrorModel &node, void *retval) |
Internal visitor function for ErrorModel nodes. More... | |
void | raw_visit_error_model (ErrorModel &node, void *retval) |
Internal visitor function for ErrorModel nodes. More... | |
void | raw_visit_for_loop (ForLoop &node, void *retval) override |
Internal visitor function for ForLoop nodes. More... | |
void | raw_visit_for_loop (ForLoop &node, void *retval) |
Internal visitor function for ForLoop nodes. More... | |
void | raw_visit_for_loop (ForLoop &node, void *retval) |
Internal visitor function for ForLoop nodes. More... | |
void | raw_visit_foreach_loop (ForeachLoop &node, void *retval) override |
Internal visitor function for ForeachLoop nodes. More... | |
void | raw_visit_foreach_loop (ForeachLoop &node, void *retval) |
Internal visitor function for ForeachLoop nodes. More... | |
void | raw_visit_foreach_loop (ForeachLoop &node, void *retval) |
Internal visitor function for ForeachLoop nodes. More... | |
void | raw_visit_goto_instruction (GotoInstruction &node, void *retval) override |
Internal visitor function for GotoInstruction nodes. More... | |
void | raw_visit_goto_instruction (GotoInstruction &node, void *retval) |
Internal visitor function for GotoInstruction nodes. More... | |
void | raw_visit_goto_instruction (GotoInstruction &node, void *retval) |
Internal visitor function for GotoInstruction nodes. More... | |
void | raw_visit_if_else (IfElse &node, void *retval) override |
Internal visitor function for IfElse nodes. More... | |
void | raw_visit_if_else (IfElse &node, void *retval) |
Internal visitor function for IfElse nodes. More... | |
void | raw_visit_if_else (IfElse &node, void *retval) |
Internal visitor function for IfElse nodes. More... | |
void | raw_visit_if_else_branch (IfElseBranch &node, void *retval) override |
Internal visitor function for IfElseBranch nodes. More... | |
void | raw_visit_if_else_branch (IfElseBranch &node, void *retval) |
Internal visitor function for IfElseBranch nodes. More... | |
void | raw_visit_if_else_branch (IfElseBranch &node, void *retval) |
Internal visitor function for IfElseBranch nodes. More... | |
void | raw_visit_instruction (Instruction &node, void *retval) override |
Internal visitor function for Instruction nodes. More... | |
void | raw_visit_instruction (Instruction &node, void *retval) |
Internal visitor function for Instruction nodes. More... | |
void | raw_visit_instruction (Instruction &node, void *retval) |
Internal visitor function for Instruction nodes. More... | |
void | raw_visit_instruction_base (InstructionBase &node, void *retval) override |
Internal visitor function for InstructionBase nodes. More... | |
void | raw_visit_instruction_base (InstructionBase &node, void *retval) |
Internal visitor function for InstructionBase nodes. More... | |
void | raw_visit_instruction_base (InstructionBase &node, void *retval) |
Internal visitor function for InstructionBase nodes. More... | |
void | raw_visit_mapping (Mapping &node, void *retval) override |
Internal visitor function for Mapping nodes. More... | |
void | raw_visit_mapping (Mapping &node, void *retval) |
Internal visitor function for Mapping nodes. More... | |
void | raw_visit_mapping (Mapping &node, void *retval) |
Internal visitor function for Mapping nodes. More... | |
void | raw_visit_program (Program &node, void *retval) override |
Internal visitor function for Program nodes. More... | |
void | raw_visit_program (Program &node, void *retval) |
Internal visitor function for Program nodes. More... | |
void | raw_visit_program (Program &node, void *retval) |
Internal visitor function for Program nodes. More... | |
void | raw_visit_repeat_until_loop (RepeatUntilLoop &node, void *retval) override |
Internal visitor function for RepeatUntilLoop nodes. More... | |
void | raw_visit_repeat_until_loop (RepeatUntilLoop &node, void *retval) |
Internal visitor function for RepeatUntilLoop nodes. More... | |
void | raw_visit_repeat_until_loop (RepeatUntilLoop &node, void *retval) |
Internal visitor function for RepeatUntilLoop nodes. More... | |
void | raw_visit_set_instruction (SetInstruction &node, void *retval) override |
Internal visitor function for SetInstruction nodes. More... | |
void | raw_visit_set_instruction (SetInstruction &node, void *retval) |
Internal visitor function for SetInstruction nodes. More... | |
void | raw_visit_set_instruction (SetInstruction &node, void *retval) |
Internal visitor function for SetInstruction nodes. More... | |
void | raw_visit_statement (Statement &node, void *retval) override |
Internal visitor function for Statement nodes. More... | |
void | raw_visit_statement (Statement &node, void *retval) |
Internal visitor function for Statement nodes. More... | |
void | raw_visit_statement (Statement &node, void *retval) |
Internal visitor function for Statement nodes. More... | |
void | raw_visit_structured (Structured &node, void *retval) override |
Internal visitor function for Structured nodes. More... | |
void | raw_visit_structured (Structured &node, void *retval) |
Internal visitor function for Structured nodes. More... | |
void | raw_visit_structured (Structured &node, void *retval) |
Internal visitor function for Structured nodes. More... | |
void | raw_visit_subcircuit (Subcircuit &node, void *retval) override |
Internal visitor function for Subcircuit nodes. More... | |
void | raw_visit_subcircuit (Subcircuit &node, void *retval) |
Internal visitor function for Subcircuit nodes. More... | |
void | raw_visit_subcircuit (Subcircuit &node, void *retval) |
Internal visitor function for Subcircuit nodes. More... | |
void | raw_visit_variable (Variable &node, void *retval) override |
Internal visitor function for Variable nodes. More... | |
void | raw_visit_variable (Variable &node, void *retval) |
Internal visitor function for Variable nodes. More... | |
void | raw_visit_variable (Variable &node, void *retval) |
Internal visitor function for Variable nodes. More... | |
void | raw_visit_version (Version &node, void *retval) override |
Internal visitor function for Version nodes. More... | |
void | raw_visit_version (Version &node, void *retval) |
Internal visitor function for Version nodes. More... | |
void | raw_visit_version (Version &node, void *retval) |
Internal visitor function for Version nodes. More... | |
void | raw_visit_while_loop (WhileLoop &node, void *retval) override |
Internal visitor function for WhileLoop nodes. More... | |
void | raw_visit_while_loop (WhileLoop &node, void *retval) |
Internal visitor function for WhileLoop nodes. More... | |
void | raw_visit_while_loop (WhileLoop &node, void *retval) |
Internal visitor function for WhileLoop nodes. More... | |
![]() | |
virtual void | raw_visit_node (Node &node, void *retval)=0 |
Internal visitor function for nodes of any type. More... | |
virtual void | raw_visit_annotated (Annotated &node, void *retval)=0 |
Internal visitor function for Annotated nodes. More... | |
virtual void | raw_visit_annotation_data (AnnotationData &node, void *retval)=0 |
Internal visitor function for AnnotationData nodes. More... | |
virtual void | raw_visit_break_statement (BreakStatement &node, void *retval)=0 |
Internal visitor function for BreakStatement nodes. More... | |
virtual void | raw_visit_bundle (Bundle &node, void *retval)=0 |
Internal visitor function for Bundle nodes. More... | |
virtual void | raw_visit_continue_statement (ContinueStatement &node, void *retval)=0 |
Internal visitor function for ContinueStatement nodes. More... | |
virtual void | raw_visit_for_loop (ForLoop &node, void *retval)=0 |
Internal visitor function for ForLoop nodes. More... | |
virtual void | raw_visit_foreach_loop (ForeachLoop &node, void *retval)=0 |
Internal visitor function for ForeachLoop nodes. More... | |
virtual void | raw_visit_if_else (IfElse &node, void *retval)=0 |
Internal visitor function for IfElse nodes. More... | |
virtual void | raw_visit_if_else_branch (IfElseBranch &node, void *retval)=0 |
Internal visitor function for IfElseBranch nodes. More... | |
virtual void | raw_visit_instruction (Instruction &node, void *retval)=0 |
Internal visitor function for Instruction nodes. More... | |
virtual void | raw_visit_mapping (Mapping &node, void *retval)=0 |
Internal visitor function for Mapping nodes. More... | |
virtual void | raw_visit_program (Program &node, void *retval)=0 |
Internal visitor function for Program nodes. More... | |
virtual void | raw_visit_repeat_until_loop (RepeatUntilLoop &node, void *retval)=0 |
Internal visitor function for RepeatUntilLoop nodes. More... | |
virtual void | raw_visit_statement (Statement &node, void *retval)=0 |
Internal visitor function for Statement nodes. More... | |
virtual void | raw_visit_structured (Structured &node, void *retval)=0 |
Internal visitor function for Structured nodes. More... | |
virtual void | raw_visit_subcircuit (Subcircuit &node, void *retval)=0 |
Internal visitor function for Subcircuit nodes. More... | |
virtual void | raw_visit_version (Version &node, void *retval)=0 |
Internal visitor function for Version nodes. More... | |
virtual void | raw_visit_while_loop (WhileLoop &node, void *retval)=0 |
Internal visitor function for WhileLoop nodes. More... | |
Protected Attributes | |
std::ostream & | out |
Output stream to dump to. More... | |
int | indent = 0 |
Current indentation level. More... | |
::tree::base::PointerMap * | ids |
When non-null, the print node IDs from here instead of link contents. More... | |
bool | in_link = false |
Whether we're printing the contents of a link. More... | |
Visitor class that debug-dumps a tree to a stream.
Definition at line 3814 of file cqasm-v1-semantic-gen.hpp.
#include <cqasm-v1-semantic-gen.hpp>
|
inline |
Construct a dumping visitor.
Definition at line 3846 of file cqasm-v1-semantic-gen.hpp.
|
protected |
Writes the current indentation level's worth of spaces.
Definition at line 3938 of file cqasm-v1-semantic-gen.cpp.
|
override |
Dumps a Node
.
Definition at line 3947 of file cqasm-v1-semantic-gen.cpp.
|
override |
Dumps a Annotated
node.
Definition at line 3956 of file cqasm-v1-semantic-gen.cpp.
|
override |
Dumps a AnnotationData
node.
Definition at line 3995 of file cqasm-v1-semantic-gen.cpp.
|
overridevirtual |
Dumps a Block
node.
Reimplemented from cqasm::v1::semantic::RecursiveVisitor.
Definition at line 4082 of file cqasm-v1-semantic-gen.cpp.
|
override |
Dumps a BreakStatement
node.
Definition at line 4121 of file cqasm-v1-semantic-gen.cpp.
|
override |
Dumps a Bundle
node.
Definition at line 4160 of file cqasm-v1-semantic-gen.cpp.
|
overridevirtual |
Dumps a BundleExt
node.
Reimplemented from cqasm::v1::semantic::RecursiveVisitor.
Definition at line 4218 of file cqasm-v1-semantic-gen.cpp.
|
override |
Dumps a ContinueStatement
node.
Definition at line 4276 of file cqasm-v1-semantic-gen.cpp.
|
overridevirtual |
Dumps a ErrorModel
node.
Reimplemented from cqasm::v1::semantic::RecursiveVisitor.
Definition at line 4315 of file cqasm-v1-semantic-gen.cpp.
|
override |
Dumps a ForLoop
node.
Definition at line 4421 of file cqasm-v1-semantic-gen.cpp.
|
override |
Dumps a ForeachLoop
node.
Definition at line 4510 of file cqasm-v1-semantic-gen.cpp.
|
overridevirtual |
Dumps a GotoInstruction
node.
Reimplemented from cqasm::v1::semantic::RecursiveVisitor.
Definition at line 4623 of file cqasm-v1-semantic-gen.cpp.
|
override |
Dumps a IfElse
node.
Definition at line 4697 of file cqasm-v1-semantic-gen.cpp.
|
override |
Dumps a IfElseBranch
node.
Definition at line 4767 of file cqasm-v1-semantic-gen.cpp.
|
override |
Dumps a Instruction
node.
Definition at line 4813 of file cqasm-v1-semantic-gen.cpp.
|
overridevirtual |
Dumps a InstructionBase
node.
Reimplemented from cqasm::v1::semantic::RecursiveVisitor.
Definition at line 4933 of file cqasm-v1-semantic-gen.cpp.
|
override |
Dumps a Mapping
node.
Definition at line 4986 of file cqasm-v1-semantic-gen.cpp.
|
override |
Dumps a Program
node.
Definition at line 5063 of file cqasm-v1-semantic-gen.cpp.
|
override |
Dumps a RepeatUntilLoop
node.
Definition at line 5212 of file cqasm-v1-semantic-gen.cpp.
|
overridevirtual |
Dumps a SetInstruction
node.
Reimplemented from cqasm::v1::semantic::RecursiveVisitor.
Definition at line 5277 of file cqasm-v1-semantic-gen.cpp.
|
override |
Dumps a Statement
node.
Definition at line 5358 of file cqasm-v1-semantic-gen.cpp.
|
override |
Dumps a Structured
node.
Definition at line 5397 of file cqasm-v1-semantic-gen.cpp.
|
override |
Dumps a Subcircuit
node.
Definition at line 5436 of file cqasm-v1-semantic-gen.cpp.
|
overridevirtual |
Dumps a Variable
node.
Reimplemented from cqasm::v1::semantic::RecursiveVisitor.
Definition at line 5554 of file cqasm-v1-semantic-gen.cpp.
|
override |
Dumps a Version
node.
Definition at line 5631 of file cqasm-v1-semantic-gen.cpp.
|
override |
Dumps a WhileLoop
node.
Definition at line 5675 of file cqasm-v1-semantic-gen.cpp.
|
protected |
Output stream to dump to.
Definition at line 3820 of file cqasm-v1-semantic-gen.hpp.
|
protected |
Current indentation level.
Definition at line 3825 of file cqasm-v1-semantic-gen.hpp.
|
protected |
When non-null, the print node IDs from here instead of link contents.
Definition at line 3830 of file cqasm-v1-semantic-gen.hpp.
|
protected |
Whether we're printing the contents of a link.
Definition at line 3834 of file cqasm-v1-semantic-gen.hpp.