PluggableParseNodeVisitor.st
author Claus Gittinger <cg@exept.de>
Sun, 24 May 2020 03:18:13 +0200
changeset 4670 4ec715f14ddd
parent 4543 b2f5c92b579b
child 4723 524785227024
permissions -rw-r--r--
#BUGFIX by cg class: Parser changed: #selectorCheck:for:positions:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
4543
b2f5c92b579b #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
     1
"{ Encoding: utf8 }"
b2f5c92b579b #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
     2
3782
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
"{ Package: 'stx:libcomp' }"
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
"{ NameSpace: Smalltalk }"
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
ParseNodeVisitor subclass:#PluggableParseNodeVisitor
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     8
	instanceVariableNames:'actionsPerNodeType'
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     9
	classVariableNames:''
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    10
	poolDictionaries:''
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
	category:'System-Compiler-Support'
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
!
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
!PluggableParseNodeVisitor class methodsFor:'documentation'!
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
documentation
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
"
4543
b2f5c92b579b #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    18
    obsolete not, because the superclass is now pluggable.
b2f5c92b579b #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    19
    left in the system for a while for backward compatibility.
b2f5c92b579b #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    20
3782
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
    a pluggable node visitor.
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
    setup with:
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    23
        actionForNodeClass:aClass put:aBlock
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
        
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
    for example, if you are only interested in assignments,
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
    use the following code:
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
        |v|
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
        v := PluggableParseNodeVisitor new.
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
        v actionForNodeClass:AssignmentNode put:[:node | Transcript showCR:node. true].
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
        v visit:(Parser parse:code in:someClass.
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
"
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
! !
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
4543
b2f5c92b579b #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    34
!PluggableParseNodeVisitor class methodsFor:'queries'!
3782
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
4543
b2f5c92b579b #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    36
isObsolete   
b2f5c92b579b #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    37
    ^ true
3782
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
! !
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
!PluggableParseNodeVisitor class methodsFor:'documentation'!
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
version
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
    ^ '$Header$'
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
!
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
version_CVS
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
    ^ '$Header$'
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
! !
226f62e32424 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49