Class: Journey::Visitors::Dot

Inherits:
Visitor
  • Object
show all
Defined in:
lib/journey/visitors.rb

Instance Method Summary collapse

Constructor Details

#initializeDot

Returns a new instance of Dot.



121
122
123
124
# File 'lib/journey/visitors.rb', line 121

def initialize
  @nodes = []
  @edges = []
end

Instance Method Details

#accept(node) ⇒ Object



126
127
128
129
130
131
132
133
134
135
136
137
# File 'lib/journey/visitors.rb', line 126

def accept node
  super
  "digraph parse_tree {\n  size=\"8,5\"\n  node [shape = none];\n  edge [dir = none];\n  \#{@nodes.join \"\\n\"}\n  \#{@edges.join(\"\\n\")}\n}\n  eodot\nend\n"