SyntaxElement.st
author Claus Gittinger <cg@exept.de>
Fri, 27 Jul 2012 21:53:54 +0200
changeset 11699 f29c996d59f1
parent 10632 9e4b40a83d6a
child 12098 6ec9402ca9b6
permissions -rw-r--r--
comment/format in:
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
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   111
next
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
    ^ next
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
next:aSyntaxElement
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
    next := aSyntaxElement.
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
    next prev: self.
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   118
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   119
    "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
   120
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
10632
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   122
nextElement
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   123
    ^ next
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   124
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   125
    "Created: / 21-08-2011 / 09:47:11 / cg"
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   126
!
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   127
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   128
nextElement:aSyntaxElement
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   129
    next := aSyntaxElement.
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   130
    next prev: self.
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   131
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   132
    "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
   133
    "Created: / 21-08-2011 / 09:47:15 / cg"
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
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
prev
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
    ^ prev
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   140
prev:aSyntaxElement
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
    prev := aSyntaxElement.
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
previousElement
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   145
    ^ prev
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:23 / 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
previousElement:aSyntaxElement
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   151
    prev := aSyntaxElement.
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   152
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   153
    "Created: / 21-08-2011 / 09:47:28 / cg"
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   154
!
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   155
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
start
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
    ^ start
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
start:anInteger
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   161
    start := anInteger.
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   163
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
stop
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   165
    ^ stop
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   167
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
stop:anInteger
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
    stop := anInteger.
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
type
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
    ^ type
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
type:aSymbol
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
    type := aSymbol.
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
value
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   181
    ^ value
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
value:anObject
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   185
    value := anObject.
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
!SyntaxElement methodsFor:'comparing'!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
< anObject
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
    anObject isNumber ifTrue:[^stop < anObject].
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
    anObject class == self class ifFalse:[^false].
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
    ^stop < anObject start
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
    "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
   197
    "Modified (format): / 27-07-2012 / 21:53:22 / cg"
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
!
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 class == self class ifFalse:[^false].
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
    ^start == (anObject start) and:
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   204
        [stop == (anObject stop) and:
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   205
            [type == (anObject type)]].
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   206
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   207
    "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
   208
    "Modified (format): / 27-07-2012 / 21:53:24 / cg"
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   209
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   210
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
hash
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
    ^start hash bitXor:[stop hash bitXor:[type hash]].
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   213
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
    "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
   215
    "Modified (format): / 27-07-2012 / 21:53:28 / cg"
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   216
! !
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   217
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   218
!SyntaxElement methodsFor:'double dispatching'!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   219
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   220
lessFromInteger:anInteger
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   221
    ^stop < anInteger
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   222
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   223
    "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
   224
    "Modified (format): / 27-07-2012 / 21:53:33 / cg"
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
! !
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   226
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
!SyntaxElement methodsFor:'printing & storing'!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
printOn:aStream
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   230
    "append a printed representation if the receiver to the argument, aStream"
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   231
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   232
    super printOn:aStream.
10632
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   233
    aStream nextPutAll:'('.
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
    type printOn: aStream.
10632
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   235
    aStream nextPutAll:' -> '.    
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
    value printOn:aStream.
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   237
    aStream nextPut:$).
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   238
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   239
    "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
   240
    "Modified: / 21-08-2011 / 09:33:51 / cg"
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   241
! !
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   242
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   243
!SyntaxElement methodsFor:'queries'!
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   244
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   245
isSelector
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   246
    ^ type == #selector
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   247
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   248
    "Created: / 21-08-2011 / 09:09:19 / cg"
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   249
!
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   250
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   251
isSelf
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   252
    ^ type == #self
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   253
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   254
    "Created: / 21-08-2011 / 09:31:20 / cg"
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   255
!
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
isVariable
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   258
    ^ type == #variable
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
    "Created: / 21-08-2011 / 09:09:00 / cg"
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   261
!
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   262
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   263
isVariableOrSelf
9e4b40a83d6a added:9 methods
Claus Gittinger <cg@exept.de>
parents: 10068
diff changeset
   264
    ^ self isVariable or:[self isSelf]
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
    "Created: / 21-08-2011 / 09:31:33 / cg"
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   267
! !
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   268
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   269
!SyntaxElement class methodsFor:'documentation'!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   270
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   271
version_CVS
11699
f29c996d59f1 comment/format in:
Claus Gittinger <cg@exept.de>
parents: 10632
diff changeset
   272
    ^ '$Header: /cvs/stx/stx/libtool/SyntaxElement.st,v 1.4 2012-07-27 19:53:54 cg Exp $'
10021
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   273
!
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   274
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   275
version_SVN
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   276
    ^ '§Id: SyntaxElement.st 7582 2010-06-25 13:26:33Z vranyj1 §'
af3ee96d9f16 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   277
! !