eXept Software AG Logo

Smalltalk/X Webserver

Documentation of class 'RBPluggableProgramNodeVisitor':

Home

Documentation
www.exept.de
Everywhere
for:
[back]

Class: RBPluggableProgramNodeVisitor


Inheritance:

   Object
   |
   +--RBProgramNodeVisitor
      |
      +--RBPluggableProgramNodeVisitor

Package:
stx:goodies/refactoryBrowser/parser
Category:
Refactory-Support
Version:
rev: 1.1 date: 2016/05/03 11:22:39
user: cg
file: RBPluggableProgramNodeVisitor.st directory: goodies/refactoryBrowser/parser
module: stx stc-classLibrary: parser

Description:


a pluggable node visitor.
setup with:
    actionForNodeClass:aClass put:aBlock
    
for example, if you are only interested in assignments,
use the following code:
    |v|
    v := PluggableParseNodeVisitor new.
    v actionForNodeClass:AssignmentNode put:[:node | Transcript showCR:node. true].
    v visit:(Parser parse:code in:someClass.


Instance protocol:

setup
o  actionForNodeClass: aNodeClass put: aBlock
setup so that for nodes of type aNodeClass, aBlock is invoked.
If the block returns true, subnodes (eg. right side of assignments, etc.)
will be enumerated as well.
Otherwise, no subnodes are visited.

visiting
o  passByNode: aNodeObject
redefined to look for an action for this node's class.
If there is one, it can specify if subnodes are to be visited too

o  visit: aNodeObject
redefined to look for an action for this node's class.
If there is one, it can specify if subnodes are to be visited too



ST/X 7.1.0.0; WebServer 1.663 at exept.de:8081; Wed, 19 Sep 2018 06:56:25 GMT