2 //=============================================================================
6 * Visitors for generation of code for Arguments
8 * @author Aniruddha Gokhale
10 //=============================================================================
13 #ifndef _BE_VISITOR_ARGUMENT_ARGUMENT_H_
14 #define _BE_VISITOR_ARGUMENT_ARGUMENT_H_
16 #include "ast_argument.h"
19 * @class be_visitor_args
21 * @brief Generates the code for arguments output.
23 * At several stages in the code generation a node of type
24 * "be_operation" is visited, and the code for its arguments must
26 * Sometimes the argument declarations must be generated (such as
27 * in the class declaration), other the arguments names (such as
28 * in method invocations).
29 * This class implements some common functionality required across all
32 class be_visitor_args
: public be_visitor_decl
36 be_visitor_args (be_visitor_context
*ctx
);
39 virtual ~be_visitor_args (void);
42 /// helper that produces either a nested name for
43 /// header files or full name for others.
44 virtual const char *type_name (be_type
*type
,
45 const char *suffix
= 0);
47 /// return the direction of the argument node
48 virtual AST_Argument::Direction
direction (void);
50 /// must be overridden by derived classes
51 virtual int visit_argument (be_argument
*node
);
53 void set_fixed_direction (AST_Argument::Direction direction
);
56 /// Consolidation of common code from invoke_cs and marshal_ss
57 /// for predefined type args.
58 int gen_pd_arg (be_predefined_type
*node
,
65 #endif /* _BE_VISITOR_ARGUMENT_ARGUMENT_H_ */