-
Notifications
You must be signed in to change notification settings - Fork 65
/
CFunctionDeclaratorNode.class.st
127 lines (101 loc) · 2.86 KB
/
CFunctionDeclaratorNode.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
Class {
#name : #CFunctionDeclaratorNode,
#superclass : #CAbstractDeclaratorNode,
#instVars : [
'identifiers',
'parameters',
'ellipsis',
'isPrototype'
],
#category : #'CAST-Nodes'
}
{ #category : #'instance creation' }
CFunctionDeclaratorNode class >> declarator: aDeclarator parameters: parameters [
^ self new
declarator: aDeclarator;
parameters: parameters;
yourself
]
{ #category : #comparing }
CFunctionDeclaratorNode >> = anObject [
"Answer whether the receiver and anObject represent the same object."
self == anObject ifTrue: [ ^ true ].
self class = anObject class ifFalse: [ ^ false ].
^ parameters = anObject parameters and: [
identifiers = anObject identifiers and: [
ellipsis = anObject ellipsis and: [
declarator = anObject declarator ] ] ]
]
{ #category : #generated }
CFunctionDeclaratorNode >> acceptVisitor: anAbstractVisitor [
^ anAbstractVisitor visitFunctionDeclarator: self
]
{ #category : #generated }
CFunctionDeclaratorNode >> compositeNodeVariables [
^ #(#parameters #identifiers)
]
{ #category : #generated }
CFunctionDeclaratorNode >> declarator [
^ declarator
]
{ #category : #generated }
CFunctionDeclaratorNode >> declarator: aCGLRAbstractNode [
self declarator notNil
ifTrue: [ self declarator parent: nil ].
declarator := aCGLRAbstractNode.
self declarator notNil
ifTrue: [ self declarator parent: self ]
]
{ #category : #generated }
CFunctionDeclaratorNode >> ellipsis [
^ ellipsis
]
{ #category : #generated }
CFunctionDeclaratorNode >> ellipsis: aSmaCCToken [
ellipsis := aSmaCCToken
]
{ #category : #comparing }
CFunctionDeclaratorNode >> hash [
"Answer an integer value that is related to the identity of the receiver."
^ parameters hash bitXor:
(identifiers hash bitXor: (ellipsis hash bitXor: declarator hash))
]
{ #category : #generated }
CFunctionDeclaratorNode >> identifiers [
^ identifiers
]
{ #category : #generated }
CFunctionDeclaratorNode >> identifiers: anOrderedCollection [
self setParents: self identifiers to: nil.
identifiers := anOrderedCollection.
self setParents: self identifiers to: self
]
{ #category : #'generated-initialize-release' }
CFunctionDeclaratorNode >> initialize [
super initialize.
parameters := OrderedCollection new: 2.
identifiers := OrderedCollection new: 2.
isPrototype := false
]
{ #category : #testing }
CFunctionDeclaratorNode >> isFunctionDeclarator [
^ true
]
{ #category : #accessing }
CFunctionDeclaratorNode >> isPrototype [
^ isPrototype
]
{ #category : #accessing }
CFunctionDeclaratorNode >> isPrototype: aBoolean [
isPrototype := aBoolean
]
{ #category : #generated }
CFunctionDeclaratorNode >> parameters [
^ parameters
]
{ #category : #generated }
CFunctionDeclaratorNode >> parameters: anOrderedCollection [
self setParents: self parameters to: nil.
parameters := anOrderedCollection.
self setParents: self parameters to: self
]