-
Notifications
You must be signed in to change notification settings - Fork 68
/
CDeclarationNode.class.st
106 lines (82 loc) · 2.33 KB
/
CDeclarationNode.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
Class {
#name : #CDeclarationNode,
#superclass : #CGLRAbstractNode,
#instVars : [
'specifiers',
'declarators',
'hasRawPrototype',
'isFunctionPrototype'
],
#category : #'CAST-Nodes'
}
{ #category : #'instance creation' }
CDeclarationNode class >> specifiers: specifiers declarator: aDeclarator [
^ self specifiers: specifiers declarators: {aDeclarator}
]
{ #category : #'instance creation' }
CDeclarationNode class >> specifiers: specifiers declarators: declarators [
^ self new
specifiers: specifiers;
declarators: declarators;
yourself
]
{ #category : #comparing }
CDeclarationNode >> = anObject [
"Answer whether the receiver and anObject represent the same object."
self == anObject ifTrue: [ ^ true ].
self class = anObject class ifFalse: [ ^ false ].
^ specifiers = anObject specifiers and: [
declarators = anObject declarators ]
]
{ #category : #generated }
CDeclarationNode >> acceptVisitor: anAbstractVisitor [
^ anAbstractVisitor visitDeclaration: self
]
{ #category : #generated }
CDeclarationNode >> declarators [
^ declarators
]
{ #category : #generated }
CDeclarationNode >> declarators: anOrderedCollection [
self setParents: self declarators to: nil.
declarators := anOrderedCollection.
self setParents: self declarators to: self
]
{ #category : #accessing }
CDeclarationNode >> hasRawPrototype [
^ hasRawPrototype
]
{ #category : #accessing }
CDeclarationNode >> hasRawPrototype: aBoolean [
hasRawPrototype := aBoolean
]
{ #category : #comparing }
CDeclarationNode >> hash [
"Answer an integer value that is related to the identity of the receiver."
^ specifiers hash bitXor: declarators hash
]
{ #category : #'generated-initialize-release' }
CDeclarationNode >> initialize [
super initialize.
hasRawPrototype := false.
isFunctionPrototype := false.
specifiers := OrderedCollection new: 2.
declarators := OrderedCollection new: 2
]
{ #category : #accessing }
CDeclarationNode >> isFunctionPrototype [
"Return true if this declaration is a function prototype."
^ isFunctionPrototype
]
{ #category : #accessing }
CDeclarationNode >> isFunctionPrototype: aBoolean [
isFunctionPrototype := aBoolean
]
{ #category : #generated }
CDeclarationNode >> specifiers [
^ specifiers
]
{ #category : #generated }
CDeclarationNode >> specifiers: anOrderedCollection [
specifiers := anOrderedCollection
]