SyntaxElement.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Wed, 30 Jan 2013 11:15:09 +0000
branchjv
changeset 12401 4714b9640528
parent 12287 400a99059170
parent 12098 6ec9402ca9b6
child 12431 9f0c59c742d5
permissions -rw-r--r--
Merged 235b77901045 and 8332590c5a41 (branch default)
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
12401
4714b9640528 Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12287 12098
diff changeset
    65
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    66
!SyntaxElement class methodsFor:'instance creation'!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    67
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    68
from: start to: stop
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    69
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    70
    ^self new
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
        start: start;
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
        stop: stop.
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    73
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    74
    "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
    75
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    76
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
from: start to: stop type: type
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
    ^self new
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
        start: start;
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
        stop: stop;
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
        type: type
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
    "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
    85
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    86
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    87
from: start to: stop type: type value: value
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    88
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    89
    ^self new
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
        start: start;
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    91
        stop: stop;
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
        type: type;
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
        value: value
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
    "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
    96
! !
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
12401
4714b9640528 Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12287 12098
diff changeset
    98
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    99
!SyntaxElement methodsFor:'accessing'!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   100
10632
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   101
firstElementInChain
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   102
    |first prev|
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   103
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   104
    first := self.
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   105
    [ (prev := first previousElement) notNil ] whileTrue:[
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   106
        first := prev.
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
    ^ first
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
    "Created: / 21-08-2011 / 09:51:35 / cg"
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   111
!
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   112
12098
6ec9402ca9b6 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 11699
diff changeset
   113
lastElementInChain
6ec9402ca9b6 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 11699
diff changeset
   114
    |last next|
6ec9402ca9b6 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 11699
diff changeset
   115
6ec9402ca9b6 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 11699
diff changeset
   116
    last := self.
6ec9402ca9b6 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 11699
diff changeset
   117
    [ (next := last nextElement) notNil ] whileTrue:[
6ec9402ca9b6 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 11699
diff changeset
   118
        last := next.
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
    ^ last
6ec9402ca9b6 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 11699
diff changeset
   121
!
6ec9402ca9b6 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 11699
diff changeset
   122
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   123
next
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   124
    ^ next
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   125
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   126
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   127
next:aSyntaxElement
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   128
    next := aSyntaxElement.
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   129
    next prev: self.
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   130
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   131
    "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
   132
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
10632
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   134
nextElement
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   135
    ^ next
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
    "Created: / 21-08-2011 / 09:47:11 / cg"
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   138
!
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   139
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   140
nextElement:aSyntaxElement
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   141
    next := aSyntaxElement.
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   142
    next prev: self.
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   143
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   144
    "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
   145
    "Created: / 21-08-2011 / 09:47:15 / cg"
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
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
prev
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
    ^ prev
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   152
prev:aSyntaxElement
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
    prev := aSyntaxElement.
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
10632
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   156
previousElement
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   157
    ^ prev
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
    "Created: / 21-08-2011 / 09:47:23 / cg"
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   160
!
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   161
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   162
previousElement:aSyntaxElement
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   163
    prev := aSyntaxElement.
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
    "Created: / 21-08-2011 / 09:47:28 / cg"
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   166
!
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   167
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
start
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
    ^ start
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   170
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   171
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   172
start:anInteger
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
    start := anInteger.
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
stop
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
    ^ stop
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
stop:anInteger
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
    stop := anInteger.
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   182
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   183
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   184
type
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   185
    ^ type
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   186
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   188
type:aSymbol
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
    type := aSymbol.
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
value
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
    ^ value
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
value:anObject
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
    value := anObject.
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
! !
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
12401
4714b9640528 Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12287 12098
diff changeset
   200
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   201
!SyntaxElement methodsFor:'comparing'!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
< anObject
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
    anObject isNumber ifTrue:[^stop < anObject].
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
    anObject class == self class ifFalse:[^false].
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
    ^stop < anObject start
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   208
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
    "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
   210
    "Modified (format): / 27-07-2012 / 21:53:22 / cg"
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
= anObject
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
    anObject class == self class ifFalse:[^false].
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   215
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   216
    ^start == (anObject start) and:
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
        [stop == (anObject stop) and:
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
            [type == (anObject type)]].
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   219
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   220
    "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
   221
    "Modified (format): / 27-07-2012 / 21:53:24 / cg"
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   222
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   223
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   224
hash
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
    ^start hash bitXor:[stop hash bitXor:[type hash]].
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   226
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
    "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
   228
    "Modified (format): / 27-07-2012 / 21:53:28 / cg"
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
! !
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   230
12401
4714b9640528 Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12287 12098
diff changeset
   231
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   232
!SyntaxElement methodsFor:'double dispatching'!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   233
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
lessFromInteger:anInteger
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
    ^stop < anInteger
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
    "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
   238
    "Modified (format): / 27-07-2012 / 21:53:33 / cg"
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
! !
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   240
12401
4714b9640528 Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12287 12098
diff changeset
   241
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
!SyntaxElement methodsFor:'printing & storing'!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
printOn:aStream
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
    "append a printed representation if the receiver to the argument, aStream"
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   246
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
    super printOn:aStream.
10632
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   248
    aStream nextPutAll:'('.
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   249
    type printOn: aStream.
10632
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   250
    aStream nextPutAll:' -> '.    
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   251
    value printOn:aStream.
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   252
    aStream nextPut:$).
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   253
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   254
    "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
   255
    "Modified: / 21-08-2011 / 09:33:51 / cg"
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   256
! !
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   257
12401
4714b9640528 Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12287 12098
diff changeset
   258
10632
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   259
!SyntaxElement methodsFor:'queries'!
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
isSelector
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   262
    ^ type == #selector
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:09:19 / 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
isSelf
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   268
    ^ type == #self
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:31:20 / 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
isVariable
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   274
    ^ type == #variable
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:09:00 / cg"
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   277
!
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
isVariableOrSelf
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   280
    ^ self isVariable or:[self isSelf]
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
    "Created: / 21-08-2011 / 09:31:33 / cg"
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
12401
4714b9640528 Merged 235b77901045 and 8332590c5a41 (branch default)
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12287 12098
diff changeset
   285
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   286
!SyntaxElement class methodsFor:'documentation'!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   287
12128
a7ff7d66ee85 Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
   288
version
12287
400a99059170 Merged with /trunk
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12128
diff changeset
   289
    ^ '$Id: SyntaxElement.st 8048 2012-09-07 17:28:09Z vranyj1 $'
12128
a7ff7d66ee85 Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
   290
!
a7ff7d66ee85 Improvements in LintHighlighter, few fixes
Jan Vrany <jan.vrany@fit.cvut.cz>
parents: 12125
diff changeset
   291
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   292
version_CVS
12098
6ec9402ca9b6 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 11699
diff changeset
   293
    ^ '$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
   294
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   295
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   296
version_SVN
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   297
    ^ '§Id: SyntaxElement.st 7582 2010-06-25 13:26:33Z vranyj1 §'
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   298
! !
12098
6ec9402ca9b6 class: SyntaxElement
Claus Gittinger <cg@exept.de>
parents: 11699
diff changeset
   299