Parent

Included Modules

Class Index [+]

Quicksearch

RKelly::Nodes::Node

Attributes

value[RW]

(Not documented)

comments[RW]

(Not documented)

line[RW]

(Not documented)

filename[RW]

(Not documented)

Public Class Methods

new(value) click to toggle source

(Not documented)

# File lib/rkelly/nodes/node.rb, line 9
      def initialize(value)
        @value = value
        @comments = []
        @filename = @line = nil
      end

Public Instance Methods

/(pattern) click to toggle source

Alias for pointcut

==(other) click to toggle source

(Not documented)

# File lib/rkelly/nodes/node.rb, line 15
      def ==(other)
        other.is_a?(self.class) && @value == other.value
      end
Also aliased as: =~
===(other) click to toggle source

(Not documented)

# File lib/rkelly/nodes/node.rb, line 20
      def ===(other)
        other.is_a?(self.class) && @value === other.value
      end
=~(other) click to toggle source

Alias for #==

each(&block) click to toggle source

(Not documented)

# File lib/rkelly/nodes/node.rb, line 72
      def each(&block)
        EnumerableVisitor.new(block).accept(self)
      end
pointcut(pattern) click to toggle source

(Not documented)

# File lib/rkelly/nodes/node.rb, line 24
      def pointcut(pattern)
        case pattern
        when String
          ast = RKelly::Parser.new.parse(pattern)
          # Only take the first statement
          finder = ast.value.first.class.to_s =~ /StatementNode$/ ?
            ast.value.first.value : ast.value.first
          visitor = PointcutVisitor.new(finder)
        else
          visitor = PointcutVisitor.new(pattern)
        end

        visitor.accept(self)
        visitor
      end
Also aliased as: /
to_dots() click to toggle source

(Not documented)

# File lib/rkelly/nodes/node.rb, line 49
      def to_dots
        visitor = DotVisitor.new
        visitor.accept(self)
        header = "digraph g {\ngraph [ rankdir = \"TB\" ];\nnode [\nfontsize = \"16\"\nshape = \"ellipse\"\n];\nedge [ ];\n"
        nodes = visitor.nodes.map { |x| x.to_s }.join("\n")
        counter = 0
        arrows = visitor.arrows.map { |x|
          s = "#{x} [\nid = #{counter}\n];"
          counter += 1
          s
        }.join("\n")
        "#{header}\n#{nodes}\n#{arrows}\n}"
      end
to_ecma() click to toggle source

(Not documented)

# File lib/rkelly/nodes/node.rb, line 45
      def to_ecma
        ECMAVisitor.new.accept(self)
      end
to_real_sexp() click to toggle source

(Not documented)

# File lib/rkelly/nodes/node.rb, line 76
      def to_real_sexp
        RealSexpVisitor.new.accept(self)
      end
to_sexp() click to toggle source

(Not documented)

# File lib/rkelly/nodes/node.rb, line 41
      def to_sexp
        SexpVisitor.new.accept(self)
      end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.