Class: BaseVisitor
- Inherits:
-
Object
- Object
- BaseVisitor
- Defined in:
- lib/visitor/base_visitor.rb
Direct Known Subclasses
DataSourceVisitor, DeepestValueDepthVisitor, KCommonVisitor, LeafCountVisitor, NumberingVisitor, ValueDepthVisitor
Instance Attribute Summary collapse
-
#postCounter ⇒ Object
Returns the value of attribute postCounter.
-
#preCounter ⇒ Object
Returns the value of attribute preCounter.
Instance Method Summary collapse
-
#initialize ⇒ BaseVisitor
constructor
A new instance of BaseVisitor.
- #postVisit(node) ⇒ Object
- #preVisit(node) ⇒ Object
Constructor Details
#initialize ⇒ BaseVisitor
Returns a new instance of BaseVisitor.
4 5 6 7 |
# File 'lib/visitor/base_visitor.rb', line 4 def initialize @preCounter = 0 @postCounter = 0 end |
Instance Attribute Details
#postCounter ⇒ Object
Returns the value of attribute postCounter.
2 3 4 |
# File 'lib/visitor/base_visitor.rb', line 2 def postCounter @postCounter end |
#preCounter ⇒ Object
Returns the value of attribute preCounter.
2 3 4 |
# File 'lib/visitor/base_visitor.rb', line 2 def preCounter @preCounter end |
Instance Method Details
#postVisit(node) ⇒ Object
14 15 16 |
# File 'lib/visitor/base_visitor.rb', line 14 def postVisit(node) @postCounter += 1 end |
#preVisit(node) ⇒ Object
9 10 11 12 |
# File 'lib/visitor/base_visitor.rb', line 9 def preVisit(node) @preCounter += 1 return true end |