class Prism::DotVisitor
This visitor provides the ability to callNode#to_dot, which converts a subtree into a graphviz dot graph.
Attributes
The digraph that is being built.
Public Class Methods
Source
# File lib/prism/dot_visitor.rb, line 110definitialize@digraph =Digraph.newend
Initialize a new dot visitor.
Public Instance Methods
Source
# File lib/prism/dot_visitor.rb, line 115defto_dotdigraph.to_dotend
Convert this visitor into a graphviz dot graph string.
Source
# File lib/prism/dot_visitor.rb, line 120defvisit_alias_global_variable_node(node)table =Table.new("AliasGlobalVariableNode")id =node_id(node)# new_nametable.field("new_name",port:true)digraph.edge("#{id}:new_name -> #{node_id(node.new_name)};")# old_nametable.field("old_name",port:true)digraph.edge("#{id}:old_name -> #{node_id(node.old_name)};")# keyword_loctable.field("keyword_loc",location_inspect(node.keyword_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aAliasGlobalVariableNode node.
Source
# File lib/prism/dot_visitor.rb, line 145defvisit_alias_method_node(node)table =Table.new("AliasMethodNode")id =node_id(node)# new_nametable.field("new_name",port:true)digraph.edge("#{id}:new_name -> #{node_id(node.new_name)};")# old_nametable.field("old_name",port:true)digraph.edge("#{id}:old_name -> #{node_id(node.old_name)};")# keyword_loctable.field("keyword_loc",location_inspect(node.keyword_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aAliasMethodNode node.
Source
# File lib/prism/dot_visitor.rb, line 170defvisit_alternation_pattern_node(node)table =Table.new("AlternationPatternNode")id =node_id(node)# lefttable.field("left",port:true)digraph.edge("#{id}:left -> #{node_id(node.left)};")# righttable.field("right",port:true)digraph.edge("#{id}:right -> #{node_id(node.right)};")# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aAlternationPatternNode node.
Source
# File lib/prism/dot_visitor.rb, line 195defvisit_and_node(node)table =Table.new("AndNode")id =node_id(node)# lefttable.field("left",port:true)digraph.edge("#{id}:left -> #{node_id(node.left)};")# righttable.field("right",port:true)digraph.edge("#{id}:right -> #{node_id(node.right)};")# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aAndNode node.
Source
# File lib/prism/dot_visitor.rb, line 220defvisit_arguments_node(node)table =Table.new("ArgumentsNode")id =node_id(node)# flagstable.field("flags",arguments_node_flags_inspect(node))# argumentsifnode.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)};") }elsetable.field("arguments","[]")enddigraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aArgumentsNode node.
Source
# File lib/prism/dot_visitor.rb, line 250defvisit_array_node(node)table =Table.new("ArrayNode")id =node_id(node)# flagstable.field("flags",array_node_flags_inspect(node))# elementsifnode.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)};") }elsetable.field("elements","[]")end# opening_locunless (opening_loc =node.opening_loc).nil?table.field("opening_loc",location_inspect(opening_loc))end# closing_locunless (closing_loc =node.closing_loc).nil?table.field("closing_loc",location_inspect(closing_loc))enddigraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aArrayNode node.
Source
# File lib/prism/dot_visitor.rb, line 290defvisit_array_pattern_node(node)table =Table.new("ArrayPatternNode")id =node_id(node)# constantunless (constant =node.constant).nil?table.field("constant",port:true)digraph.edge("#{id}:constant -> #{node_id(constant)};")end# requiredsifnode.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)};") }elsetable.field("requireds","[]")end# restunless (rest =node.rest).nil?table.field("rest",port:true)digraph.edge("#{id}:rest -> #{node_id(rest)};")end# postsifnode.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)};") }elsetable.field("posts","[]")end# opening_locunless (opening_loc =node.opening_loc).nil?table.field("opening_loc",location_inspect(opening_loc))end# closing_locunless (closing_loc =node.closing_loc).nil?table.field("closing_loc",location_inspect(closing_loc))enddigraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aArrayPatternNode node.
Source
# File lib/prism/dot_visitor.rb, line 352defvisit_assoc_node(node)table =Table.new("AssocNode")id =node_id(node)# keytable.field("key",port:true)digraph.edge("#{id}:key -> #{node_id(node.key)};")# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")# operator_locunless (operator_loc =node.operator_loc).nil?table.field("operator_loc",location_inspect(operator_loc))enddigraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aAssocNode node.
Source
# File lib/prism/dot_visitor.rb, line 379defvisit_assoc_splat_node(node)table =Table.new("AssocSplatNode")id =node_id(node)# valueunless (value =node.value).nil?table.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(value)};")end# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aAssocSplatNode node.
Source
# File lib/prism/dot_visitor.rb, line 402defvisit_back_reference_read_node(node)table =Table.new("BackReferenceReadNode")id =node_id(node)# nametable.field("name",node.name.inspect)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aBackReferenceReadNode node.
Source
# File lib/prism/dot_visitor.rb, line 419defvisit_begin_node(node)table =Table.new("BeginNode")id =node_id(node)# begin_keyword_locunless (begin_keyword_loc =node.begin_keyword_loc).nil?table.field("begin_keyword_loc",location_inspect(begin_keyword_loc))end# statementsunless (statements =node.statements).nil?table.field("statements",port:true)digraph.edge("#{id}:statements -> #{node_id(statements)};")end# rescue_clauseunless (rescue_clause =node.rescue_clause).nil?table.field("rescue_clause",port:true)digraph.edge("#{id}:rescue_clause -> #{node_id(rescue_clause)};")end# else_clauseunless (else_clause =node.else_clause).nil?table.field("else_clause",port:true)digraph.edge("#{id}:else_clause -> #{node_id(else_clause)};")end# ensure_clauseunless (ensure_clause =node.ensure_clause).nil?table.field("ensure_clause",port:true)digraph.edge("#{id}:ensure_clause -> #{node_id(ensure_clause)};")end# end_keyword_locunless (end_keyword_loc =node.end_keyword_loc).nil?table.field("end_keyword_loc",location_inspect(end_keyword_loc))enddigraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aBeginNode node.
Source
# File lib/prism/dot_visitor.rb, line 467defvisit_block_argument_node(node)table =Table.new("BlockArgumentNode")id =node_id(node)# expressionunless (expression =node.expression).nil?table.field("expression",port:true)digraph.edge("#{id}:expression -> #{node_id(expression)};")end# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aBlockArgumentNode node.
Source
# File lib/prism/dot_visitor.rb, line 490defvisit_block_local_variable_node(node)table =Table.new("BlockLocalVariableNode")id =node_id(node)# flagstable.field("flags",parameter_flags_inspect(node))# nametable.field("name",node.name.inspect)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aBlockLocalVariableNode node.
Source
# File lib/prism/dot_visitor.rb, line 510defvisit_block_node(node)table =Table.new("BlockNode")id =node_id(node)# localstable.field("locals",node.locals.inspect)# parametersunless (parameters =node.parameters).nil?table.field("parameters",port:true)digraph.edge("#{id}:parameters -> #{node_id(parameters)};")end# bodyunless (body =node.body).nil?table.field("body",port:true)digraph.edge("#{id}:body -> #{node_id(body)};")end# opening_loctable.field("opening_loc",location_inspect(node.opening_loc))# closing_loctable.field("closing_loc",location_inspect(node.closing_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aBlockNode node.
Source
# File lib/prism/dot_visitor.rb, line 545defvisit_block_parameter_node(node)table =Table.new("BlockParameterNode")id =node_id(node)# flagstable.field("flags",parameter_flags_inspect(node))# nametable.field("name",node.name.inspect)# name_locunless (name_loc =node.name_loc).nil?table.field("name_loc",location_inspect(name_loc))end# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aBlockParameterNode node.
Source
# File lib/prism/dot_visitor.rb, line 573defvisit_block_parameters_node(node)table =Table.new("BlockParametersNode")id =node_id(node)# parametersunless (parameters =node.parameters).nil?table.field("parameters",port:true)digraph.edge("#{id}:parameters -> #{node_id(parameters)};")end# localsifnode.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)};") }elsetable.field("locals","[]")end# opening_locunless (opening_loc =node.opening_loc).nil?table.field("opening_loc",location_inspect(opening_loc))end# closing_locunless (closing_loc =node.closing_loc).nil?table.field("closing_loc",location_inspect(closing_loc))enddigraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aBlockParametersNode node.
Source
# File lib/prism/dot_visitor.rb, line 616defvisit_break_node(node)table =Table.new("BreakNode")id =node_id(node)# argumentsunless (arguments =node.arguments).nil?table.field("arguments",port:true)digraph.edge("#{id}:arguments -> #{node_id(arguments)};")end# keyword_loctable.field("keyword_loc",location_inspect(node.keyword_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aBreakNode node.
Source
# File lib/prism/dot_visitor.rb, line 639defvisit_call_and_write_node(node)table =Table.new("CallAndWriteNode")id =node_id(node)# flagstable.field("flags",call_node_flags_inspect(node))# receiverunless (receiver =node.receiver).nil?table.field("receiver",port:true)digraph.edge("#{id}:receiver -> #{node_id(receiver)};")end# call_operator_locunless (call_operator_loc =node.call_operator_loc).nil?table.field("call_operator_loc",location_inspect(call_operator_loc))end# message_locunless (message_loc =node.message_loc).nil?table.field("message_loc",location_inspect(message_loc))end# read_nametable.field("read_name",node.read_name.inspect)# write_nametable.field("write_name",node.write_name.inspect)# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aCallAndWriteNode node.
Source
# File lib/prism/dot_visitor.rb, line 685defvisit_call_node(node)table =Table.new("CallNode")id =node_id(node)# flagstable.field("flags",call_node_flags_inspect(node))# receiverunless (receiver =node.receiver).nil?table.field("receiver",port:true)digraph.edge("#{id}:receiver -> #{node_id(receiver)};")end# call_operator_locunless (call_operator_loc =node.call_operator_loc).nil?table.field("call_operator_loc",location_inspect(call_operator_loc))end# nametable.field("name",node.name.inspect)# message_locunless (message_loc =node.message_loc).nil?table.field("message_loc",location_inspect(message_loc))end# opening_locunless (opening_loc =node.opening_loc).nil?table.field("opening_loc",location_inspect(opening_loc))end# argumentsunless (arguments =node.arguments).nil?table.field("arguments",port:true)digraph.edge("#{id}:arguments -> #{node_id(arguments)};")end# closing_locunless (closing_loc =node.closing_loc).nil?table.field("closing_loc",location_inspect(closing_loc))end# equal_locunless (equal_loc =node.equal_loc).nil?table.field("equal_loc",location_inspect(equal_loc))end# blockunless (block =node.block).nil?table.field("block",port:true)digraph.edge("#{id}:block -> #{node_id(block)};")enddigraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aCallNode node.
Source
# File lib/prism/dot_visitor.rb, line 748defvisit_call_operator_write_node(node)table =Table.new("CallOperatorWriteNode")id =node_id(node)# flagstable.field("flags",call_node_flags_inspect(node))# receiverunless (receiver =node.receiver).nil?table.field("receiver",port:true)digraph.edge("#{id}:receiver -> #{node_id(receiver)};")end# call_operator_locunless (call_operator_loc =node.call_operator_loc).nil?table.field("call_operator_loc",location_inspect(call_operator_loc))end# message_locunless (message_loc =node.message_loc).nil?table.field("message_loc",location_inspect(message_loc))end# read_nametable.field("read_name",node.read_name.inspect)# write_nametable.field("write_name",node.write_name.inspect)# binary_operatortable.field("binary_operator",node.binary_operator.inspect)# binary_operator_loctable.field("binary_operator_loc",location_inspect(node.binary_operator_loc))# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aCallOperatorWriteNode node.
Source
# File lib/prism/dot_visitor.rb, line 797defvisit_call_or_write_node(node)table =Table.new("CallOrWriteNode")id =node_id(node)# flagstable.field("flags",call_node_flags_inspect(node))# receiverunless (receiver =node.receiver).nil?table.field("receiver",port:true)digraph.edge("#{id}:receiver -> #{node_id(receiver)};")end# call_operator_locunless (call_operator_loc =node.call_operator_loc).nil?table.field("call_operator_loc",location_inspect(call_operator_loc))end# message_locunless (message_loc =node.message_loc).nil?table.field("message_loc",location_inspect(message_loc))end# read_nametable.field("read_name",node.read_name.inspect)# write_nametable.field("write_name",node.write_name.inspect)# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aCallOrWriteNode node.
Source
# File lib/prism/dot_visitor.rb, line 843defvisit_call_target_node(node)table =Table.new("CallTargetNode")id =node_id(node)# flagstable.field("flags",call_node_flags_inspect(node))# receivertable.field("receiver",port:true)digraph.edge("#{id}:receiver -> #{node_id(node.receiver)};")# call_operator_loctable.field("call_operator_loc",location_inspect(node.call_operator_loc))# nametable.field("name",node.name.inspect)# message_loctable.field("message_loc",location_inspect(node.message_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aCallTargetNode node.
Source
# File lib/prism/dot_visitor.rb, line 873defvisit_capture_pattern_node(node)table =Table.new("CapturePatternNode")id =node_id(node)# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")# targettable.field("target",port:true)digraph.edge("#{id}:target -> #{node_id(node.target)};")# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aCapturePatternNode node.
Source
# File lib/prism/dot_visitor.rb, line 898defvisit_case_match_node(node)table =Table.new("CaseMatchNode")id =node_id(node)# predicateunless (predicate =node.predicate).nil?table.field("predicate",port:true)digraph.edge("#{id}:predicate -> #{node_id(predicate)};")end# conditionsifnode.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)};") }elsetable.field("conditions","[]")end# else_clauseunless (else_clause =node.else_clause).nil?table.field("else_clause",port:true)digraph.edge("#{id}:else_clause -> #{node_id(else_clause)};")end# case_keyword_loctable.field("case_keyword_loc",location_inspect(node.case_keyword_loc))# end_keyword_loctable.field("end_keyword_loc",location_inspect(node.end_keyword_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aCaseMatchNode node.
Source
# File lib/prism/dot_visitor.rb, line 943defvisit_case_node(node)table =Table.new("CaseNode")id =node_id(node)# predicateunless (predicate =node.predicate).nil?table.field("predicate",port:true)digraph.edge("#{id}:predicate -> #{node_id(predicate)};")end# conditionsifnode.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)};") }elsetable.field("conditions","[]")end# else_clauseunless (else_clause =node.else_clause).nil?table.field("else_clause",port:true)digraph.edge("#{id}:else_clause -> #{node_id(else_clause)};")end# case_keyword_loctable.field("case_keyword_loc",location_inspect(node.case_keyword_loc))# end_keyword_loctable.field("end_keyword_loc",location_inspect(node.end_keyword_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aCaseNode node.
Source
# File lib/prism/dot_visitor.rb, line 988defvisit_class_node(node)table =Table.new("ClassNode")id =node_id(node)# localstable.field("locals",node.locals.inspect)# class_keyword_loctable.field("class_keyword_loc",location_inspect(node.class_keyword_loc))# constant_pathtable.field("constant_path",port:true)digraph.edge("#{id}:constant_path -> #{node_id(node.constant_path)};")# inheritance_operator_locunless (inheritance_operator_loc =node.inheritance_operator_loc).nil?table.field("inheritance_operator_loc",location_inspect(inheritance_operator_loc))end# superclassunless (superclass =node.superclass).nil?table.field("superclass",port:true)digraph.edge("#{id}:superclass -> #{node_id(superclass)};")end# bodyunless (body =node.body).nil?table.field("body",port:true)digraph.edge("#{id}:body -> #{node_id(body)};")end# end_keyword_loctable.field("end_keyword_loc",location_inspect(node.end_keyword_loc))# nametable.field("name",node.name.inspect)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aClassNode node.
Source
# File lib/prism/dot_visitor.rb, line 1035defvisit_class_variable_and_write_node(node)table =Table.new("ClassVariableAndWriteNode")id =node_id(node)# nametable.field("name",node.name.inspect)# name_loctable.field("name_loc",location_inspect(node.name_loc))# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aClassVariableAndWriteNode node.
Source
# File lib/prism/dot_visitor.rb, line 1062defvisit_class_variable_operator_write_node(node)table =Table.new("ClassVariableOperatorWriteNode")id =node_id(node)# nametable.field("name",node.name.inspect)# name_loctable.field("name_loc",location_inspect(node.name_loc))# binary_operator_loctable.field("binary_operator_loc",location_inspect(node.binary_operator_loc))# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")# binary_operatortable.field("binary_operator",node.binary_operator.inspect)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aClassVariableOperatorWriteNode node.
Source
# File lib/prism/dot_visitor.rb, line 1092defvisit_class_variable_or_write_node(node)table =Table.new("ClassVariableOrWriteNode")id =node_id(node)# nametable.field("name",node.name.inspect)# name_loctable.field("name_loc",location_inspect(node.name_loc))# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aClassVariableOrWriteNode node.
Source
# File lib/prism/dot_visitor.rb, line 1119defvisit_class_variable_read_node(node)table =Table.new("ClassVariableReadNode")id =node_id(node)# nametable.field("name",node.name.inspect)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aClassVariableReadNode node.
Source
# File lib/prism/dot_visitor.rb, line 1136defvisit_class_variable_target_node(node)table =Table.new("ClassVariableTargetNode")id =node_id(node)# nametable.field("name",node.name.inspect)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aClassVariableTargetNode node.
Source
# File lib/prism/dot_visitor.rb, line 1153defvisit_class_variable_write_node(node)table =Table.new("ClassVariableWriteNode")id =node_id(node)# nametable.field("name",node.name.inspect)# name_loctable.field("name_loc",location_inspect(node.name_loc))# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aClassVariableWriteNode node.
Source
# File lib/prism/dot_visitor.rb, line 1180defvisit_constant_and_write_node(node)table =Table.new("ConstantAndWriteNode")id =node_id(node)# nametable.field("name",node.name.inspect)# name_loctable.field("name_loc",location_inspect(node.name_loc))# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aConstantAndWriteNode node.
Source
# File lib/prism/dot_visitor.rb, line 1207defvisit_constant_operator_write_node(node)table =Table.new("ConstantOperatorWriteNode")id =node_id(node)# nametable.field("name",node.name.inspect)# name_loctable.field("name_loc",location_inspect(node.name_loc))# binary_operator_loctable.field("binary_operator_loc",location_inspect(node.binary_operator_loc))# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")# binary_operatortable.field("binary_operator",node.binary_operator.inspect)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aConstantOperatorWriteNode node.
Source
# File lib/prism/dot_visitor.rb, line 1237defvisit_constant_or_write_node(node)table =Table.new("ConstantOrWriteNode")id =node_id(node)# nametable.field("name",node.name.inspect)# name_loctable.field("name_loc",location_inspect(node.name_loc))# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aConstantOrWriteNode node.
Source
# File lib/prism/dot_visitor.rb, line 1264defvisit_constant_path_and_write_node(node)table =Table.new("ConstantPathAndWriteNode")id =node_id(node)# targettable.field("target",port:true)digraph.edge("#{id}:target -> #{node_id(node.target)};")# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aConstantPathAndWriteNode node.
Source
# File lib/prism/dot_visitor.rb, line 1289defvisit_constant_path_node(node)table =Table.new("ConstantPathNode")id =node_id(node)# parentunless (parent =node.parent).nil?table.field("parent",port:true)digraph.edge("#{id}:parent -> #{node_id(parent)};")end# nametable.field("name",node.name.inspect)# delimiter_loctable.field("delimiter_loc",location_inspect(node.delimiter_loc))# name_loctable.field("name_loc",location_inspect(node.name_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aConstantPathNode node.
Source
# File lib/prism/dot_visitor.rb, line 1318defvisit_constant_path_operator_write_node(node)table =Table.new("ConstantPathOperatorWriteNode")id =node_id(node)# targettable.field("target",port:true)digraph.edge("#{id}:target -> #{node_id(node.target)};")# binary_operator_loctable.field("binary_operator_loc",location_inspect(node.binary_operator_loc))# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")# binary_operatortable.field("binary_operator",node.binary_operator.inspect)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aConstantPathOperatorWriteNode node.
Source
# File lib/prism/dot_visitor.rb, line 1346defvisit_constant_path_or_write_node(node)table =Table.new("ConstantPathOrWriteNode")id =node_id(node)# targettable.field("target",port:true)digraph.edge("#{id}:target -> #{node_id(node.target)};")# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aConstantPathOrWriteNode node.
Source
# File lib/prism/dot_visitor.rb, line 1371defvisit_constant_path_target_node(node)table =Table.new("ConstantPathTargetNode")id =node_id(node)# parentunless (parent =node.parent).nil?table.field("parent",port:true)digraph.edge("#{id}:parent -> #{node_id(parent)};")end# nametable.field("name",node.name.inspect)# delimiter_loctable.field("delimiter_loc",location_inspect(node.delimiter_loc))# name_loctable.field("name_loc",location_inspect(node.name_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aConstantPathTargetNode node.
Source
# File lib/prism/dot_visitor.rb, line 1400defvisit_constant_path_write_node(node)table =Table.new("ConstantPathWriteNode")id =node_id(node)# targettable.field("target",port:true)digraph.edge("#{id}:target -> #{node_id(node.target)};")# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aConstantPathWriteNode node.
Source
# File lib/prism/dot_visitor.rb, line 1425defvisit_constant_read_node(node)table =Table.new("ConstantReadNode")id =node_id(node)# nametable.field("name",node.name.inspect)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aConstantReadNode node.
Source
# File lib/prism/dot_visitor.rb, line 1442defvisit_constant_target_node(node)table =Table.new("ConstantTargetNode")id =node_id(node)# nametable.field("name",node.name.inspect)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aConstantTargetNode node.
Source
# File lib/prism/dot_visitor.rb, line 1459defvisit_constant_write_node(node)table =Table.new("ConstantWriteNode")id =node_id(node)# nametable.field("name",node.name.inspect)# name_loctable.field("name_loc",location_inspect(node.name_loc))# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aConstantWriteNode node.
Source
# File lib/prism/dot_visitor.rb, line 1486defvisit_def_node(node)table =Table.new("DefNode")id =node_id(node)# nametable.field("name",node.name.inspect)# name_loctable.field("name_loc",location_inspect(node.name_loc))# receiverunless (receiver =node.receiver).nil?table.field("receiver",port:true)digraph.edge("#{id}:receiver -> #{node_id(receiver)};")end# parametersunless (parameters =node.parameters).nil?table.field("parameters",port:true)digraph.edge("#{id}:parameters -> #{node_id(parameters)};")end# bodyunless (body =node.body).nil?table.field("body",port:true)digraph.edge("#{id}:body -> #{node_id(body)};")end# localstable.field("locals",node.locals.inspect)# def_keyword_loctable.field("def_keyword_loc",location_inspect(node.def_keyword_loc))# operator_locunless (operator_loc =node.operator_loc).nil?table.field("operator_loc",location_inspect(operator_loc))end# lparen_locunless (lparen_loc =node.lparen_loc).nil?table.field("lparen_loc",location_inspect(lparen_loc))end# rparen_locunless (rparen_loc =node.rparen_loc).nil?table.field("rparen_loc",location_inspect(rparen_loc))end# equal_locunless (equal_loc =node.equal_loc).nil?table.field("equal_loc",location_inspect(equal_loc))end# end_keyword_locunless (end_keyword_loc =node.end_keyword_loc).nil?table.field("end_keyword_loc",location_inspect(end_keyword_loc))enddigraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aDefNode node.
Source
# File lib/prism/dot_visitor.rb, line 1555defvisit_defined_node(node)table =Table.new("DefinedNode")id =node_id(node)# lparen_locunless (lparen_loc =node.lparen_loc).nil?table.field("lparen_loc",location_inspect(lparen_loc))end# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")# rparen_locunless (rparen_loc =node.rparen_loc).nil?table.field("rparen_loc",location_inspect(rparen_loc))end# keyword_loctable.field("keyword_loc",location_inspect(node.keyword_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aDefinedNode node.
Source
# File lib/prism/dot_visitor.rb, line 1586defvisit_else_node(node)table =Table.new("ElseNode")id =node_id(node)# else_keyword_loctable.field("else_keyword_loc",location_inspect(node.else_keyword_loc))# statementsunless (statements =node.statements).nil?table.field("statements",port:true)digraph.edge("#{id}:statements -> #{node_id(statements)};")end# end_keyword_locunless (end_keyword_loc =node.end_keyword_loc).nil?table.field("end_keyword_loc",location_inspect(end_keyword_loc))enddigraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aElseNode node.
Source
# File lib/prism/dot_visitor.rb, line 1614defvisit_embedded_statements_node(node)table =Table.new("EmbeddedStatementsNode")id =node_id(node)# opening_loctable.field("opening_loc",location_inspect(node.opening_loc))# statementsunless (statements =node.statements).nil?table.field("statements",port:true)digraph.edge("#{id}:statements -> #{node_id(statements)};")end# closing_loctable.field("closing_loc",location_inspect(node.closing_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aEmbeddedStatementsNode node.
Source
# File lib/prism/dot_visitor.rb, line 1640defvisit_embedded_variable_node(node)table =Table.new("EmbeddedVariableNode")id =node_id(node)# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))# variabletable.field("variable",port:true)digraph.edge("#{id}:variable -> #{node_id(node.variable)};")digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aEmbeddedVariableNode node.
Source
# File lib/prism/dot_visitor.rb, line 1661defvisit_ensure_node(node)table =Table.new("EnsureNode")id =node_id(node)# ensure_keyword_loctable.field("ensure_keyword_loc",location_inspect(node.ensure_keyword_loc))# statementsunless (statements =node.statements).nil?table.field("statements",port:true)digraph.edge("#{id}:statements -> #{node_id(statements)};")end# end_keyword_loctable.field("end_keyword_loc",location_inspect(node.end_keyword_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aEnsureNode node.
Source
# File lib/prism/dot_visitor.rb, line 1687defvisit_false_node(node)table =Table.new("FalseNode")id =node_id(node)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aFalseNode node.
Source
# File lib/prism/dot_visitor.rb, line 1701defvisit_find_pattern_node(node)table =Table.new("FindPatternNode")id =node_id(node)# constantunless (constant =node.constant).nil?table.field("constant",port:true)digraph.edge("#{id}:constant -> #{node_id(constant)};")end# lefttable.field("left",port:true)digraph.edge("#{id}:left -> #{node_id(node.left)};")# requiredsifnode.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)};") }elsetable.field("requireds","[]")end# righttable.field("right",port:true)digraph.edge("#{id}:right -> #{node_id(node.right)};")# opening_locunless (opening_loc =node.opening_loc).nil?table.field("opening_loc",location_inspect(opening_loc))end# closing_locunless (closing_loc =node.closing_loc).nil?table.field("closing_loc",location_inspect(closing_loc))enddigraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aFindPatternNode node.
Source
# File lib/prism/dot_visitor.rb, line 1752defvisit_flip_flop_node(node)table =Table.new("FlipFlopNode")id =node_id(node)# flagstable.field("flags",range_flags_inspect(node))# leftunless (left =node.left).nil?table.field("left",port:true)digraph.edge("#{id}:left -> #{node_id(left)};")end# rightunless (right =node.right).nil?table.field("right",port:true)digraph.edge("#{id}:right -> #{node_id(right)};")end# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aFlipFlopNode node.
Source
# File lib/prism/dot_visitor.rb, line 1784defvisit_float_node(node)table =Table.new("FloatNode")id =node_id(node)# valuetable.field("value",node.value.inspect)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aFloatNode node.
Source
# File lib/prism/dot_visitor.rb, line 1801defvisit_for_node(node)table =Table.new("ForNode")id =node_id(node)# indextable.field("index",port:true)digraph.edge("#{id}:index -> #{node_id(node.index)};")# collectiontable.field("collection",port:true)digraph.edge("#{id}:collection -> #{node_id(node.collection)};")# statementsunless (statements =node.statements).nil?table.field("statements",port:true)digraph.edge("#{id}:statements -> #{node_id(statements)};")end# for_keyword_loctable.field("for_keyword_loc",location_inspect(node.for_keyword_loc))# in_keyword_loctable.field("in_keyword_loc",location_inspect(node.in_keyword_loc))# do_keyword_locunless (do_keyword_loc =node.do_keyword_loc).nil?table.field("do_keyword_loc",location_inspect(do_keyword_loc))end# end_keyword_loctable.field("end_keyword_loc",location_inspect(node.end_keyword_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aForNode node.
Source
# File lib/prism/dot_visitor.rb, line 1843defvisit_forwarding_arguments_node(node)table =Table.new("ForwardingArgumentsNode")id =node_id(node)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aForwardingArgumentsNode node.
Source
# File lib/prism/dot_visitor.rb, line 1857defvisit_forwarding_parameter_node(node)table =Table.new("ForwardingParameterNode")id =node_id(node)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aForwardingParameterNode node.
Source
# File lib/prism/dot_visitor.rb, line 1871defvisit_forwarding_super_node(node)table =Table.new("ForwardingSuperNode")id =node_id(node)# blockunless (block =node.block).nil?table.field("block",port:true)digraph.edge("#{id}:block -> #{node_id(block)};")enddigraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aForwardingSuperNode node.
Source
# File lib/prism/dot_visitor.rb, line 1891defvisit_global_variable_and_write_node(node)table =Table.new("GlobalVariableAndWriteNode")id =node_id(node)# nametable.field("name",node.name.inspect)# name_loctable.field("name_loc",location_inspect(node.name_loc))# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aGlobalVariableAndWriteNode node.
Source
# File lib/prism/dot_visitor.rb, line 1918defvisit_global_variable_operator_write_node(node)table =Table.new("GlobalVariableOperatorWriteNode")id =node_id(node)# nametable.field("name",node.name.inspect)# name_loctable.field("name_loc",location_inspect(node.name_loc))# binary_operator_loctable.field("binary_operator_loc",location_inspect(node.binary_operator_loc))# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")# binary_operatortable.field("binary_operator",node.binary_operator.inspect)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aGlobalVariableOperatorWriteNode node.
Source
# File lib/prism/dot_visitor.rb, line 1948defvisit_global_variable_or_write_node(node)table =Table.new("GlobalVariableOrWriteNode")id =node_id(node)# nametable.field("name",node.name.inspect)# name_loctable.field("name_loc",location_inspect(node.name_loc))# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aGlobalVariableOrWriteNode node.
Source
# File lib/prism/dot_visitor.rb, line 1975defvisit_global_variable_read_node(node)table =Table.new("GlobalVariableReadNode")id =node_id(node)# nametable.field("name",node.name.inspect)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aGlobalVariableReadNode node.
Source
# File lib/prism/dot_visitor.rb, line 1992defvisit_global_variable_target_node(node)table =Table.new("GlobalVariableTargetNode")id =node_id(node)# nametable.field("name",node.name.inspect)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aGlobalVariableTargetNode node.
Source
# File lib/prism/dot_visitor.rb, line 2009defvisit_global_variable_write_node(node)table =Table.new("GlobalVariableWriteNode")id =node_id(node)# nametable.field("name",node.name.inspect)# name_loctable.field("name_loc",location_inspect(node.name_loc))# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aGlobalVariableWriteNode node.
Source
# File lib/prism/dot_visitor.rb, line 2036defvisit_hash_node(node)table =Table.new("HashNode")id =node_id(node)# opening_loctable.field("opening_loc",location_inspect(node.opening_loc))# elementsifnode.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)};") }elsetable.field("elements","[]")end# closing_loctable.field("closing_loc",location_inspect(node.closing_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aHashNode node.
Source
# File lib/prism/dot_visitor.rb, line 2069defvisit_hash_pattern_node(node)table =Table.new("HashPatternNode")id =node_id(node)# constantunless (constant =node.constant).nil?table.field("constant",port:true)digraph.edge("#{id}:constant -> #{node_id(constant)};")end# elementsifnode.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)};") }elsetable.field("elements","[]")end# restunless (rest =node.rest).nil?table.field("rest",port:true)digraph.edge("#{id}:rest -> #{node_id(rest)};")end# opening_locunless (opening_loc =node.opening_loc).nil?table.field("opening_loc",location_inspect(opening_loc))end# closing_locunless (closing_loc =node.closing_loc).nil?table.field("closing_loc",location_inspect(closing_loc))enddigraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aHashPatternNode node.
Source
# File lib/prism/dot_visitor.rb, line 2118defvisit_if_node(node)table =Table.new("IfNode")id =node_id(node)# if_keyword_locunless (if_keyword_loc =node.if_keyword_loc).nil?table.field("if_keyword_loc",location_inspect(if_keyword_loc))end# predicatetable.field("predicate",port:true)digraph.edge("#{id}:predicate -> #{node_id(node.predicate)};")# then_keyword_locunless (then_keyword_loc =node.then_keyword_loc).nil?table.field("then_keyword_loc",location_inspect(then_keyword_loc))end# statementsunless (statements =node.statements).nil?table.field("statements",port:true)digraph.edge("#{id}:statements -> #{node_id(statements)};")end# subsequentunless (subsequent =node.subsequent).nil?table.field("subsequent",port:true)digraph.edge("#{id}:subsequent -> #{node_id(subsequent)};")end# end_keyword_locunless (end_keyword_loc =node.end_keyword_loc).nil?table.field("end_keyword_loc",location_inspect(end_keyword_loc))enddigraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aIfNode node.
Source
# File lib/prism/dot_visitor.rb, line 2163defvisit_imaginary_node(node)table =Table.new("ImaginaryNode")id =node_id(node)# numerictable.field("numeric",port:true)digraph.edge("#{id}:numeric -> #{node_id(node.numeric)};")digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aImaginaryNode node.
Source
# File lib/prism/dot_visitor.rb, line 2181defvisit_implicit_node(node)table =Table.new("ImplicitNode")id =node_id(node)# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aImplicitNode node.
Source
# File lib/prism/dot_visitor.rb, line 2199defvisit_implicit_rest_node(node)table =Table.new("ImplicitRestNode")id =node_id(node)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aImplicitRestNode node.
Source
# File lib/prism/dot_visitor.rb, line 2213defvisit_in_node(node)table =Table.new("InNode")id =node_id(node)# patterntable.field("pattern",port:true)digraph.edge("#{id}:pattern -> #{node_id(node.pattern)};")# statementsunless (statements =node.statements).nil?table.field("statements",port:true)digraph.edge("#{id}:statements -> #{node_id(statements)};")end# in_loctable.field("in_loc",location_inspect(node.in_loc))# then_locunless (then_loc =node.then_loc).nil?table.field("then_loc",location_inspect(then_loc))enddigraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aInNode node.
Source
# File lib/prism/dot_visitor.rb, line 2245defvisit_index_and_write_node(node)table =Table.new("IndexAndWriteNode")id =node_id(node)# flagstable.field("flags",call_node_flags_inspect(node))# receiverunless (receiver =node.receiver).nil?table.field("receiver",port:true)digraph.edge("#{id}:receiver -> #{node_id(receiver)};")end# call_operator_locunless (call_operator_loc =node.call_operator_loc).nil?table.field("call_operator_loc",location_inspect(call_operator_loc))end# opening_loctable.field("opening_loc",location_inspect(node.opening_loc))# argumentsunless (arguments =node.arguments).nil?table.field("arguments",port:true)digraph.edge("#{id}:arguments -> #{node_id(arguments)};")end# closing_loctable.field("closing_loc",location_inspect(node.closing_loc))# blockunless (block =node.block).nil?table.field("block",port:true)digraph.edge("#{id}:block -> #{node_id(block)};")end# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aIndexAndWriteNode node.
Source
# File lib/prism/dot_visitor.rb, line 2298defvisit_index_operator_write_node(node)table =Table.new("IndexOperatorWriteNode")id =node_id(node)# flagstable.field("flags",call_node_flags_inspect(node))# receiverunless (receiver =node.receiver).nil?table.field("receiver",port:true)digraph.edge("#{id}:receiver -> #{node_id(receiver)};")end# call_operator_locunless (call_operator_loc =node.call_operator_loc).nil?table.field("call_operator_loc",location_inspect(call_operator_loc))end# opening_loctable.field("opening_loc",location_inspect(node.opening_loc))# argumentsunless (arguments =node.arguments).nil?table.field("arguments",port:true)digraph.edge("#{id}:arguments -> #{node_id(arguments)};")end# closing_loctable.field("closing_loc",location_inspect(node.closing_loc))# blockunless (block =node.block).nil?table.field("block",port:true)digraph.edge("#{id}:block -> #{node_id(block)};")end# binary_operatortable.field("binary_operator",node.binary_operator.inspect)# binary_operator_loctable.field("binary_operator_loc",location_inspect(node.binary_operator_loc))# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aIndexOperatorWriteNode node.
Source
# File lib/prism/dot_visitor.rb, line 2354defvisit_index_or_write_node(node)table =Table.new("IndexOrWriteNode")id =node_id(node)# flagstable.field("flags",call_node_flags_inspect(node))# receiverunless (receiver =node.receiver).nil?table.field("receiver",port:true)digraph.edge("#{id}:receiver -> #{node_id(receiver)};")end# call_operator_locunless (call_operator_loc =node.call_operator_loc).nil?table.field("call_operator_loc",location_inspect(call_operator_loc))end# opening_loctable.field("opening_loc",location_inspect(node.opening_loc))# argumentsunless (arguments =node.arguments).nil?table.field("arguments",port:true)digraph.edge("#{id}:arguments -> #{node_id(arguments)};")end# closing_loctable.field("closing_loc",location_inspect(node.closing_loc))# blockunless (block =node.block).nil?table.field("block",port:true)digraph.edge("#{id}:block -> #{node_id(block)};")end# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aIndexOrWriteNode node.
Source
# File lib/prism/dot_visitor.rb, line 2407defvisit_index_target_node(node)table =Table.new("IndexTargetNode")id =node_id(node)# flagstable.field("flags",call_node_flags_inspect(node))# receivertable.field("receiver",port:true)digraph.edge("#{id}:receiver -> #{node_id(node.receiver)};")# opening_loctable.field("opening_loc",location_inspect(node.opening_loc))# argumentsunless (arguments =node.arguments).nil?table.field("arguments",port:true)digraph.edge("#{id}:arguments -> #{node_id(arguments)};")end# closing_loctable.field("closing_loc",location_inspect(node.closing_loc))# blockunless (block =node.block).nil?table.field("block",port:true)digraph.edge("#{id}:block -> #{node_id(block)};")enddigraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aIndexTargetNode node.
Source
# File lib/prism/dot_visitor.rb, line 2446defvisit_instance_variable_and_write_node(node)table =Table.new("InstanceVariableAndWriteNode")id =node_id(node)# nametable.field("name",node.name.inspect)# name_loctable.field("name_loc",location_inspect(node.name_loc))# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aInstanceVariableAndWriteNode node.
Source
# File lib/prism/dot_visitor.rb, line 2473defvisit_instance_variable_operator_write_node(node)table =Table.new("InstanceVariableOperatorWriteNode")id =node_id(node)# nametable.field("name",node.name.inspect)# name_loctable.field("name_loc",location_inspect(node.name_loc))# binary_operator_loctable.field("binary_operator_loc",location_inspect(node.binary_operator_loc))# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")# binary_operatortable.field("binary_operator",node.binary_operator.inspect)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aInstanceVariableOperatorWriteNode node.
Source
# File lib/prism/dot_visitor.rb, line 2503defvisit_instance_variable_or_write_node(node)table =Table.new("InstanceVariableOrWriteNode")id =node_id(node)# nametable.field("name",node.name.inspect)# name_loctable.field("name_loc",location_inspect(node.name_loc))# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aInstanceVariableOrWriteNode node.
Source
# File lib/prism/dot_visitor.rb, line 2530defvisit_instance_variable_read_node(node)table =Table.new("InstanceVariableReadNode")id =node_id(node)# nametable.field("name",node.name.inspect)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aInstanceVariableReadNode node.
Source
# File lib/prism/dot_visitor.rb, line 2547defvisit_instance_variable_target_node(node)table =Table.new("InstanceVariableTargetNode")id =node_id(node)# nametable.field("name",node.name.inspect)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aInstanceVariableTargetNode node.
Source
# File lib/prism/dot_visitor.rb, line 2564defvisit_instance_variable_write_node(node)table =Table.new("InstanceVariableWriteNode")id =node_id(node)# nametable.field("name",node.name.inspect)# name_loctable.field("name_loc",location_inspect(node.name_loc))# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aInstanceVariableWriteNode node.
Source
# File lib/prism/dot_visitor.rb, line 2591defvisit_integer_node(node)table =Table.new("IntegerNode")id =node_id(node)# flagstable.field("flags",integer_base_flags_inspect(node))# valuetable.field("value",node.value.inspect)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aIntegerNode node.
Source
# File lib/prism/dot_visitor.rb, line 2611defvisit_interpolated_match_last_line_node(node)table =Table.new("InterpolatedMatchLastLineNode")id =node_id(node)# flagstable.field("flags",regular_expression_flags_inspect(node))# opening_loctable.field("opening_loc",location_inspect(node.opening_loc))# partsifnode.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)};") }elsetable.field("parts","[]")end# closing_loctable.field("closing_loc",location_inspect(node.closing_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aInterpolatedMatchLastLineNode node.
Source
# File lib/prism/dot_visitor.rb, line 2647defvisit_interpolated_regular_expression_node(node)table =Table.new("InterpolatedRegularExpressionNode")id =node_id(node)# flagstable.field("flags",regular_expression_flags_inspect(node))# opening_loctable.field("opening_loc",location_inspect(node.opening_loc))# partsifnode.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)};") }elsetable.field("parts","[]")end# closing_loctable.field("closing_loc",location_inspect(node.closing_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aInterpolatedRegularExpressionNode node.
Source
# File lib/prism/dot_visitor.rb, line 2683defvisit_interpolated_string_node(node)table =Table.new("InterpolatedStringNode")id =node_id(node)# flagstable.field("flags",interpolated_string_node_flags_inspect(node))# opening_locunless (opening_loc =node.opening_loc).nil?table.field("opening_loc",location_inspect(opening_loc))end# partsifnode.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)};") }elsetable.field("parts","[]")end# closing_locunless (closing_loc =node.closing_loc).nil?table.field("closing_loc",location_inspect(closing_loc))enddigraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aInterpolatedStringNode node.
Source
# File lib/prism/dot_visitor.rb, line 2723defvisit_interpolated_symbol_node(node)table =Table.new("InterpolatedSymbolNode")id =node_id(node)# opening_locunless (opening_loc =node.opening_loc).nil?table.field("opening_loc",location_inspect(opening_loc))end# partsifnode.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)};") }elsetable.field("parts","[]")end# closing_locunless (closing_loc =node.closing_loc).nil?table.field("closing_loc",location_inspect(closing_loc))enddigraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aInterpolatedSymbolNode node.
Source
# File lib/prism/dot_visitor.rb, line 2760defvisit_interpolated_x_string_node(node)table =Table.new("InterpolatedXStringNode")id =node_id(node)# opening_loctable.field("opening_loc",location_inspect(node.opening_loc))# partsifnode.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)};") }elsetable.field("parts","[]")end# closing_loctable.field("closing_loc",location_inspect(node.closing_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aInterpolatedXStringNode node.
Source
# File lib/prism/dot_visitor.rb, line 2793defvisit_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 ")}> ]; DOTsuperend
Visit aItLocalVariableReadNode node.
Source
# File lib/prism/dot_visitor.rb, line 2807defvisit_it_parameters_node(node)table =Table.new("ItParametersNode")id =node_id(node)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aItParametersNode node.
Source
# File lib/prism/dot_visitor.rb, line 2821defvisit_keyword_hash_node(node)table =Table.new("KeywordHashNode")id =node_id(node)# flagstable.field("flags",keyword_hash_node_flags_inspect(node))# elementsifnode.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)};") }elsetable.field("elements","[]")enddigraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aKeywordHashNode node.
Source
# File lib/prism/dot_visitor.rb, line 2851defvisit_keyword_rest_parameter_node(node)table =Table.new("KeywordRestParameterNode")id =node_id(node)# flagstable.field("flags",parameter_flags_inspect(node))# nametable.field("name",node.name.inspect)# name_locunless (name_loc =node.name_loc).nil?table.field("name_loc",location_inspect(name_loc))end# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aKeywordRestParameterNode node.
Source
# File lib/prism/dot_visitor.rb, line 2879defvisit_lambda_node(node)table =Table.new("LambdaNode")id =node_id(node)# localstable.field("locals",node.locals.inspect)# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))# opening_loctable.field("opening_loc",location_inspect(node.opening_loc))# closing_loctable.field("closing_loc",location_inspect(node.closing_loc))# parametersunless (parameters =node.parameters).nil?table.field("parameters",port:true)digraph.edge("#{id}:parameters -> #{node_id(parameters)};")end# bodyunless (body =node.body).nil?table.field("body",port:true)digraph.edge("#{id}:body -> #{node_id(body)};")enddigraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aLambdaNode node.
Source
# File lib/prism/dot_visitor.rb, line 2917defvisit_local_variable_and_write_node(node)table =Table.new("LocalVariableAndWriteNode")id =node_id(node)# name_loctable.field("name_loc",location_inspect(node.name_loc))# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")# nametable.field("name",node.name.inspect)# depthtable.field("depth",node.depth.inspect)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aLocalVariableAndWriteNode node.
Source
# File lib/prism/dot_visitor.rb, line 2947defvisit_local_variable_operator_write_node(node)table =Table.new("LocalVariableOperatorWriteNode")id =node_id(node)# name_loctable.field("name_loc",location_inspect(node.name_loc))# binary_operator_loctable.field("binary_operator_loc",location_inspect(node.binary_operator_loc))# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")# nametable.field("name",node.name.inspect)# binary_operatortable.field("binary_operator",node.binary_operator.inspect)# depthtable.field("depth",node.depth.inspect)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aLocalVariableOperatorWriteNode node.
Source
# File lib/prism/dot_visitor.rb, line 2980defvisit_local_variable_or_write_node(node)table =Table.new("LocalVariableOrWriteNode")id =node_id(node)# name_loctable.field("name_loc",location_inspect(node.name_loc))# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")# nametable.field("name",node.name.inspect)# depthtable.field("depth",node.depth.inspect)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aLocalVariableOrWriteNode node.
Source
# File lib/prism/dot_visitor.rb, line 3010defvisit_local_variable_read_node(node)table =Table.new("LocalVariableReadNode")id =node_id(node)# nametable.field("name",node.name.inspect)# depthtable.field("depth",node.depth.inspect)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aLocalVariableReadNode node.
Source
# File lib/prism/dot_visitor.rb, line 3030defvisit_local_variable_target_node(node)table =Table.new("LocalVariableTargetNode")id =node_id(node)# nametable.field("name",node.name.inspect)# depthtable.field("depth",node.depth.inspect)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aLocalVariableTargetNode node.
Source
# File lib/prism/dot_visitor.rb, line 3050defvisit_local_variable_write_node(node)table =Table.new("LocalVariableWriteNode")id =node_id(node)# nametable.field("name",node.name.inspect)# depthtable.field("depth",node.depth.inspect)# name_loctable.field("name_loc",location_inspect(node.name_loc))# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aLocalVariableWriteNode node.
Source
# File lib/prism/dot_visitor.rb, line 3080defvisit_match_last_line_node(node)table =Table.new("MatchLastLineNode")id =node_id(node)# flagstable.field("flags",regular_expression_flags_inspect(node))# opening_loctable.field("opening_loc",location_inspect(node.opening_loc))# content_loctable.field("content_loc",location_inspect(node.content_loc))# closing_loctable.field("closing_loc",location_inspect(node.closing_loc))# unescapedtable.field("unescaped",node.unescaped.inspect)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aMatchLastLineNode node.
Source
# File lib/prism/dot_visitor.rb, line 3109defvisit_match_predicate_node(node)table =Table.new("MatchPredicateNode")id =node_id(node)# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")# patterntable.field("pattern",port:true)digraph.edge("#{id}:pattern -> #{node_id(node.pattern)};")# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aMatchPredicateNode node.
Source
# File lib/prism/dot_visitor.rb, line 3134defvisit_match_required_node(node)table =Table.new("MatchRequiredNode")id =node_id(node)# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")# patterntable.field("pattern",port:true)digraph.edge("#{id}:pattern -> #{node_id(node.pattern)};")# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aMatchRequiredNode node.
Source
# File lib/prism/dot_visitor.rb, line 3159defvisit_match_write_node(node)table =Table.new("MatchWriteNode")id =node_id(node)# calltable.field("call",port:true)digraph.edge("#{id}:call -> #{node_id(node.call)};")# targetsifnode.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)};") }elsetable.field("targets","[]")enddigraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aMatchWriteNode node.
Source
# File lib/prism/dot_visitor.rb, line 3190defvisit_missing_node(node)table =Table.new("MissingNode")id =node_id(node)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aMissingNode node.
Source
# File lib/prism/dot_visitor.rb, line 3204defvisit_module_node(node)table =Table.new("ModuleNode")id =node_id(node)# localstable.field("locals",node.locals.inspect)# module_keyword_loctable.field("module_keyword_loc",location_inspect(node.module_keyword_loc))# constant_pathtable.field("constant_path",port:true)digraph.edge("#{id}:constant_path -> #{node_id(node.constant_path)};")# bodyunless (body =node.body).nil?table.field("body",port:true)digraph.edge("#{id}:body -> #{node_id(body)};")end# end_keyword_loctable.field("end_keyword_loc",location_inspect(node.end_keyword_loc))# nametable.field("name",node.name.inspect)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aModuleNode node.
Source
# File lib/prism/dot_visitor.rb, line 3240defvisit_multi_target_node(node)table =Table.new("MultiTargetNode")id =node_id(node)# leftsifnode.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)};") }elsetable.field("lefts","[]")end# restunless (rest =node.rest).nil?table.field("rest",port:true)digraph.edge("#{id}:rest -> #{node_id(rest)};")end# rightsifnode.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)};") }elsetable.field("rights","[]")end# lparen_locunless (lparen_loc =node.lparen_loc).nil?table.field("lparen_loc",location_inspect(lparen_loc))end# rparen_locunless (rparen_loc =node.rparen_loc).nil?table.field("rparen_loc",location_inspect(rparen_loc))enddigraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aMultiTargetNode node.
Source
# File lib/prism/dot_visitor.rb, line 3296defvisit_multi_write_node(node)table =Table.new("MultiWriteNode")id =node_id(node)# leftsifnode.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)};") }elsetable.field("lefts","[]")end# restunless (rest =node.rest).nil?table.field("rest",port:true)digraph.edge("#{id}:rest -> #{node_id(rest)};")end# rightsifnode.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)};") }elsetable.field("rights","[]")end# lparen_locunless (lparen_loc =node.lparen_loc).nil?table.field("lparen_loc",location_inspect(lparen_loc))end# rparen_locunless (rparen_loc =node.rparen_loc).nil?table.field("rparen_loc",location_inspect(rparen_loc))end# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aMultiWriteNode node.
Source
# File lib/prism/dot_visitor.rb, line 3359defvisit_next_node(node)table =Table.new("NextNode")id =node_id(node)# argumentsunless (arguments =node.arguments).nil?table.field("arguments",port:true)digraph.edge("#{id}:arguments -> #{node_id(arguments)};")end# keyword_loctable.field("keyword_loc",location_inspect(node.keyword_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aNextNode node.
Source
# File lib/prism/dot_visitor.rb, line 3382defvisit_nil_node(node)table =Table.new("NilNode")id =node_id(node)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aNilNode node.
Source
# File lib/prism/dot_visitor.rb, line 3396defvisit_no_keywords_parameter_node(node)table =Table.new("NoKeywordsParameterNode")id =node_id(node)# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))# keyword_loctable.field("keyword_loc",location_inspect(node.keyword_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aNoKeywordsParameterNode node.
Source
# File lib/prism/dot_visitor.rb, line 3416defvisit_numbered_parameters_node(node)table =Table.new("NumberedParametersNode")id =node_id(node)# maximumtable.field("maximum",node.maximum.inspect)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aNumberedParametersNode node.
Source
# File lib/prism/dot_visitor.rb, line 3433defvisit_numbered_reference_read_node(node)table =Table.new("NumberedReferenceReadNode")id =node_id(node)# numbertable.field("number",node.number.inspect)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aNumberedReferenceReadNode node.
Source
# File lib/prism/dot_visitor.rb, line 3450defvisit_optional_keyword_parameter_node(node)table =Table.new("OptionalKeywordParameterNode")id =node_id(node)# flagstable.field("flags",parameter_flags_inspect(node))# nametable.field("name",node.name.inspect)# name_loctable.field("name_loc",location_inspect(node.name_loc))# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aOptionalKeywordParameterNode node.
Source
# File lib/prism/dot_visitor.rb, line 3477defvisit_optional_parameter_node(node)table =Table.new("OptionalParameterNode")id =node_id(node)# flagstable.field("flags",parameter_flags_inspect(node))# nametable.field("name",node.name.inspect)# name_loctable.field("name_loc",location_inspect(node.name_loc))# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))# valuetable.field("value",port:true)digraph.edge("#{id}:value -> #{node_id(node.value)};")digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aOptionalParameterNode node.
Source
# File lib/prism/dot_visitor.rb, line 3507defvisit_or_node(node)table =Table.new("OrNode")id =node_id(node)# lefttable.field("left",port:true)digraph.edge("#{id}:left -> #{node_id(node.left)};")# righttable.field("right",port:true)digraph.edge("#{id}:right -> #{node_id(node.right)};")# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aOrNode node.
Source
# File lib/prism/dot_visitor.rb, line 3532defvisit_parameters_node(node)table =Table.new("ParametersNode")id =node_id(node)# requiredsifnode.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)};") }elsetable.field("requireds","[]")end# optionalsifnode.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)};") }elsetable.field("optionals","[]")end# restunless (rest =node.rest).nil?table.field("rest",port:true)digraph.edge("#{id}:rest -> #{node_id(rest)};")end# postsifnode.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)};") }elsetable.field("posts","[]")end# keywordsifnode.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)};") }elsetable.field("keywords","[]")end# keyword_restunless (keyword_rest =node.keyword_rest).nil?table.field("keyword_rest",port:true)digraph.edge("#{id}:keyword_rest -> #{node_id(keyword_rest)};")end# blockunless (block =node.block).nil?table.field("block",port:true)digraph.edge("#{id}:block -> #{node_id(block)};")enddigraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aParametersNode node.
Source
# File lib/prism/dot_visitor.rb, line 3616defvisit_parentheses_node(node)table =Table.new("ParenthesesNode")id =node_id(node)# flagstable.field("flags",parentheses_node_flags_inspect(node))# bodyunless (body =node.body).nil?table.field("body",port:true)digraph.edge("#{id}:body -> #{node_id(body)};")end# opening_loctable.field("opening_loc",location_inspect(node.opening_loc))# closing_loctable.field("closing_loc",location_inspect(node.closing_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aParenthesesNode node.
Source
# File lib/prism/dot_visitor.rb, line 3645defvisit_pinned_expression_node(node)table =Table.new("PinnedExpressionNode")id =node_id(node)# expressiontable.field("expression",port:true)digraph.edge("#{id}:expression -> #{node_id(node.expression)};")# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))# lparen_loctable.field("lparen_loc",location_inspect(node.lparen_loc))# rparen_loctable.field("rparen_loc",location_inspect(node.rparen_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aPinnedExpressionNode node.
Source
# File lib/prism/dot_visitor.rb, line 3672defvisit_pinned_variable_node(node)table =Table.new("PinnedVariableNode")id =node_id(node)# variabletable.field("variable",port:true)digraph.edge("#{id}:variable -> #{node_id(node.variable)};")# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aPinnedVariableNode node.
Source
# File lib/prism/dot_visitor.rb, line 3693defvisit_post_execution_node(node)table =Table.new("PostExecutionNode")id =node_id(node)# statementsunless (statements =node.statements).nil?table.field("statements",port:true)digraph.edge("#{id}:statements -> #{node_id(statements)};")end# keyword_loctable.field("keyword_loc",location_inspect(node.keyword_loc))# opening_loctable.field("opening_loc",location_inspect(node.opening_loc))# closing_loctable.field("closing_loc",location_inspect(node.closing_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aPostExecutionNode node.
Source
# File lib/prism/dot_visitor.rb, line 3722defvisit_pre_execution_node(node)table =Table.new("PreExecutionNode")id =node_id(node)# statementsunless (statements =node.statements).nil?table.field("statements",port:true)digraph.edge("#{id}:statements -> #{node_id(statements)};")end# keyword_loctable.field("keyword_loc",location_inspect(node.keyword_loc))# opening_loctable.field("opening_loc",location_inspect(node.opening_loc))# closing_loctable.field("closing_loc",location_inspect(node.closing_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aPreExecutionNode node.
Source
# File lib/prism/dot_visitor.rb, line 3751defvisit_program_node(node)table =Table.new("ProgramNode")id =node_id(node)# localstable.field("locals",node.locals.inspect)# statementstable.field("statements",port:true)digraph.edge("#{id}:statements -> #{node_id(node.statements)};")digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aProgramNode node.
Source
# File lib/prism/dot_visitor.rb, line 3772defvisit_range_node(node)table =Table.new("RangeNode")id =node_id(node)# flagstable.field("flags",range_flags_inspect(node))# leftunless (left =node.left).nil?table.field("left",port:true)digraph.edge("#{id}:left -> #{node_id(left)};")end# rightunless (right =node.right).nil?table.field("right",port:true)digraph.edge("#{id}:right -> #{node_id(right)};")end# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aRangeNode node.
Source
# File lib/prism/dot_visitor.rb, line 3804defvisit_rational_node(node)table =Table.new("RationalNode")id =node_id(node)# flagstable.field("flags",integer_base_flags_inspect(node))# numeratortable.field("numerator",node.numerator.inspect)# denominatortable.field("denominator",node.denominator.inspect)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aRationalNode node.
Source
# File lib/prism/dot_visitor.rb, line 3827defvisit_redo_node(node)table =Table.new("RedoNode")id =node_id(node)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aRedoNode node.
Source
# File lib/prism/dot_visitor.rb, line 3841defvisit_regular_expression_node(node)table =Table.new("RegularExpressionNode")id =node_id(node)# flagstable.field("flags",regular_expression_flags_inspect(node))# opening_loctable.field("opening_loc",location_inspect(node.opening_loc))# content_loctable.field("content_loc",location_inspect(node.content_loc))# closing_loctable.field("closing_loc",location_inspect(node.closing_loc))# unescapedtable.field("unescaped",node.unescaped.inspect)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aRegularExpressionNode node.
Source
# File lib/prism/dot_visitor.rb, line 3870defvisit_required_keyword_parameter_node(node)table =Table.new("RequiredKeywordParameterNode")id =node_id(node)# flagstable.field("flags",parameter_flags_inspect(node))# nametable.field("name",node.name.inspect)# name_loctable.field("name_loc",location_inspect(node.name_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aRequiredKeywordParameterNode node.
Source
# File lib/prism/dot_visitor.rb, line 3893defvisit_required_parameter_node(node)table =Table.new("RequiredParameterNode")id =node_id(node)# flagstable.field("flags",parameter_flags_inspect(node))# nametable.field("name",node.name.inspect)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aRequiredParameterNode node.
Source
# File lib/prism/dot_visitor.rb, line 3913defvisit_rescue_modifier_node(node)table =Table.new("RescueModifierNode")id =node_id(node)# expressiontable.field("expression",port:true)digraph.edge("#{id}:expression -> #{node_id(node.expression)};")# keyword_loctable.field("keyword_loc",location_inspect(node.keyword_loc))# rescue_expressiontable.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 ")}> ]; DOTsuperend
Visit aRescueModifierNode node.
Source
# File lib/prism/dot_visitor.rb, line 3938defvisit_rescue_node(node)table =Table.new("RescueNode")id =node_id(node)# keyword_loctable.field("keyword_loc",location_inspect(node.keyword_loc))# exceptionsifnode.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)};") }elsetable.field("exceptions","[]")end# operator_locunless (operator_loc =node.operator_loc).nil?table.field("operator_loc",location_inspect(operator_loc))end# referenceunless (reference =node.reference).nil?table.field("reference",port:true)digraph.edge("#{id}:reference -> #{node_id(reference)};")end# then_keyword_locunless (then_keyword_loc =node.then_keyword_loc).nil?table.field("then_keyword_loc",location_inspect(then_keyword_loc))end# statementsunless (statements =node.statements).nil?table.field("statements",port:true)digraph.edge("#{id}:statements -> #{node_id(statements)};")end# subsequentunless (subsequent =node.subsequent).nil?table.field("subsequent",port:true)digraph.edge("#{id}:subsequent -> #{node_id(subsequent)};")enddigraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aRescueNode node.
Source
# File lib/prism/dot_visitor.rb, line 3996defvisit_rest_parameter_node(node)table =Table.new("RestParameterNode")id =node_id(node)# flagstable.field("flags",parameter_flags_inspect(node))# nametable.field("name",node.name.inspect)# name_locunless (name_loc =node.name_loc).nil?table.field("name_loc",location_inspect(name_loc))end# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aRestParameterNode node.
Source
# File lib/prism/dot_visitor.rb, line 4024defvisit_retry_node(node)table =Table.new("RetryNode")id =node_id(node)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aRetryNode node.
Source
# File lib/prism/dot_visitor.rb, line 4038defvisit_return_node(node)table =Table.new("ReturnNode")id =node_id(node)# keyword_loctable.field("keyword_loc",location_inspect(node.keyword_loc))# argumentsunless (arguments =node.arguments).nil?table.field("arguments",port:true)digraph.edge("#{id}:arguments -> #{node_id(arguments)};")enddigraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aReturnNode node.
Source
# File lib/prism/dot_visitor.rb, line 4061defvisit_self_node(node)table =Table.new("SelfNode")id =node_id(node)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aSelfNode node.
Source
# File lib/prism/dot_visitor.rb, line 4075defvisit_shareable_constant_node(node)table =Table.new("ShareableConstantNode")id =node_id(node)# flagstable.field("flags",shareable_constant_node_flags_inspect(node))# writetable.field("write",port:true)digraph.edge("#{id}:write -> #{node_id(node.write)};")digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aShareableConstantNode node.
Source
# File lib/prism/dot_visitor.rb, line 4096defvisit_singleton_class_node(node)table =Table.new("SingletonClassNode")id =node_id(node)# localstable.field("locals",node.locals.inspect)# class_keyword_loctable.field("class_keyword_loc",location_inspect(node.class_keyword_loc))# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))# expressiontable.field("expression",port:true)digraph.edge("#{id}:expression -> #{node_id(node.expression)};")# bodyunless (body =node.body).nil?table.field("body",port:true)digraph.edge("#{id}:body -> #{node_id(body)};")end# end_keyword_loctable.field("end_keyword_loc",location_inspect(node.end_keyword_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aSingletonClassNode node.
Source
# File lib/prism/dot_visitor.rb, line 4132defvisit_source_encoding_node(node)table =Table.new("SourceEncodingNode")id =node_id(node)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aSourceEncodingNode node.
Source
# File lib/prism/dot_visitor.rb, line 4146defvisit_source_file_node(node)table =Table.new("SourceFileNode")id =node_id(node)# flagstable.field("flags",string_flags_inspect(node))# filepathtable.field("filepath",node.filepath.inspect)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aSourceFileNode node.
Source
# File lib/prism/dot_visitor.rb, line 4166defvisit_source_line_node(node)table =Table.new("SourceLineNode")id =node_id(node)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aSourceLineNode node.
Source
# File lib/prism/dot_visitor.rb, line 4180defvisit_splat_node(node)table =Table.new("SplatNode")id =node_id(node)# operator_loctable.field("operator_loc",location_inspect(node.operator_loc))# expressionunless (expression =node.expression).nil?table.field("expression",port:true)digraph.edge("#{id}:expression -> #{node_id(expression)};")enddigraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aSplatNode node.
Source
# File lib/prism/dot_visitor.rb, line 4203defvisit_statements_node(node)table =Table.new("StatementsNode")id =node_id(node)# bodyifnode.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)};") }elsetable.field("body","[]")enddigraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aStatementsNode node.
Source
# File lib/prism/dot_visitor.rb, line 4230defvisit_string_node(node)table =Table.new("StringNode")id =node_id(node)# flagstable.field("flags",string_flags_inspect(node))# opening_locunless (opening_loc =node.opening_loc).nil?table.field("opening_loc",location_inspect(opening_loc))end# content_loctable.field("content_loc",location_inspect(node.content_loc))# closing_locunless (closing_loc =node.closing_loc).nil?table.field("closing_loc",location_inspect(closing_loc))end# unescapedtable.field("unescaped",node.unescaped.inspect)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aStringNode node.
Source
# File lib/prism/dot_visitor.rb, line 4263defvisit_super_node(node)table =Table.new("SuperNode")id =node_id(node)# keyword_loctable.field("keyword_loc",location_inspect(node.keyword_loc))# lparen_locunless (lparen_loc =node.lparen_loc).nil?table.field("lparen_loc",location_inspect(lparen_loc))end# argumentsunless (arguments =node.arguments).nil?table.field("arguments",port:true)digraph.edge("#{id}:arguments -> #{node_id(arguments)};")end# rparen_locunless (rparen_loc =node.rparen_loc).nil?table.field("rparen_loc",location_inspect(rparen_loc))end# blockunless (block =node.block).nil?table.field("block",port:true)digraph.edge("#{id}:block -> #{node_id(block)};")enddigraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aSuperNode node.
Source
# File lib/prism/dot_visitor.rb, line 4302defvisit_symbol_node(node)table =Table.new("SymbolNode")id =node_id(node)# flagstable.field("flags",symbol_flags_inspect(node))# opening_locunless (opening_loc =node.opening_loc).nil?table.field("opening_loc",location_inspect(opening_loc))end# value_locunless (value_loc =node.value_loc).nil?table.field("value_loc",location_inspect(value_loc))end# closing_locunless (closing_loc =node.closing_loc).nil?table.field("closing_loc",location_inspect(closing_loc))end# unescapedtable.field("unescaped",node.unescaped.inspect)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aSymbolNode node.
Source
# File lib/prism/dot_visitor.rb, line 4337defvisit_true_node(node)table =Table.new("TrueNode")id =node_id(node)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aTrueNode node.
Source
# File lib/prism/dot_visitor.rb, line 4351defvisit_undef_node(node)table =Table.new("UndefNode")id =node_id(node)# namesifnode.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)};") }elsetable.field("names","[]")end# keyword_loctable.field("keyword_loc",location_inspect(node.keyword_loc))digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aUndefNode node.
Source
# File lib/prism/dot_visitor.rb, line 4381defvisit_unless_node(node)table =Table.new("UnlessNode")id =node_id(node)# keyword_loctable.field("keyword_loc",location_inspect(node.keyword_loc))# predicatetable.field("predicate",port:true)digraph.edge("#{id}:predicate -> #{node_id(node.predicate)};")# then_keyword_locunless (then_keyword_loc =node.then_keyword_loc).nil?table.field("then_keyword_loc",location_inspect(then_keyword_loc))end# statementsunless (statements =node.statements).nil?table.field("statements",port:true)digraph.edge("#{id}:statements -> #{node_id(statements)};")end# else_clauseunless (else_clause =node.else_clause).nil?table.field("else_clause",port:true)digraph.edge("#{id}:else_clause -> #{node_id(else_clause)};")end# end_keyword_locunless (end_keyword_loc =node.end_keyword_loc).nil?table.field("end_keyword_loc",location_inspect(end_keyword_loc))enddigraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aUnlessNode node.
Source
# File lib/prism/dot_visitor.rb, line 4424defvisit_until_node(node)table =Table.new("UntilNode")id =node_id(node)# flagstable.field("flags",loop_flags_inspect(node))# keyword_loctable.field("keyword_loc",location_inspect(node.keyword_loc))# do_keyword_locunless (do_keyword_loc =node.do_keyword_loc).nil?table.field("do_keyword_loc",location_inspect(do_keyword_loc))end# closing_locunless (closing_loc =node.closing_loc).nil?table.field("closing_loc",location_inspect(closing_loc))end# predicatetable.field("predicate",port:true)digraph.edge("#{id}:predicate -> #{node_id(node.predicate)};")# statementsunless (statements =node.statements).nil?table.field("statements",port:true)digraph.edge("#{id}:statements -> #{node_id(statements)};")enddigraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aUntilNode node.
Source
# File lib/prism/dot_visitor.rb, line 4464defvisit_when_node(node)table =Table.new("WhenNode")id =node_id(node)# keyword_loctable.field("keyword_loc",location_inspect(node.keyword_loc))# conditionsifnode.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)};") }elsetable.field("conditions","[]")end# then_keyword_locunless (then_keyword_loc =node.then_keyword_loc).nil?table.field("then_keyword_loc",location_inspect(then_keyword_loc))end# statementsunless (statements =node.statements).nil?table.field("statements",port:true)digraph.edge("#{id}:statements -> #{node_id(statements)};")enddigraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aWhenNode node.
Source
# File lib/prism/dot_visitor.rb, line 4505defvisit_while_node(node)table =Table.new("WhileNode")id =node_id(node)# flagstable.field("flags",loop_flags_inspect(node))# keyword_loctable.field("keyword_loc",location_inspect(node.keyword_loc))# do_keyword_locunless (do_keyword_loc =node.do_keyword_loc).nil?table.field("do_keyword_loc",location_inspect(do_keyword_loc))end# closing_locunless (closing_loc =node.closing_loc).nil?table.field("closing_loc",location_inspect(closing_loc))end# predicatetable.field("predicate",port:true)digraph.edge("#{id}:predicate -> #{node_id(node.predicate)};")# statementsunless (statements =node.statements).nil?table.field("statements",port:true)digraph.edge("#{id}:statements -> #{node_id(statements)};")enddigraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aWhileNode node.
Source
# File lib/prism/dot_visitor.rb, line 4545defvisit_x_string_node(node)table =Table.new("XStringNode")id =node_id(node)# flagstable.field("flags",encoding_flags_inspect(node))# opening_loctable.field("opening_loc",location_inspect(node.opening_loc))# content_loctable.field("content_loc",location_inspect(node.content_loc))# closing_loctable.field("closing_loc",location_inspect(node.closing_loc))# unescapedtable.field("unescaped",node.unescaped.inspect)digraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aXStringNode node.
Source
# File lib/prism/dot_visitor.rb, line 4574defvisit_yield_node(node)table =Table.new("YieldNode")id =node_id(node)# keyword_loctable.field("keyword_loc",location_inspect(node.keyword_loc))# lparen_locunless (lparen_loc =node.lparen_loc).nil?table.field("lparen_loc",location_inspect(lparen_loc))end# argumentsunless (arguments =node.arguments).nil?table.field("arguments",port:true)digraph.edge("#{id}:arguments -> #{node_id(arguments)};")end# rparen_locunless (rparen_loc =node.rparen_loc).nil?table.field("rparen_loc",location_inspect(rparen_loc))enddigraph.nodes<<<<~DOT #{id} [ label=<#{table.to_dot.gsub(/\n/, "\n ")}> ]; DOTsuperend
Visit aYieldNode node.
Private Instance Methods
Source
# File lib/prism/dot_visitor.rb, line 4620defarguments_node_flags_inspect(node)flags = []#: Array[String]flags<<"contains_forwarding"ifnode.contains_forwarding?flags<<"contains_keywords"ifnode.contains_keywords?flags<<"contains_keyword_splat"ifnode.contains_keyword_splat?flags<<"contains_splat"ifnode.contains_splat?flags<<"contains_multiple_splats"ifnode.contains_multiple_splats?flags.join(", ")end
Inspect a node that has arguments_node_flags flags to display the flags as a comma-separated list.
Source
# File lib/prism/dot_visitor.rb, line 4632defarray_node_flags_inspect(node)flags = []#: Array[String]flags<<"contains_splat"ifnode.contains_splat?flags.join(", ")end
Inspect a node that has array_node_flags flags to display the flags as a comma-separated list.
Source
# File lib/prism/dot_visitor.rb, line 4640defcall_node_flags_inspect(node)flags = []#: Array[String]flags<<"safe_navigation"ifnode.safe_navigation?flags<<"variable_call"ifnode.variable_call?flags<<"attribute_write"ifnode.attribute_write?flags<<"ignore_visibility"ifnode.ignore_visibility?flags.join(", ")end
Inspect a node that has call_node_flags flags to display the flags as a comma-separated list.
Source
# File lib/prism/dot_visitor.rb, line 4651defencoding_flags_inspect(node)flags = []#: Array[String]flags<<"forced_utf8_encoding"ifnode.forced_utf8_encoding?flags<<"forced_binary_encoding"ifnode.forced_binary_encoding?flags.join(", ")end
Inspect a node that has encoding_flags flags to display the flags as a comma-separated list.
Source
# File lib/prism/dot_visitor.rb, line 4660definteger_base_flags_inspect(node)flags = []#: Array[String]flags<<"binary"ifnode.binary?flags<<"decimal"ifnode.decimal?flags<<"octal"ifnode.octal?flags<<"hexadecimal"ifnode.hexadecimal?flags.join(", ")end
Inspect a node that has integer_base_flags flags to display the flags as a comma-separated list.
Source
# File lib/prism/dot_visitor.rb, line 4671definterpolated_string_node_flags_inspect(node)flags = []#: Array[String]flags<<"frozen"ifnode.frozen?flags<<"mutable"ifnode.mutable?flags.join(", ")end
Inspect a node that has interpolated_string_node_flags flags to display the flags as a comma-separated list.
Source
# File lib/prism/dot_visitor.rb, line 4680defkeyword_hash_node_flags_inspect(node)flags = []#: Array[String]flags<<"symbol_keys"ifnode.symbol_keys?flags.join(", ")end
Inspect a node that has keyword_hash_node_flags flags to display the flags as a comma-separated list.
Source
# File lib/prism/dot_visitor.rb, line 4614deflocation_inspect(location)"(#{location.start_line},#{location.start_column})-(#{location.end_line},#{location.end_column})"end
Inspect a location to display the start and end line and column numbers.
Source
# File lib/prism/dot_visitor.rb, line 4688defloop_flags_inspect(node)flags = []#: Array[String]flags<<"begin_modifier"ifnode.begin_modifier?flags.join(", ")end
Inspect a node that has loop_flags flags to display the flags as a comma-separated list.
Source
# File lib/prism/dot_visitor.rb, line 4609defnode_id(node)"Node_#{node.object_id}"end
Generate a unique node ID for a node throughout the digraph.
Source
# File lib/prism/dot_visitor.rb, line 4696defparameter_flags_inspect(node)flags = []#: Array[String]flags<<"repeated_parameter"ifnode.repeated_parameter?flags.join(", ")end
Inspect a node that has parameter_flags flags to display the flags as a comma-separated list.
Source
# File lib/prism/dot_visitor.rb, line 4704defparentheses_node_flags_inspect(node)flags = []#: Array[String]flags<<"multiple_statements"ifnode.multiple_statements?flags.join(", ")end
Inspect a node that has parentheses_node_flags flags to display the flags as a comma-separated list.
Source
# File lib/prism/dot_visitor.rb, line 4712defrange_flags_inspect(node)flags = []#: Array[String]flags<<"exclude_end"ifnode.exclude_end?flags.join(", ")end
Inspect a node that has range_flags flags to display the flags as a comma-separated list.
Source
# File lib/prism/dot_visitor.rb, line 4720defregular_expression_flags_inspect(node)flags = []#: Array[String]flags<<"ignore_case"ifnode.ignore_case?flags<<"extended"ifnode.extended?flags<<"multi_line"ifnode.multi_line?flags<<"once"ifnode.once?flags<<"euc_jp"ifnode.euc_jp?flags<<"ascii_8bit"ifnode.ascii_8bit?flags<<"windows_31j"ifnode.windows_31j?flags<<"utf_8"ifnode.utf_8?flags<<"forced_utf8_encoding"ifnode.forced_utf8_encoding?flags<<"forced_binary_encoding"ifnode.forced_binary_encoding?flags<<"forced_us_ascii_encoding"ifnode.forced_us_ascii_encoding?flags.join(", ")end
Inspect a node that has regular_expression_flags flags to display the flags as a comma-separated list.
Source
# File lib/prism/dot_visitor.rb, line 4738defshareable_constant_node_flags_inspect(node)flags = []#: Array[String]flags<<"literal"ifnode.literal?flags<<"experimental_everything"ifnode.experimental_everything?flags<<"experimental_copy"ifnode.experimental_copy?flags.join(", ")end
Inspect a node that has shareable_constant_node_flags flags to display the flags as a comma-separated list.
Source
# File lib/prism/dot_visitor.rb, line 4748defstring_flags_inspect(node)flags = []#: Array[String]flags<<"forced_utf8_encoding"ifnode.forced_utf8_encoding?flags<<"forced_binary_encoding"ifnode.forced_binary_encoding?flags<<"frozen"ifnode.frozen?flags<<"mutable"ifnode.mutable?flags.join(", ")end
Inspect a node that has string_flags flags to display the flags as a comma-separated list.
Source
# File lib/prism/dot_visitor.rb, line 4759defsymbol_flags_inspect(node)flags = []#: Array[String]flags<<"forced_utf8_encoding"ifnode.forced_utf8_encoding?flags<<"forced_binary_encoding"ifnode.forced_binary_encoding?flags<<"forced_us_ascii_encoding"ifnode.forced_us_ascii_encoding?flags.join(", ")end
Inspect a node that has symbol_flags flags to display the flags as a comma-separated list.