SyntaxElement.st
author Claus Gittinger <cg@exept.de>
Thu, 28 Mar 2013 17:48:59 +0100
changeset 12565 458c68d41bbd
parent 12098 6ec9402ca9b6
child 12401 4714b9640528
child 12909 7fdc1ff6720c
permissions -rw-r--r--
class: AbstractFileFinderApplicationComponent changed: #fileDoubleClick: focus to text
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     1
"
10068
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
     2
 COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
     3
              All Rights Reserved
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
10068
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
     5
Permission is hereby granted, free of charge, to any person
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
     6
obtaining a copy of this software and associated documentation
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
     7
files (the 'Software'), to deal in the Software without
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
     8
restriction, including without limitation the rights to use,
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
     9
copy, modify, merge, publish, distribute, sublicense, and/or sell
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    10
copies of the Software, and to permit persons to whom the
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    11
Software is furnished to do so, subject to the following
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    12
conditions:
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    13
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    14
The above copyright notice and this permission notice shall be
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    15
included in all copies or substantial portions of the Software.
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    16
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    17
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    18
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    19
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    20
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    21
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    22
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    23
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    24
OTHER DEALINGS IN THE SOFTWARE.
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
"
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
"{ Package: 'stx:libtool' }"
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
Magnitude subclass:#SyntaxElement
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
	instanceVariableNames:'start stop type value next prev'
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    30
	classVariableNames:''
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    31
	poolDictionaries:''
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
	category:'Interface-CodeView-Syntax'
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
!SyntaxElement class methodsFor:'documentation'!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
copyright
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
"
10068
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    39
 COPYRIGHT (c) 2010 by Jan Vrany, SWING Research Group. CTU in Prague
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    40
              All Rights Reserved
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    41
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    42
Permission is hereby granted, free of charge, to any person
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    43
obtaining a copy of this software and associated documentation
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    44
files (the 'Software'), to deal in the Software without
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    45
restriction, including without limitation the rights to use,
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    46
copy, modify, merge, publish, distribute, sublicense, and/or sell
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    47
copies of the Software, and to permit persons to whom the
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    48
Software is furnished to do so, subject to the following
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    49
conditions:
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
10068
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    51
The above copyright notice and this permission notice shall be
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    52
included in all copies or substantial portions of the Software.
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    53
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    54
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    55
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    56
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    57
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    58
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    59
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    60
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
5ff502cb7f74 changed: #copyright
Claus Gittinger <cg@exept.de>
parents: 10021
diff changeset
    61
OTHER DEALINGS IN THE SOFTWARE.
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
"
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
! !
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    65
!SyntaxElement class methodsFor:'instance creation'!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
from: start to: stop
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
    ^self new
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
        start: start;
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
        stop: stop.
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
    "Created: / 14-02-2010 / 13:13:23 / Jan Vrany <jan.vrany@fit.cvut.cz>"
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    75
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
from: start to: stop type: type
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
    ^self new
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
        start: start;
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
        stop: stop;
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
        type: type
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
    "Created: / 14-02-2010 / 14:09:20 / Jan Vrany <jan.vrany@fit.cvut.cz>"
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    85
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
from: start to: stop type: type value: value
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
    ^self new
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
        start: start;
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
        stop: stop;
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
        type: type;
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
        value: value
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
    "Created: / 14-02-2010 / 17:41:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
! !
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
!SyntaxElement methodsFor:'accessing'!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    98
10632
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
    99
firstElementInChain
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   100
    |first prev|
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   101
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   102
    first := self.
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   103
    [ (prev := first previousElement) notNil ] whileTrue:[
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   104
        first := prev.
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   105
    ].
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   106
    ^ first
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   107
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   108
    "Created: / 21-08-2011 / 09:51:35 / cg"
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   109
!
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   110
12098
6ec9402ca9b6 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 11699
diff changeset
   111
lastElementInChain
6ec9402ca9b6 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 11699
diff changeset
   112
    |last next|
6ec9402ca9b6 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 11699
diff changeset
   113
6ec9402ca9b6 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 11699
diff changeset
   114
    last := self.
6ec9402ca9b6 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 11699
diff changeset
   115
    [ (next := last nextElement) notNil ] whileTrue:[
6ec9402ca9b6 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 11699
diff changeset
   116
        last := next.
6ec9402ca9b6 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 11699
diff changeset
   117
    ].
6ec9402ca9b6 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 11699
diff changeset
   118
    ^ last
6ec9402ca9b6 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 11699
diff changeset
   119
!
6ec9402ca9b6 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 11699
diff changeset
   120
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
next
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   122
    ^ next
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
next:aSyntaxElement
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
    next := aSyntaxElement.
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
    next prev: self.
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
    "Modified: / 14-02-2010 / 17:44:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
10632
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   132
nextElement
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   133
    ^ next
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   134
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   135
    "Created: / 21-08-2011 / 09:47:11 / cg"
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   136
!
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   137
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   138
nextElement:aSyntaxElement
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   139
    next := aSyntaxElement.
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   140
    next prev: self.
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   141
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   142
    "Modified: / 14-02-2010 / 17:44:48 / Jan Vrany <jan.vrany@fit.cvut.cz>"
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   143
    "Created: / 21-08-2011 / 09:47:15 / cg"
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   144
!
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   145
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   146
prev
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
    ^ prev
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
prev:aSyntaxElement
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
    prev := aSyntaxElement.
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
10632
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   154
previousElement
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   155
    ^ prev
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   156
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   157
    "Created: / 21-08-2011 / 09:47:23 / cg"
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   158
!
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   159
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   160
previousElement:aSyntaxElement
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   161
    prev := aSyntaxElement.
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   162
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   163
    "Created: / 21-08-2011 / 09:47:28 / cg"
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   164
!
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   165
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
start
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
    ^ start
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
start:anInteger
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
    start := anInteger.
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
stop
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
    ^ stop
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
stop:anInteger
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
    stop := anInteger.
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
type
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
    ^ type
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   185
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
type:aSymbol
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
    type := aSymbol.
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
value
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
    ^ value
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
value:anObject
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
    value := anObject.
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
! !
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
!SyntaxElement methodsFor:'comparing'!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
< anObject
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
    anObject isNumber ifTrue:[^stop < anObject].
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
    anObject class == self class ifFalse:[^false].
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
    ^stop < anObject start
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
    "Created: / 14-02-2010 / 13:39:46 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11699
f29c996d59f1 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 10632
diff changeset
   207
    "Modified (format): / 27-07-2012 / 21:53:22 / cg"
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
= anObject
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
    anObject class == self class ifFalse:[^false].
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
    ^start == (anObject start) and:
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
        [stop == (anObject stop) and:
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
            [type == (anObject type)]].
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   216
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
    "Created: / 14-02-2010 / 13:33:36 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11699
f29c996d59f1 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 10632
diff changeset
   218
    "Modified (format): / 27-07-2012 / 21:53:24 / cg"
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   219
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   220
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   221
hash
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   222
    ^start hash bitXor:[stop hash bitXor:[type hash]].
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   223
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   224
    "Created: / 14-02-2010 / 13:30:00 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11699
f29c996d59f1 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 10632
diff changeset
   225
    "Modified (format): / 27-07-2012 / 21:53:28 / cg"
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   226
! !
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
!SyntaxElement methodsFor:'double dispatching'!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   230
lessFromInteger:anInteger
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   231
    ^stop < anInteger
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   232
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   233
    "Created: / 14-02-2010 / 13:49:50 / Jan Vrany <jan.vrany@fit.cvut.cz>"
11699
f29c996d59f1 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 10632
diff changeset
   234
    "Modified (format): / 27-07-2012 / 21:53:33 / cg"
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
! !
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
!SyntaxElement methodsFor:'printing & storing'!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   238
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
printOn:aStream
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   240
    "append a printed representation if the receiver to the argument, aStream"
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
    super printOn:aStream.
10632
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   243
    aStream nextPutAll:'('.
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
    type printOn: aStream.
10632
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   245
    aStream nextPutAll:' -> '.    
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   246
    value printOn:aStream.
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
    aStream nextPut:$).
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   248
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   249
    "Modified: / 25-06-2010 / 13:20:13 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10632
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   250
    "Modified: / 21-08-2011 / 09:33:51 / cg"
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   251
! !
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   252
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   253
!SyntaxElement methodsFor:'queries'!
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   254
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   255
isSelector
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   256
    ^ type == #selector
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   257
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   258
    "Created: / 21-08-2011 / 09:09:19 / cg"
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   259
!
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   260
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   261
isSelf
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   262
    ^ type == #self
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   263
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   264
    "Created: / 21-08-2011 / 09:31:20 / cg"
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   265
!
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   266
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   267
isVariable
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   268
    ^ type == #variable
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   269
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   270
    "Created: / 21-08-2011 / 09:09:00 / cg"
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   271
!
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   272
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   273
isVariableOrSelf
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   274
    ^ self isVariable or:[self isSelf]
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   275
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   276
    "Created: / 21-08-2011 / 09:31:33 / cg"
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   277
! !
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   278
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   279
!SyntaxElement class methodsFor:'documentation'!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   280
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   281
version_CVS
12098
6ec9402ca9b6 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 11699
diff changeset
   282
    ^ '$Header: /cvs/stx/stx/libtool/SyntaxElement.st,v 1.5 2013-01-11 09:56:30 cg Exp $'
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   283
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   284
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   285
version_SVN
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   286
    ^ '§Id: SyntaxElement.st 7582 2010-06-25 13:26:33Z vranyj1 §'
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   287
! !
12098
6ec9402ca9b6 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 11699
diff changeset
   288