@@ -6,8 +6,7 @@ import type {
6
6
import type { NodeId } from '../r-bridge/lang-4.x/ast/model/processing/node-id' ;
7
7
import type {
8
8
NormalizedAst ,
9
- ParentInformation ,
10
- RNodeWithParent
9
+ ParentInformation
11
10
} from '../r-bridge/lang-4.x/ast/model/processing/decorate' ;
12
11
import type { BasicCfgGuidedVisitorConfiguration } from './basic-cfg-guided-visitor' ;
13
12
import { BasicCfgGuidedVisitor } from './basic-cfg-guided-visitor' ;
@@ -34,10 +33,12 @@ import type { RString } from '../r-bridge/lang-4.x/ast/model/nodes/r-string';
34
33
import type { RNext } from '../r-bridge/lang-4.x/ast/model/nodes/r-next' ;
35
34
import type { RNumber } from '../r-bridge/lang-4.x/ast/model/nodes/r-number' ;
36
35
import type { RSymbol } from '../r-bridge/lang-4.x/ast/model/nodes/r-symbol' ;
36
+ import type { NoInfo , RNode } from '../r-bridge/lang-4.x/ast/model/model' ;
37
37
38
38
export interface SyntaxCfgGuidedVisitorConfiguration <
39
- Cfg extends ControlFlowInformation = ControlFlowInformation ,
40
- Ast extends NormalizedAst = NormalizedAst
39
+ OtherInfo = NoInfo ,
40
+ Cfg extends ControlFlowInformation = ControlFlowInformation ,
41
+ Ast extends NormalizedAst < OtherInfo > = NormalizedAst < OtherInfo >
41
42
> extends BasicCfgGuidedVisitorConfiguration < Cfg > {
42
43
readonly normalizedAst : Ast ;
43
44
}
@@ -48,15 +49,16 @@ export interface SyntaxCfgGuidedVisitorConfiguration<
48
49
* Use {@link BasicCfgGuidedVisitor#start} to start the traversal.
49
50
*/
50
51
export class SyntaxAwareCfgGuidedVisitor <
52
+ OtherInfo = NoInfo ,
51
53
Cfg extends ControlFlowInformation = ControlFlowInformation ,
52
- Ast extends NormalizedAst = NormalizedAst ,
53
- Config extends SyntaxCfgGuidedVisitorConfiguration < Cfg , Ast > = SyntaxCfgGuidedVisitorConfiguration < Cfg , Ast >
54
+ Ast extends NormalizedAst < OtherInfo > = NormalizedAst < OtherInfo > ,
55
+ Config extends SyntaxCfgGuidedVisitorConfiguration < OtherInfo , Cfg , Ast > = SyntaxCfgGuidedVisitorConfiguration < OtherInfo , Cfg , Ast > ,
54
56
> extends BasicCfgGuidedVisitor < Cfg , Config > {
55
57
56
58
/**
57
59
* Get the normalized AST node for the given id or fail if it does not exist.
58
60
*/
59
- protected getNormalizedAst ( id : NodeId ) : RNodeWithParent | undefined {
61
+ protected getNormalizedAst ( id : NodeId ) : RNode < OtherInfo & ParentInformation > | undefined {
60
62
return this . config . normalizedAst . idMap . get ( id ) ;
61
63
}
62
64
@@ -125,46 +127,89 @@ export class SyntaxAwareCfgGuidedVisitor<
125
127
}
126
128
}
127
129
128
- protected visitRAccess ( _node : RAccess < ParentInformation > ) : void {
129
- }
130
- protected visitRArgument ( _node : RArgument < ParentInformation > ) : void {
131
- }
132
- protected visitRBinaryOp ( _node : RBinaryOp < ParentInformation > ) : void {
133
- }
134
- protected visitRExpressionList ( _node : RExpressionList < ParentInformation > ) : void {
135
- }
136
- protected visitRForLoop ( _node : RForLoop < ParentInformation > ) : void {
137
- }
138
- protected visitRFunctionCall ( _node : RFunctionCall < ParentInformation > ) : void {
139
- }
140
- protected visitRFunctionDefinition ( _node : RFunctionDefinition < ParentInformation > ) : void {
141
- }
142
- protected visitRIfThenElse ( _node : RIfThenElse < ParentInformation > ) : void {
143
- }
144
- protected visitRParameter ( _node : RParameter < ParentInformation > ) : void {
145
- }
146
- protected visitRPipe ( _node : RPipe < ParentInformation > ) : void {
147
- }
148
- protected visitRRepeatLoop ( _node : RRepeatLoop < ParentInformation > ) : void {
149
- }
150
- protected visitRUnaryOp ( _node : RUnaryOp < ParentInformation > ) : void {
151
- }
152
- protected visitRWhileLoop ( _node : RWhileLoop < ParentInformation > ) : void {
153
- }
154
- protected visitRBreak ( _node : RBreak < ParentInformation > ) : void {
155
- }
156
- protected visitRComment ( _node : RComment < ParentInformation > ) : void {
157
- }
158
- protected visitRLineDirective ( _node : RLineDirective < ParentInformation > ) : void {
159
- }
160
- protected visitRLogical ( _node : RLogical < ParentInformation > ) : void {
161
- }
162
- protected visitRNext ( _node : RNext < ParentInformation > ) : void {
163
- }
164
- protected visitRNumber ( _node : RNumber < ParentInformation > ) : void {
165
- }
166
- protected visitRString ( _node : RString < ParentInformation > ) : void {
167
- }
168
- protected visitRSymbol ( _node : RSymbol < ParentInformation > ) : void {
169
- }
130
+
131
+ /**
132
+ * {@link RAccess }
133
+ */
134
+ protected visitRAccess ( _node : RAccess < OtherInfo & ParentInformation > ) : void { }
135
+ /**
136
+ * {@link RArgument }
137
+ */
138
+ protected visitRArgument ( _node : RArgument < OtherInfo & ParentInformation > ) : void { }
139
+ /**
140
+ * {@link RBinaryOp }
141
+ */
142
+ protected visitRBinaryOp ( _node : RBinaryOp < OtherInfo & ParentInformation > ) : void { }
143
+ /**
144
+ * {@link RExpressionList }
145
+ */
146
+ protected visitRExpressionList ( _node : RExpressionList < OtherInfo & ParentInformation > ) : void { }
147
+ /**
148
+ * {@link RForLoop }
149
+ */
150
+ protected visitRForLoop ( _node : RForLoop < OtherInfo & ParentInformation > ) : void { }
151
+ /**
152
+ * {@link RFunctionCall }
153
+ */
154
+ protected visitRFunctionCall ( _node : RFunctionCall < OtherInfo & ParentInformation > ) : void { }
155
+ /**
156
+ * {@link RFunctionDefinition }
157
+ */
158
+ protected visitRFunctionDefinition ( _node : RFunctionDefinition < OtherInfo & ParentInformation > ) : void { }
159
+ /**
160
+ * {@link RIfThenElse }
161
+ */
162
+ protected visitRIfThenElse ( _node : RIfThenElse < OtherInfo & ParentInformation > ) : void { }
163
+ /**
164
+ * {@link RParameter }
165
+ */
166
+ protected visitRParameter ( _node : RParameter < OtherInfo & ParentInformation > ) : void { }
167
+ /**
168
+ * {@link RPipe }
169
+ */
170
+ protected visitRPipe ( _node : RPipe < OtherInfo & ParentInformation > ) : void { }
171
+ /**
172
+ * {@link RRepeatLoop }
173
+ */
174
+ protected visitRRepeatLoop ( _node : RRepeatLoop < OtherInfo & ParentInformation > ) : void { }
175
+ /**
176
+ * {@link RUnaryOp }
177
+ */
178
+ protected visitRUnaryOp ( _node : RUnaryOp < OtherInfo & ParentInformation > ) : void { }
179
+ /**
180
+ * {@link RWhileLoop }
181
+ */
182
+ protected visitRWhileLoop ( _node : RWhileLoop < OtherInfo & ParentInformation > ) : void { }
183
+ /**
184
+ * {@link RBreak }
185
+ */
186
+ protected visitRBreak ( _node : RBreak < OtherInfo & ParentInformation > ) : void { }
187
+ /**
188
+ * {@link RComment }
189
+ */
190
+ protected visitRComment ( _node : RComment < OtherInfo & ParentInformation > ) : void { }
191
+ /**
192
+ * {@link RLineDirective }
193
+ */
194
+ protected visitRLineDirective ( _node : RLineDirective < OtherInfo & ParentInformation > ) : void { }
195
+ /**
196
+ * {@link RLogical }
197
+ */
198
+ protected visitRLogical ( _node : RLogical < OtherInfo & ParentInformation > ) : void { }
199
+ /**
200
+ * {@link RNext }
201
+ */
202
+ protected visitRNext ( _node : RNext < OtherInfo & ParentInformation > ) : void { }
203
+ /**
204
+ * {@link RNumber }
205
+ */
206
+ protected visitRNumber ( _node : RNumber < OtherInfo & ParentInformation > ) : void { }
207
+ /**
208
+ * {@link RString }
209
+ */
210
+ protected visitRString ( _node : RString < OtherInfo & ParentInformation > ) : void { }
211
+ /**
212
+ * {@link RSymbol }
213
+ */
214
+ protected visitRSymbol ( _node : RSymbol < OtherInfo & ParentInformation > ) : void { }
170
215
}
0 commit comments