Logo Search packages:      
Sourcecode: vala version File versions

valacodevisitor.h

/* valacodevisitor.vala
 *
 * Copyright (C) 2006-2007  Jürg Billeter, Raffaele Sandrini
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.

 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.

 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301  USA
 *
 * Author:
 *    Jürg Billeter <j@bitron.ch>
 *    Raffaele Sandrini <rasa@gmx.ch>
 */

#ifndef __VALACODEVISITOR_H__
#define __VALACODEVISITOR_H__

#include <glib.h>
#include <glib-object.h>
#include <vala/valacodenode.h>

G_BEGIN_DECLS


#define VALA_TYPE_CODE_VISITOR (vala_code_visitor_get_type ())
#define VALA_CODE_VISITOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), VALA_TYPE_CODE_VISITOR, ValaCodeVisitor))
#define VALA_CODE_VISITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), VALA_TYPE_CODE_VISITOR, ValaCodeVisitorClass))
#define VALA_IS_CODE_VISITOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), VALA_TYPE_CODE_VISITOR))
#define VALA_IS_CODE_VISITOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), VALA_TYPE_CODE_VISITOR))
#define VALA_CODE_VISITOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), VALA_TYPE_CODE_VISITOR, ValaCodeVisitorClass))

typedef struct _ValaCodeVisitorPrivate ValaCodeVisitorPrivate;

/**
 * Abstract code node visitor for traversing source code tree.
 */
00046 struct _ValaCodeVisitor {
      GObject parent;
      ValaCodeVisitorPrivate * priv;
};
struct _ValaCodeVisitorClass {
      GObjectClass parent;
      void (*visit_source_file) (ValaCodeVisitor* self, ValaSourceFile* source_file);
      void (*visit_namespace) (ValaCodeVisitor* self, ValaNamespace* ns);
      void (*visit_class) (ValaCodeVisitor* self, ValaClass* cl);
      void (*visit_struct) (ValaCodeVisitor* self, ValaStruct* st);
      void (*visit_interface) (ValaCodeVisitor* self, ValaInterface* iface);
      void (*visit_enum) (ValaCodeVisitor* self, ValaEnum* en);
      void (*visit_enum_value) (ValaCodeVisitor* self, ValaEnumValue* ev);
      void (*visit_callback) (ValaCodeVisitor* self, ValaCallback* cb);
      void (*visit_member) (ValaCodeVisitor* self, ValaMember* m);
      void (*visit_constant) (ValaCodeVisitor* self, ValaConstant* c);
      void (*visit_field) (ValaCodeVisitor* self, ValaField* f);
      void (*visit_method) (ValaCodeVisitor* self, ValaMethod* m);
      void (*visit_creation_method) (ValaCodeVisitor* self, ValaCreationMethod* m);
      void (*visit_formal_parameter) (ValaCodeVisitor* self, ValaFormalParameter* p);
      void (*visit_property) (ValaCodeVisitor* self, ValaProperty* prop);
      void (*visit_property_accessor) (ValaCodeVisitor* self, ValaPropertyAccessor* acc);
      void (*visit_signal) (ValaCodeVisitor* self, ValaSignal* sig);
      void (*visit_constructor) (ValaCodeVisitor* self, ValaConstructor* c);
      void (*visit_destructor) (ValaCodeVisitor* self, ValaDestructor* d);
      void (*visit_named_argument) (ValaCodeVisitor* self, ValaNamedArgument* n);
      void (*visit_type_parameter) (ValaCodeVisitor* self, ValaTypeParameter* p);
      void (*visit_namespace_reference) (ValaCodeVisitor* self, ValaNamespaceReference* ns);
      void (*visit_type_reference) (ValaCodeVisitor* self, ValaTypeReference* type);
      void (*visit_begin_block) (ValaCodeVisitor* self, ValaBlock* b);
      void (*visit_end_block) (ValaCodeVisitor* self, ValaBlock* b);
      void (*visit_empty_statement) (ValaCodeVisitor* self, ValaEmptyStatement* stmt);
      void (*visit_declaration_statement) (ValaCodeVisitor* self, ValaDeclarationStatement* stmt);
      void (*visit_local_variable_declaration) (ValaCodeVisitor* self, ValaLocalVariableDeclaration* decl);
      void (*visit_variable_declarator) (ValaCodeVisitor* self, ValaVariableDeclarator* decl);
      void (*visit_begin_initializer_list) (ValaCodeVisitor* self, ValaInitializerList* list);
      void (*visit_end_initializer_list) (ValaCodeVisitor* self, ValaInitializerList* list);
      void (*visit_expression_statement) (ValaCodeVisitor* self, ValaExpressionStatement* stmt);
      void (*visit_if_statement) (ValaCodeVisitor* self, ValaIfStatement* stmt);
      void (*visit_switch_statement) (ValaCodeVisitor* self, ValaSwitchStatement* stmt);
      void (*visit_switch_section) (ValaCodeVisitor* self, ValaSwitchSection* section);
      void (*visit_switch_label) (ValaCodeVisitor* self, ValaSwitchLabel* label);
      void (*visit_while_statement) (ValaCodeVisitor* self, ValaWhileStatement* stmt);
      void (*visit_do_statement) (ValaCodeVisitor* self, ValaDoStatement* stmt);
      void (*visit_for_statement) (ValaCodeVisitor* self, ValaForStatement* stmt);
      void (*visit_begin_foreach_statement) (ValaCodeVisitor* self, ValaForeachStatement* stmt);
      void (*visit_end_foreach_statement) (ValaCodeVisitor* self, ValaForeachStatement* stmt);
      void (*visit_break_statement) (ValaCodeVisitor* self, ValaBreakStatement* stmt);
      void (*visit_continue_statement) (ValaCodeVisitor* self, ValaContinueStatement* stmt);
      void (*visit_begin_return_statement) (ValaCodeVisitor* self, ValaReturnStatement* stmt);
      void (*visit_end_return_statement) (ValaCodeVisitor* self, ValaReturnStatement* stmt);
      void (*visit_throw_statement) (ValaCodeVisitor* self, ValaThrowStatement* stmt);
      void (*visit_try_statement) (ValaCodeVisitor* self, ValaTryStatement* stmt);
      void (*visit_catch_clause) (ValaCodeVisitor* self, ValaCatchClause* clause);
      void (*visit_lock_statement) (ValaCodeVisitor* self, ValaLockStatement* stmt);
      void (*visit_begin_array_creation_expression) (ValaCodeVisitor* self, ValaArrayCreationExpression* expr);
      void (*visit_end_array_creation_expression) (ValaCodeVisitor* self, ValaArrayCreationExpression* expr);
      void (*visit_boolean_literal) (ValaCodeVisitor* self, ValaBooleanLiteral* lit);
      void (*visit_character_literal) (ValaCodeVisitor* self, ValaCharacterLiteral* lit);
      void (*visit_integer_literal) (ValaCodeVisitor* self, ValaIntegerLiteral* lit);
      void (*visit_real_literal) (ValaCodeVisitor* self, ValaRealLiteral* lit);
      void (*visit_string_literal) (ValaCodeVisitor* self, ValaStringLiteral* lit);
      void (*visit_null_literal) (ValaCodeVisitor* self, ValaNullLiteral* lit);
      void (*visit_literal_expression) (ValaCodeVisitor* self, ValaLiteralExpression* expr);
      void (*visit_parenthesized_expression) (ValaCodeVisitor* self, ValaParenthesizedExpression* expr);
      void (*visit_member_access) (ValaCodeVisitor* self, ValaMemberAccess* expr);
      void (*visit_begin_invocation_expression) (ValaCodeVisitor* self, ValaInvocationExpression* expr);
      void (*visit_end_invocation_expression) (ValaCodeVisitor* self, ValaInvocationExpression* expr);
      void (*visit_element_access) (ValaCodeVisitor* self, ValaElementAccess* expr);
      void (*visit_base_access) (ValaCodeVisitor* self, ValaBaseAccess* expr);
      void (*visit_postfix_expression) (ValaCodeVisitor* self, ValaPostfixExpression* expr);
      void (*visit_begin_object_creation_expression) (ValaCodeVisitor* self, ValaObjectCreationExpression* expr);
      void (*visit_end_object_creation_expression) (ValaCodeVisitor* self, ValaObjectCreationExpression* expr);
      void (*visit_sizeof_expression) (ValaCodeVisitor* self, ValaSizeofExpression* expr);
      void (*visit_typeof_expression) (ValaCodeVisitor* self, ValaTypeofExpression* expr);
      void (*visit_unary_expression) (ValaCodeVisitor* self, ValaUnaryExpression* expr);
      void (*visit_cast_expression) (ValaCodeVisitor* self, ValaCastExpression* expr);
      void (*visit_pointer_indirection) (ValaCodeVisitor* self, ValaPointerIndirection* expr);
      void (*visit_addressof_expression) (ValaCodeVisitor* self, ValaAddressofExpression* expr);
      void (*visit_reference_transfer_expression) (ValaCodeVisitor* self, ValaReferenceTransferExpression* expr);
      void (*visit_binary_expression) (ValaCodeVisitor* self, ValaBinaryExpression* expr);
      void (*visit_type_check) (ValaCodeVisitor* self, ValaTypeCheck* expr);
      void (*visit_conditional_expression) (ValaCodeVisitor* self, ValaConditionalExpression* expr);
      void (*visit_begin_lambda_expression) (ValaCodeVisitor* self, ValaLambdaExpression* expr);
      void (*visit_end_lambda_expression) (ValaCodeVisitor* self, ValaLambdaExpression* expr);
      void (*visit_begin_assignment) (ValaCodeVisitor* self, ValaAssignment* a);
      void (*visit_end_assignment) (ValaCodeVisitor* self, ValaAssignment* a);
      void (*visit_end_full_expression) (ValaCodeVisitor* self, ValaExpression* expr);
};

void vala_code_visitor_visit_source_file (ValaCodeVisitor* self, ValaSourceFile* source_file);
void vala_code_visitor_visit_namespace (ValaCodeVisitor* self, ValaNamespace* ns);
void vala_code_visitor_visit_class (ValaCodeVisitor* self, ValaClass* cl);
void vala_code_visitor_visit_struct (ValaCodeVisitor* self, ValaStruct* st);
void vala_code_visitor_visit_interface (ValaCodeVisitor* self, ValaInterface* iface);
void vala_code_visitor_visit_enum (ValaCodeVisitor* self, ValaEnum* en);
void vala_code_visitor_visit_enum_value (ValaCodeVisitor* self, ValaEnumValue* ev);
void vala_code_visitor_visit_callback (ValaCodeVisitor* self, ValaCallback* cb);
void vala_code_visitor_visit_member (ValaCodeVisitor* self, ValaMember* m);
void vala_code_visitor_visit_constant (ValaCodeVisitor* self, ValaConstant* c);
void vala_code_visitor_visit_field (ValaCodeVisitor* self, ValaField* f);
void vala_code_visitor_visit_method (ValaCodeVisitor* self, ValaMethod* m);
void vala_code_visitor_visit_creation_method (ValaCodeVisitor* self, ValaCreationMethod* m);
void vala_code_visitor_visit_formal_parameter (ValaCodeVisitor* self, ValaFormalParameter* p);
void vala_code_visitor_visit_property (ValaCodeVisitor* self, ValaProperty* prop);
void vala_code_visitor_visit_property_accessor (ValaCodeVisitor* self, ValaPropertyAccessor* acc);
void vala_code_visitor_visit_signal (ValaCodeVisitor* self, ValaSignal* sig);
void vala_code_visitor_visit_constructor (ValaCodeVisitor* self, ValaConstructor* c);
void vala_code_visitor_visit_destructor (ValaCodeVisitor* self, ValaDestructor* d);
void vala_code_visitor_visit_named_argument (ValaCodeVisitor* self, ValaNamedArgument* n);
void vala_code_visitor_visit_type_parameter (ValaCodeVisitor* self, ValaTypeParameter* p);
void vala_code_visitor_visit_namespace_reference (ValaCodeVisitor* self, ValaNamespaceReference* ns);
void vala_code_visitor_visit_type_reference (ValaCodeVisitor* self, ValaTypeReference* type);
void vala_code_visitor_visit_begin_block (ValaCodeVisitor* self, ValaBlock* b);
void vala_code_visitor_visit_end_block (ValaCodeVisitor* self, ValaBlock* b);
void vala_code_visitor_visit_empty_statement (ValaCodeVisitor* self, ValaEmptyStatement* stmt);
void vala_code_visitor_visit_declaration_statement (ValaCodeVisitor* self, ValaDeclarationStatement* stmt);
void vala_code_visitor_visit_local_variable_declaration (ValaCodeVisitor* self, ValaLocalVariableDeclaration* decl);
void vala_code_visitor_visit_variable_declarator (ValaCodeVisitor* self, ValaVariableDeclarator* decl);
void vala_code_visitor_visit_begin_initializer_list (ValaCodeVisitor* self, ValaInitializerList* list);
void vala_code_visitor_visit_end_initializer_list (ValaCodeVisitor* self, ValaInitializerList* list);
void vala_code_visitor_visit_expression_statement (ValaCodeVisitor* self, ValaExpressionStatement* stmt);
void vala_code_visitor_visit_if_statement (ValaCodeVisitor* self, ValaIfStatement* stmt);
void vala_code_visitor_visit_switch_statement (ValaCodeVisitor* self, ValaSwitchStatement* stmt);
void vala_code_visitor_visit_switch_section (ValaCodeVisitor* self, ValaSwitchSection* section);
void vala_code_visitor_visit_switch_label (ValaCodeVisitor* self, ValaSwitchLabel* label);
void vala_code_visitor_visit_while_statement (ValaCodeVisitor* self, ValaWhileStatement* stmt);
void vala_code_visitor_visit_do_statement (ValaCodeVisitor* self, ValaDoStatement* stmt);
void vala_code_visitor_visit_for_statement (ValaCodeVisitor* self, ValaForStatement* stmt);
void vala_code_visitor_visit_begin_foreach_statement (ValaCodeVisitor* self, ValaForeachStatement* stmt);
void vala_code_visitor_visit_end_foreach_statement (ValaCodeVisitor* self, ValaForeachStatement* stmt);
void vala_code_visitor_visit_break_statement (ValaCodeVisitor* self, ValaBreakStatement* stmt);
void vala_code_visitor_visit_continue_statement (ValaCodeVisitor* self, ValaContinueStatement* stmt);
void vala_code_visitor_visit_begin_return_statement (ValaCodeVisitor* self, ValaReturnStatement* stmt);
void vala_code_visitor_visit_end_return_statement (ValaCodeVisitor* self, ValaReturnStatement* stmt);
void vala_code_visitor_visit_throw_statement (ValaCodeVisitor* self, ValaThrowStatement* stmt);
void vala_code_visitor_visit_try_statement (ValaCodeVisitor* self, ValaTryStatement* stmt);
void vala_code_visitor_visit_catch_clause (ValaCodeVisitor* self, ValaCatchClause* clause);
void vala_code_visitor_visit_lock_statement (ValaCodeVisitor* self, ValaLockStatement* stmt);
void vala_code_visitor_visit_begin_array_creation_expression (ValaCodeVisitor* self, ValaArrayCreationExpression* expr);
void vala_code_visitor_visit_end_array_creation_expression (ValaCodeVisitor* self, ValaArrayCreationExpression* expr);
void vala_code_visitor_visit_boolean_literal (ValaCodeVisitor* self, ValaBooleanLiteral* lit);
void vala_code_visitor_visit_character_literal (ValaCodeVisitor* self, ValaCharacterLiteral* lit);
void vala_code_visitor_visit_integer_literal (ValaCodeVisitor* self, ValaIntegerLiteral* lit);
void vala_code_visitor_visit_real_literal (ValaCodeVisitor* self, ValaRealLiteral* lit);
void vala_code_visitor_visit_string_literal (ValaCodeVisitor* self, ValaStringLiteral* lit);
void vala_code_visitor_visit_null_literal (ValaCodeVisitor* self, ValaNullLiteral* lit);
void vala_code_visitor_visit_literal_expression (ValaCodeVisitor* self, ValaLiteralExpression* expr);
void vala_code_visitor_visit_parenthesized_expression (ValaCodeVisitor* self, ValaParenthesizedExpression* expr);
void vala_code_visitor_visit_member_access (ValaCodeVisitor* self, ValaMemberAccess* expr);
void vala_code_visitor_visit_begin_invocation_expression (ValaCodeVisitor* self, ValaInvocationExpression* expr);
void vala_code_visitor_visit_end_invocation_expression (ValaCodeVisitor* self, ValaInvocationExpression* expr);
void vala_code_visitor_visit_element_access (ValaCodeVisitor* self, ValaElementAccess* expr);
void vala_code_visitor_visit_base_access (ValaCodeVisitor* self, ValaBaseAccess* expr);
void vala_code_visitor_visit_postfix_expression (ValaCodeVisitor* self, ValaPostfixExpression* expr);
void vala_code_visitor_visit_begin_object_creation_expression (ValaCodeVisitor* self, ValaObjectCreationExpression* expr);
void vala_code_visitor_visit_end_object_creation_expression (ValaCodeVisitor* self, ValaObjectCreationExpression* expr);
void vala_code_visitor_visit_sizeof_expression (ValaCodeVisitor* self, ValaSizeofExpression* expr);
void vala_code_visitor_visit_typeof_expression (ValaCodeVisitor* self, ValaTypeofExpression* expr);
void vala_code_visitor_visit_unary_expression (ValaCodeVisitor* self, ValaUnaryExpression* expr);
void vala_code_visitor_visit_cast_expression (ValaCodeVisitor* self, ValaCastExpression* expr);
void vala_code_visitor_visit_pointer_indirection (ValaCodeVisitor* self, ValaPointerIndirection* expr);
void vala_code_visitor_visit_addressof_expression (ValaCodeVisitor* self, ValaAddressofExpression* expr);
void vala_code_visitor_visit_reference_transfer_expression (ValaCodeVisitor* self, ValaReferenceTransferExpression* expr);
void vala_code_visitor_visit_binary_expression (ValaCodeVisitor* self, ValaBinaryExpression* expr);
void vala_code_visitor_visit_type_check (ValaCodeVisitor* self, ValaTypeCheck* expr);
void vala_code_visitor_visit_conditional_expression (ValaCodeVisitor* self, ValaConditionalExpression* expr);
void vala_code_visitor_visit_begin_lambda_expression (ValaCodeVisitor* self, ValaLambdaExpression* expr);
void vala_code_visitor_visit_end_lambda_expression (ValaCodeVisitor* self, ValaLambdaExpression* expr);
void vala_code_visitor_visit_begin_assignment (ValaCodeVisitor* self, ValaAssignment* a);
void vala_code_visitor_visit_end_assignment (ValaCodeVisitor* self, ValaAssignment* a);
void vala_code_visitor_visit_end_full_expression (ValaCodeVisitor* self, ValaExpression* expr);
GType vala_code_visitor_get_type (void);

G_END_DECLS

#endif

Generated by  Doxygen 1.6.0   Back to index