-/* An entry in a queue of function arguments that require post-processing. */
-
-typedef struct GTY(()) cp_default_arg_entry_d {
- /* The current_class_type when we parsed this arg. */
- tree class_type;
-
- /* The function decl itself. */
- tree decl;
-} cp_default_arg_entry;
-
-DEF_VEC_O(cp_default_arg_entry);
-DEF_VEC_ALLOC_O(cp_default_arg_entry,gc);
-
-/* An entry in a stack for member functions of local classes. */
-
-typedef struct GTY(()) cp_unparsed_functions_entry_d {
- /* Functions with default arguments that require post-processing.
- Functions appear in this list in declaration order. */
- VEC(cp_default_arg_entry,gc) *funs_with_default_args;
-
- /* Functions with defintions that require post-processing. Functions
- appear in this list in declaration order. */
- VEC(tree,gc) *funs_with_definitions;
-} cp_unparsed_functions_entry;
-
-DEF_VEC_O(cp_unparsed_functions_entry);
-DEF_VEC_ALLOC_O(cp_unparsed_functions_entry,gc);
-
-/* The cp_parser structure represents the C++ parser. */
-
-typedef struct GTY(()) cp_parser {
- /* The lexer from which we are obtaining tokens. */
- cp_lexer *lexer;
-
- /* The scope in which names should be looked up. If NULL_TREE, then
- we look up names in the scope that is currently open in the
- source program. If non-NULL, this is either a TYPE or
- NAMESPACE_DECL for the scope in which we should look. It can
- also be ERROR_MARK, when we've parsed a bogus scope.
-
- This value is not cleared automatically after a name is looked
- up, so we must be careful to clear it before starting a new look
- up sequence. (If it is not cleared, then `X::Y' followed by `Z'
- will look up `Z' in the scope of `X', rather than the current
- scope.) Unfortunately, it is difficult to tell when name lookup
- is complete, because we sometimes peek at a token, look it up,
- and then decide not to consume it. */
- tree scope;
-
- /* OBJECT_SCOPE and QUALIFYING_SCOPE give the scopes in which the
- last lookup took place. OBJECT_SCOPE is used if an expression
- like "x->y" or "x.y" was used; it gives the type of "*x" or "x",
- respectively. QUALIFYING_SCOPE is used for an expression of the
- form "X::Y"; it refers to X. */
- tree object_scope;
- tree qualifying_scope;
-
- /* A stack of parsing contexts. All but the bottom entry on the
- stack will be tentative contexts.
-
- We parse tentatively in order to determine which construct is in
- use in some situations. For example, in order to determine
- whether a statement is an expression-statement or a
- declaration-statement we parse it tentatively as a
- declaration-statement. If that fails, we then reparse the same
- token stream as an expression-statement. */
- cp_parser_context *context;
-
- /* True if we are parsing GNU C++. If this flag is not set, then
- GNU extensions are not recognized. */
- bool allow_gnu_extensions_p;
-
- /* TRUE if the `>' token should be interpreted as the greater-than
- operator. FALSE if it is the end of a template-id or
- template-parameter-list. In C++0x mode, this flag also applies to
- `>>' tokens, which are viewed as two consecutive `>' tokens when
- this flag is FALSE. */
- bool greater_than_is_operator_p;
-
- /* TRUE if default arguments are allowed within a parameter list
- that starts at this point. FALSE if only a gnu extension makes
- them permissible. */
- bool default_arg_ok_p;
-
- /* TRUE if we are parsing an integral constant-expression. See
- [expr.const] for a precise definition. */
- bool integral_constant_expression_p;
-
- /* TRUE if we are parsing an integral constant-expression -- but a
- non-constant expression should be permitted as well. This flag
- is used when parsing an array bound so that GNU variable-length
- arrays are tolerated. */
- bool allow_non_integral_constant_expression_p;
-
- /* TRUE if ALLOW_NON_CONSTANT_EXPRESSION_P is TRUE and something has
- been seen that makes the expression non-constant. */
- bool non_integral_constant_expression_p;
-
- /* TRUE if local variable names and `this' are forbidden in the
- current context. */
- bool local_variables_forbidden_p;
-
- /* TRUE if the declaration we are parsing is part of a
- linkage-specification of the form `extern string-literal
- declaration'. */
- bool in_unbraced_linkage_specification_p;
-
- /* TRUE if we are presently parsing a declarator, after the
- direct-declarator. */
- bool in_declarator_p;
-
- /* TRUE if we are presently parsing a template-argument-list. */
- bool in_template_argument_list_p;
-
- /* Set to IN_ITERATION_STMT if parsing an iteration-statement,
- to IN_OMP_BLOCK if parsing OpenMP structured block and
- IN_OMP_FOR if parsing OpenMP loop. If parsing a switch statement,
- this is bitwise ORed with IN_SWITCH_STMT, unless parsing an
- iteration-statement, OpenMP block or loop within that switch. */
-#define IN_SWITCH_STMT 1
-#define IN_ITERATION_STMT 2
-#define IN_OMP_BLOCK 4
-#define IN_OMP_FOR 8
-#define IN_IF_STMT 16
- unsigned char in_statement;
-
- /* TRUE if we are presently parsing the body of a switch statement.
- Note that this doesn't quite overlap with in_statement above.
- The difference relates to giving the right sets of error messages:
- "case not in switch" vs "break statement used with OpenMP...". */
- bool in_switch_statement_p;
-
- /* TRUE if we are parsing a type-id in an expression context. In
- such a situation, both "type (expr)" and "type (type)" are valid
- alternatives. */
- bool in_type_id_in_expr_p;
-
- /* TRUE if we are currently in a header file where declarations are
- implicitly extern "C". */
- bool implicit_extern_c;
-
- /* TRUE if strings in expressions should be translated to the execution
- character set. */
- bool translate_strings_p;
-
- /* TRUE if we are presently parsing the body of a function, but not
- a local class. */
- bool in_function_body;
-
- /* If non-NULL, then we are parsing a construct where new type
- definitions are not permitted. The string stored here will be
- issued as an error message if a type is defined. */
- const char *type_definition_forbidden_message;
-
- /* A stack used for member functions of local classes. The lists
- contained in an individual entry can only be processed once the
- outermost class being defined is complete. */
- VEC(cp_unparsed_functions_entry,gc) *unparsed_queues;
-
- /* The number of classes whose definitions are currently in
- progress. */
- unsigned num_classes_being_defined;
-
- /* The number of template parameter lists that apply directly to the
- current declaration. */
- unsigned num_template_parameter_lists;
-} cp_parser;
-