SyntaxElement.st
author Claus Gittinger <cg@exept.de>
Sun, 01 Feb 2015 14:17:11 +0100
changeset 15150 940d37c7d3ac
parent 12985 a2c868a05375
child 13178 c9bf900fe729
child 15314 b0ad3176b612
permissions -rw-r--r--
class: Tools::ChangeList fixed the following redraw bug in ModelListView (which is already fixed in SelectionInListView): if a colored item is shown with selection, the color attribute should be removed (or relaxed), to avoid drawing the label invisible. I.e. if the text color is blue or grey, and the selection bg is blue. we should draw white-on-blue, instead of blue/grey on blue. For this to work, the info whether drawing a selection must be passed down through the renderer to the item's draw routine.
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>"
12909
7fdc1ff6720c class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 12098
diff changeset
    95
!
7fdc1ff6720c class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 12098
diff changeset
    96
7fdc1ff6720c class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 12098
diff changeset
    97
from: start to: stop type: type value: value assigned:assigned
7fdc1ff6720c class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 12098
diff changeset
    98
7fdc1ff6720c class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 12098
diff changeset
    99
    ^self new
7fdc1ff6720c class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 12098
diff changeset
   100
        start: start;
7fdc1ff6720c class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 12098
diff changeset
   101
        stop: stop;
7fdc1ff6720c class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 12098
diff changeset
   102
        type: type;
7fdc1ff6720c class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 12098
diff changeset
   103
        value: value;
7fdc1ff6720c class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 12098
diff changeset
   104
        assigned: assigned
7fdc1ff6720c class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 12098
diff changeset
   105
7fdc1ff6720c class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 12098
diff changeset
   106
    "Created: / 14-02-2010 / 17:41:54 / Jan Vrany <jan.vrany@fit.cvut.cz>"
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
! !
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
!SyntaxElement methodsFor:'accessing'!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   110
10632
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   111
firstElementInChain
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   112
    |first prev|
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   113
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   114
    first := self.
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   115
    [ (prev := first previousElement) notNil ] whileTrue:[
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   116
        first := prev.
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   117
    ].
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   118
    ^ first
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   119
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   120
    "Created: / 21-08-2011 / 09:51:35 / cg"
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   121
!
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   122
12098
6ec9402ca9b6 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 11699
diff changeset
   123
lastElementInChain
6ec9402ca9b6 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 11699
diff changeset
   124
    |last next|
6ec9402ca9b6 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 11699
diff changeset
   125
6ec9402ca9b6 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 11699
diff changeset
   126
    last := self.
6ec9402ca9b6 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 11699
diff changeset
   127
    [ (next := last nextElement) notNil ] whileTrue:[
6ec9402ca9b6 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 11699
diff changeset
   128
        last := next.
6ec9402ca9b6 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 11699
diff changeset
   129
    ].
6ec9402ca9b6 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 11699
diff changeset
   130
    ^ last
6ec9402ca9b6 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 11699
diff changeset
   131
!
6ec9402ca9b6 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 11699
diff changeset
   132
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
next
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
    ^ next
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
next:aSyntaxElement
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
    next := aSyntaxElement.
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
    next prev: self.
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
    "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
   142
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
10632
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   144
nextElement
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   145
    ^ next
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   146
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   147
    "Created: / 21-08-2011 / 09:47:11 / cg"
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   148
!
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   149
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   150
nextElement:aSyntaxElement
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   151
    next := aSyntaxElement.
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   152
    next prev: self.
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   153
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   154
    "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
   155
    "Created: / 21-08-2011 / 09:47:15 / cg"
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
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
prev
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
    ^ prev
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
prev:aSyntaxElement
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   163
    prev := aSyntaxElement.
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   165
10632
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   166
previousElement
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   167
    ^ prev
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   168
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   169
    "Created: / 21-08-2011 / 09:47:23 / cg"
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   170
!
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   171
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   172
previousElement:aSyntaxElement
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   173
    prev := aSyntaxElement.
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   174
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   175
    "Created: / 21-08-2011 / 09:47:28 / cg"
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   176
!
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   177
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
start
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
    ^ start
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
start:anInteger
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
    start := anInteger.
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
stop
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
    ^ stop
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
stop:anInteger
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
    stop := anInteger.
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
type
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
    ^ type
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
type:aSymbol
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
    type := aSymbol.
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   200
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
value
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
    ^ value
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
value:anObject
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
    value := anObject.
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
!SyntaxElement methodsFor:'comparing'!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
< anObject
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
    anObject isNumber ifTrue:[^stop < anObject].
12909
7fdc1ff6720c class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 12098
diff changeset
   214
    "/ anObject class == self class ifFalse:[^false].
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
12909
7fdc1ff6720c class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 12098
diff changeset
   216
    ^stop < anObject stop
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
    "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
   219
    "Modified (format): / 27-07-2012 / 21:53:22 / cg"
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   220
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   221
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   222
= anObject
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   223
    anObject class == self class ifFalse:[^false].
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   224
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
    ^start == (anObject start) and:
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   226
        [stop == (anObject stop) and:
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
            [type == (anObject type)]].
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
    "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
   230
    "Modified (format): / 27-07-2012 / 21:53:24 / cg"
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   231
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   232
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   233
hash
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
    ^start hash bitXor:[stop hash bitXor:[type hash]].
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
    "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
   237
    "Modified (format): / 27-07-2012 / 21:53:28 / cg"
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   238
! !
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   240
!SyntaxElement methodsFor:'double dispatching'!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
lessFromInteger:anInteger
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
    ^stop < anInteger
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
    "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
   246
    "Modified (format): / 27-07-2012 / 21:53:33 / cg"
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
! !
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   248
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   249
!SyntaxElement methodsFor:'printing & storing'!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   250
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   251
printOn:aStream
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   252
    "append a printed representation if the receiver to the argument, aStream"
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   253
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   254
    super printOn:aStream.
10632
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   255
    aStream nextPutAll:'('.
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   256
    type printOn: aStream.
10632
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   257
    aStream nextPutAll:' -> '.    
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   258
    value printOn:aStream.
12909
7fdc1ff6720c class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 12098
diff changeset
   259
    aStream nextPut:$[.
7fdc1ff6720c class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 12098
diff changeset
   260
    start printOn:aStream.
7fdc1ff6720c class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 12098
diff changeset
   261
    aStream nextPutAll:' .. '.    
7fdc1ff6720c class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 12098
diff changeset
   262
    stop printOn:aStream.
7fdc1ff6720c class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 12098
diff changeset
   263
    aStream nextPut:$].
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   264
    aStream nextPut:$).
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   265
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   266
    "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
   267
    "Modified: / 21-08-2011 / 09:33:51 / cg"
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   268
! !
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
!SyntaxElement methodsFor:'queries'!
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   271
12985
a2c868a05375 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 12909
diff changeset
   272
assigned
a2c868a05375 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 12909
diff changeset
   273
    ^ false.
a2c868a05375 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 12909
diff changeset
   274
!
a2c868a05375 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 12909
diff changeset
   275
10632
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   276
isSelector
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   277
    ^ type == #selector
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   278
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   279
    "Created: / 21-08-2011 / 09:09:19 / cg"
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   280
!
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   281
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   282
isSelf
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   283
    ^ type == #self
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   284
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   285
    "Created: / 21-08-2011 / 09:31:20 / cg"
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   286
!
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   287
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   288
isVariable
12909
7fdc1ff6720c class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 12098
diff changeset
   289
    ^ false
10632
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   290
!
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   291
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   292
isVariableOrSelf
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   293
    ^ self isVariable or:[self isSelf]
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   294
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   295
    "Created: / 21-08-2011 / 09:31:33 / cg"
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   296
! !
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   297
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   298
!SyntaxElement class methodsFor:'documentation'!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   299
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   300
version_CVS
12985
a2c868a05375 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 12909
diff changeset
   301
    ^ '$Header: /cvs/stx/stx/libtool/SyntaxElement.st,v 1.7 2013-06-24 13:43:05 cg Exp $'
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   302
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   303
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   304
version_SVN
12985
a2c868a05375 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 12909
diff changeset
   305
    ^ '$Id: SyntaxElement.st,v 1.7 2013-06-24 13:43:05 cg Exp $'
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   306
! !
12098
6ec9402ca9b6 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 11699
diff changeset
   307