123456789_123456789_123456789_123456789_123456789_

Class: Prism::DotVisitor

Relationships & Source Files
Namespace Children
Classes:
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: Prism::Visitor
Defined in: lib/prism/dot_visitor.rb

Overview

This visitor provides the ability to call Node#to_dot, which converts a subtree into a graphviz dot graph.

Class Method Summary

Instance Attribute Summary

  • #digraph readonly

    The digraph that is being built.

Instance Method Summary

Visitor - Inherited

#visit_alias_global_variable_node
#visit_alias_method_node

Visit a AliasMethodNode node.

#visit_alternation_pattern_node
#visit_and_node

Visit a AndNode node.

#visit_arguments_node

Visit a ArgumentsNode node.

#visit_array_node

Visit a ArrayNode node.

#visit_array_pattern_node

Visit a ArrayPatternNode node.

#visit_assoc_node

Visit a AssocNode node.

#visit_assoc_splat_node

Visit a AssocSplatNode node.

#visit_back_reference_read_node

Visit a BackReferenceReadNode node.

#visit_begin_node

Visit a BeginNode node.

#visit_block_argument_node

Visit a BlockArgumentNode node.

#visit_block_local_variable_node
#visit_block_node

Visit a BlockNode node.

#visit_block_parameter_node

Visit a BlockParameterNode node.

#visit_block_parameters_node

Visit a BlockParametersNode node.

#visit_break_node

Visit a BreakNode node.

#visit_call_and_write_node

Visit a CallAndWriteNode node.

#visit_call_node

Visit a CallNode node.

#visit_call_operator_write_node

Visit a CallOperatorWriteNode node.

#visit_call_or_write_node

Visit a CallOrWriteNode node.

#visit_call_target_node

Visit a CallTargetNode node.

#visit_capture_pattern_node

Visit a CapturePatternNode node.

#visit_case_match_node

Visit a CaseMatchNode node.

#visit_case_node

Visit a CaseNode node.

#visit_class_node

Visit a ClassNode node.

#visit_class_variable_and_write_node
#visit_class_variable_operator_write_node
#visit_class_variable_or_write_node
#visit_class_variable_read_node

Visit a ClassVariableReadNode node.

#visit_class_variable_target_node
#visit_class_variable_write_node
#visit_constant_and_write_node

Visit a ConstantAndWriteNode node.

#visit_constant_operator_write_node
#visit_constant_or_write_node

Visit a ConstantOrWriteNode node.

#visit_constant_path_and_write_node
#visit_constant_path_node

Visit a ConstantPathNode node.

#visit_constant_path_operator_write_node
#visit_constant_path_or_write_node
#visit_constant_path_target_node
#visit_constant_path_write_node

Visit a ConstantPathWriteNode node.

#visit_constant_read_node

Visit a ConstantReadNode node.

#visit_constant_target_node

Visit a ConstantTargetNode node.

#visit_constant_write_node

Visit a ConstantWriteNode node.

#visit_def_node

Visit a DefNode node.

#visit_defined_node

Visit a DefinedNode node.

#visit_else_node

Visit a ElseNode node.

#visit_embedded_statements_node
#visit_embedded_variable_node

Visit a EmbeddedVariableNode node.

#visit_ensure_node

Visit a EnsureNode node.

#visit_false_node

Visit a FalseNode node.

#visit_find_pattern_node

Visit a FindPatternNode node.

#visit_flip_flop_node

Visit a FlipFlopNode node.

#visit_float_node

Visit a FloatNode node.

#visit_for_node

Visit a ForNode node.

#visit_forwarding_arguments_node
#visit_forwarding_parameter_node
#visit_forwarding_super_node

Visit a ForwardingSuperNode node.

#visit_global_variable_and_write_node
#visit_global_variable_operator_write_node
#visit_global_variable_or_write_node
#visit_global_variable_read_node
#visit_global_variable_target_node
#visit_global_variable_write_node
#visit_hash_node

Visit a HashNode node.

#visit_hash_pattern_node

Visit a HashPatternNode node.

#visit_if_node

Visit a IfNode node.

#visit_imaginary_node

Visit a ImaginaryNode node.

#visit_implicit_node

Visit a ImplicitNode node.

#visit_implicit_rest_node

Visit a ImplicitRestNode node.

#visit_in_node

Visit a InNode node.

#visit_index_and_write_node

Visit a IndexAndWriteNode node.

#visit_index_operator_write_node
#visit_index_or_write_node

Visit a IndexOrWriteNode node.

#visit_index_target_node

Visit a IndexTargetNode node.

#visit_instance_variable_and_write_node
#visit_instance_variable_operator_write_node
#visit_instance_variable_or_write_node
#visit_instance_variable_read_node
#visit_instance_variable_target_node
#visit_instance_variable_write_node
#visit_integer_node

Visit a IntegerNode node.

#visit_interpolated_match_last_line_node
#visit_interpolated_regular_expression_node
#visit_interpolated_string_node
#visit_interpolated_symbol_node
#visit_interpolated_x_string_node
#visit_it_local_variable_read_node
#visit_it_parameters_node

Visit a ItParametersNode node.

#visit_keyword_hash_node

Visit a KeywordHashNode node.

#visit_keyword_rest_parameter_node
#visit_lambda_node

Visit a LambdaNode node.

#visit_local_variable_and_write_node
#visit_local_variable_operator_write_node
#visit_local_variable_or_write_node
#visit_local_variable_read_node

Visit a LocalVariableReadNode node.

#visit_local_variable_target_node
#visit_local_variable_write_node
#visit_match_last_line_node

Visit a MatchLastLineNode node.

#visit_match_predicate_node

Visit a MatchPredicateNode node.

#visit_match_required_node

Visit a MatchRequiredNode node.

#visit_match_write_node

Visit a MatchWriteNode node.

#visit_missing_node

Visit a MissingNode node.

#visit_module_node

Visit a ModuleNode node.

#visit_multi_target_node

Visit a MultiTargetNode node.

#visit_multi_write_node

Visit a MultiWriteNode node.

#visit_next_node

Visit a NextNode node.

#visit_nil_node

Visit a NilNode node.

#visit_no_keywords_parameter_node
#visit_numbered_parameters_node
#visit_numbered_reference_read_node
#visit_optional_keyword_parameter_node
#visit_optional_parameter_node

Visit a OptionalParameterNode node.

#visit_or_node

Visit a OrNode node.

#visit_parameters_node

Visit a ParametersNode node.

#visit_parentheses_node

Visit a ParenthesesNode node.

#visit_pinned_expression_node

Visit a PinnedExpressionNode node.

#visit_pinned_variable_node

Visit a PinnedVariableNode node.

#visit_post_execution_node

Visit a PostExecutionNode node.

#visit_pre_execution_node

Visit a PreExecutionNode node.

#visit_program_node

Visit a ProgramNode node.

#visit_range_node

Visit a RangeNode node.

#visit_rational_node

Visit a RationalNode node.

#visit_redo_node

Visit a RedoNode node.

#visit_regular_expression_node

Visit a RegularExpressionNode node.

#visit_required_keyword_parameter_node
#visit_required_parameter_node

Visit a RequiredParameterNode node.

#visit_rescue_modifier_node

Visit a RescueModifierNode node.

#visit_rescue_node

Visit a RescueNode node.

#visit_rest_parameter_node

Visit a RestParameterNode node.

#visit_retry_node

Visit a RetryNode node.

#visit_return_node

Visit a ReturnNode node.

#visit_self_node

Visit a SelfNode node.

#visit_shareable_constant_node

Visit a ShareableConstantNode node.

#visit_singleton_class_node

Visit a SingletonClassNode node.

#visit_source_encoding_node

Visit a SourceEncodingNode node.

#visit_source_file_node

Visit a SourceFileNode node.

#visit_source_line_node

Visit a SourceLineNode node.

#visit_splat_node

Visit a SplatNode node.

#visit_statements_node

Visit a StatementsNode node.

#visit_string_node

Visit a StringNode node.

#visit_super_node

Visit a SuperNode node.

#visit_symbol_node

Visit a SymbolNode node.

#visit_true_node

Visit a TrueNode node.

#visit_undef_node

Visit a UndefNode node.

#visit_unless_node

Visit a UnlessNode node.

#visit_until_node

Visit a UntilNode node.

#visit_when_node

Visit a WhenNode node.

#visit_while_node

Visit a WhileNode node.

#visit_x_string_node

Visit a XStringNode node.

#visit_yield_node

Visit a YieldNode node.

BasicVisitor - Inherited

#visit

Calls accept on the given node if it is not nil, which in turn should call back into this visitor by calling the appropriate visit_* method.

#visit_all

Visits each node in nodes by calling accept on each one.

#visit_child_nodes

Visits the child nodes of node by calling accept on each one.

Constructor Details

.newDotVisitor

Initialize a new dot visitor.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 110

def initialize
  @digraph = Digraph.new
end

Instance Attribute Details

#digraph (readonly)

The digraph that is being built.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 107

attr_reader :digraph

Instance Method Details

#arguments_node_flags_inspect(node) (private)

Inspect a node that has arguments_node_flags flags to display the flags as a comma-separated list.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4620

def arguments_node_flags_inspect(node)
  flags = [] #: Array[String]
  flags << "contains_forwarding" if node.contains_forwarding?
  flags << "contains_keywords" if node.contains_keywords?
  flags << "contains_keyword_splat" if node.contains_keyword_splat?
  flags << "contains_splat" if node.contains_splat?
  flags << "contains_multiple_splats" if node.contains_multiple_splats?
  flags.join(", ")
end

#array_node_flags_inspect(node) (private)

Inspect a node that has array_node_flags flags to display the flags as a comma-separated list.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4632

def array_node_flags_inspect(node)
  flags = [] #: Array[String]
  flags << "contains_splat" if node.contains_splat?
  flags.join(", ")
end

#call_node_flags_inspect(node) (private)

Inspect a node that has call_node_flags flags to display the flags as a comma-separated list.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4640

def call_node_flags_inspect(node)
  flags = [] #: Array[String]
  flags << "safe_navigation" if node.safe_navigation?
  flags << "variable_call" if node.variable_call?
  flags << "attribute_write" if node.attribute_write?
  flags << "ignore_visibility" if node.ignore_visibility?
  flags.join(", ")
end

#encoding_flags_inspect(node) (private)

Inspect a node that has encoding_flags flags to display the flags as a comma-separated list.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4651

def encoding_flags_inspect(node)
  flags = [] #: Array[String]
  flags << "forced_utf8_encoding" if node.forced_utf8_encoding?
  flags << "forced_binary_encoding" if node.forced_binary_encoding?
  flags.join(", ")
end

#integer_base_flags_inspect(node) (private)

Inspect a node that has integer_base_flags flags to display the flags as a comma-separated list.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4660

def integer_base_flags_inspect(node)
  flags = [] #: Array[String]
  flags << "binary" if node.binary?
  flags << "decimal" if node.decimal?
  flags << "octal" if node.octal?
  flags << "hexadecimal" if node.hexadecimal?
  flags.join(", ")
end

#interpolated_string_node_flags_inspect(node) (private)

Inspect a node that has interpolated_string_node_flags flags to display the flags as a comma-separated list.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4671

def interpolated_string_node_flags_inspect(node)
  flags = [] #: Array[String]
  flags << "frozen" if node.frozen?
  flags << "mutable" if node.mutable?
  flags.join(", ")
end

#keyword_hash_node_flags_inspect(node) (private)

Inspect a node that has keyword_hash_node_flags flags to display the flags as a comma-separated list.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4680

def keyword_hash_node_flags_inspect(node)
  flags = [] #: Array[String]
  flags << "symbol_keys" if node.symbol_keys?
  flags.join(", ")
end

#location_inspect(location) (private)

Inspect a location to display the start and end line and column numbers.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4614

def location_inspect(location)
  "(#{location.start_line},#{location.start_column})-(#{location.end_line},#{location.end_column})"
end

#loop_flags_inspect(node) (private)

Inspect a node that has loop_flags flags to display the flags as a comma-separated list.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4688

def loop_flags_inspect(node)
  flags = [] #: Array[String]
  flags << "begin_modifier" if node.begin_modifier?
  flags.join(", ")
end

#node_id(node) (private)

Generate a unique node ID for a node throughout the digraph.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4609

def node_id(node)
  "Node_#{node.object_id}"
end

#parameter_flags_inspect(node) (private)

Inspect a node that has parameter_flags flags to display the flags as a comma-separated list.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4696

def parameter_flags_inspect(node)
  flags = [] #: Array[String]
  flags << "repeated_parameter" if node.repeated_parameter?
  flags.join(", ")
end

#parentheses_node_flags_inspect(node) (private)

Inspect a node that has parentheses_node_flags flags to display the flags as a comma-separated list.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4704

def parentheses_node_flags_inspect(node)
  flags = [] #: Array[String]
  flags << "multiple_statements" if node.multiple_statements?
  flags.join(", ")
end

#range_flags_inspect(node) (private)

Inspect a node that has range_flags flags to display the flags as a comma-separated list.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4712

def range_flags_inspect(node)
  flags = [] #: Array[String]
  flags << "exclude_end" if node.exclude_end?
  flags.join(", ")
end

#regular_expression_flags_inspect(node) (private)

Inspect a node that has regular_expression_flags flags to display the flags as a comma-separated list.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4720

def regular_expression_flags_inspect(node)
  flags = [] #: Array[String]
  flags << "ignore_case" if node.ignore_case?
  flags << "extended" if node.extended?
  flags << "multi_line" if node.multi_line?
  flags << "once" if node.once?
  flags << "euc_jp" if node.euc_jp?
  flags << "ascii_8bit" if node.ascii_8bit?
  flags << "windows_31j" if node.windows_31j?
  flags << "utf_8" if node.utf_8?
  flags << "forced_utf8_encoding" if node.forced_utf8_encoding?
  flags << "forced_binary_encoding" if node.forced_binary_encoding?
  flags << "forced_us_ascii_encoding" if node.forced_us_ascii_encoding?
  flags.join(", ")
end

#shareable_constant_node_flags_inspect(node) (private)

Inspect a node that has shareable_constant_node_flags flags to display the flags as a comma-separated list.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4738

def shareable_constant_node_flags_inspect(node)
  flags = [] #: Array[String]
  flags << "literal" if node.literal?
  flags << "experimental_everything" if node.experimental_everything?
  flags << "experimental_copy" if node.experimental_copy?
  flags.join(", ")
end

#string_flags_inspect(node) (private)

Inspect a node that has string_flags flags to display the flags as a comma-separated list.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4748

def string_flags_inspect(node)
  flags = [] #: Array[String]
  flags << "forced_utf8_encoding" if node.forced_utf8_encoding?
  flags << "forced_binary_encoding" if node.forced_binary_encoding?
  flags << "frozen" if node.frozen?
  flags << "mutable" if node.mutable?
  flags.join(", ")
end

#symbol_flags_inspect(node) (private)

Inspect a node that has symbol_flags flags to display the flags as a comma-separated list.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4759

def symbol_flags_inspect(node)
  flags = [] #: Array[String]
  flags << "forced_utf8_encoding" if node.forced_utf8_encoding?
  flags << "forced_binary_encoding" if node.forced_binary_encoding?
  flags << "forced_us_ascii_encoding" if node.forced_us_ascii_encoding?
  flags.join(", ")
end

#to_dot

Convert this visitor into a graphviz dot graph string.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 115

def to_dot
  digraph.to_dot
end

#visit_alias_global_variable_node(node)

Visit a AliasGlobalVariableNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 120

def visit_alias_global_variable_node(node)
  table = Table.new("AliasGlobalVariableNode")
  id = node_id(node)

  # new_name
  table.field("new_name", port: true)
  digraph.edge("#{id}:new_name -> #{node_id(node.new_name)};")

  # old_name
  table.field("old_name", port: true)
  digraph.edge("#{id}:old_name -> #{node_id(node.old_name)};")

  # keyword_loc
  table.field("keyword_loc", location_inspect(node.keyword_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_alias_method_node(node)

Visit a AliasMethodNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 145

def visit_alias_method_node(node)
  table = Table.new("AliasMethodNode")
  id = node_id(node)

  # new_name
  table.field("new_name", port: true)
  digraph.edge("#{id}:new_name -> #{node_id(node.new_name)};")

  # old_name
  table.field("old_name", port: true)
  digraph.edge("#{id}:old_name -> #{node_id(node.old_name)};")

  # keyword_loc
  table.field("keyword_loc", location_inspect(node.keyword_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_alternation_pattern_node(node)

Visit a AlternationPatternNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 170

def visit_alternation_pattern_node(node)
  table = Table.new("AlternationPatternNode")
  id = node_id(node)

  # left
  table.field("left", port: true)
  digraph.edge("#{id}:left -> #{node_id(node.left)};")

  # right
  table.field("right", port: true)
  digraph.edge("#{id}:right -> #{node_id(node.right)};")

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_and_node(node)

Visit a AndNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 195

def visit_and_node(node)
  table = Table.new("AndNode")
  id = node_id(node)

  # left
  table.field("left", port: true)
  digraph.edge("#{id}:left -> #{node_id(node.left)};")

  # right
  table.field("right", port: true)
  digraph.edge("#{id}:right -> #{node_id(node.right)};")

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_arguments_node(node)

Visit a ArgumentsNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 220

def visit_arguments_node(node)
  table = Table.new("ArgumentsNode")
  id = node_id(node)

  # flags
  table.field("flags", arguments_node_flags_inspect(node))

  # arguments
  if node.arguments.any?
    table.field("arguments", port: true)

    waypoint = "#{id}_arguments"
    digraph.waypoint("#{waypoint};")

    digraph.edge("#{id}:arguments -> #{waypoint};")
    node.arguments.each { |child| digraph.edge("#{waypoint} -> #{node_id(child)};") }
  else
    table.field("arguments", "[]")
  end

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_array_node(node)

Visit a ArrayNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 250

def visit_array_node(node)
  table = Table.new("ArrayNode")
  id = node_id(node)

  # flags
  table.field("flags", array_node_flags_inspect(node))

  # elements
  if node.elements.any?
    table.field("elements", port: true)

    waypoint = "#{id}_elements"
    digraph.waypoint("#{waypoint};")

    digraph.edge("#{id}:elements -> #{waypoint};")
    node.elements.each { |child| digraph.edge("#{waypoint} -> #{node_id(child)};") }
  else
    table.field("elements", "[]")
  end

  # opening_loc
  unless (opening_loc = node.opening_loc).nil?
    table.field("opening_loc", location_inspect(opening_loc))
  end

  # closing_loc
  unless (closing_loc = node.closing_loc).nil?
    table.field("closing_loc", location_inspect(closing_loc))
  end

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_array_pattern_node(node)

Visit a ArrayPatternNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 290

def visit_array_pattern_node(node)
  table = Table.new("ArrayPatternNode")
  id = node_id(node)

  # constant
  unless (constant = node.constant).nil?
    table.field("constant", port: true)
    digraph.edge("#{id}:constant -> #{node_id(constant)};")
  end

  # requireds
  if node.requireds.any?
    table.field("requireds", port: true)

    waypoint = "#{id}_requireds"
    digraph.waypoint("#{waypoint};")

    digraph.edge("#{id}:requireds -> #{waypoint};")
    node.requireds.each { |child| digraph.edge("#{waypoint} -> #{node_id(child)};") }
  else
    table.field("requireds", "[]")
  end

  # rest
  unless (rest = node.rest).nil?
    table.field("rest", port: true)
    digraph.edge("#{id}:rest -> #{node_id(rest)};")
  end

  # posts
  if node.posts.any?
    table.field("posts", port: true)

    waypoint = "#{id}_posts"
    digraph.waypoint("#{waypoint};")

    digraph.edge("#{id}:posts -> #{waypoint};")
    node.posts.each { |child| digraph.edge("#{waypoint} -> #{node_id(child)};") }
  else
    table.field("posts", "[]")
  end

  # opening_loc
  unless (opening_loc = node.opening_loc).nil?
    table.field("opening_loc", location_inspect(opening_loc))
  end

  # closing_loc
  unless (closing_loc = node.closing_loc).nil?
    table.field("closing_loc", location_inspect(closing_loc))
  end

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_assoc_node(node)

Visit a AssocNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 352

def visit_assoc_node(node)
  table = Table.new("AssocNode")
  id = node_id(node)

  # key
  table.field("key", port: true)
  digraph.edge("#{id}:key -> #{node_id(node.key)};")

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  # operator_loc
  unless (operator_loc = node.operator_loc).nil?
    table.field("operator_loc", location_inspect(operator_loc))
  end

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_assoc_splat_node(node)

Visit a AssocSplatNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 379

def visit_assoc_splat_node(node)
  table = Table.new("AssocSplatNode")
  id = node_id(node)

  # value
  unless (value = node.value).nil?
    table.field("value", port: true)
    digraph.edge("#{id}:value -> #{node_id(value)};")
  end

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_back_reference_read_node(node)

Visit a BackReferenceReadNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 402

def visit_back_reference_read_node(node)
  table = Table.new("BackReferenceReadNode")
  id = node_id(node)

  # name
  table.field("name", node.name.inspect)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_begin_node(node)

Visit a BeginNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 419

def visit_begin_node(node)
  table = Table.new("BeginNode")
  id = node_id(node)

  # begin_keyword_loc
  unless (begin_keyword_loc = node.begin_keyword_loc).nil?
    table.field("begin_keyword_loc", location_inspect(begin_keyword_loc))
  end

  # statements
  unless (statements = node.statements).nil?
    table.field("statements", port: true)
    digraph.edge("#{id}:statements -> #{node_id(statements)};")
  end

  # rescue_clause
  unless (rescue_clause = node.rescue_clause).nil?
    table.field("rescue_clause", port: true)
    digraph.edge("#{id}:rescue_clause -> #{node_id(rescue_clause)};")
  end

  # else_clause
  unless (else_clause = node.else_clause).nil?
    table.field("else_clause", port: true)
    digraph.edge("#{id}:else_clause -> #{node_id(else_clause)};")
  end

  # ensure_clause
  unless (ensure_clause = node.ensure_clause).nil?
    table.field("ensure_clause", port: true)
    digraph.edge("#{id}:ensure_clause -> #{node_id(ensure_clause)};")
  end

  # end_keyword_loc
  unless (end_keyword_loc = node.end_keyword_loc).nil?
    table.field("end_keyword_loc", location_inspect(end_keyword_loc))
  end

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_block_argument_node(node)

Visit a BlockArgumentNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 467

def visit_block_argument_node(node)
  table = Table.new("BlockArgumentNode")
  id = node_id(node)

  # expression
  unless (expression = node.expression).nil?
    table.field("expression", port: true)
    digraph.edge("#{id}:expression -> #{node_id(expression)};")
  end

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_block_local_variable_node(node)

Visit a BlockLocalVariableNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 490

def visit_block_local_variable_node(node)
  table = Table.new("BlockLocalVariableNode")
  id = node_id(node)

  # flags
  table.field("flags", parameter_flags_inspect(node))

  # name
  table.field("name", node.name.inspect)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_block_node(node)

Visit a BlockNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 510

def visit_block_node(node)
  table = Table.new("BlockNode")
  id = node_id(node)

  # locals
  table.field("locals", node.locals.inspect)

  # parameters
  unless (parameters = node.parameters).nil?
    table.field("parameters", port: true)
    digraph.edge("#{id}:parameters -> #{node_id(parameters)};")
  end

  # body
  unless (body = node.body).nil?
    table.field("body", port: true)
    digraph.edge("#{id}:body -> #{node_id(body)};")
  end

  # opening_loc
  table.field("opening_loc", location_inspect(node.opening_loc))

  # closing_loc
  table.field("closing_loc", location_inspect(node.closing_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_block_parameter_node(node)

Visit a BlockParameterNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 545

def visit_block_parameter_node(node)
  table = Table.new("BlockParameterNode")
  id = node_id(node)

  # flags
  table.field("flags", parameter_flags_inspect(node))

  # name
  table.field("name", node.name.inspect)

  # name_loc
  unless (name_loc = node.name_loc).nil?
    table.field("name_loc", location_inspect(name_loc))
  end

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_block_parameters_node(node)

Visit a BlockParametersNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 573

def visit_block_parameters_node(node)
  table = Table.new("BlockParametersNode")
  id = node_id(node)

  # parameters
  unless (parameters = node.parameters).nil?
    table.field("parameters", port: true)
    digraph.edge("#{id}:parameters -> #{node_id(parameters)};")
  end

  # locals
  if node.locals.any?
    table.field("locals", port: true)

    waypoint = "#{id}_locals"
    digraph.waypoint("#{waypoint};")

    digraph.edge("#{id}:locals -> #{waypoint};")
    node.locals.each { |child| digraph.edge("#{waypoint} -> #{node_id(child)};") }
  else
    table.field("locals", "[]")
  end

  # opening_loc
  unless (opening_loc = node.opening_loc).nil?
    table.field("opening_loc", location_inspect(opening_loc))
  end

  # closing_loc
  unless (closing_loc = node.closing_loc).nil?
    table.field("closing_loc", location_inspect(closing_loc))
  end

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_break_node(node)

Visit a BreakNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 616

def visit_break_node(node)
  table = Table.new("BreakNode")
  id = node_id(node)

  # arguments
  unless (arguments = node.arguments).nil?
    table.field("arguments", port: true)
    digraph.edge("#{id}:arguments -> #{node_id(arguments)};")
  end

  # keyword_loc
  table.field("keyword_loc", location_inspect(node.keyword_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_call_and_write_node(node)

Visit a CallAndWriteNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 639

def visit_call_and_write_node(node)
  table = Table.new("CallAndWriteNode")
  id = node_id(node)

  # flags
  table.field("flags", call_node_flags_inspect(node))

  # receiver
  unless (receiver = node.receiver).nil?
    table.field("receiver", port: true)
    digraph.edge("#{id}:receiver -> #{node_id(receiver)};")
  end

  # call_operator_loc
  unless (call_operator_loc = node.call_operator_loc).nil?
    table.field("call_operator_loc", location_inspect(call_operator_loc))
  end

  # message_loc
  unless (message_loc = node.message_loc).nil?
    table.field("message_loc", location_inspect(message_loc))
  end

  # read_name
  table.field("read_name", node.read_name.inspect)

  # write_name
  table.field("write_name", node.write_name.inspect)

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_call_node(node)

Visit a CallNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 685

def visit_call_node(node)
  table = Table.new("CallNode")
  id = node_id(node)

  # flags
  table.field("flags", call_node_flags_inspect(node))

  # receiver
  unless (receiver = node.receiver).nil?
    table.field("receiver", port: true)
    digraph.edge("#{id}:receiver -> #{node_id(receiver)};")
  end

  # call_operator_loc
  unless (call_operator_loc = node.call_operator_loc).nil?
    table.field("call_operator_loc", location_inspect(call_operator_loc))
  end

  # name
  table.field("name", node.name.inspect)

  # message_loc
  unless (message_loc = node.message_loc).nil?
    table.field("message_loc", location_inspect(message_loc))
  end

  # opening_loc
  unless (opening_loc = node.opening_loc).nil?
    table.field("opening_loc", location_inspect(opening_loc))
  end

  # arguments
  unless (arguments = node.arguments).nil?
    table.field("arguments", port: true)
    digraph.edge("#{id}:arguments -> #{node_id(arguments)};")
  end

  # closing_loc
  unless (closing_loc = node.closing_loc).nil?
    table.field("closing_loc", location_inspect(closing_loc))
  end

  # equal_loc
  unless (equal_loc = node.equal_loc).nil?
    table.field("equal_loc", location_inspect(equal_loc))
  end

  # block
  unless (block = node.block).nil?
    table.field("block", port: true)
    digraph.edge("#{id}:block -> #{node_id(block)};")
  end

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_call_operator_write_node(node)

Visit a CallOperatorWriteNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 748

def visit_call_operator_write_node(node)
  table = Table.new("CallOperatorWriteNode")
  id = node_id(node)

  # flags
  table.field("flags", call_node_flags_inspect(node))

  # receiver
  unless (receiver = node.receiver).nil?
    table.field("receiver", port: true)
    digraph.edge("#{id}:receiver -> #{node_id(receiver)};")
  end

  # call_operator_loc
  unless (call_operator_loc = node.call_operator_loc).nil?
    table.field("call_operator_loc", location_inspect(call_operator_loc))
  end

  # message_loc
  unless (message_loc = node.message_loc).nil?
    table.field("message_loc", location_inspect(message_loc))
  end

  # read_name
  table.field("read_name", node.read_name.inspect)

  # write_name
  table.field("write_name", node.write_name.inspect)

  # binary_operator
  table.field("binary_operator", node.binary_operator.inspect)

  # binary_operator_loc
  table.field("binary_operator_loc", location_inspect(node.binary_operator_loc))

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_call_or_write_node(node)

Visit a CallOrWriteNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 797

def visit_call_or_write_node(node)
  table = Table.new("CallOrWriteNode")
  id = node_id(node)

  # flags
  table.field("flags", call_node_flags_inspect(node))

  # receiver
  unless (receiver = node.receiver).nil?
    table.field("receiver", port: true)
    digraph.edge("#{id}:receiver -> #{node_id(receiver)};")
  end

  # call_operator_loc
  unless (call_operator_loc = node.call_operator_loc).nil?
    table.field("call_operator_loc", location_inspect(call_operator_loc))
  end

  # message_loc
  unless (message_loc = node.message_loc).nil?
    table.field("message_loc", location_inspect(message_loc))
  end

  # read_name
  table.field("read_name", node.read_name.inspect)

  # write_name
  table.field("write_name", node.write_name.inspect)

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_call_target_node(node)

Visit a CallTargetNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 843

def visit_call_target_node(node)
  table = Table.new("CallTargetNode")
  id = node_id(node)

  # flags
  table.field("flags", call_node_flags_inspect(node))

  # receiver
  table.field("receiver", port: true)
  digraph.edge("#{id}:receiver -> #{node_id(node.receiver)};")

  # call_operator_loc
  table.field("call_operator_loc", location_inspect(node.call_operator_loc))

  # name
  table.field("name", node.name.inspect)

  # message_loc
  table.field("message_loc", location_inspect(node.message_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_capture_pattern_node(node)

Visit a CapturePatternNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 873

def visit_capture_pattern_node(node)
  table = Table.new("CapturePatternNode")
  id = node_id(node)

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  # target
  table.field("target", port: true)
  digraph.edge("#{id}:target -> #{node_id(node.target)};")

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_case_match_node(node)

Visit a CaseMatchNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 898

def visit_case_match_node(node)
  table = Table.new("CaseMatchNode")
  id = node_id(node)

  # predicate
  unless (predicate = node.predicate).nil?
    table.field("predicate", port: true)
    digraph.edge("#{id}:predicate -> #{node_id(predicate)};")
  end

  # conditions
  if node.conditions.any?
    table.field("conditions", port: true)

    waypoint = "#{id}_conditions"
    digraph.waypoint("#{waypoint};")

    digraph.edge("#{id}:conditions -> #{waypoint};")
    node.conditions.each { |child| digraph.edge("#{waypoint} -> #{node_id(child)};") }
  else
    table.field("conditions", "[]")
  end

  # else_clause
  unless (else_clause = node.else_clause).nil?
    table.field("else_clause", port: true)
    digraph.edge("#{id}:else_clause -> #{node_id(else_clause)};")
  end

  # case_keyword_loc
  table.field("case_keyword_loc", location_inspect(node.case_keyword_loc))

  # end_keyword_loc
  table.field("end_keyword_loc", location_inspect(node.end_keyword_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_case_node(node)

Visit a CaseNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 943

def visit_case_node(node)
  table = Table.new("CaseNode")
  id = node_id(node)

  # predicate
  unless (predicate = node.predicate).nil?
    table.field("predicate", port: true)
    digraph.edge("#{id}:predicate -> #{node_id(predicate)};")
  end

  # conditions
  if node.conditions.any?
    table.field("conditions", port: true)

    waypoint = "#{id}_conditions"
    digraph.waypoint("#{waypoint};")

    digraph.edge("#{id}:conditions -> #{waypoint};")
    node.conditions.each { |child| digraph.edge("#{waypoint} -> #{node_id(child)};") }
  else
    table.field("conditions", "[]")
  end

  # else_clause
  unless (else_clause = node.else_clause).nil?
    table.field("else_clause", port: true)
    digraph.edge("#{id}:else_clause -> #{node_id(else_clause)};")
  end

  # case_keyword_loc
  table.field("case_keyword_loc", location_inspect(node.case_keyword_loc))

  # end_keyword_loc
  table.field("end_keyword_loc", location_inspect(node.end_keyword_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_class_node(node)

Visit a ClassNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 988

def visit_class_node(node)
  table = Table.new("ClassNode")
  id = node_id(node)

  # locals
  table.field("locals", node.locals.inspect)

  # class_keyword_loc
  table.field("class_keyword_loc", location_inspect(node.class_keyword_loc))

  # constant_path
  table.field("constant_path", port: true)
  digraph.edge("#{id}:constant_path -> #{node_id(node.constant_path)};")

  # inheritance_operator_loc
  unless (inheritance_operator_loc = node.inheritance_operator_loc).nil?
    table.field("inheritance_operator_loc", location_inspect(inheritance_operator_loc))
  end

  # superclass
  unless (superclass = node.superclass).nil?
    table.field("superclass", port: true)
    digraph.edge("#{id}:superclass -> #{node_id(superclass)};")
  end

  # body
  unless (body = node.body).nil?
    table.field("body", port: true)
    digraph.edge("#{id}:body -> #{node_id(body)};")
  end

  # end_keyword_loc
  table.field("end_keyword_loc", location_inspect(node.end_keyword_loc))

  # name
  table.field("name", node.name.inspect)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_class_variable_and_write_node(node)

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1035

def visit_class_variable_and_write_node(node)
  table = Table.new("ClassVariableAndWriteNode")
  id = node_id(node)

  # name
  table.field("name", node.name.inspect)

  # name_loc
  table.field("name_loc", location_inspect(node.name_loc))

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_class_variable_operator_write_node(node)

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1062

def visit_class_variable_operator_write_node(node)
  table = Table.new("ClassVariableOperatorWriteNode")
  id = node_id(node)

  # name
  table.field("name", node.name.inspect)

  # name_loc
  table.field("name_loc", location_inspect(node.name_loc))

  # binary_operator_loc
  table.field("binary_operator_loc", location_inspect(node.binary_operator_loc))

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  # binary_operator
  table.field("binary_operator", node.binary_operator.inspect)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_class_variable_or_write_node(node)

Visit a ClassVariableOrWriteNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1092

def visit_class_variable_or_write_node(node)
  table = Table.new("ClassVariableOrWriteNode")
  id = node_id(node)

  # name
  table.field("name", node.name.inspect)

  # name_loc
  table.field("name_loc", location_inspect(node.name_loc))

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_class_variable_read_node(node)

Visit a ClassVariableReadNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1119

def visit_class_variable_read_node(node)
  table = Table.new("ClassVariableReadNode")
  id = node_id(node)

  # name
  table.field("name", node.name.inspect)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_class_variable_target_node(node)

Visit a ClassVariableTargetNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1136

def visit_class_variable_target_node(node)
  table = Table.new("ClassVariableTargetNode")
  id = node_id(node)

  # name
  table.field("name", node.name.inspect)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_class_variable_write_node(node)

Visit a ClassVariableWriteNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1153

def visit_class_variable_write_node(node)
  table = Table.new("ClassVariableWriteNode")
  id = node_id(node)

  # name
  table.field("name", node.name.inspect)

  # name_loc
  table.field("name_loc", location_inspect(node.name_loc))

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_constant_and_write_node(node)

Visit a ConstantAndWriteNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1180

def visit_constant_and_write_node(node)
  table = Table.new("ConstantAndWriteNode")
  id = node_id(node)

  # name
  table.field("name", node.name.inspect)

  # name_loc
  table.field("name_loc", location_inspect(node.name_loc))

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_constant_operator_write_node(node)

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1207

def visit_constant_operator_write_node(node)
  table = Table.new("ConstantOperatorWriteNode")
  id = node_id(node)

  # name
  table.field("name", node.name.inspect)

  # name_loc
  table.field("name_loc", location_inspect(node.name_loc))

  # binary_operator_loc
  table.field("binary_operator_loc", location_inspect(node.binary_operator_loc))

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  # binary_operator
  table.field("binary_operator", node.binary_operator.inspect)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_constant_or_write_node(node)

Visit a ConstantOrWriteNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1237

def visit_constant_or_write_node(node)
  table = Table.new("ConstantOrWriteNode")
  id = node_id(node)

  # name
  table.field("name", node.name.inspect)

  # name_loc
  table.field("name_loc", location_inspect(node.name_loc))

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_constant_path_and_write_node(node)

Visit a ConstantPathAndWriteNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1264

def visit_constant_path_and_write_node(node)
  table = Table.new("ConstantPathAndWriteNode")
  id = node_id(node)

  # target
  table.field("target", port: true)
  digraph.edge("#{id}:target -> #{node_id(node.target)};")

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_constant_path_node(node)

Visit a ConstantPathNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1289

def visit_constant_path_node(node)
  table = Table.new("ConstantPathNode")
  id = node_id(node)

  # parent
  unless (parent = node.parent).nil?
    table.field("parent", port: true)
    digraph.edge("#{id}:parent -> #{node_id(parent)};")
  end

  # name
  table.field("name", node.name.inspect)

  # delimiter_loc
  table.field("delimiter_loc", location_inspect(node.delimiter_loc))

  # name_loc
  table.field("name_loc", location_inspect(node.name_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_constant_path_operator_write_node(node)

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1318

def visit_constant_path_operator_write_node(node)
  table = Table.new("ConstantPathOperatorWriteNode")
  id = node_id(node)

  # target
  table.field("target", port: true)
  digraph.edge("#{id}:target -> #{node_id(node.target)};")

  # binary_operator_loc
  table.field("binary_operator_loc", location_inspect(node.binary_operator_loc))

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  # binary_operator
  table.field("binary_operator", node.binary_operator.inspect)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_constant_path_or_write_node(node)

Visit a ConstantPathOrWriteNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1346

def visit_constant_path_or_write_node(node)
  table = Table.new("ConstantPathOrWriteNode")
  id = node_id(node)

  # target
  table.field("target", port: true)
  digraph.edge("#{id}:target -> #{node_id(node.target)};")

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_constant_path_target_node(node)

Visit a ConstantPathTargetNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1371

def visit_constant_path_target_node(node)
  table = Table.new("ConstantPathTargetNode")
  id = node_id(node)

  # parent
  unless (parent = node.parent).nil?
    table.field("parent", port: true)
    digraph.edge("#{id}:parent -> #{node_id(parent)};")
  end

  # name
  table.field("name", node.name.inspect)

  # delimiter_loc
  table.field("delimiter_loc", location_inspect(node.delimiter_loc))

  # name_loc
  table.field("name_loc", location_inspect(node.name_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_constant_path_write_node(node)

Visit a ConstantPathWriteNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1400

def visit_constant_path_write_node(node)
  table = Table.new("ConstantPathWriteNode")
  id = node_id(node)

  # target
  table.field("target", port: true)
  digraph.edge("#{id}:target -> #{node_id(node.target)};")

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_constant_read_node(node)

Visit a ConstantReadNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1425

def visit_constant_read_node(node)
  table = Table.new("ConstantReadNode")
  id = node_id(node)

  # name
  table.field("name", node.name.inspect)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_constant_target_node(node)

Visit a ConstantTargetNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1442

def visit_constant_target_node(node)
  table = Table.new("ConstantTargetNode")
  id = node_id(node)

  # name
  table.field("name", node.name.inspect)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_constant_write_node(node)

Visit a ConstantWriteNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1459

def visit_constant_write_node(node)
  table = Table.new("ConstantWriteNode")
  id = node_id(node)

  # name
  table.field("name", node.name.inspect)

  # name_loc
  table.field("name_loc", location_inspect(node.name_loc))

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_def_node(node)

Visit a DefNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1486

def visit_def_node(node)
  table = Table.new("DefNode")
  id = node_id(node)

  # name
  table.field("name", node.name.inspect)

  # name_loc
  table.field("name_loc", location_inspect(node.name_loc))

  # receiver
  unless (receiver = node.receiver).nil?
    table.field("receiver", port: true)
    digraph.edge("#{id}:receiver -> #{node_id(receiver)};")
  end

  # parameters
  unless (parameters = node.parameters).nil?
    table.field("parameters", port: true)
    digraph.edge("#{id}:parameters -> #{node_id(parameters)};")
  end

  # body
  unless (body = node.body).nil?
    table.field("body", port: true)
    digraph.edge("#{id}:body -> #{node_id(body)};")
  end

  # locals
  table.field("locals", node.locals.inspect)

  # def_keyword_loc
  table.field("def_keyword_loc", location_inspect(node.def_keyword_loc))

  # operator_loc
  unless (operator_loc = node.operator_loc).nil?
    table.field("operator_loc", location_inspect(operator_loc))
  end

  # lparen_loc
  unless (lparen_loc = node.lparen_loc).nil?
    table.field("lparen_loc", location_inspect(lparen_loc))
  end

  # rparen_loc
  unless (rparen_loc = node.rparen_loc).nil?
    table.field("rparen_loc", location_inspect(rparen_loc))
  end

  # equal_loc
  unless (equal_loc = node.equal_loc).nil?
    table.field("equal_loc", location_inspect(equal_loc))
  end

  # end_keyword_loc
  unless (end_keyword_loc = node.end_keyword_loc).nil?
    table.field("end_keyword_loc", location_inspect(end_keyword_loc))
  end

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_defined_node(node)

Visit a DefinedNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1555

def visit_defined_node(node)
  table = Table.new("DefinedNode")
  id = node_id(node)

  # lparen_loc
  unless (lparen_loc = node.lparen_loc).nil?
    table.field("lparen_loc", location_inspect(lparen_loc))
  end

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  # rparen_loc
  unless (rparen_loc = node.rparen_loc).nil?
    table.field("rparen_loc", location_inspect(rparen_loc))
  end

  # keyword_loc
  table.field("keyword_loc", location_inspect(node.keyword_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_else_node(node)

Visit a ElseNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1586

def visit_else_node(node)
  table = Table.new("ElseNode")
  id = node_id(node)

  # else_keyword_loc
  table.field("else_keyword_loc", location_inspect(node.else_keyword_loc))

  # statements
  unless (statements = node.statements).nil?
    table.field("statements", port: true)
    digraph.edge("#{id}:statements -> #{node_id(statements)};")
  end

  # end_keyword_loc
  unless (end_keyword_loc = node.end_keyword_loc).nil?
    table.field("end_keyword_loc", location_inspect(end_keyword_loc))
  end

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_embedded_statements_node(node)

Visit a EmbeddedStatementsNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1614

def visit_embedded_statements_node(node)
  table = Table.new("EmbeddedStatementsNode")
  id = node_id(node)

  # opening_loc
  table.field("opening_loc", location_inspect(node.opening_loc))

  # statements
  unless (statements = node.statements).nil?
    table.field("statements", port: true)
    digraph.edge("#{id}:statements -> #{node_id(statements)};")
  end

  # closing_loc
  table.field("closing_loc", location_inspect(node.closing_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_embedded_variable_node(node)

Visit a EmbeddedVariableNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1640

def visit_embedded_variable_node(node)
  table = Table.new("EmbeddedVariableNode")
  id = node_id(node)

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  # variable
  table.field("variable", port: true)
  digraph.edge("#{id}:variable -> #{node_id(node.variable)};")

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_ensure_node(node)

Visit a EnsureNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1661

def visit_ensure_node(node)
  table = Table.new("EnsureNode")
  id = node_id(node)

  # ensure_keyword_loc
  table.field("ensure_keyword_loc", location_inspect(node.ensure_keyword_loc))

  # statements
  unless (statements = node.statements).nil?
    table.field("statements", port: true)
    digraph.edge("#{id}:statements -> #{node_id(statements)};")
  end

  # end_keyword_loc
  table.field("end_keyword_loc", location_inspect(node.end_keyword_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_false_node(node)

Visit a FalseNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1687

def visit_false_node(node)
  table = Table.new("FalseNode")
  id = node_id(node)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_find_pattern_node(node)

Visit a FindPatternNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1701

def visit_find_pattern_node(node)
  table = Table.new("FindPatternNode")
  id = node_id(node)

  # constant
  unless (constant = node.constant).nil?
    table.field("constant", port: true)
    digraph.edge("#{id}:constant -> #{node_id(constant)};")
  end

  # left
  table.field("left", port: true)
  digraph.edge("#{id}:left -> #{node_id(node.left)};")

  # requireds
  if node.requireds.any?
    table.field("requireds", port: true)

    waypoint = "#{id}_requireds"
    digraph.waypoint("#{waypoint};")

    digraph.edge("#{id}:requireds -> #{waypoint};")
    node.requireds.each { |child| digraph.edge("#{waypoint} -> #{node_id(child)};") }
  else
    table.field("requireds", "[]")
  end

  # right
  table.field("right", port: true)
  digraph.edge("#{id}:right -> #{node_id(node.right)};")

  # opening_loc
  unless (opening_loc = node.opening_loc).nil?
    table.field("opening_loc", location_inspect(opening_loc))
  end

  # closing_loc
  unless (closing_loc = node.closing_loc).nil?
    table.field("closing_loc", location_inspect(closing_loc))
  end

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_flip_flop_node(node)

Visit a FlipFlopNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1752

def visit_flip_flop_node(node)
  table = Table.new("FlipFlopNode")
  id = node_id(node)

  # flags
  table.field("flags", range_flags_inspect(node))

  # left
  unless (left = node.left).nil?
    table.field("left", port: true)
    digraph.edge("#{id}:left -> #{node_id(left)};")
  end

  # right
  unless (right = node.right).nil?
    table.field("right", port: true)
    digraph.edge("#{id}:right -> #{node_id(right)};")
  end

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_float_node(node)

Visit a FloatNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1784

def visit_float_node(node)
  table = Table.new("FloatNode")
  id = node_id(node)

  # value
  table.field("value", node.value.inspect)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_for_node(node)

Visit a ForNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1801

def visit_for_node(node)
  table = Table.new("ForNode")
  id = node_id(node)

  # index
  table.field("index", port: true)
  digraph.edge("#{id}:index -> #{node_id(node.index)};")

  # collection
  table.field("collection", port: true)
  digraph.edge("#{id}:collection -> #{node_id(node.collection)};")

  # statements
  unless (statements = node.statements).nil?
    table.field("statements", port: true)
    digraph.edge("#{id}:statements -> #{node_id(statements)};")
  end

  # for_keyword_loc
  table.field("for_keyword_loc", location_inspect(node.for_keyword_loc))

  # in_keyword_loc
  table.field("in_keyword_loc", location_inspect(node.in_keyword_loc))

  # do_keyword_loc
  unless (do_keyword_loc = node.do_keyword_loc).nil?
    table.field("do_keyword_loc", location_inspect(do_keyword_loc))
  end

  # end_keyword_loc
  table.field("end_keyword_loc", location_inspect(node.end_keyword_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_forwarding_arguments_node(node)

Visit a ForwardingArgumentsNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1843

def visit_forwarding_arguments_node(node)
  table = Table.new("ForwardingArgumentsNode")
  id = node_id(node)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_forwarding_parameter_node(node)

Visit a ForwardingParameterNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1857

def visit_forwarding_parameter_node(node)
  table = Table.new("ForwardingParameterNode")
  id = node_id(node)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_forwarding_super_node(node)

Visit a ForwardingSuperNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1871

def visit_forwarding_super_node(node)
  table = Table.new("ForwardingSuperNode")
  id = node_id(node)

  # block
  unless (block = node.block).nil?
    table.field("block", port: true)
    digraph.edge("#{id}:block -> #{node_id(block)};")
  end

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_global_variable_and_write_node(node)

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1891

def visit_global_variable_and_write_node(node)
  table = Table.new("GlobalVariableAndWriteNode")
  id = node_id(node)

  # name
  table.field("name", node.name.inspect)

  # name_loc
  table.field("name_loc", location_inspect(node.name_loc))

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_global_variable_operator_write_node(node)

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1918

def visit_global_variable_operator_write_node(node)
  table = Table.new("GlobalVariableOperatorWriteNode")
  id = node_id(node)

  # name
  table.field("name", node.name.inspect)

  # name_loc
  table.field("name_loc", location_inspect(node.name_loc))

  # binary_operator_loc
  table.field("binary_operator_loc", location_inspect(node.binary_operator_loc))

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  # binary_operator
  table.field("binary_operator", node.binary_operator.inspect)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_global_variable_or_write_node(node)

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1948

def visit_global_variable_or_write_node(node)
  table = Table.new("GlobalVariableOrWriteNode")
  id = node_id(node)

  # name
  table.field("name", node.name.inspect)

  # name_loc
  table.field("name_loc", location_inspect(node.name_loc))

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_global_variable_read_node(node)

Visit a GlobalVariableReadNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1975

def visit_global_variable_read_node(node)
  table = Table.new("GlobalVariableReadNode")
  id = node_id(node)

  # name
  table.field("name", node.name.inspect)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_global_variable_target_node(node)

Visit a GlobalVariableTargetNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 1992

def visit_global_variable_target_node(node)
  table = Table.new("GlobalVariableTargetNode")
  id = node_id(node)

  # name
  table.field("name", node.name.inspect)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_global_variable_write_node(node)

Visit a GlobalVariableWriteNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 2009

def visit_global_variable_write_node(node)
  table = Table.new("GlobalVariableWriteNode")
  id = node_id(node)

  # name
  table.field("name", node.name.inspect)

  # name_loc
  table.field("name_loc", location_inspect(node.name_loc))

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_hash_node(node)

Visit a HashNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 2036

def visit_hash_node(node)
  table = Table.new("HashNode")
  id = node_id(node)

  # opening_loc
  table.field("opening_loc", location_inspect(node.opening_loc))

  # elements
  if node.elements.any?
    table.field("elements", port: true)

    waypoint = "#{id}_elements"
    digraph.waypoint("#{waypoint};")

    digraph.edge("#{id}:elements -> #{waypoint};")
    node.elements.each { |child| digraph.edge("#{waypoint} -> #{node_id(child)};") }
  else
    table.field("elements", "[]")
  end

  # closing_loc
  table.field("closing_loc", location_inspect(node.closing_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_hash_pattern_node(node)

Visit a HashPatternNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 2069

def visit_hash_pattern_node(node)
  table = Table.new("HashPatternNode")
  id = node_id(node)

  # constant
  unless (constant = node.constant).nil?
    table.field("constant", port: true)
    digraph.edge("#{id}:constant -> #{node_id(constant)};")
  end

  # elements
  if node.elements.any?
    table.field("elements", port: true)

    waypoint = "#{id}_elements"
    digraph.waypoint("#{waypoint};")

    digraph.edge("#{id}:elements -> #{waypoint};")
    node.elements.each { |child| digraph.edge("#{waypoint} -> #{node_id(child)};") }
  else
    table.field("elements", "[]")
  end

  # rest
  unless (rest = node.rest).nil?
    table.field("rest", port: true)
    digraph.edge("#{id}:rest -> #{node_id(rest)};")
  end

  # opening_loc
  unless (opening_loc = node.opening_loc).nil?
    table.field("opening_loc", location_inspect(opening_loc))
  end

  # closing_loc
  unless (closing_loc = node.closing_loc).nil?
    table.field("closing_loc", location_inspect(closing_loc))
  end

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_if_node(node)

Visit a IfNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 2118

def visit_if_node(node)
  table = Table.new("IfNode")
  id = node_id(node)

  # if_keyword_loc
  unless (if_keyword_loc = node.if_keyword_loc).nil?
    table.field("if_keyword_loc", location_inspect(if_keyword_loc))
  end

  # predicate
  table.field("predicate", port: true)
  digraph.edge("#{id}:predicate -> #{node_id(node.predicate)};")

  # then_keyword_loc
  unless (then_keyword_loc = node.then_keyword_loc).nil?
    table.field("then_keyword_loc", location_inspect(then_keyword_loc))
  end

  # statements
  unless (statements = node.statements).nil?
    table.field("statements", port: true)
    digraph.edge("#{id}:statements -> #{node_id(statements)};")
  end

  # subsequent
  unless (subsequent = node.subsequent).nil?
    table.field("subsequent", port: true)
    digraph.edge("#{id}:subsequent -> #{node_id(subsequent)};")
  end

  # end_keyword_loc
  unless (end_keyword_loc = node.end_keyword_loc).nil?
    table.field("end_keyword_loc", location_inspect(end_keyword_loc))
  end

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_imaginary_node(node)

Visit a ImaginaryNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 2163

def visit_imaginary_node(node)
  table = Table.new("ImaginaryNode")
  id = node_id(node)

  # numeric
  table.field("numeric", port: true)
  digraph.edge("#{id}:numeric -> #{node_id(node.numeric)};")

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_implicit_node(node)

Visit a ImplicitNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 2181

def visit_implicit_node(node)
  table = Table.new("ImplicitNode")
  id = node_id(node)

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_implicit_rest_node(node)

Visit a ImplicitRestNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 2199

def visit_implicit_rest_node(node)
  table = Table.new("ImplicitRestNode")
  id = node_id(node)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_in_node(node)

Visit a InNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 2213

def visit_in_node(node)
  table = Table.new("InNode")
  id = node_id(node)

  # pattern
  table.field("pattern", port: true)
  digraph.edge("#{id}:pattern -> #{node_id(node.pattern)};")

  # statements
  unless (statements = node.statements).nil?
    table.field("statements", port: true)
    digraph.edge("#{id}:statements -> #{node_id(statements)};")
  end

  # in_loc
  table.field("in_loc", location_inspect(node.in_loc))

  # then_loc
  unless (then_loc = node.then_loc).nil?
    table.field("then_loc", location_inspect(then_loc))
  end

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_index_and_write_node(node)

Visit a IndexAndWriteNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 2245

def visit_index_and_write_node(node)
  table = Table.new("IndexAndWriteNode")
  id = node_id(node)

  # flags
  table.field("flags", call_node_flags_inspect(node))

  # receiver
  unless (receiver = node.receiver).nil?
    table.field("receiver", port: true)
    digraph.edge("#{id}:receiver -> #{node_id(receiver)};")
  end

  # call_operator_loc
  unless (call_operator_loc = node.call_operator_loc).nil?
    table.field("call_operator_loc", location_inspect(call_operator_loc))
  end

  # opening_loc
  table.field("opening_loc", location_inspect(node.opening_loc))

  # arguments
  unless (arguments = node.arguments).nil?
    table.field("arguments", port: true)
    digraph.edge("#{id}:arguments -> #{node_id(arguments)};")
  end

  # closing_loc
  table.field("closing_loc", location_inspect(node.closing_loc))

  # block
  unless (block = node.block).nil?
    table.field("block", port: true)
    digraph.edge("#{id}:block -> #{node_id(block)};")
  end

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_index_operator_write_node(node)

Visit a IndexOperatorWriteNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 2298

def visit_index_operator_write_node(node)
  table = Table.new("IndexOperatorWriteNode")
  id = node_id(node)

  # flags
  table.field("flags", call_node_flags_inspect(node))

  # receiver
  unless (receiver = node.receiver).nil?
    table.field("receiver", port: true)
    digraph.edge("#{id}:receiver -> #{node_id(receiver)};")
  end

  # call_operator_loc
  unless (call_operator_loc = node.call_operator_loc).nil?
    table.field("call_operator_loc", location_inspect(call_operator_loc))
  end

  # opening_loc
  table.field("opening_loc", location_inspect(node.opening_loc))

  # arguments
  unless (arguments = node.arguments).nil?
    table.field("arguments", port: true)
    digraph.edge("#{id}:arguments -> #{node_id(arguments)};")
  end

  # closing_loc
  table.field("closing_loc", location_inspect(node.closing_loc))

  # block
  unless (block = node.block).nil?
    table.field("block", port: true)
    digraph.edge("#{id}:block -> #{node_id(block)};")
  end

  # binary_operator
  table.field("binary_operator", node.binary_operator.inspect)

  # binary_operator_loc
  table.field("binary_operator_loc", location_inspect(node.binary_operator_loc))

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_index_or_write_node(node)

Visit a IndexOrWriteNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 2354

def visit_index_or_write_node(node)
  table = Table.new("IndexOrWriteNode")
  id = node_id(node)

  # flags
  table.field("flags", call_node_flags_inspect(node))

  # receiver
  unless (receiver = node.receiver).nil?
    table.field("receiver", port: true)
    digraph.edge("#{id}:receiver -> #{node_id(receiver)};")
  end

  # call_operator_loc
  unless (call_operator_loc = node.call_operator_loc).nil?
    table.field("call_operator_loc", location_inspect(call_operator_loc))
  end

  # opening_loc
  table.field("opening_loc", location_inspect(node.opening_loc))

  # arguments
  unless (arguments = node.arguments).nil?
    table.field("arguments", port: true)
    digraph.edge("#{id}:arguments -> #{node_id(arguments)};")
  end

  # closing_loc
  table.field("closing_loc", location_inspect(node.closing_loc))

  # block
  unless (block = node.block).nil?
    table.field("block", port: true)
    digraph.edge("#{id}:block -> #{node_id(block)};")
  end

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_index_target_node(node)

Visit a IndexTargetNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 2407

def visit_index_target_node(node)
  table = Table.new("IndexTargetNode")
  id = node_id(node)

  # flags
  table.field("flags", call_node_flags_inspect(node))

  # receiver
  table.field("receiver", port: true)
  digraph.edge("#{id}:receiver -> #{node_id(node.receiver)};")

  # opening_loc
  table.field("opening_loc", location_inspect(node.opening_loc))

  # arguments
  unless (arguments = node.arguments).nil?
    table.field("arguments", port: true)
    digraph.edge("#{id}:arguments -> #{node_id(arguments)};")
  end

  # closing_loc
  table.field("closing_loc", location_inspect(node.closing_loc))

  # block
  unless (block = node.block).nil?
    table.field("block", port: true)
    digraph.edge("#{id}:block -> #{node_id(block)};")
  end

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_instance_variable_and_write_node(node)

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 2446

def visit_instance_variable_and_write_node(node)
  table = Table.new("InstanceVariableAndWriteNode")
  id = node_id(node)

  # name
  table.field("name", node.name.inspect)

  # name_loc
  table.field("name_loc", location_inspect(node.name_loc))

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_instance_variable_operator_write_node(node)

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 2473

def visit_instance_variable_operator_write_node(node)
  table = Table.new("InstanceVariableOperatorWriteNode")
  id = node_id(node)

  # name
  table.field("name", node.name.inspect)

  # name_loc
  table.field("name_loc", location_inspect(node.name_loc))

  # binary_operator_loc
  table.field("binary_operator_loc", location_inspect(node.binary_operator_loc))

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  # binary_operator
  table.field("binary_operator", node.binary_operator.inspect)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_instance_variable_or_write_node(node)

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 2503

def visit_instance_variable_or_write_node(node)
  table = Table.new("InstanceVariableOrWriteNode")
  id = node_id(node)

  # name
  table.field("name", node.name.inspect)

  # name_loc
  table.field("name_loc", location_inspect(node.name_loc))

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_instance_variable_read_node(node)

Visit a InstanceVariableReadNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 2530

def visit_instance_variable_read_node(node)
  table = Table.new("InstanceVariableReadNode")
  id = node_id(node)

  # name
  table.field("name", node.name.inspect)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_instance_variable_target_node(node)

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 2547

def visit_instance_variable_target_node(node)
  table = Table.new("InstanceVariableTargetNode")
  id = node_id(node)

  # name
  table.field("name", node.name.inspect)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_instance_variable_write_node(node)

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 2564

def visit_instance_variable_write_node(node)
  table = Table.new("InstanceVariableWriteNode")
  id = node_id(node)

  # name
  table.field("name", node.name.inspect)

  # name_loc
  table.field("name_loc", location_inspect(node.name_loc))

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_integer_node(node)

Visit a IntegerNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 2591

def visit_integer_node(node)
  table = Table.new("IntegerNode")
  id = node_id(node)

  # flags
  table.field("flags", integer_base_flags_inspect(node))

  # value
  table.field("value", node.value.inspect)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_interpolated_match_last_line_node(node)

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 2611

def visit_interpolated_match_last_line_node(node)
  table = Table.new("InterpolatedMatchLastLineNode")
  id = node_id(node)

  # flags
  table.field("flags", regular_expression_flags_inspect(node))

  # opening_loc
  table.field("opening_loc", location_inspect(node.opening_loc))

  # parts
  if node.parts.any?
    table.field("parts", port: true)

    waypoint = "#{id}_parts"
    digraph.waypoint("#{waypoint};")

    digraph.edge("#{id}:parts -> #{waypoint};")
    node.parts.each { |child| digraph.edge("#{waypoint} -> #{node_id(child)};") }
  else
    table.field("parts", "[]")
  end

  # closing_loc
  table.field("closing_loc", location_inspect(node.closing_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_interpolated_regular_expression_node(node)

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 2647

def visit_interpolated_regular_expression_node(node)
  table = Table.new("InterpolatedRegularExpressionNode")
  id = node_id(node)

  # flags
  table.field("flags", regular_expression_flags_inspect(node))

  # opening_loc
  table.field("opening_loc", location_inspect(node.opening_loc))

  # parts
  if node.parts.any?
    table.field("parts", port: true)

    waypoint = "#{id}_parts"
    digraph.waypoint("#{waypoint};")

    digraph.edge("#{id}:parts -> #{waypoint};")
    node.parts.each { |child| digraph.edge("#{waypoint} -> #{node_id(child)};") }
  else
    table.field("parts", "[]")
  end

  # closing_loc
  table.field("closing_loc", location_inspect(node.closing_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_interpolated_string_node(node)

Visit a InterpolatedStringNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 2683

def visit_interpolated_string_node(node)
  table = Table.new("InterpolatedStringNode")
  id = node_id(node)

  # flags
  table.field("flags", interpolated_string_node_flags_inspect(node))

  # opening_loc
  unless (opening_loc = node.opening_loc).nil?
    table.field("opening_loc", location_inspect(opening_loc))
  end

  # parts
  if node.parts.any?
    table.field("parts", port: true)

    waypoint = "#{id}_parts"
    digraph.waypoint("#{waypoint};")

    digraph.edge("#{id}:parts -> #{waypoint};")
    node.parts.each { |child| digraph.edge("#{waypoint} -> #{node_id(child)};") }
  else
    table.field("parts", "[]")
  end

  # closing_loc
  unless (closing_loc = node.closing_loc).nil?
    table.field("closing_loc", location_inspect(closing_loc))
  end

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_interpolated_symbol_node(node)

Visit a InterpolatedSymbolNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 2723

def visit_interpolated_symbol_node(node)
  table = Table.new("InterpolatedSymbolNode")
  id = node_id(node)

  # opening_loc
  unless (opening_loc = node.opening_loc).nil?
    table.field("opening_loc", location_inspect(opening_loc))
  end

  # parts
  if node.parts.any?
    table.field("parts", port: true)

    waypoint = "#{id}_parts"
    digraph.waypoint("#{waypoint};")

    digraph.edge("#{id}:parts -> #{waypoint};")
    node.parts.each { |child| digraph.edge("#{waypoint} -> #{node_id(child)};") }
  else
    table.field("parts", "[]")
  end

  # closing_loc
  unless (closing_loc = node.closing_loc).nil?
    table.field("closing_loc", location_inspect(closing_loc))
  end

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_interpolated_x_string_node(node)

Visit a InterpolatedXStringNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 2760

def visit_interpolated_x_string_node(node)
  table = Table.new("InterpolatedXStringNode")
  id = node_id(node)

  # opening_loc
  table.field("opening_loc", location_inspect(node.opening_loc))

  # parts
  if node.parts.any?
    table.field("parts", port: true)

    waypoint = "#{id}_parts"
    digraph.waypoint("#{waypoint};")

    digraph.edge("#{id}:parts -> #{waypoint};")
    node.parts.each { |child| digraph.edge("#{waypoint} -> #{node_id(child)};") }
  else
    table.field("parts", "[]")
  end

  # closing_loc
  table.field("closing_loc", location_inspect(node.closing_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_it_local_variable_read_node(node)

Visit a ItLocalVariableReadNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 2793

def visit_it_local_variable_read_node(node)
  table = Table.new("ItLocalVariableReadNode")
  id = node_id(node)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_it_parameters_node(node)

Visit a ItParametersNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 2807

def visit_it_parameters_node(node)
  table = Table.new("ItParametersNode")
  id = node_id(node)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_keyword_hash_node(node)

Visit a KeywordHashNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 2821

def visit_keyword_hash_node(node)
  table = Table.new("KeywordHashNode")
  id = node_id(node)

  # flags
  table.field("flags", keyword_hash_node_flags_inspect(node))

  # elements
  if node.elements.any?
    table.field("elements", port: true)

    waypoint = "#{id}_elements"
    digraph.waypoint("#{waypoint};")

    digraph.edge("#{id}:elements -> #{waypoint};")
    node.elements.each { |child| digraph.edge("#{waypoint} -> #{node_id(child)};") }
  else
    table.field("elements", "[]")
  end

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_keyword_rest_parameter_node(node)

Visit a KeywordRestParameterNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 2851

def visit_keyword_rest_parameter_node(node)
  table = Table.new("KeywordRestParameterNode")
  id = node_id(node)

  # flags
  table.field("flags", parameter_flags_inspect(node))

  # name
  table.field("name", node.name.inspect)

  # name_loc
  unless (name_loc = node.name_loc).nil?
    table.field("name_loc", location_inspect(name_loc))
  end

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_lambda_node(node)

Visit a LambdaNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 2879

def visit_lambda_node(node)
  table = Table.new("LambdaNode")
  id = node_id(node)

  # locals
  table.field("locals", node.locals.inspect)

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  # opening_loc
  table.field("opening_loc", location_inspect(node.opening_loc))

  # closing_loc
  table.field("closing_loc", location_inspect(node.closing_loc))

  # parameters
  unless (parameters = node.parameters).nil?
    table.field("parameters", port: true)
    digraph.edge("#{id}:parameters -> #{node_id(parameters)};")
  end

  # body
  unless (body = node.body).nil?
    table.field("body", port: true)
    digraph.edge("#{id}:body -> #{node_id(body)};")
  end

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_local_variable_and_write_node(node)

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 2917

def visit_local_variable_and_write_node(node)
  table = Table.new("LocalVariableAndWriteNode")
  id = node_id(node)

  # name_loc
  table.field("name_loc", location_inspect(node.name_loc))

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  # name
  table.field("name", node.name.inspect)

  # depth
  table.field("depth", node.depth.inspect)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_local_variable_operator_write_node(node)

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 2947

def visit_local_variable_operator_write_node(node)
  table = Table.new("LocalVariableOperatorWriteNode")
  id = node_id(node)

  # name_loc
  table.field("name_loc", location_inspect(node.name_loc))

  # binary_operator_loc
  table.field("binary_operator_loc", location_inspect(node.binary_operator_loc))

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  # name
  table.field("name", node.name.inspect)

  # binary_operator
  table.field("binary_operator", node.binary_operator.inspect)

  # depth
  table.field("depth", node.depth.inspect)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_local_variable_or_write_node(node)

Visit a LocalVariableOrWriteNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 2980

def visit_local_variable_or_write_node(node)
  table = Table.new("LocalVariableOrWriteNode")
  id = node_id(node)

  # name_loc
  table.field("name_loc", location_inspect(node.name_loc))

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  # name
  table.field("name", node.name.inspect)

  # depth
  table.field("depth", node.depth.inspect)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_local_variable_read_node(node)

Visit a LocalVariableReadNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 3010

def visit_local_variable_read_node(node)
  table = Table.new("LocalVariableReadNode")
  id = node_id(node)

  # name
  table.field("name", node.name.inspect)

  # depth
  table.field("depth", node.depth.inspect)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_local_variable_target_node(node)

Visit a LocalVariableTargetNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 3030

def visit_local_variable_target_node(node)
  table = Table.new("LocalVariableTargetNode")
  id = node_id(node)

  # name
  table.field("name", node.name.inspect)

  # depth
  table.field("depth", node.depth.inspect)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_local_variable_write_node(node)

Visit a LocalVariableWriteNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 3050

def visit_local_variable_write_node(node)
  table = Table.new("LocalVariableWriteNode")
  id = node_id(node)

  # name
  table.field("name", node.name.inspect)

  # depth
  table.field("depth", node.depth.inspect)

  # name_loc
  table.field("name_loc", location_inspect(node.name_loc))

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_match_last_line_node(node)

Visit a MatchLastLineNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 3080

def visit_match_last_line_node(node)
  table = Table.new("MatchLastLineNode")
  id = node_id(node)

  # flags
  table.field("flags", regular_expression_flags_inspect(node))

  # opening_loc
  table.field("opening_loc", location_inspect(node.opening_loc))

  # content_loc
  table.field("content_loc", location_inspect(node.content_loc))

  # closing_loc
  table.field("closing_loc", location_inspect(node.closing_loc))

  # unescaped
  table.field("unescaped", node.unescaped.inspect)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_match_predicate_node(node)

Visit a MatchPredicateNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 3109

def visit_match_predicate_node(node)
  table = Table.new("MatchPredicateNode")
  id = node_id(node)

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  # pattern
  table.field("pattern", port: true)
  digraph.edge("#{id}:pattern -> #{node_id(node.pattern)};")

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_match_required_node(node)

Visit a MatchRequiredNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 3134

def visit_match_required_node(node)
  table = Table.new("MatchRequiredNode")
  id = node_id(node)

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  # pattern
  table.field("pattern", port: true)
  digraph.edge("#{id}:pattern -> #{node_id(node.pattern)};")

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_match_write_node(node)

Visit a MatchWriteNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 3159

def visit_match_write_node(node)
  table = Table.new("MatchWriteNode")
  id = node_id(node)

  # call
  table.field("call", port: true)
  digraph.edge("#{id}:call -> #{node_id(node.call)};")

  # targets
  if node.targets.any?
    table.field("targets", port: true)

    waypoint = "#{id}_targets"
    digraph.waypoint("#{waypoint};")

    digraph.edge("#{id}:targets -> #{waypoint};")
    node.targets.each { |child| digraph.edge("#{waypoint} -> #{node_id(child)};") }
  else
    table.field("targets", "[]")
  end

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_missing_node(node)

Visit a MissingNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 3190

def visit_missing_node(node)
  table = Table.new("MissingNode")
  id = node_id(node)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_module_node(node)

Visit a ModuleNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 3204

def visit_module_node(node)
  table = Table.new("ModuleNode")
  id = node_id(node)

  # locals
  table.field("locals", node.locals.inspect)

  # module_keyword_loc
  table.field("module_keyword_loc", location_inspect(node.module_keyword_loc))

  # constant_path
  table.field("constant_path", port: true)
  digraph.edge("#{id}:constant_path -> #{node_id(node.constant_path)};")

  # body
  unless (body = node.body).nil?
    table.field("body", port: true)
    digraph.edge("#{id}:body -> #{node_id(body)};")
  end

  # end_keyword_loc
  table.field("end_keyword_loc", location_inspect(node.end_keyword_loc))

  # name
  table.field("name", node.name.inspect)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_multi_target_node(node)

Visit a MultiTargetNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 3240

def visit_multi_target_node(node)
  table = Table.new("MultiTargetNode")
  id = node_id(node)

  # lefts
  if node.lefts.any?
    table.field("lefts", port: true)

    waypoint = "#{id}_lefts"
    digraph.waypoint("#{waypoint};")

    digraph.edge("#{id}:lefts -> #{waypoint};")
    node.lefts.each { |child| digraph.edge("#{waypoint} -> #{node_id(child)};") }
  else
    table.field("lefts", "[]")
  end

  # rest
  unless (rest = node.rest).nil?
    table.field("rest", port: true)
    digraph.edge("#{id}:rest -> #{node_id(rest)};")
  end

  # rights
  if node.rights.any?
    table.field("rights", port: true)

    waypoint = "#{id}_rights"
    digraph.waypoint("#{waypoint};")

    digraph.edge("#{id}:rights -> #{waypoint};")
    node.rights.each { |child| digraph.edge("#{waypoint} -> #{node_id(child)};") }
  else
    table.field("rights", "[]")
  end

  # lparen_loc
  unless (lparen_loc = node.lparen_loc).nil?
    table.field("lparen_loc", location_inspect(lparen_loc))
  end

  # rparen_loc
  unless (rparen_loc = node.rparen_loc).nil?
    table.field("rparen_loc", location_inspect(rparen_loc))
  end

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_multi_write_node(node)

Visit a MultiWriteNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 3296

def visit_multi_write_node(node)
  table = Table.new("MultiWriteNode")
  id = node_id(node)

  # lefts
  if node.lefts.any?
    table.field("lefts", port: true)

    waypoint = "#{id}_lefts"
    digraph.waypoint("#{waypoint};")

    digraph.edge("#{id}:lefts -> #{waypoint};")
    node.lefts.each { |child| digraph.edge("#{waypoint} -> #{node_id(child)};") }
  else
    table.field("lefts", "[]")
  end

  # rest
  unless (rest = node.rest).nil?
    table.field("rest", port: true)
    digraph.edge("#{id}:rest -> #{node_id(rest)};")
  end

  # rights
  if node.rights.any?
    table.field("rights", port: true)

    waypoint = "#{id}_rights"
    digraph.waypoint("#{waypoint};")

    digraph.edge("#{id}:rights -> #{waypoint};")
    node.rights.each { |child| digraph.edge("#{waypoint} -> #{node_id(child)};") }
  else
    table.field("rights", "[]")
  end

  # lparen_loc
  unless (lparen_loc = node.lparen_loc).nil?
    table.field("lparen_loc", location_inspect(lparen_loc))
  end

  # rparen_loc
  unless (rparen_loc = node.rparen_loc).nil?
    table.field("rparen_loc", location_inspect(rparen_loc))
  end

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_next_node(node)

Visit a NextNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 3359

def visit_next_node(node)
  table = Table.new("NextNode")
  id = node_id(node)

  # arguments
  unless (arguments = node.arguments).nil?
    table.field("arguments", port: true)
    digraph.edge("#{id}:arguments -> #{node_id(arguments)};")
  end

  # keyword_loc
  table.field("keyword_loc", location_inspect(node.keyword_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_nil_node(node)

Visit a NilNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 3382

def visit_nil_node(node)
  table = Table.new("NilNode")
  id = node_id(node)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_no_keywords_parameter_node(node)

Visit a NoKeywordsParameterNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 3396

def visit_no_keywords_parameter_node(node)
  table = Table.new("NoKeywordsParameterNode")
  id = node_id(node)

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  # keyword_loc
  table.field("keyword_loc", location_inspect(node.keyword_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_numbered_parameters_node(node)

Visit a NumberedParametersNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 3416

def visit_numbered_parameters_node(node)
  table = Table.new("NumberedParametersNode")
  id = node_id(node)

  # maximum
  table.field("maximum", node.maximum.inspect)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_numbered_reference_read_node(node)

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 3433

def visit_numbered_reference_read_node(node)
  table = Table.new("NumberedReferenceReadNode")
  id = node_id(node)

  # number
  table.field("number", node.number.inspect)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_optional_keyword_parameter_node(node)

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 3450

def visit_optional_keyword_parameter_node(node)
  table = Table.new("OptionalKeywordParameterNode")
  id = node_id(node)

  # flags
  table.field("flags", parameter_flags_inspect(node))

  # name
  table.field("name", node.name.inspect)

  # name_loc
  table.field("name_loc", location_inspect(node.name_loc))

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_optional_parameter_node(node)

Visit a OptionalParameterNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 3477

def visit_optional_parameter_node(node)
  table = Table.new("OptionalParameterNode")
  id = node_id(node)

  # flags
  table.field("flags", parameter_flags_inspect(node))

  # name
  table.field("name", node.name.inspect)

  # name_loc
  table.field("name_loc", location_inspect(node.name_loc))

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  # value
  table.field("value", port: true)
  digraph.edge("#{id}:value -> #{node_id(node.value)};")

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_or_node(node)

Visit a OrNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 3507

def visit_or_node(node)
  table = Table.new("OrNode")
  id = node_id(node)

  # left
  table.field("left", port: true)
  digraph.edge("#{id}:left -> #{node_id(node.left)};")

  # right
  table.field("right", port: true)
  digraph.edge("#{id}:right -> #{node_id(node.right)};")

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_parameters_node(node)

Visit a ParametersNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 3532

def visit_parameters_node(node)
  table = Table.new("ParametersNode")
  id = node_id(node)

  # requireds
  if node.requireds.any?
    table.field("requireds", port: true)

    waypoint = "#{id}_requireds"
    digraph.waypoint("#{waypoint};")

    digraph.edge("#{id}:requireds -> #{waypoint};")
    node.requireds.each { |child| digraph.edge("#{waypoint} -> #{node_id(child)};") }
  else
    table.field("requireds", "[]")
  end

  # optionals
  if node.optionals.any?
    table.field("optionals", port: true)

    waypoint = "#{id}_optionals"
    digraph.waypoint("#{waypoint};")

    digraph.edge("#{id}:optionals -> #{waypoint};")
    node.optionals.each { |child| digraph.edge("#{waypoint} -> #{node_id(child)};") }
  else
    table.field("optionals", "[]")
  end

  # rest
  unless (rest = node.rest).nil?
    table.field("rest", port: true)
    digraph.edge("#{id}:rest -> #{node_id(rest)};")
  end

  # posts
  if node.posts.any?
    table.field("posts", port: true)

    waypoint = "#{id}_posts"
    digraph.waypoint("#{waypoint};")

    digraph.edge("#{id}:posts -> #{waypoint};")
    node.posts.each { |child| digraph.edge("#{waypoint} -> #{node_id(child)};") }
  else
    table.field("posts", "[]")
  end

  # keywords
  if node.keywords.any?
    table.field("keywords", port: true)

    waypoint = "#{id}_keywords"
    digraph.waypoint("#{waypoint};")

    digraph.edge("#{id}:keywords -> #{waypoint};")
    node.keywords.each { |child| digraph.edge("#{waypoint} -> #{node_id(child)};") }
  else
    table.field("keywords", "[]")
  end

  # keyword_rest
  unless (keyword_rest = node.keyword_rest).nil?
    table.field("keyword_rest", port: true)
    digraph.edge("#{id}:keyword_rest -> #{node_id(keyword_rest)};")
  end

  # block
  unless (block = node.block).nil?
    table.field("block", port: true)
    digraph.edge("#{id}:block -> #{node_id(block)};")
  end

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_parentheses_node(node)

Visit a ParenthesesNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 3616

def visit_parentheses_node(node)
  table = Table.new("ParenthesesNode")
  id = node_id(node)

  # flags
  table.field("flags", parentheses_node_flags_inspect(node))

  # body
  unless (body = node.body).nil?
    table.field("body", port: true)
    digraph.edge("#{id}:body -> #{node_id(body)};")
  end

  # opening_loc
  table.field("opening_loc", location_inspect(node.opening_loc))

  # closing_loc
  table.field("closing_loc", location_inspect(node.closing_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_pinned_expression_node(node)

Visit a PinnedExpressionNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 3645

def visit_pinned_expression_node(node)
  table = Table.new("PinnedExpressionNode")
  id = node_id(node)

  # expression
  table.field("expression", port: true)
  digraph.edge("#{id}:expression -> #{node_id(node.expression)};")

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  # lparen_loc
  table.field("lparen_loc", location_inspect(node.lparen_loc))

  # rparen_loc
  table.field("rparen_loc", location_inspect(node.rparen_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_pinned_variable_node(node)

Visit a PinnedVariableNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 3672

def visit_pinned_variable_node(node)
  table = Table.new("PinnedVariableNode")
  id = node_id(node)

  # variable
  table.field("variable", port: true)
  digraph.edge("#{id}:variable -> #{node_id(node.variable)};")

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_post_execution_node(node)

Visit a PostExecutionNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 3693

def visit_post_execution_node(node)
  table = Table.new("PostExecutionNode")
  id = node_id(node)

  # statements
  unless (statements = node.statements).nil?
    table.field("statements", port: true)
    digraph.edge("#{id}:statements -> #{node_id(statements)};")
  end

  # keyword_loc
  table.field("keyword_loc", location_inspect(node.keyword_loc))

  # opening_loc
  table.field("opening_loc", location_inspect(node.opening_loc))

  # closing_loc
  table.field("closing_loc", location_inspect(node.closing_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_pre_execution_node(node)

Visit a PreExecutionNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 3722

def visit_pre_execution_node(node)
  table = Table.new("PreExecutionNode")
  id = node_id(node)

  # statements
  unless (statements = node.statements).nil?
    table.field("statements", port: true)
    digraph.edge("#{id}:statements -> #{node_id(statements)};")
  end

  # keyword_loc
  table.field("keyword_loc", location_inspect(node.keyword_loc))

  # opening_loc
  table.field("opening_loc", location_inspect(node.opening_loc))

  # closing_loc
  table.field("closing_loc", location_inspect(node.closing_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_program_node(node)

Visit a ProgramNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 3751

def visit_program_node(node)
  table = Table.new("ProgramNode")
  id = node_id(node)

  # locals
  table.field("locals", node.locals.inspect)

  # statements
  table.field("statements", port: true)
  digraph.edge("#{id}:statements -> #{node_id(node.statements)};")

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_range_node(node)

Visit a RangeNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 3772

def visit_range_node(node)
  table = Table.new("RangeNode")
  id = node_id(node)

  # flags
  table.field("flags", range_flags_inspect(node))

  # left
  unless (left = node.left).nil?
    table.field("left", port: true)
    digraph.edge("#{id}:left -> #{node_id(left)};")
  end

  # right
  unless (right = node.right).nil?
    table.field("right", port: true)
    digraph.edge("#{id}:right -> #{node_id(right)};")
  end

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_rational_node(node)

Visit a RationalNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 3804

def visit_rational_node(node)
  table = Table.new("RationalNode")
  id = node_id(node)

  # flags
  table.field("flags", integer_base_flags_inspect(node))

  # numerator
  table.field("numerator", node.numerator.inspect)

  # denominator
  table.field("denominator", node.denominator.inspect)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_redo_node(node)

Visit a RedoNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 3827

def visit_redo_node(node)
  table = Table.new("RedoNode")
  id = node_id(node)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_regular_expression_node(node)

Visit a RegularExpressionNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 3841

def visit_regular_expression_node(node)
  table = Table.new("RegularExpressionNode")
  id = node_id(node)

  # flags
  table.field("flags", regular_expression_flags_inspect(node))

  # opening_loc
  table.field("opening_loc", location_inspect(node.opening_loc))

  # content_loc
  table.field("content_loc", location_inspect(node.content_loc))

  # closing_loc
  table.field("closing_loc", location_inspect(node.closing_loc))

  # unescaped
  table.field("unescaped", node.unescaped.inspect)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_required_keyword_parameter_node(node)

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 3870

def visit_required_keyword_parameter_node(node)
  table = Table.new("RequiredKeywordParameterNode")
  id = node_id(node)

  # flags
  table.field("flags", parameter_flags_inspect(node))

  # name
  table.field("name", node.name.inspect)

  # name_loc
  table.field("name_loc", location_inspect(node.name_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_required_parameter_node(node)

Visit a RequiredParameterNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 3893

def visit_required_parameter_node(node)
  table = Table.new("RequiredParameterNode")
  id = node_id(node)

  # flags
  table.field("flags", parameter_flags_inspect(node))

  # name
  table.field("name", node.name.inspect)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_rescue_modifier_node(node)

Visit a RescueModifierNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 3913

def visit_rescue_modifier_node(node)
  table = Table.new("RescueModifierNode")
  id = node_id(node)

  # expression
  table.field("expression", port: true)
  digraph.edge("#{id}:expression -> #{node_id(node.expression)};")

  # keyword_loc
  table.field("keyword_loc", location_inspect(node.keyword_loc))

  # rescue_expression
  table.field("rescue_expression", port: true)
  digraph.edge("#{id}:rescue_expression -> #{node_id(node.rescue_expression)};")

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_rescue_node(node)

Visit a RescueNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 3938

def visit_rescue_node(node)
  table = Table.new("RescueNode")
  id = node_id(node)

  # keyword_loc
  table.field("keyword_loc", location_inspect(node.keyword_loc))

  # exceptions
  if node.exceptions.any?
    table.field("exceptions", port: true)

    waypoint = "#{id}_exceptions"
    digraph.waypoint("#{waypoint};")

    digraph.edge("#{id}:exceptions -> #{waypoint};")
    node.exceptions.each { |child| digraph.edge("#{waypoint} -> #{node_id(child)};") }
  else
    table.field("exceptions", "[]")
  end

  # operator_loc
  unless (operator_loc = node.operator_loc).nil?
    table.field("operator_loc", location_inspect(operator_loc))
  end

  # reference
  unless (reference = node.reference).nil?
    table.field("reference", port: true)
    digraph.edge("#{id}:reference -> #{node_id(reference)};")
  end

  # then_keyword_loc
  unless (then_keyword_loc = node.then_keyword_loc).nil?
    table.field("then_keyword_loc", location_inspect(then_keyword_loc))
  end

  # statements
  unless (statements = node.statements).nil?
    table.field("statements", port: true)
    digraph.edge("#{id}:statements -> #{node_id(statements)};")
  end

  # subsequent
  unless (subsequent = node.subsequent).nil?
    table.field("subsequent", port: true)
    digraph.edge("#{id}:subsequent -> #{node_id(subsequent)};")
  end

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_rest_parameter_node(node)

Visit a RestParameterNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 3996

def visit_rest_parameter_node(node)
  table = Table.new("RestParameterNode")
  id = node_id(node)

  # flags
  table.field("flags", parameter_flags_inspect(node))

  # name
  table.field("name", node.name.inspect)

  # name_loc
  unless (name_loc = node.name_loc).nil?
    table.field("name_loc", location_inspect(name_loc))
  end

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_retry_node(node)

Visit a RetryNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4024

def visit_retry_node(node)
  table = Table.new("RetryNode")
  id = node_id(node)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_return_node(node)

Visit a ReturnNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4038

def visit_return_node(node)
  table = Table.new("ReturnNode")
  id = node_id(node)

  # keyword_loc
  table.field("keyword_loc", location_inspect(node.keyword_loc))

  # arguments
  unless (arguments = node.arguments).nil?
    table.field("arguments", port: true)
    digraph.edge("#{id}:arguments -> #{node_id(arguments)};")
  end

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_self_node(node)

Visit a SelfNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4061

def visit_self_node(node)
  table = Table.new("SelfNode")
  id = node_id(node)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_shareable_constant_node(node)

Visit a ShareableConstantNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4075

def visit_shareable_constant_node(node)
  table = Table.new("ShareableConstantNode")
  id = node_id(node)

  # flags
  table.field("flags", shareable_constant_node_flags_inspect(node))

  # write
  table.field("write", port: true)
  digraph.edge("#{id}:write -> #{node_id(node.write)};")

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_singleton_class_node(node)

Visit a SingletonClassNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4096

def visit_singleton_class_node(node)
  table = Table.new("SingletonClassNode")
  id = node_id(node)

  # locals
  table.field("locals", node.locals.inspect)

  # class_keyword_loc
  table.field("class_keyword_loc", location_inspect(node.class_keyword_loc))

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  # expression
  table.field("expression", port: true)
  digraph.edge("#{id}:expression -> #{node_id(node.expression)};")

  # body
  unless (body = node.body).nil?
    table.field("body", port: true)
    digraph.edge("#{id}:body -> #{node_id(body)};")
  end

  # end_keyword_loc
  table.field("end_keyword_loc", location_inspect(node.end_keyword_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_source_encoding_node(node)

Visit a SourceEncodingNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4132

def visit_source_encoding_node(node)
  table = Table.new("SourceEncodingNode")
  id = node_id(node)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_source_file_node(node)

Visit a SourceFileNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4146

def visit_source_file_node(node)
  table = Table.new("SourceFileNode")
  id = node_id(node)

  # flags
  table.field("flags", string_flags_inspect(node))

  # filepath
  table.field("filepath", node.filepath.inspect)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_source_line_node(node)

Visit a SourceLineNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4166

def visit_source_line_node(node)
  table = Table.new("SourceLineNode")
  id = node_id(node)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_splat_node(node)

Visit a SplatNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4180

def visit_splat_node(node)
  table = Table.new("SplatNode")
  id = node_id(node)

  # operator_loc
  table.field("operator_loc", location_inspect(node.operator_loc))

  # expression
  unless (expression = node.expression).nil?
    table.field("expression", port: true)
    digraph.edge("#{id}:expression -> #{node_id(expression)};")
  end

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_statements_node(node)

Visit a StatementsNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4203

def visit_statements_node(node)
  table = Table.new("StatementsNode")
  id = node_id(node)

  # body
  if node.body.any?
    table.field("body", port: true)

    waypoint = "#{id}_body"
    digraph.waypoint("#{waypoint};")

    digraph.edge("#{id}:body -> #{waypoint};")
    node.body.each { |child| digraph.edge("#{waypoint} -> #{node_id(child)};") }
  else
    table.field("body", "[]")
  end

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_string_node(node)

Visit a StringNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4230

def visit_string_node(node)
  table = Table.new("StringNode")
  id = node_id(node)

  # flags
  table.field("flags", string_flags_inspect(node))

  # opening_loc
  unless (opening_loc = node.opening_loc).nil?
    table.field("opening_loc", location_inspect(opening_loc))
  end

  # content_loc
  table.field("content_loc", location_inspect(node.content_loc))

  # closing_loc
  unless (closing_loc = node.closing_loc).nil?
    table.field("closing_loc", location_inspect(closing_loc))
  end

  # unescaped
  table.field("unescaped", node.unescaped.inspect)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_super_node(node)

Visit a SuperNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4263

def visit_super_node(node)
  table = Table.new("SuperNode")
  id = node_id(node)

  # keyword_loc
  table.field("keyword_loc", location_inspect(node.keyword_loc))

  # lparen_loc
  unless (lparen_loc = node.lparen_loc).nil?
    table.field("lparen_loc", location_inspect(lparen_loc))
  end

  # arguments
  unless (arguments = node.arguments).nil?
    table.field("arguments", port: true)
    digraph.edge("#{id}:arguments -> #{node_id(arguments)};")
  end

  # rparen_loc
  unless (rparen_loc = node.rparen_loc).nil?
    table.field("rparen_loc", location_inspect(rparen_loc))
  end

  # block
  unless (block = node.block).nil?
    table.field("block", port: true)
    digraph.edge("#{id}:block -> #{node_id(block)};")
  end

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_symbol_node(node)

Visit a SymbolNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4302

def visit_symbol_node(node)
  table = Table.new("SymbolNode")
  id = node_id(node)

  # flags
  table.field("flags", symbol_flags_inspect(node))

  # opening_loc
  unless (opening_loc = node.opening_loc).nil?
    table.field("opening_loc", location_inspect(opening_loc))
  end

  # value_loc
  unless (value_loc = node.value_loc).nil?
    table.field("value_loc", location_inspect(value_loc))
  end

  # closing_loc
  unless (closing_loc = node.closing_loc).nil?
    table.field("closing_loc", location_inspect(closing_loc))
  end

  # unescaped
  table.field("unescaped", node.unescaped.inspect)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_true_node(node)

Visit a TrueNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4337

def visit_true_node(node)
  table = Table.new("TrueNode")
  id = node_id(node)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_undef_node(node)

Visit a UndefNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4351

def visit_undef_node(node)
  table = Table.new("UndefNode")
  id = node_id(node)

  # names
  if node.names.any?
    table.field("names", port: true)

    waypoint = "#{id}_names"
    digraph.waypoint("#{waypoint};")

    digraph.edge("#{id}:names -> #{waypoint};")
    node.names.each { |child| digraph.edge("#{waypoint} -> #{node_id(child)};") }
  else
    table.field("names", "[]")
  end

  # keyword_loc
  table.field("keyword_loc", location_inspect(node.keyword_loc))

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_unless_node(node)

Visit a UnlessNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4381

def visit_unless_node(node)
  table = Table.new("UnlessNode")
  id = node_id(node)

  # keyword_loc
  table.field("keyword_loc", location_inspect(node.keyword_loc))

  # predicate
  table.field("predicate", port: true)
  digraph.edge("#{id}:predicate -> #{node_id(node.predicate)};")

  # then_keyword_loc
  unless (then_keyword_loc = node.then_keyword_loc).nil?
    table.field("then_keyword_loc", location_inspect(then_keyword_loc))
  end

  # statements
  unless (statements = node.statements).nil?
    table.field("statements", port: true)
    digraph.edge("#{id}:statements -> #{node_id(statements)};")
  end

  # else_clause
  unless (else_clause = node.else_clause).nil?
    table.field("else_clause", port: true)
    digraph.edge("#{id}:else_clause -> #{node_id(else_clause)};")
  end

  # end_keyword_loc
  unless (end_keyword_loc = node.end_keyword_loc).nil?
    table.field("end_keyword_loc", location_inspect(end_keyword_loc))
  end

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_until_node(node)

Visit a UntilNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4424

def visit_until_node(node)
  table = Table.new("UntilNode")
  id = node_id(node)

  # flags
  table.field("flags", loop_flags_inspect(node))

  # keyword_loc
  table.field("keyword_loc", location_inspect(node.keyword_loc))

  # do_keyword_loc
  unless (do_keyword_loc = node.do_keyword_loc).nil?
    table.field("do_keyword_loc", location_inspect(do_keyword_loc))
  end

  # closing_loc
  unless (closing_loc = node.closing_loc).nil?
    table.field("closing_loc", location_inspect(closing_loc))
  end

  # predicate
  table.field("predicate", port: true)
  digraph.edge("#{id}:predicate -> #{node_id(node.predicate)};")

  # statements
  unless (statements = node.statements).nil?
    table.field("statements", port: true)
    digraph.edge("#{id}:statements -> #{node_id(statements)};")
  end

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_when_node(node)

Visit a WhenNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4464

def visit_when_node(node)
  table = Table.new("WhenNode")
  id = node_id(node)

  # keyword_loc
  table.field("keyword_loc", location_inspect(node.keyword_loc))

  # conditions
  if node.conditions.any?
    table.field("conditions", port: true)

    waypoint = "#{id}_conditions"
    digraph.waypoint("#{waypoint};")

    digraph.edge("#{id}:conditions -> #{waypoint};")
    node.conditions.each { |child| digraph.edge("#{waypoint} -> #{node_id(child)};") }
  else
    table.field("conditions", "[]")
  end

  # then_keyword_loc
  unless (then_keyword_loc = node.then_keyword_loc).nil?
    table.field("then_keyword_loc", location_inspect(then_keyword_loc))
  end

  # statements
  unless (statements = node.statements).nil?
    table.field("statements", port: true)
    digraph.edge("#{id}:statements -> #{node_id(statements)};")
  end

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_while_node(node)

Visit a WhileNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4505

def visit_while_node(node)
  table = Table.new("WhileNode")
  id = node_id(node)

  # flags
  table.field("flags", loop_flags_inspect(node))

  # keyword_loc
  table.field("keyword_loc", location_inspect(node.keyword_loc))

  # do_keyword_loc
  unless (do_keyword_loc = node.do_keyword_loc).nil?
    table.field("do_keyword_loc", location_inspect(do_keyword_loc))
  end

  # closing_loc
  unless (closing_loc = node.closing_loc).nil?
    table.field("closing_loc", location_inspect(closing_loc))
  end

  # predicate
  table.field("predicate", port: true)
  digraph.edge("#{id}:predicate -> #{node_id(node.predicate)};")

  # statements
  unless (statements = node.statements).nil?
    table.field("statements", port: true)
    digraph.edge("#{id}:statements -> #{node_id(statements)};")
  end

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_x_string_node(node)

Visit a XStringNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4545

def visit_x_string_node(node)
  table = Table.new("XStringNode")
  id = node_id(node)

  # flags
  table.field("flags", encoding_flags_inspect(node))

  # opening_loc
  table.field("opening_loc", location_inspect(node.opening_loc))

  # content_loc
  table.field("content_loc", location_inspect(node.content_loc))

  # closing_loc
  table.field("closing_loc", location_inspect(node.closing_loc))

  # unescaped
  table.field("unescaped", node.unescaped.inspect)

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end

#visit_yield_node(node)

Visit a YieldNode node.

[ GitHub ]

  
# File 'lib/prism/dot_visitor.rb', line 4574

def visit_yield_node(node)
  table = Table.new("YieldNode")
  id = node_id(node)

  # keyword_loc
  table.field("keyword_loc", location_inspect(node.keyword_loc))

  # lparen_loc
  unless (lparen_loc = node.lparen_loc).nil?
    table.field("lparen_loc", location_inspect(lparen_loc))
  end

  # arguments
  unless (arguments = node.arguments).nil?
    table.field("arguments", port: true)
    digraph.edge("#{id}:arguments -> #{node_id(arguments)};")
  end

  # rparen_loc
  unless (rparen_loc = node.rparen_loc).nil?
    table.field("rparen_loc", location_inspect(rparen_loc))
  end

  digraph.nodes << <<~DOT
    #{id} [
      label=<#{table.to_dot.gsub(/\n/, "\n  ")}>
    ];
  DOT

  super
end