-
Notifications
You must be signed in to change notification settings - Fork 65
/
CPointerDeclaratorNode.class.st
81 lines (63 loc) · 1.82 KB
/
CPointerDeclaratorNode.class.st
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
Class {
#name : #CPointerDeclaratorNode,
#superclass : #CAbstractDeclaratorNode,
#instVars : [
'pointers',
'qualifiers'
],
#category : #'CAST-Nodes'
}
{ #category : #'as yet unclassified' }
CPointerDeclaratorNode class >> declarator: aDeclarator pointers: numberOfPointers [
^ (self declarator: aDeclarator)
pointers: ((1 to: numberOfPointers) collect: [ :e | '*' ]);
yourself
]
{ #category : #comparing }
CPointerDeclaratorNode >> = anObject [
"Answer whether the receiver and anObject represent the same object."
self == anObject ifTrue: [ ^ true ].
self class = anObject class ifFalse: [ ^ false ].
^ qualifiers = anObject qualifiers and: [
pointers = anObject pointers and: [
declarator = anObject declarator2 ] ]
]
{ #category : #generated }
CPointerDeclaratorNode >> acceptVisitor: anAbstractVisitor [
^ anAbstractVisitor visitDeclarator: self
]
{ #category : #accessing }
CPointerDeclaratorNode >> declarator2 [
^ declarator
]
{ #category : #comparing }
CPointerDeclaratorNode >> hash [
"Answer an integer value that is related to the identity of the receiver."
^ qualifiers hash bitXor: (pointers hash bitXor: declarator hash)
]
{ #category : #'generated-initialize-release' }
CPointerDeclaratorNode >> initialize [
super initialize.
pointers := OrderedCollection new: 2.
qualifiers := OrderedCollection new: 2.
]
{ #category : #testing }
CPointerDeclaratorNode >> isPointerDeclarator [
^ true
]
{ #category : #generated }
CPointerDeclaratorNode >> pointers [
^ pointers
]
{ #category : #generated }
CPointerDeclaratorNode >> pointers: anOrderedCollection [
pointers := anOrderedCollection
]
{ #category : #generated }
CPointerDeclaratorNode >> qualifiers [
^ qualifiers
]
{ #category : #generated }
CPointerDeclaratorNode >> qualifiers: anOrderedCollection [
qualifiers := anOrderedCollection
]