Line data Source code
1 : /* valacodevisitor.vala
2 : *
3 : * Copyright (C) 2006-2010 Jürg Billeter
4 : * Copyright (C) 2006-2008 Raffaele Sandrini
5 : *
6 : * This library is free software; you can redistribute it and/or
7 : * modify it under the terms of the GNU Lesser General Public
8 : * License as published by the Free Software Foundation; either
9 : * version 2.1 of the License, or (at your option) any later version.
10 :
11 : * This library is distributed in the hope that it will be useful,
12 : * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 : * Lesser General Public License for more details.
15 :
16 : * You should have received a copy of the GNU Lesser General Public
17 : * License along with this library; if not, write to the Free Software
18 : * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 : *
20 : * Author:
21 : * Jürg Billeter <j@bitron.ch>
22 : * Raffaele Sandrini <raffaele@sandrini.ch>
23 : */
24 :
25 : using GLib;
26 :
27 : /**
28 : * Abstract code node visitor for traversing source code tree.
29 : */
30 20889188 : public abstract class Vala.CodeVisitor {
31 : /**
32 : * Visit operation called for source files.
33 : *
34 : * @param source_file a source file
35 : */
36 34331 : public virtual void visit_source_file (SourceFile source_file) {
37 : }
38 :
39 : /**
40 : * Visit operation called for namespaces.
41 : *
42 : * @param ns a namespace
43 : */
44 207220 : public virtual void visit_namespace (Namespace ns) {
45 : }
46 :
47 : /**
48 : * Visit operation called for classes.
49 : *
50 : * @param cl a class
51 : */
52 847705 : public virtual void visit_class (Class cl) {
53 : }
54 :
55 : /**
56 : * Visit operation called for structs.
57 : *
58 : * @param st a struct
59 : */
60 327139 : public virtual void visit_struct (Struct st) {
61 : }
62 :
63 : /**
64 : * Visit operation called for interfaces.
65 : *
66 : * @param iface an interface
67 : */
68 130835 : public virtual void visit_interface (Interface iface) {
69 : }
70 :
71 : /**
72 : * Visit operation called for enums.
73 : *
74 : * @param en an enum
75 : */
76 474770 : public virtual void visit_enum (Enum en) {
77 : }
78 :
79 : /**
80 : * Visit operation called for enum values.
81 : *
82 : * @param ev an enum value
83 : */
84 6634579 : public virtual void visit_enum_value (EnumValue ev) {
85 : }
86 :
87 : /**
88 : * Visit operation called for error domains.
89 : *
90 : * @param edomain an error domain
91 : */
92 68933 : public virtual void visit_error_domain (ErrorDomain edomain) {
93 : }
94 :
95 : /**
96 : * Visit operation called for error codes.
97 : *
98 : * @param ecode an error code
99 : */
100 1940737 : public virtual void visit_error_code (ErrorCode ecode) {
101 : }
102 :
103 : /**
104 : * Visit operation called for delegates.
105 : *
106 : * @param d a delegate
107 : */
108 551735 : public virtual void visit_delegate (Delegate d) {
109 : }
110 :
111 : /**
112 : * Visit operation called for constants.
113 : *
114 : * @param c a constant
115 : */
116 2024663 : public virtual void visit_constant (Constant c) {
117 : }
118 :
119 : /**
120 : * Visit operation called for fields.
121 : *
122 : * @param f a field
123 : */
124 1304466 : public virtual void visit_field (Field f) {
125 : }
126 :
127 : /**
128 : * Visit operation called for methods.
129 : *
130 : * @param m a method
131 : */
132 13701212 : public virtual void visit_method (Method m) {
133 : }
134 :
135 : /**
136 : * Visit operation called for creation methods.
137 : *
138 : * @param m a method
139 : */
140 1244520 : public virtual void visit_creation_method (CreationMethod m) {
141 : }
142 :
143 : /**
144 : * Visit operation called for formal parameters.
145 : *
146 : * @param p a formal parameter
147 : */
148 14397832 : public virtual void visit_formal_parameter (Parameter p) {
149 : }
150 :
151 : /**
152 : * Visit operation called for properties.
153 : *
154 : * @param prop a property
155 : */
156 998636 : public virtual void visit_property (Property prop) {
157 : }
158 :
159 : /**
160 : * Visit operation called for property accessors.
161 : *
162 : * @param acc a property accessor
163 : */
164 1199588 : public virtual void visit_property_accessor (PropertyAccessor acc) {
165 : }
166 :
167 : /**
168 : * Visit operation called for signals.
169 : *
170 : * @param sig a signal
171 : */
172 304034 : public virtual void visit_signal (Signal sig) {
173 : }
174 :
175 : /**
176 : * Visit operation called for constructors.
177 : *
178 : * @param c a constructor
179 : */
180 214 : public virtual void visit_constructor (Constructor c) {
181 : }
182 :
183 : /**
184 : * Visit operation called for destructors.
185 : *
186 : * @param d a destructor
187 : */
188 103 : public virtual void visit_destructor (Destructor d) {
189 : }
190 :
191 : /**
192 : * Visit operation called for type parameters.
193 : *
194 : * @param p a type parameter
195 : */
196 451462 : public virtual void visit_type_parameter (TypeParameter p) {
197 : }
198 :
199 : /**
200 : * Visit operation called for using directives.
201 : *
202 : * @param ns a using directive
203 : */
204 4772 : public virtual void visit_using_directive (UsingDirective ns) {
205 : }
206 :
207 : /**
208 : * Visit operation called for type references.
209 : *
210 : * @param type a type reference
211 : */
212 46508417 : public virtual void visit_data_type (DataType type) {
213 : }
214 :
215 : /**
216 : * Visit operation called for blocks.
217 : *
218 : * @param b a block
219 : */
220 775669 : public virtual void visit_block (Block b) {
221 : }
222 :
223 : /**
224 : * Visit operation called for empty statements.
225 : *
226 : * @param stmt an empty statement
227 : */
228 122 : public virtual void visit_empty_statement (EmptyStatement stmt) {
229 : }
230 :
231 : /**
232 : * Visit operation called for declaration statements.
233 : *
234 : * @param stmt a declaration statement
235 : */
236 212182 : public virtual void visit_declaration_statement (DeclarationStatement stmt) {
237 : }
238 :
239 : /**
240 : * Visit operation called for local variables.
241 : *
242 : * @param local a local variable
243 : */
244 212739 : public virtual void visit_local_variable (LocalVariable local) {
245 : }
246 :
247 : /**
248 : * Visit operation called for initializer lists
249 : *
250 : * @param list an initializer list
251 : */
252 16625 : public virtual void visit_initializer_list (InitializerList list) {
253 : }
254 :
255 : /**
256 : * Visit operation called for expression statements.
257 : *
258 : * @param stmt an expression statement
259 : */
260 446609 : public virtual void visit_expression_statement (ExpressionStatement stmt) {
261 : }
262 :
263 : /**
264 : * Visit operation called for if statements.
265 : *
266 : * @param stmt an if statement
267 : */
268 179623 : public virtual void visit_if_statement (IfStatement stmt) {
269 : }
270 :
271 : /**
272 : * Visit operation called for switch statements.
273 : *
274 : * @param stmt a switch statement
275 : */
276 319 : public virtual void visit_switch_statement (SwitchStatement stmt) {
277 : }
278 :
279 : /**
280 : * Visit operation called for switch sections.
281 : *
282 : * @param section a switch section
283 : */
284 579 : public virtual void visit_switch_section (SwitchSection section) {
285 : }
286 :
287 : /**
288 : * Visit operation called for switch label.
289 : *
290 : * @param label a switch label
291 : */
292 1326 : public virtual void visit_switch_label (SwitchLabel label) {
293 : }
294 :
295 : /**
296 : * Visit operation called for loops.
297 : *
298 : * @param stmt a loop
299 : */
300 10386 : public virtual void visit_loop_statement (LoopStatement stmt) {
301 : }
302 :
303 : /**
304 : * Visit operation called for while statements.
305 : *
306 : * @param stmt an while statement
307 : */
308 8710 : public virtual void visit_while_statement (WhileStatement stmt) {
309 : }
310 :
311 : /**
312 : * Visit operation called for do statements.
313 : *
314 : * @param stmt a do statement
315 : */
316 9 : public virtual void visit_do_statement (DoStatement stmt) {
317 : }
318 :
319 : /**
320 : * Visit operation called for for statements.
321 : *
322 : * @param stmt a for statement
323 : */
324 4442 : public virtual void visit_for_statement (ForStatement stmt) {
325 : }
326 :
327 : /**
328 : * Visit operation called for foreach statements.
329 : *
330 : * @param stmt a foreach statement
331 : */
332 987 : public virtual void visit_foreach_statement (ForeachStatement stmt) {
333 : }
334 :
335 : /**
336 : * Visit operation called for break statements.
337 : *
338 : * @param stmt a break statement
339 : */
340 23676 : public virtual void visit_break_statement (BreakStatement stmt) {
341 : }
342 :
343 : /**
344 : * Visit operation called for continue statements.
345 : *
346 : * @param stmt a continue statement
347 : */
348 463 : public virtual void visit_continue_statement (ContinueStatement stmt) {
349 : }
350 :
351 : /**
352 : * Visit operation called for return statements.
353 : *
354 : * @param stmt a return statement
355 : */
356 278969 : public virtual void visit_return_statement (ReturnStatement stmt) {
357 : }
358 :
359 : /**
360 : * Visit operation called for yield statement.
361 : *
362 : * @param y a yield statement
363 : */
364 53 : public virtual void visit_yield_statement (YieldStatement y) {
365 : }
366 :
367 : /**
368 : * Visit operation called for throw statements.
369 : *
370 : * @param stmt a throw statement
371 : */
372 2570 : public virtual void visit_throw_statement (ThrowStatement stmt) {
373 : }
374 :
375 : /**
376 : * Visit operation called for try statements.
377 : *
378 : * @param stmt a try statement
379 : */
380 5278 : public virtual void visit_try_statement (TryStatement stmt) {
381 : }
382 :
383 : /**
384 : * Visit operation called for catch clauses.
385 : *
386 : * @param clause a catch clause
387 : */
388 3153 : public virtual void visit_catch_clause (CatchClause clause) {
389 : }
390 :
391 : /**
392 : * Visit operation called for lock statements before the body has been visited.
393 : *
394 : * @param stmt a lock statement
395 : */
396 110 : public virtual void visit_lock_statement (LockStatement stmt) {
397 : }
398 :
399 : /**
400 : * Visit operation called for unlock statements.
401 : *
402 : * @param stmt an unlock statement
403 : */
404 58 : public virtual void visit_unlock_statement (UnlockStatement stmt) {
405 : }
406 :
407 : /**
408 : * Visit operation called for with statements.
409 : *
410 : * @param stmt a with statement
411 : */
412 85 : public virtual void visit_with_statement (WithStatement stmt) {
413 : }
414 :
415 : /**
416 : * Visit operation called for delete statements.
417 : *
418 : * @param stmt a delete statement
419 : */
420 21 : public virtual void visit_delete_statement (DeleteStatement stmt) {
421 : }
422 :
423 : /**
424 : * Visit operations called for expressions.
425 : *
426 : * @param expr an expression
427 : */
428 24563215 : public virtual void visit_expression (Expression expr) {
429 : }
430 :
431 : /**
432 : * Visit operations called for array creation expressions.
433 : *
434 : * @param expr an array creation expression
435 : */
436 25738 : public virtual void visit_array_creation_expression (ArrayCreationExpression expr) {
437 : }
438 :
439 : /**
440 : * Visit operation called for boolean literals.
441 : *
442 : * @param lit a boolean literal
443 : */
444 350897 : public virtual void visit_boolean_literal (BooleanLiteral lit) {
445 : }
446 :
447 : /**
448 : * Visit operation called for character literals.
449 : *
450 : * @param lit a character literal
451 : */
452 28967 : public virtual void visit_character_literal (CharacterLiteral lit) {
453 : }
454 :
455 : /**
456 : * Visit operation called for integer literals.
457 : *
458 : * @param lit an integer literal
459 : */
460 1225919 : public virtual void visit_integer_literal (IntegerLiteral lit) {
461 : }
462 :
463 : /**
464 : * Visit operation called for real literals.
465 : *
466 : * @param lit a real literal
467 : */
468 2868 : public virtual void visit_real_literal (RealLiteral lit) {
469 : }
470 :
471 : /**
472 : * Visit operation called for regex literals.
473 : *
474 : * @param lit a regex literal
475 : */
476 159 : public virtual void visit_regex_literal (RegexLiteral lit) {
477 : }
478 :
479 :
480 : /**
481 : * Visit operation called for string literals.
482 : *
483 : * @param lit a string literal
484 : */
485 530667 : public virtual void visit_string_literal (StringLiteral lit) {
486 : }
487 :
488 : /**
489 : * Visit operation called for string templates.
490 : *
491 : * @param tmpl a string template
492 : */
493 33 : public virtual void visit_template (Template tmpl) {
494 : }
495 :
496 : /**
497 : * Visit operation called for tuples.
498 : *
499 : * @param tuple a tuple
500 : */
501 2 : public virtual void visit_tuple (Tuple tuple) {
502 : }
503 :
504 : /**
505 : * Visit operation called for null literals.
506 : *
507 : * @param lit a null literal
508 : */
509 3150900 : public virtual void visit_null_literal (NullLiteral lit) {
510 : }
511 :
512 : /**
513 : * Visit operation called for member access expressions.
514 : *
515 : * @param expr a member access expression
516 : */
517 7559900 : public virtual void visit_member_access (MemberAccess expr) {
518 : }
519 :
520 : /**
521 : * Visit operation called for invocation expressions.
522 : *
523 : * @param expr an invocation expression
524 : */
525 1035359 : public virtual void visit_method_call (MethodCall expr) {
526 : }
527 :
528 : /**
529 : * Visit operation called for element access expressions.
530 : *
531 : * @param expr an element access expression
532 : */
533 88801 : public virtual void visit_element_access (ElementAccess expr) {
534 : }
535 :
536 : /**
537 : * Visit operation called for array slice expressions.
538 : *
539 : * @param expr an array slice expression
540 : */
541 187 : public virtual void visit_slice_expression (SliceExpression expr) {
542 : }
543 :
544 : /**
545 : * Visit operation called for base access expressions.
546 : *
547 : * @param expr a base access expression
548 : */
549 3550 : public virtual void visit_base_access (BaseAccess expr) {
550 : }
551 :
552 : /**
553 : * Visit operation called for postfix expressions.
554 : *
555 : * @param expr a postfix expression
556 : */
557 21588 : public virtual void visit_postfix_expression (PostfixExpression expr) {
558 : }
559 :
560 : /**
561 : * Visit operation called for object creation expressions.
562 : *
563 : * @param expr an object creation expression
564 : */
565 93710 : public virtual void visit_object_creation_expression (ObjectCreationExpression expr) {
566 : }
567 :
568 : /**
569 : * Visit operation called for sizeof expressions.
570 : *
571 : * @param expr a sizeof expression
572 : */
573 5856 : public virtual void visit_sizeof_expression (SizeofExpression expr) {
574 : }
575 :
576 : /**
577 : * Visit operation called for typeof expressions.
578 : *
579 : * @param expr a typeof expression
580 : */
581 1065 : public virtual void visit_typeof_expression (TypeofExpression expr) {
582 : }
583 :
584 : /**
585 : * Visit operation called for unary expressions.
586 : *
587 : * @param expr an unary expression
588 : */
589 155094 : public virtual void visit_unary_expression (UnaryExpression expr) {
590 : }
591 :
592 : /**
593 : * Visit operation called for call expressions.
594 : *
595 : * @param expr a call expression
596 : */
597 845468 : public virtual void visit_cast_expression (CastExpression expr) {
598 : }
599 :
600 : /**
601 : * Visit operation called for named arguments.
602 : *
603 : * @param expr a named argument
604 : */
605 84 : public virtual void visit_named_argument (NamedArgument expr) {
606 : }
607 :
608 : /**
609 : * Visit operation called for pointer indirections.
610 : *
611 : * @param expr a pointer indirection
612 : */
613 76484 : public virtual void visit_pointer_indirection (PointerIndirection expr) {
614 : }
615 :
616 : /**
617 : * Visit operation called for address-of expressions.
618 : *
619 : * @param expr an address-of expression
620 : */
621 9656 : public virtual void visit_addressof_expression (AddressofExpression expr) {
622 : }
623 :
624 : /**
625 : * Visit operation called for reference transfer expressions.
626 : *
627 : * @param expr a reference transfer expression
628 : */
629 61883 : public virtual void visit_reference_transfer_expression (ReferenceTransferExpression expr) {
630 : }
631 :
632 : /**
633 : * Visit operation called for binary expressions.
634 : *
635 : * @param expr a binary expression
636 : */
637 1138374 : public virtual void visit_binary_expression (BinaryExpression expr) {
638 : }
639 :
640 : /**
641 : * Visit operation called for type checks.
642 : *
643 : * @param expr a type check expression
644 : */
645 7277 : public virtual void visit_type_check (TypeCheck expr) {
646 : }
647 :
648 : /**
649 : * Visit operation called for conditional expressions.
650 : *
651 : * @param expr a conditional expression
652 : */
653 14559 : public virtual void visit_conditional_expression (ConditionalExpression expr) {
654 : }
655 :
656 : /**
657 : * Visit operation called for lambda expressions.
658 : *
659 : * @param expr a lambda expression
660 : */
661 21371 : public virtual void visit_lambda_expression (LambdaExpression expr) {
662 : }
663 :
664 : /**
665 : * Visit operation called for assignments.
666 : *
667 : * @param a an assignment
668 : */
669 748441 : public virtual void visit_assignment (Assignment a) {
670 : }
671 :
672 : /**
673 : * Visit operation called at end of full expressions.
674 : *
675 : * @param expr a full expression
676 : */
677 920314 : public virtual void visit_end_full_expression (Expression expr) {
678 : }
679 : }
|