Class: DeepestValueDepthVisitor

Inherits:
BaseVisitor show all
Defined in:
lib/visitor/value_depth_visitor.rb

Instance Attribute Summary collapse

Attributes inherited from BaseVisitor

#postCounter, #preCounter

Instance Method Summary collapse

Methods inherited from BaseVisitor

#preVisit

Constructor Details

#initializeDeepestValueDepthVisitor

Returns a new instance of DeepestValueDepthVisitor.



22
23
24
25
26
# File 'lib/visitor/value_depth_visitor.rb', line 22

def initialize
  @deepestValueDepthNode = nil
  @deepestValueDepth = 0
  super
end

Instance Attribute Details

#deepestValueDepthObject (readonly)

Returns the value of attribute deepestValueDepth.



20
21
22
# File 'lib/visitor/value_depth_visitor.rb', line 20

def deepestValueDepth
  @deepestValueDepth
end

#deepestValueDepthNodeObject (readonly)

Returns the value of attribute deepestValueDepthNode.



20
21
22
# File 'lib/visitor/value_depth_visitor.rb', line 20

def deepestValueDepthNode
  @deepestValueDepthNode
end

Instance Method Details

#postVisit(node) ⇒ Object



28
29
30
31
32
33
# File 'lib/visitor/value_depth_visitor.rb', line 28

def postVisit(node)
  if (node.valueDepth > @deepestValueDepth) then
    @deepestValueDepth = node.valueDepth
    @deepestValueDepthNode = node
  end
end