class ActionDispatch::Journey::Visitors::Dot

:nodoc:

def accept(node, seed = [[], []])

def accept(node, seed = [[], []])
  super
  nodes, edges = seed
  <<-eodot
h parse_tree {
="8,5"
 [shape = none];
 [dir = none];
des.join "\n"}
ges.join("\n")}
  eodot
end

def binary(node, seed)

def binary(node, seed)
  seed.last.concat node.children.map { |c|
    "#{node.object_id} -> #{c.object_id};"
  }
  super
end

def initialize

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

def nary(node, seed)

def nary(node, seed)
  seed.last.concat node.children.map { |c|
    "#{node.object_id} -> #{c.object_id};"
  }
  super
end

def terminal(node, seed)

def terminal(node, seed)
  value = node.left
  seed.first << "#{node.object_id} [label=\"#{value}\"];"
  seed
end

def unary(node, seed)

def unary(node, seed)
  seed.last << "#{node.object_id} -> #{node.left.object_id};"
  super
end

def visit_CAT(node, seed)

def visit_CAT(node, seed)
  seed.first << "#{node.object_id} [label=\"\"];"
  super
end

def visit_GROUP(node, seed)

def visit_GROUP(node, seed)
  seed.first << "#{node.object_id} [label=\"()\"];"
  super
end

def visit_OR(node, seed)

def visit_OR(node, seed)
  seed.first << "#{node.object_id} [label=\"|\"];"
  super
end

def visit_STAR(node, seed)

def visit_STAR(node, seed)
  seed.first << "#{node.object_id} [label=\"*\"];"
  super
end