Parent

Class Index [+]

Quicksearch

RKelly::Visitors::DotVisitor

Attributes

nodes[R]

(Not documented)

arrows[R]

(Not documented)

Public Class Methods

new() click to toggle source

(Not documented)

# File lib/rkelly/visitors/dot_visitor.rb, line 24
      def initialize
        @stack = []
        @node_index = 0
        @nodes  = []
        @arrows = []
      end

Public Instance Methods

visit_BracketAccessorNode(o) click to toggle source

(Not documented)

# File lib/rkelly/visitors/dot_visitor.rb, line 174
      def visit_BracketAccessorNode(o)
        node = Node.new(@node_index += 1, ['BracketAccessorNode'])
        add_arrow_for(node)
        @nodes << node
        @stack.push(node)
        [:value, :accessor].each do |method|
          o.send(method) && o.send(method).accept(self)
        end
        @stack.pop
      end
visit_DotAccessorNode(o) click to toggle source

(Not documented)

# File lib/rkelly/visitors/dot_visitor.rb, line 210
      def visit_DotAccessorNode(o)
        node = Node.new(@node_index += 1, ['DotAccessorNode', o.accessor])
        add_arrow_for(node)
        @nodes << node
        @stack.push(node)
        [:value].each do |method|
          o.send(method) && o.send(method).accept(self)
        end
        @stack.pop
      end
visit_ForInNode(o) click to toggle source

(Not documented)

# File lib/rkelly/visitors/dot_visitor.rb, line 152
      def visit_ForInNode(o)
        node = Node.new(@node_index += 1, ['ForInNode'])
        add_arrow_for(node)
        @nodes << node
        @stack.push(node)
        [:left, :right, :value].each do |method|
          o.send(method) && o.send(method).accept(self)
        end
        @stack.pop
      end
visit_ForNode(o) click to toggle source

(Not documented)

# File lib/rkelly/visitors/dot_visitor.rb, line 128
      def visit_ForNode(o)
        node = Node.new(@node_index += 1, ['ForNode'])
        add_arrow_for(node)
        @nodes << node
        @stack.push(node)
        [:init, :test, :counter, :value].each do |method|
          o.send(method) && o.send(method).accept(self)
        end
        @stack.pop
      end
visit_TryNode(o) click to toggle source

(Not documented)

# File lib/rkelly/visitors/dot_visitor.rb, line 163
      def visit_TryNode(o)
        node = Node.new(@node_index += 1, ['TryNode', o.catch_var || 'NULL'])
        add_arrow_for(node)
        @nodes << node
        @stack.push(node)
        [:value, :catch_block, :finally_block].each do |method|
          o.send(method) && o.send(method).accept(self)
        end
        @stack.pop
      end

Private Instance Methods

add_arrow_for(node, label = nil) click to toggle source

(Not documented)

# File lib/rkelly/visitors/dot_visitor.rb, line 222
      def add_arrow_for(node, label = nil)
        @arrows << Arrow.new(@stack.last, node, label) if @stack.length > 0
      end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.