Fix array length handling for get_attributes method
[vala-lang.git] / vala / valacodevisitor.vala
blob90de7141d1dd7637958e73c4329da6ac75c3885f
1 /* valacodevisitor.vala
3 * Copyright (C) 2006-2008 Jürg Billeter, Raffaele Sandrini
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 * Author:
20 * Jürg Billeter <j@bitron.ch>
21 * Raffaele Sandrini <raffaele@sandrini.ch>
24 using GLib;
26 /**
27 * Abstract code node visitor for traversing source code tree.
29 public abstract class Vala.CodeVisitor {
30 /**
31 * Visit operation called for source files.
33 * @param source_file a source file
35 public virtual void visit_source_file (SourceFile source_file) {
38 /**
39 * Visit operation called for namespaces.
41 * @param ns a namespace
43 public virtual void visit_namespace (Namespace ns) {
46 /**
47 * Visit operation called for classes.
49 * @param cl a class
51 public virtual void visit_class (Class cl) {
54 /**
55 * Visit operation called for structs.
57 * @param st a struct
59 public virtual void visit_struct (Struct st) {
62 /**
63 * Visit operation called for interfaces.
65 * @param iface an interface
67 public virtual void visit_interface (Interface iface) {
70 /**
71 * Visit operation called for enums.
73 * @param en an enum
75 public virtual void visit_enum (Enum en) {
78 /**
79 * Visit operation called for enum values.
81 * @param ev an enum value
83 public virtual void visit_enum_value (EnumValue ev) {
86 /**
87 * Visit operation called for error domains.
89 * @param edomain an error domain
91 public virtual void visit_error_domain (ErrorDomain edomain) {
94 /**
95 * Visit operation called for error codes.
97 * @param ecode an error code
99 public virtual void visit_error_code (ErrorCode ecode) {
103 * Visit operation called for delegates.
105 * @param d a delegate
107 public virtual void visit_delegate (Delegate d) {
111 * Visit operation called for members.
113 * @param m a member
115 public virtual void visit_member (Member m) {
119 * Visit operation called for constants.
121 * @param c a constant
123 public virtual void visit_constant (Constant c) {
127 * Visit operation called for fields.
129 * @param f a field
131 public virtual void visit_field (Field f) {
135 * Visit operation called for methods.
137 * @param m a method
139 public virtual void visit_method (Method m) {
143 * Visit operation called for creation methods.
145 * @param m a method
147 public virtual void visit_creation_method (CreationMethod m) {
151 * Visit operation called for formal parameters.
153 * @param p a formal parameter
155 public virtual void visit_formal_parameter (FormalParameter p) {
159 * Visit operation called for properties.
161 * @param prop a property
163 public virtual void visit_property (Property prop) {
167 * Visit operation called for property accessors.
169 * @param acc a property accessor
171 public virtual void visit_property_accessor (PropertyAccessor acc) {
175 * Visit operation called for signals.
177 * @param sig a signal
179 public virtual void visit_signal (Signal sig) {
183 * Visit operation called for constructors.
185 * @param c a constructor
187 public virtual void visit_constructor (Constructor c) {
191 * Visit operation called for destructors.
193 * @param d a destructor
195 public virtual void visit_destructor (Destructor d) {
199 * Visit operation called for type parameters.
201 * @param p a type parameter
203 public virtual void visit_type_parameter (TypeParameter p) {
207 * Visit operation called for using directives.
209 * @param ns a using directive
211 public virtual void visit_using_directive (UsingDirective ns) {
215 * Visit operation called for type references.
217 * @param type a type reference
219 public virtual void visit_data_type (DataType type) {
223 * Visit operation called for blocks.
225 * @param b a block
227 public virtual void visit_block (Block b) {
231 * Visit operation called for empty statements.
233 * @param stmt an empty statement
235 public virtual void visit_empty_statement (EmptyStatement stmt) {
239 * Visit operation called for declaration statements.
241 * @param stmt a declaration statement
243 public virtual void visit_declaration_statement (DeclarationStatement stmt) {
247 * Visit operation called for local variables.
249 * @param local a local variable
251 public virtual void visit_local_variable (LocalVariable local) {
255 * Visit operation called for initializer lists
257 * @param list an initializer list
259 public virtual void visit_initializer_list (InitializerList list) {
263 * Visit operation called for expression statements.
265 * @param stmt an expression statement
267 public virtual void visit_expression_statement (ExpressionStatement stmt) {
271 * Visit operation called for if statements.
273 * @param stmt an if statement
275 public virtual void visit_if_statement (IfStatement stmt) {
279 * Visit operation called for switch statements.
281 * @param stmt a switch statement
283 public virtual void visit_switch_statement (SwitchStatement stmt) {
287 * Visit operation called for switch sections.
289 * @param section a switch section
291 public virtual void visit_switch_section (SwitchSection section) {
295 * Visit operation called for switch label.
297 * @param label a switch label
299 public virtual void visit_switch_label (SwitchLabel label) {
303 * Visit operation called for while statements.
305 * @param stmt an while statement
307 public virtual void visit_while_statement (WhileStatement stmt) {
311 * Visit operation called for do statements.
313 * @param stmt a do statement
315 public virtual void visit_do_statement (DoStatement stmt) {
319 * Visit operation called for for statements.
321 * @param stmt a for statement
323 public virtual void visit_for_statement (ForStatement stmt) {
327 * Visit operation called for foreach statements.
329 * @param stmt a foreach statement
331 public virtual void visit_foreach_statement (ForeachStatement stmt) {
335 * Visit operation called for break statements.
337 * @param stmt a break statement
339 public virtual void visit_break_statement (BreakStatement stmt) {
343 * Visit operation called for continue statements.
345 * @param stmt a continue statement
347 public virtual void visit_continue_statement (ContinueStatement stmt) {
351 * Visit operation called for return statements.
353 * @param stmt a return statement
355 public virtual void visit_return_statement (ReturnStatement stmt) {
359 * Visit operation called for yield statement.
361 * @param y a yield statement
363 public virtual void visit_yield_statement (YieldStatement y) {
367 * Visit operation called for throw statements.
369 * @param stmt a throw statement
371 public virtual void visit_throw_statement (ThrowStatement stmt) {
375 * Visit operation called for try statements.
377 * @param stmt a try statement
379 public virtual void visit_try_statement (TryStatement stmt) {
383 * Visit operation called for catch clauses.
385 * @param clause a catch cluase
387 public virtual void visit_catch_clause (CatchClause clause) {
391 * Visit operation called for lock statements before the body has been visited.
393 * @param stmt a lock statement
395 public virtual void visit_lock_statement (LockStatement stmt) {
399 * Visit operation called for delete statements.
401 * @param stmt a delete statement
403 public virtual void visit_delete_statement (DeleteStatement stmt) {
407 * Visit operations called for expresions.
409 * @param expr an expression
411 public virtual void visit_expression (Expression expr) {
415 * Visit operations called for array creation expresions.
417 * @param expr an array creation expression
419 public virtual void visit_array_creation_expression (ArrayCreationExpression expr) {
423 * Visit operation called for boolean literals.
425 * @param lit a boolean literal
427 public virtual void visit_boolean_literal (BooleanLiteral lit) {
431 * Visit operation called for character literals.
433 * @param lit a character literal
435 public virtual void visit_character_literal (CharacterLiteral lit) {
439 * Visit operation called for integer literals.
441 * @param lit an integer literal
443 public virtual void visit_integer_literal (IntegerLiteral lit) {
447 * Visit operation called for real literals.
449 * @param lit a real literal
451 public virtual void visit_real_literal (RealLiteral lit) {
455 * Visit operation called for string literals.
457 * @param lit a string literal
459 public virtual void visit_string_literal (StringLiteral lit) {
463 * Visit operation called for null literals.
465 * @param lit a null literal
467 public virtual void visit_null_literal (NullLiteral lit) {
471 * Visit operation called for parenthesized expressions.
473 * @param expr a parenthesized expression
475 public virtual void visit_parenthesized_expression (ParenthesizedExpression expr) {
479 * Visit operation called for member access expressions.
481 * @param expr a member access expression
483 public virtual void visit_member_access (MemberAccess expr) {
487 * Visit operation called for invocation expressions.
489 * @param expr an invocation expression
491 public virtual void visit_method_call (MethodCall expr) {
495 * Visit operation called for element access expressions.
497 * @param expr an element access expression
499 public virtual void visit_element_access (ElementAccess expr) {
503 * Visit operation called for base access expressions.
505 * @param expr a base access expression
507 public virtual void visit_base_access (BaseAccess expr) {
511 * Visit operation called for postfix expressions.
513 * @param expr a postfix expression
515 public virtual void visit_postfix_expression (PostfixExpression expr) {
519 * Visit operation called for object creation expressions.
521 * @param expr an object creation expression
523 public virtual void visit_object_creation_expression (ObjectCreationExpression expr) {
527 * Visit operation called for sizeof expressions.
529 * @param expr a sizeof expression
531 public virtual void visit_sizeof_expression (SizeofExpression expr) {
535 * Visit operation called for typeof expressions.
537 * @param expr a typeof expression
539 public virtual void visit_typeof_expression (TypeofExpression expr) {
543 * Visit operation called for unary expressions.
545 * @param expr an unary expression
547 public virtual void visit_unary_expression (UnaryExpression expr) {
551 * Visit operation called for call expressions.
553 * @param expr a call expression
555 public virtual void visit_cast_expression (CastExpression expr) {
559 * Visit operation called for pointer indirections.
561 * @param expr a pointer indirection
563 public virtual void visit_pointer_indirection (PointerIndirection expr) {
567 * Visit operation called for address-of expressions.
569 * @param expr an address-of expression
571 public virtual void visit_addressof_expression (AddressofExpression expr) {
575 * Visit operation called for reference transfer expressions.
577 * @param expr a reference transfer expression
579 public virtual void visit_reference_transfer_expression (ReferenceTransferExpression expr) {
583 * Visit operation called for binary expressions.
585 * @param expr a binary expression
587 public virtual void visit_binary_expression (BinaryExpression expr) {
591 * Visit operation called for type checks.
593 * @param expr a type check expression
595 public virtual void visit_type_check (TypeCheck expr) {
599 * Visit operation called for conditional expressions.
601 * @param expr a conditional expression
603 public virtual void visit_conditional_expression (ConditionalExpression expr) {
607 * Visit operation called for lambda expressions.
609 * @param expr a lambda expression
611 public virtual void visit_lambda_expression (LambdaExpression expr) {
615 * Visit operation called for assignments.
617 * @param a an assignment
619 public virtual void visit_assignment (Assignment a) {
623 * Visit operation called at end of full expressions.
625 * @param expr a full expression
627 public virtual void visit_end_full_expression (Expression expr) {