Class: DeepestValueDepthVisitor
- Inherits:
-
BaseVisitor
- Object
- BaseVisitor
- DeepestValueDepthVisitor
- Defined in:
- lib/visitor/value_depth_visitor.rb
Instance Attribute Summary collapse
-
#deepestValueDepth ⇒ Object
readonly
Returns the value of attribute deepestValueDepth.
-
#deepestValueDepthNode ⇒ Object
readonly
Returns the value of attribute deepestValueDepthNode.
Attributes inherited from BaseVisitor
Instance Method Summary collapse
-
#initialize ⇒ DeepestValueDepthVisitor
constructor
A new instance of DeepestValueDepthVisitor.
- #postVisit(node) ⇒ Object
Methods inherited from BaseVisitor
Constructor Details
#initialize ⇒ DeepestValueDepthVisitor
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
#deepestValueDepth ⇒ Object (readonly)
Returns the value of attribute deepestValueDepth.
20 21 22 |
# File 'lib/visitor/value_depth_visitor.rb', line 20 def deepestValueDepth @deepestValueDepth end |
#deepestValueDepthNode ⇒ Object (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 |