#include "output.h"
#include "toplev.h"
#include "ggc.h"
-
+
#ifdef MULTIBYTE_CHARS
#include <locale.h>
#endif
end ifobjc
\f
%{
-/* Number of statements (loosely speaking) and compound statements
+/* Number of statements (loosely speaking) and compound statements
seen so far. */
static int stmt_count;
static int compstmt_count;
-
+
/* Input file and line number of the end of the body of last simple_if;
used by the stmt-rule immediately after simple_if returns. */
static const char *if_stmt_file;
static int objc_pq_context = 0, objc_public_flag = 0;
/* The following flag is needed to contextualize ObjC lexical analysis.
- In some cases (e.g., 'int NSObject;'), it is undesirable to bind
- an identifier to an ObjC class, even if a class with that name
+ In some cases (e.g., 'int NSObject;'), it is undesirable to bind
+ an identifier to an ObjC class, even if a class with that name
exists. */
static int objc_need_raw_identifier;
#define OBJC_NEED_RAW_IDENTIFIER(VAL) objc_need_raw_identifier = VAL
{ if (pedantic)
error ("ISO C forbids data definition with no type or storage class");
else
- warning ("data definition has no type or storage class");
+ warning ("data definition has no type or storage class");
POP_DECLSPEC_STACK; }
| declspecs_nots setspecs notype_initdecls ';'
save_filename save_lineno compstmt_or_error
{ DECL_SOURCE_FILE (current_function_decl) = $7;
DECL_SOURCE_LINE (current_function_decl) = $8;
- finish_function (0, 1);
+ finish_function (0, 1);
POP_DECLSPEC_STACK; }
| declspecs_ts setspecs declarator error
{ POP_DECLSPEC_STACK; }
save_filename save_lineno compstmt_or_error
{ DECL_SOURCE_FILE (current_function_decl) = $7;
DECL_SOURCE_LINE (current_function_decl) = $8;
- finish_function (0, 1);
+ finish_function (0, 1);
POP_DECLSPEC_STACK; }
| declspecs_nots setspecs notype_declarator error
{ POP_DECLSPEC_STACK; }
save_filename save_lineno compstmt_or_error
{ DECL_SOURCE_FILE (current_function_decl) = $6;
DECL_SOURCE_LINE (current_function_decl) = $7;
- finish_function (0, 1);
+ finish_function (0, 1);
POP_DECLSPEC_STACK; }
| setspecs notype_declarator error
{ POP_DECLSPEC_STACK; }
{ $$ = fix_string_type ($$); }
| VAR_FUNC_NAME
{ $$ = fname_decl (C_RID_CODE ($$), $$); }
- | '(' typename ')' '{'
+ | '(' typename ')' '{'
{ start_init (NULL_TREE, NULL, 0);
$2 = groktypename ($2);
really_start_incremental_init ($2); }
| declarator maybeasm maybe_attribute
{ tree d = start_decl ($1, current_declspecs, 0,
chainon ($3, all_prefix_attributes));
- finish_decl (d, NULL_TREE, $2);
+ finish_decl (d, NULL_TREE, $2);
}
;
| attributes
{ $$ = $1; }
;
-
+
attributes:
attribute
{ $$ = $1; }
| attribute_list ',' attrib
{ $$ = chainon ($1, $3); }
;
-
+
attrib:
/* empty */
{ $$ = NULL_TREE; }
if (pedantic)
pedwarn ("obsolete use of designated initializer with `:'"); }
initval
+ {}
| initval
;
DECL_SOURCE_FILE (decl) = $5;
DECL_SOURCE_LINE (decl) = $6;
finish_function (1, 1);
- pop_function_context ();
+ pop_function_context ();
add_decl_stmt (decl); }
;
DECL_SOURCE_FILE (decl) = $5;
DECL_SOURCE_LINE (decl) = $6;
finish_function (1, 1);
- pop_function_context ();
+ pop_function_context ();
add_decl_stmt (decl); }
;
{ $$ = start_struct (RECORD_TYPE, $2);
/* Start scope of tag before parsing components. */
}
- component_decl_list '}' maybe_attribute
+ component_decl_list '}' maybe_attribute
{ $$ = finish_struct ($<ttype>4, $5, chainon ($1, $7)); }
| struct_head '{' component_decl_list '}' maybe_attribute
{ $$ = finish_struct (start_struct (RECORD_TYPE, NULL_TREE),
POP_DECLSPEC_STACK; }
| declspecs_nosc_ts setspecs save_filename save_lineno
{
- /* Support for unnamed structs or unions as members of
- structs or unions (which is [a] useful and [b] supports
+ /* Support for unnamed structs or unions as members of
+ structs or unions (which is [a] useful and [b] supports
MS P-SDK). */
if (pedantic)
pedwarn ("ISO C doesn't support unnamed structs/unions");
{ if (flag_isoc99)
{
tree scope_stmt = add_scope_stmt (/*begin_p=*/0, /*partial_p=*/0);
- $$ = poplevel (kept_level_p (), 0, 0);
- SCOPE_STMT_BLOCK (TREE_PURPOSE (scope_stmt))
+ $$ = poplevel (kept_level_p (), 0, 0);
+ SCOPE_STMT_BLOCK (TREE_PURPOSE (scope_stmt))
= SCOPE_STMT_BLOCK (TREE_VALUE (scope_stmt))
= $$;
}
compstmt_nostart: '}'
{ $$ = convert (void_type_node, integer_zero_node); }
| pushlevel maybe_label_decls compstmt_contents_nonempty '}' poplevel
- { $$ = poplevel (kept_level_p (), 1, 0);
- SCOPE_STMT_BLOCK (TREE_PURPOSE ($5))
+ { $$ = poplevel (kept_level_p (), 1, 0);
+ SCOPE_STMT_BLOCK (TREE_PURPOSE ($5))
= SCOPE_STMT_BLOCK (TREE_VALUE ($5))
= $$; }
;
;
compstmt: compstmt_start compstmt_nostart
- { RECHAIN_STMTS ($1, COMPOUND_BODY ($1));
+ { RECHAIN_STMTS ($1, COMPOUND_BODY ($1));
last_expr_type = NULL_TREE;
$$ = $1; }
;
IF
{ $<ttype>$ = c_begin_if_stmt (); }
'(' expr ')'
- { c_expand_start_cond (c_common_truthvalue_conversion ($4),
+ { c_expand_start_cond (c_common_truthvalue_conversion ($4),
compstmt_count,$<ttype>2);
$<itype>$ = stmt_count;
if_stmt_file = $<filename>-2;
DO
{ stmt_count++;
compstmt_count++;
- $<ttype>$
+ $<ttype>$
= add_stmt (build_stmt (DO_STMT, NULL_TREE,
NULL_TREE));
/* In the event that a parse error prevents
we later pass to c_finish_while_stmt_cond to fill
in the condition and other tidbits. */
| WHILE
- { stmt_count++;
+ { stmt_count++;
$<ttype>$ = c_begin_while_stmt (); }
'(' expr ')'
{ $4 = c_common_truthvalue_conversion ($4);
| FOR
{ $<ttype>$ = build_stmt (FOR_STMT, NULL_TREE, NULL_TREE,
NULL_TREE, NULL_TREE);
- add_stmt ($<ttype>$); }
+ add_stmt ($<ttype>$); }
'(' for_init_stmt
{ stmt_count++;
RECHAIN_STMTS ($<ttype>2, FOR_INIT_STMT ($<ttype>2)); }
xexpr ';'
- { if ($6)
+ { if ($6)
FOR_COND ($<ttype>2)
= c_common_truthvalue_conversion ($6); }
xexpr ')'
for_init_stmt:
xexpr ';'
- { add_stmt (build_stmt (EXPR_STMT, $1)); }
+ { add_stmt (build_stmt (EXPR_STMT, $1)); }
| decl
{ check_for_loop_decls (); }
;
| declspecs_ts setspecs notype_declarator maybe_attribute
{ $$ = build_tree_list (build_tree_list (current_declspecs,
$3),
- chainon ($4, all_prefix_attributes));
+ chainon ($4, all_prefix_attributes));
POP_DECLSPEC_STACK; }
| declspecs_ts setspecs absdcl_maybe_attribute
{ $$ = $3;
| declspecs_ts_nosa setspecs_fp notype_declarator maybe_attribute
{ $$ = build_tree_list (build_tree_list (current_declspecs,
$3),
- chainon ($4, all_prefix_attributes));
+ chainon ($4, all_prefix_attributes));
POP_DECLSPEC_STACK; }
| declspecs_ts_nosa setspecs_fp absdcl_maybe_attribute
{ $$ = $3;
{
objc_declare_class ($2);
}
+ ;
aliasdecl:
ALIAS identifier identifier ';'
{
objc_declare_alias ($2, $3);
}
+ ;
classdef:
INTERFACE identifier protocolrefs '{'
/* RID_BYCOPY */ TYPE_QUAL,
/* RID_BYREF */ TYPE_QUAL,
/* RID_ONEWAY */ TYPE_QUAL,
-
+
/* C */
/* RID_INT */ TYPESPEC,
/* RID_CHAR */ TYPESPEC,
/* RID_BITAND */ 0,
/* RID_BITOR */ 0,
/* RID_COMPL */ 0,
-
+
/* Objective C */
/* RID_ID */ OBJECTNAME,
/* RID_AT_ENCODE */ ENCODE,
yylexname ()
{
tree decl;
-
+
ifobjc
int objc_force_identifier = objc_need_raw_identifier;
OBJC_NEED_RAW_IDENTIFIER (0);
end ifobjc
-
+
if (C_IS_RESERVED_WORD (yylval.ttype))
{
enum rid rid_code = C_RID_CODE (yylval.ttype);
/* __FUNCTION__ and __PRETTY_FUNCTION__ get converted
to string constants. */
const char *name = fname_string (rid_code);
-
+
yylval.ttype = build_string (strlen (name) + 1, name);
C_ARTIFICIAL_STRING_P (yylval.ttype) = 1;
last_token = CPP_STRING; /* so yyerror won't choke */
return STRING;
}
-
+
/* Return the canonical spelling for this keyword. */
yylval.ttype = ridpointers[(int) rid_code];
return yycode;
tree objc_interface_decl = is_class_name (yylval.ttype);
/* ObjC class names are in the same namespace as variables and
typedefs, and hence are shadowed by local declarations. */
- if (objc_interface_decl
- && (global_bindings_p ()
+ if (objc_interface_decl
+ && (global_bindings_p ()
|| (!objc_force_identifier && !decl)))
{
yylval.ttype = objc_interface_decl;
case CPP_STRING:
case CPP_WSTRING:
return yylexstring ();
-
+
/* This token is Objective-C specific. It gives the next token
special significance. */
case CPP_ATSIGN:
tree t = yyl.ttype;
fprintf (file, " [%s]", NAME(last_token));
-
+
switch (yychar)
{
case IDENTIFIER:
tree parms;
#ifndef NO_IMPLICIT_EXTERN_C
- if (in_system_header && current_class_type == NULL
+ if (in_system_header && current_class_type == NULL
&& current_lang_name == lang_name_c)
parms = NULL_TREE;
else
{
/* We have to indicate that there is an "extern", but that it
was part of a language specifier. For instance,
-
+
extern "C" typedef int (*Ptr) ();
is well formed. */
current_declspecs = tree_cons (error_mark_node,
- get_identifier ("extern"),
+ get_identifier ("extern"),
current_declspecs);
used_extern_spec = 1;
}
%start program
%union { GTY(())
- long itype;
- tree ttype;
- char *strtype;
- enum tree_code code;
+ long itype;
+ tree ttype;
+ char *strtype;
+ enum tree_code code;
flagged_type_tree ftype;
struct unparsed_text *pi;
}
/* All identifiers that are declared typedefs in the current block.
In some contexts, they are treated just like IDENTIFIER,
but they can also serve as typespecs in declarations. */
-%token TYPENAME
+%token tTYPENAME
%token SELFNAME
/* A template function. */
%nonassoc IF
%nonassoc ELSE
-%left IDENTIFIER PFUNCNAME TYPENAME SELFNAME PTYPENAME SCSPEC TYPESPEC CV_QUALIFIER ENUM AGGR ELLIPSIS TYPEOF SIGOF OPERATOR NSNAME TYPENAME_KEYWORD ATTRIBUTE
+%left IDENTIFIER PFUNCNAME tTYPENAME SELFNAME PTYPENAME SCSPEC TYPESPEC CV_QUALIFIER ENUM AGGR ELLIPSIS TYPEOF SIGOF OPERATOR NSNAME TYPENAME_KEYWORD ATTRIBUTE
%left '{' ',' ';'
%type <code> unop
-%type <ttype> identifier IDENTIFIER TYPENAME CONSTANT expr nonnull_exprlist
+%type <ttype> identifier IDENTIFIER tTYPENAME CONSTANT expr nonnull_exprlist
%type <ttype> PFUNCNAME maybe_identifier
%type <ttype> paren_expr_or_null nontrivial_exprlist SELFNAME
%type <ttype> expr_no_commas expr_no_comma_rangle
%type <ttype> after_type_declarator_intern
%type <ttype> direct_notype_declarator direct_after_type_declarator
%type <itype> components notype_components
-%type <ttype> component_decl component_decl_1
+%type <ttype> component_decl component_decl_1
%type <ttype> component_declarator component_declarator0
%type <ttype> notype_component_declarator notype_component_declarator0
%type <ttype> after_type_component_declarator after_type_component_declarator0
%type <ttype> absdcl cv_qualifiers
%type <ttype> direct_abstract_declarator conversion_declarator
%type <ttype> new_declarator direct_new_declarator
-%type <ttype> xexpr parmlist parms bad_parm
+%type <ttype> xexpr parmlist parms bad_parm
%type <ttype> identifiers_or_typenames
%type <ttype> fcast_or_absdcl regcast_or_absdcl
%type <ttype> expr_or_declarator expr_or_declarator_intern
%type <ttype> template_id do_id object_template_id notype_template_declarator
%type <ttype> overqualified_id notype_qualified_id any_id
%type <ttype> complex_direct_notype_declarator functional_cast
-%type <ttype> complex_parmlist parms_comma
+%type <ttype> complex_parmlist parms_comma
%type <ttype> namespace_qualifier namespace_using_decl
%type <ftype> type_id new_type_id typed_typespecs typespec typed_declspecs
%token <ttype> PTYPENAME
%token <ttype> EXTERN_LANG_STRING ALL
%token <ttype> PRE_PARSED_CLASS_DECL DEFARG DEFARG_MARKER
-%token <pi> PRE_PARSED_FUNCTION_DECL
+%token <pi> PRE_PARSED_FUNCTION_DECL
%type <ttype> component_constructor_declarator
%type <ttype> fn_def2 return_id constructor_declarator
%type <ttype> begin_function_body_
;
namespace_alias:
- NAMESPACE identifier '='
+ NAMESPACE identifier '='
{ begin_only_namespace_names (); }
any_id ';'
{
template_spec_header:
TEMPLATE '<' '>'
- { begin_specialization();
+ { begin_specialization();
$$ = NULL_TREE; }
;
function_body:
begin_function_body_ ctor_initializer_opt save_lineno '{'
{ $<ttype>$ = begin_compound_stmt (/*has_no_scope=*/1); }
- compstmtend
+ compstmtend
{
STMT_LINENO ($<ttype>5) = $3;
finish_compound_stmt (/*has_no_scope=*/1, $<ttype>5);
;
constructor_declarator:
- nested_name_specifier SELFNAME '('
+ nested_name_specifier SELFNAME '('
{ $$ = begin_constructor_declarator ($1, $2); }
parmlist ')' cv_qualifiers exception_specification_opt
{ $$ = make_call_declarator ($<ttype>4, $5, $7, $8); }
| nested_name_specifier SELFNAME LEFT_RIGHT cv_qualifiers exception_specification_opt
- { $$ = begin_constructor_declarator ($1, $2);
+ { $$ = begin_constructor_declarator ($1, $2);
$$ = make_call_declarator ($$, empty_parms (), $4, $5);
}
- | global_scope nested_name_specifier SELFNAME '('
+ | global_scope nested_name_specifier SELFNAME '('
{ $$ = begin_constructor_declarator ($2, $3); }
parmlist ')' cv_qualifiers exception_specification_opt
{ $$ = make_call_declarator ($<ttype>5, $6, $8, $9); }
{ $$ = begin_constructor_declarator ($2, $3);
$$ = make_call_declarator ($$, empty_parms (), $5, $6);
}
- | nested_name_specifier self_template_type '('
+ | nested_name_specifier self_template_type '('
{ $$ = begin_constructor_declarator ($1, $2); }
parmlist ')' cv_qualifiers exception_specification_opt
{ $$ = make_call_declarator ($<ttype>4, $5, $7, $8); }
{ $$ = begin_constructor_declarator ($1, $2);
$$ = make_call_declarator ($$, empty_parms (), $4, $5);
}
- | global_scope nested_name_specifier self_template_type '('
+ | global_scope nested_name_specifier self_template_type '('
{ $$ = begin_constructor_declarator ($2, $3); }
parmlist ')' cv_qualifiers exception_specification_opt
{ $$ = make_call_declarator ($<ttype>5, $6, $8, $9); }
| global_scope nested_name_specifier self_template_type LEFT_RIGHT cv_qualifiers exception_specification_opt
- { $$ = begin_constructor_declarator ($2, $3);
+ { $$ = begin_constructor_declarator ($2, $3);
$$ = make_call_declarator ($$, empty_parms (), $5, $6);
}
;
yychar = YYLEX;
snarf_method ($$); }
| component_constructor_declarator
- { $$ = parse_method ($1, NULL_TREE, NULL_TREE);
+ { $$ = parse_method ($1, NULL_TREE, NULL_TREE);
goto rest_of_mdef; }
| typed_declspecs declarator
{ $$ = parse_method ($2, $1.t, $1.lookups); goto rest_of_mdef;}
| declmods notype_declarator
{ $$ = parse_method ($2, $1.t, $1.lookups); goto rest_of_mdef;}
| notype_declarator
- { $$ = parse_method ($1, NULL_TREE, NULL_TREE);
+ { $$ = parse_method ($1, NULL_TREE, NULL_TREE);
goto rest_of_mdef; }
| declmods constructor_declarator
{ $$ = parse_method ($2, $1.t, $1.lookups); goto rest_of_mdef;}
| constructor_declarator
- { $$ = parse_method ($1, NULL_TREE, NULL_TREE);
+ { $$ = parse_method ($1, NULL_TREE, NULL_TREE);
goto rest_of_mdef; }
;
member_init_list:
/* empty */
- {
- $$.new_type_flag = 0;
- $$.t = NULL_TREE;
+ {
+ $$.new_type_flag = 0;
+ $$.t = NULL_TREE;
}
| member_init
- {
- $$.new_type_flag = 1;
- $$.t = $1;
+ {
+ $$.new_type_flag = 1;
+ $$.t = $1;
}
| member_init_list ',' member_init
- {
- if ($3)
+ {
+ if ($3)
{
- $$.new_type_flag = 1;
+ $$.new_type_flag = 1;
TREE_CHAIN ($3) = $1.t;
$$.t = $3;
}
if (current_class_name)
pedwarn ("anachronistic old style base class initializer");
$$ = expand_member_init (current_class_ref,
- NULL_TREE,
+ NULL_TREE,
void_type_node);
}
| notype_identifier '(' nonnull_exprlist ')'
identifier:
IDENTIFIER
- | TYPENAME
+ | tTYPENAME
| SELFNAME
| PTYPENAME
| NSNAME
notype_identifier:
IDENTIFIER
- | PTYPENAME
+ | PTYPENAME
| NSNAME %prec EMPTY
;
{ do_type_instantiation ($4.t, $1, 1);
yyungetc (';', 1); }
end_explicit_instantiation
- | SCSPEC TEMPLATE begin_explicit_instantiation typed_declspecs
+ {}
+ | SCSPEC TEMPLATE begin_explicit_instantiation typed_declspecs
declarator
{ tree specs = strip_attrs ($4.t);
do_decl_instantiation (specs, $5, $1); }
end_explicit_instantiation
+ {}
| SCSPEC TEMPLATE begin_explicit_instantiation notype_declarator
{ do_decl_instantiation (NULL_TREE, $4, $1); }
end_explicit_instantiation
+ {}
| SCSPEC TEMPLATE begin_explicit_instantiation constructor_declarator
{ do_decl_instantiation (NULL_TREE, $4, $1); }
end_explicit_instantiation
+ {}
;
-begin_explicit_instantiation:
+begin_explicit_instantiation:
{ begin_explicit_instantiation(); }
;
-end_explicit_instantiation:
+end_explicit_instantiation:
{ end_explicit_instantiation(); }
;
PTYPENAME '<' template_arg_list_opt template_close_bracket
finish_template_type_
{ $$ = $5; }
- | TYPENAME '<' template_arg_list_opt template_close_bracket
+ | tTYPENAME '<' template_arg_list_opt template_close_bracket
finish_template_type_
{ $$ = $5; }
| self_template_type
;
finish_template_type_:
- {
+ {
if (yychar == YYEMPTY)
yychar = YYLEX;
- $$ = finish_template_type ($<ttype>-3, $<ttype>-1,
+ $$ = finish_template_type ($<ttype>-3, $<ttype>-1,
yychar == SCOPE);
}
;
template_close_bracket:
'>'
- | RSHIFT
+ | RSHIFT
{
/* Handle `Class<Class<Type>>' without space in the `>>' */
pedwarn ("`>>' should be `> >' in template class name");
$<ttype>$ = parse_decl ($<ttype>2, $4, 1);
}
init
- {
+ {
parse_end_decl ($<ttype>6, $7, $4);
- $$ = convert_from_reference ($<ttype>6);
+ $$ = convert_from_reference ($<ttype>6);
if (TREE_CODE (TREE_TYPE ($$)) == ARRAY_TYPE)
- error ("definition of array `%#D' in condition", $$);
+ error ("definition of array `%#D' in condition", $$);
}
| expr
;
nontrivial_exprlist:
expr_no_commas ',' expr_no_commas
- { $$ = tree_cons (NULL_TREE, $$,
+ { $$ = tree_cons (NULL_TREE, $$,
build_tree_list (NULL_TREE, $3)); }
| expr_no_commas ',' error
- { $$ = tree_cons (NULL_TREE, $$,
+ { $$ = tree_cons (NULL_TREE, $$,
build_tree_list (NULL_TREE, error_mark_node)); }
| nontrivial_exprlist ',' expr_no_commas
{ chainon ($$, build_tree_list (NULL_TREE, $3)); }
| ALIGNOF unary_expr %prec UNARY
{ $$ = finish_alignof ($2); }
| ALIGNOF '(' type_id ')' %prec HYPERUNARY
- { $$ = finish_alignof (groktypename ($3.t));
+ { $$ = finish_alignof (groktypename ($3.t));
check_for_new_type ("alignof", $3); }
/* The %prec EMPTY's here are required by the = init initializer
syntax extension; see below. */
| new new_type_id %prec EMPTY
- { $$ = build_new (NULL_TREE, $2.t, NULL_TREE, $1);
+ { $$ = build_new (NULL_TREE, $2.t, NULL_TREE, $1);
check_for_new_type ("new", $2); }
| new new_type_id new_initializer
- { $$ = build_new (NULL_TREE, $2.t, $3, $1);
+ { $$ = build_new (NULL_TREE, $2.t, $3, $1);
check_for_new_type ("new", $2); }
| new new_placement new_type_id %prec EMPTY
- { $$ = build_new ($2, $3.t, NULL_TREE, $1);
+ { $$ = build_new ($2, $3.t, NULL_TREE, $1);
check_for_new_type ("new", $3); }
| new new_placement new_type_id new_initializer
- { $$ = build_new ($2, $3.t, $4, $1);
+ { $$ = build_new ($2, $3.t, $4, $1);
check_for_new_type ("new", $3); }
| new '(' type_id ')'
%prec EMPTY
{ $$ = build_new (NULL_TREE, groktypename($3.t),
- NULL_TREE, $1);
+ NULL_TREE, $1);
check_for_new_type ("new", $3); }
| new '(' type_id ')' new_initializer
- { $$ = build_new (NULL_TREE, groktypename($3.t), $5, $1);
+ { $$ = build_new (NULL_TREE, groktypename($3.t), $5, $1);
check_for_new_type ("new", $3); }
| new new_placement '(' type_id ')' %prec EMPTY
- { $$ = build_new ($2, groktypename($4.t), NULL_TREE, $1);
+ { $$ = build_new ($2, groktypename($4.t), NULL_TREE, $1);
check_for_new_type ("new", $4); }
| new new_placement '(' type_id ')' new_initializer
- { $$ = build_new ($2, groktypename($4.t), $6, $1);
+ { $$ = build_new ($2, groktypename($4.t), $6, $1);
check_for_new_type ("new", $4); }
| delete cast_expr %prec UNARY
}
/* GNU extension so people can use initializer lists. Note that
this alters the meaning of `new int = 1', which was previously
- syntactically valid but semantically invalid.
+ syntactically valid but semantically invalid.
This feature is now deprecated and will be removed in a future
release. */
| '=' init
$$ = make_call_declarator (NULL_TREE, $2.t, NULL_TREE, NULL_TREE);
check_for_new_type ("cast", $2); }
| regcast_or_absdcl '(' type_id ')' %prec EMPTY
- { $3.t = finish_parmlist (build_tree_list (NULL_TREE, $3.t), 0);
+ { $3.t = finish_parmlist (build_tree_list (NULL_TREE, $3.t), 0);
$$ = make_call_declarator ($$, $3.t, NULL_TREE, NULL_TREE);
check_for_new_type ("cast", $3); }
;
| regcast_or_absdcl unary_expr %prec UNARY
{ $$ = reparse_absdcl_as_casts ($$, $2); }
| regcast_or_absdcl '{' initlist maybecomma '}' %prec UNARY
- {
+ {
tree init = build_nt (CONSTRUCTOR, NULL_TREE,
- nreverse ($3));
+ nreverse ($3));
if (pedantic)
pedwarn ("ISO C++ forbids compound literals");
/* Indicate that this was a C99 compound literal. */
;
template_id:
- PFUNCNAME '<' do_id template_arg_list_opt template_close_bracket
+ PFUNCNAME '<' do_id template_arg_list_opt template_close_bracket
{ $$ = lookup_template_function ($3, $4); }
| operator_name '<' do_id template_arg_list_opt template_close_bracket
{ $$ = lookup_template_function ($3, $4); }
{ $$ = lookup_template_function ($2, $4); }
| TEMPLATE PFUNCNAME '<' template_arg_list_opt template_close_bracket
{ $$ = lookup_template_function ($2, $4); }
- | TEMPLATE operator_name '<' template_arg_list_opt
+ | TEMPLATE operator_name '<' template_arg_list_opt
template_close_bracket
{ $$ = lookup_template_function ($2, $4); }
;
unqualified_id:
notype_unqualified_id
- | TYPENAME
+ | tTYPENAME
| SELFNAME
;
| NSNAME '<' template_arg_list template_close_bracket
{ $$ = lookup_template_function ($1, $3); }
;
-
+
direct_notype_declarator:
complex_direct_notype_declarator
/* This precedence declaration is to prefer this reduce
{
if (TREE_CODE ($1) == BIT_NOT_EXPR)
$$ = build_x_unary_op (BIT_NOT_EXPR, TREE_OPERAND ($1, 0));
- else
+ else
$$ = finish_id_expr ($1);
- }
+ }
| CONSTANT
| boolean_literal
| STRING
YYERROR;
}
if (pedantic)
- pedwarn ("ISO C++ forbids braced-groups within expressions");
- $<ttype>$ = begin_stmt_expr ();
+ pedwarn ("ISO C++ forbids braced-groups within expressions");
+ $<ttype>$ = begin_stmt_expr ();
}
compstmt_or_stmtexpr ')'
{ $$ = finish_stmt_expr ($<ttype>2); }
| overqualified_id LEFT_RIGHT
{ $$ = finish_qualified_call_expr ($1, NULL_TREE); }
| object object_template_id %prec UNARY
- {
- $$ = build_x_component_ref ($$, $2, NULL_TREE, 1);
+ {
+ $$ = build_x_component_ref ($$, $2, NULL_TREE, 1);
}
| object object_template_id '(' nonnull_exprlist ')'
{ $$ = finish_object_call_expr ($2, $1, $4); }
{ got_object = TREE_TYPE ($$); }
| primary POINTSAT
{
- $$ = build_x_arrow ($$);
+ $$ = build_x_arrow ($$);
got_object = TREE_TYPE ($$);
}
;
/* ISO type-id (8.1) */
type_id:
typed_typespecs absdcl
- { $$.t = build_tree_list ($1.t, $2);
+ { $$.t = build_tree_list ($1.t, $2);
$$.new_type_flag = $1.new_type_flag; }
| nonempty_cv_qualifiers absdcl
- { $$.t = build_tree_list ($1.t, $2);
+ { $$.t = build_tree_list ($1.t, $2);
$$.new_type_flag = $1.new_type_flag; }
| typespec absdcl
{ $$.t = build_tree_list (build_tree_list (NULL_TREE, $1.t),
- $2);
+ $2);
$$.new_type_flag = $1.new_type_flag; }
| typed_typespecs %prec EMPTY
{ $$.t = build_tree_list ($1.t, NULL_TREE);
$$.new_type_flag = $1.new_type_flag; }
| nonempty_cv_qualifiers %prec EMPTY
- { $$.t = build_tree_list ($1.t, NULL_TREE);
+ { $$.t = build_tree_list ($1.t, NULL_TREE);
$$.new_type_flag = $1.new_type_flag; }
;
typed_declspecs1:
declmods typespec
- { $$.t = tree_cons (NULL_TREE, $2.t, $1.t);
+ { $$.t = tree_cons (NULL_TREE, $2.t, $1.t);
$$.new_type_flag = $2.new_type_flag; }
| typespec reserved_declspecs %prec HYPERUNARY
- { $$.t = tree_cons (NULL_TREE, $1.t, $2);
+ { $$.t = tree_cons (NULL_TREE, $1.t, $2);
$$.new_type_flag = $1.new_type_flag; }
| typespec reserved_typespecquals reserved_declspecs
- { $$.t = tree_cons (NULL_TREE, $1.t, chainon ($2, $3));
+ { $$.t = tree_cons (NULL_TREE, $1.t, chainon ($2, $3));
$$.new_type_flag = $1.new_type_flag; }
| declmods typespec reserved_declspecs
- { $$.t = tree_cons (NULL_TREE, $2.t, chainon ($3, $1.t));
+ { $$.t = tree_cons (NULL_TREE, $2.t, chainon ($3, $1.t));
$$.new_type_flag = $2.new_type_flag; }
| declmods typespec reserved_typespecquals
- { $$.t = tree_cons (NULL_TREE, $2.t, chainon ($3, $1.t));
+ { $$.t = tree_cons (NULL_TREE, $2.t, chainon ($3, $1.t));
$$.new_type_flag = $2.new_type_flag; }
| declmods typespec reserved_typespecquals reserved_declspecs
{ $$.t = tree_cons (NULL_TREE, $2.t,
- chainon ($3, chainon ($4, $1.t)));
+ chainon ($3, chainon ($4, $1.t)));
$$.new_type_flag = $2.new_type_flag; }
;
typed_typespecs:
typespec %prec EMPTY
- { $$.t = build_tree_list (NULL_TREE, $1.t);
+ { $$.t = build_tree_list (NULL_TREE, $1.t);
$$.new_type_flag = $1.new_type_flag; }
| nonempty_cv_qualifiers typespec
- { $$.t = tree_cons (NULL_TREE, $2.t, $1.t);
+ { $$.t = tree_cons (NULL_TREE, $2.t, $1.t);
$$.new_type_flag = $2.new_type_flag; }
| typespec reserved_typespecquals
- { $$.t = tree_cons (NULL_TREE, $1.t, $2);
+ { $$.t = tree_cons (NULL_TREE, $1.t, $2);
$$.new_type_flag = $1.new_type_flag; }
| nonempty_cv_qualifiers typespec reserved_typespecquals
- { $$.t = tree_cons (NULL_TREE, $2.t, chainon ($3, $1.t));
+ { $$.t = tree_cons (NULL_TREE, $2.t, chainon ($3, $1.t));
$$.new_type_flag = $2.new_type_flag; }
;
{ $<ttype>$ = parse_decl0 ($<ttype>-1, $<ftype>-2.t,
$<ftype>-2.lookups, $1, 1); }
/* Note how the declaration of the variable is in effect
- while its init is parsed! */
+ while its init is parsed! */
init
{ parse_end_decl ($<ttype>3, $4, $<ttype>0); }
| maybe_attribute
$<ftype>-2.lookups, $1, 0);
parse_end_decl (d, NULL_TREE, $<ttype>0); }
;
-
+
initdcl0:
declarator maybeasm initdcl0_innards
{}
notype_declarator maybeasm initdcl0_innards
{}
;
-
+
nomods_initdcl0:
notype_declarator maybeasm
{ /* Set things up as initdcl0_innards expects. */
$<ttype>$ = $2;
- $2 = $1;
+ $2 = $1;
$<ftype>1.t = NULL_TREE;
$<ftype>1.lookups = NULL_TREE; }
- initdcl0_innards
+ initdcl0_innards
{}
| constructor_declarator maybeasm maybe_attribute
{ tree d = parse_decl0 ($1, NULL_TREE, NULL_TREE, $3, 0);
| attributes
{ $$ = $1; }
;
-
+
attributes:
attribute
{ $$ = $1; }
| attribute_list ',' attrib
{ $$ = chainon ($1, $3); }
;
-
+
attrib:
/* empty */
{ $$ = NULL_TREE; }
process_next_inline ($1);
}
| PRE_PARSED_FUNCTION_DECL maybe_return_init function_try_block
- {
- expand_body (finish_function (2));
+ {
+ expand_body (finish_function (2));
process_next_inline ($1);
}
| PRE_PARSED_FUNCTION_DECL maybe_return_init error
- {
- finish_function (2);
+ {
+ finish_function (2);
process_next_inline ($1); }
;
current_enum_type = $<ttype>3;
check_for_missing_semicolon ($$.t); }
| ENUM identifier
- { $$.t = xref_tag (enum_type_node, $2, 1);
+ { $$.t = xref_tag (enum_type_node, $2, 1);
$$.new_type_flag = 0; }
| ENUM complex_type_name
- { $$.t = xref_tag (enum_type_node, $2, 1);
+ { $$.t = xref_tag (enum_type_node, $2, 1);
$$.new_type_flag = 0; }
| TYPENAME_KEYWORD typename_sub
{ $$.t = $2;
- $$.new_type_flag = 0;
+ $$.new_type_flag = 0;
if (!processing_template_decl)
pedwarn ("using `typename' outside of template"); }
/* C++ extensions, merged with C to avoid shift/reduce conflicts */
if ($2 && $1.t != error_mark_node)
{
tree type = TREE_TYPE ($1.t);
-
+
if (TREE_CODE (type) == TYPENAME_TYPE)
/* In a definition of a member class template,
we will get here with an implicit typename,
maybe_process_partial_specialization (type);
xref_basetypes (current_aggr, $1.t, type, $2);
}
- $1.t = begin_class_definition (TREE_TYPE ($1.t));
+ $1.t = begin_class_definition (TREE_TYPE ($1.t));
check_class_key (current_aggr, $1.t);
current_aggr = NULL_TREE; }
opt.component_decl_list '}' maybe_attribute
- {
+ {
int semi;
tree t;
pending_inlines
{
$$.t = $<ttype>8;
- $$.new_type_flag = 1;
+ $$.new_type_flag = 1;
}
| class_head_decl
{
class_head_apparent_template:
aggr apparent_template_type
- {
- current_aggr = $1;
+ {
+ current_aggr = $1;
$$ = $2;
}
| aggr nested_name_specifier apparent_template_type
- {
- current_aggr = $1;
+ {
+ current_aggr = $1;
$$ = $3;
}
| aggr global_scope nested_name_specifier apparent_template_type
- {
- current_aggr = $1;
+ {
+ current_aggr = $1;
$$ = $4;
}
;
opt.component_decl_list:
| component_decl_list
| opt.component_decl_list access_specifier component_decl_list
- | opt.component_decl_list access_specifier
+ | opt.component_decl_list access_specifier
;
access_specifier:
ARM $9.2 says that the semicolon is optional, and therefore allowed. */
component_decl_list:
component_decl
- {
+ {
finish_member_declaration ($1);
current_aggr = NULL_TREE;
reset_type_access_control ();
}
| component_decl_list component_decl
- {
+ {
finish_member_declaration ($2);
current_aggr = NULL_TREE;
reset_type_access_control ();
{ $$ = $2;
pedantic = $1; }
| template_header component_decl
- {
+ {
if ($2)
$$ = finish_member_template_decl ($2);
else
finish_template_decl ($1);
}
| template_header typed_declspecs ';'
- {
- $$ = finish_member_class_template ($2.t);
+ {
+ $$ = finish_member_class_template ($2.t);
finish_template_decl ($1);
}
| bad_decl
$$ = NULL_TREE;
}
| declmods notype_components
- {
+ {
if (!$2)
grok_x_components ($1.t);
- $$ = NULL_TREE;
+ $$ = NULL_TREE;
}
| notype_declarator maybeasm maybe_attribute maybe_init
{ $$ = grokfield ($$, NULL_TREE, $4, $2, $3); }
/* empty: possibly anonymous */
{ $$ = 0; }
| component_declarator0
- {
+ {
if (PROCESSING_REAL_TEMPLATE_DECL_P ())
$1 = finish_member_template_decl ($1);
- finish_member_declaration ($1);
+ finish_member_declaration ($1);
$$ = 1;
}
| components ',' component_declarator
- {
+ {
check_multiple_declarators ();
if (PROCESSING_REAL_TEMPLATE_DECL_P ())
$3 = finish_member_template_decl ($3);
/* empty: possibly anonymous */
{ $$ = 0; }
| notype_component_declarator0
- {
+ {
if (PROCESSING_REAL_TEMPLATE_DECL_P ())
$1 = finish_member_template_decl ($1);
finish_member_declaration ($1);
$$ = 1;
}
| notype_components ',' notype_component_declarator
- {
+ {
check_multiple_declarators ();
if (PROCESSING_REAL_TEMPLATE_DECL_P ())
$3 = finish_member_template_decl ($3);
- finish_member_declaration ($3);
+ finish_member_declaration ($3);
$$ = 2;
}
;
after_type_declarator maybeasm maybe_attribute maybe_init
{ $$ = parse_field0 ($1, $<ftype>0.t, $<ftype>0.lookups,
$3, $2, $4); }
- | TYPENAME ':' expr_no_commas maybe_attribute
+ | tTYPENAME ':' expr_no_commas maybe_attribute
{ $$ = parse_bitfield0 ($1, $<ftype>0.t, $<ftype>0.lookups,
$4, $3); }
;
after_type_component_declarator:
after_type_declarator maybeasm maybe_attribute maybe_init
{ $$ = parse_field ($1, $3, $2, $4); }
- | TYPENAME ':' expr_no_commas maybe_attribute
+ | tTYPENAME ':' expr_no_commas maybe_attribute
{ $$ = parse_bitfield ($1, $4, $3); }
;
/* ISO new-type-id (5.3.4) */
new_type_id:
type_specifier_seq new_declarator
- { $$.t = build_tree_list ($1.t, $2);
+ { $$.t = build_tree_list ($1.t, $2);
$$.new_type_flag = $1.new_type_flag; }
| type_specifier_seq %prec EMPTY
- { $$.t = build_tree_list ($1.t, NULL_TREE);
+ { $$.t = build_tree_list ($1.t, NULL_TREE);
$$.new_type_flag = $1.new_type_flag; }
/* GNU extension to allow arrays of arbitrary types with
non-constant dimension. */
{ $$.t = hash_tree_cons (NULL_TREE, $1, NULL_TREE);
$$.new_type_flag = 0; }
| nonempty_cv_qualifiers CV_QUALIFIER
- { $$.t = hash_tree_cons (NULL_TREE, $2, $1.t);
+ { $$.t = hash_tree_cons (NULL_TREE, $2, $1.t);
$$.new_type_flag = $1.new_type_flag; }
| attributes %prec EMPTY
- { $$.t = hash_tree_cons ($1, NULL_TREE, NULL_TREE);
+ { $$.t = hash_tree_cons ($1, NULL_TREE, NULL_TREE);
$$.new_type_flag = 0; }
| nonempty_cv_qualifiers attributes %prec EMPTY
- { $$.t = hash_tree_cons ($2, NULL_TREE, $1.t);
+ { $$.t = hash_tree_cons ($2, NULL_TREE, $1.t);
$$.new_type_flag = $1.new_type_flag; }
;
$$ = tree_cons ($1, $2, NULL_TREE);
}
;
-
+
notype_declarator:
'*' nonempty_cv_qualifiers notype_declarator_intern %prec UNARY
{ $$ = make_pointer_declarator ($2.t, $3); }
{ enter_scope_of ($2); $$ = $2;}
| global_scope notype_unqualified_id
{ $$ = build_nt (SCOPE_REF, global_namespace, $2);
- enter_scope_of ($$);
+ enter_scope_of ($$);
}
| nested_name_specifier notype_template_declarator
{ got_scope = NULL_TREE;
;
type_name:
- TYPENAME
+ tTYPENAME
| SELFNAME
| template_type %prec EMPTY
;
| nested_name_specifier nested_name_specifier_1
{ $$ = $2; }
| nested_name_specifier TEMPLATE explicit_template_type SCOPE
- { got_scope = $$
+ { got_scope = $$
= make_typename_type ($1, $3, tf_error); }
/* Error handling per Core 125. */
| nested_name_specifier IDENTIFIER SCOPE
- { got_scope = $$
+ { got_scope = $$
= make_typename_type ($1, $2, tf_error); }
| nested_name_specifier PTYPENAME SCOPE
- { got_scope = $$
+ { got_scope = $$
= make_typename_type ($1, $2, tf_error); }
;
/* Why the @#$%^& do type_name and notype_identifier need to be expanded
inline here?!? (jason) */
nested_name_specifier_1:
- TYPENAME SCOPE
+ tTYPENAME SCOPE
{
if (TREE_CODE ($1) == IDENTIFIER_NODE)
{
}
}
| typename_sub1 explicit_template_type SCOPE
- { got_scope = $$
+ { got_scope = $$
= make_typename_type ($1, $2, tf_error); }
| typename_sub1 TEMPLATE explicit_template_type SCOPE
- { got_scope = $$
+ { got_scope = $$
= make_typename_type ($1, $3, tf_error); }
;
/* This needs to return a TYPE_DECL for simple names so that we don't
forget what name was used. */
typename_sub2:
- TYPENAME SCOPE
+ tTYPENAME SCOPE
{
if (TREE_CODE ($1) != TYPE_DECL)
$$ = lastiddecl;
$$ = tree_cons ($1, $2, NULL_TREE);
}
;
-
+
/* ISO abstract-declarator (8.1) */
absdcl:
'*' nonempty_cv_qualifiers absdcl_intern
label_decl:
LABEL identifiers_or_typenames ';'
- {
+ {
while ($2)
{
finish_label_decl (TREE_VALUE ($2));
compstmt_or_stmtexpr:
save_lineno '{'
{ $<ttype>$ = begin_compound_stmt (0); }
- compstmtend
+ compstmtend
{ STMT_LINENO ($<ttype>3) = $1;
finish_compound_stmt (0, $<ttype>3); }
;
implicitly_scoped_stmt:
compstmt
- |
+ |
{ $<ttype>$ = begin_compound_stmt (0); }
- save_lineno simple_stmt
+ save_lineno simple_stmt
{ STMT_LINENO ($<ttype>1) = $2;
if ($3) STMT_LINENO ($3) = $2;
finish_compound_stmt (0, $<ttype>1); }
| simple_if ELSE
{ begin_else_clause (); }
implicitly_scoped_stmt
- {
+ {
$$ = $1;
- finish_else_clause ($1);
+ finish_else_clause ($1);
finish_if_stmt ();
}
| simple_if %prec IF
implicitly_scoped_stmt
{ $$ = $<ttype>2;
finish_for_stmt ($<ttype>2); }
- | SWITCH
+ | SWITCH
{ $<ttype>$ = begin_switch_stmt (); }
'(' condition ')'
{ finish_switch_cond ($4, $<ttype>2); }
asm_clobbers ')' ';'
{ $$ = finish_asm_stmt ($2, $4, $6, NULL_TREE, $8); }
| GOTO '*' expr ';'
- {
+ {
if (pedantic)
pedwarn ("ISO C++ forbids computed gotos");
$$ = finish_goto_stmt ($3);
expand_start_catch_block ($2.t, $3); }
This allows reference parameters... */
| '(' parm ')'
- {
+ {
check_for_new_type ("inside exception declarations", $2);
$$ = start_handler_parms (TREE_PURPOSE ($2.t),
TREE_VALUE ($2.t));
{ finish_label_stmt ($1); }
| PTYPENAME ':'
{ finish_label_stmt ($1); }
- | TYPENAME ':'
+ | tTYPENAME ':'
{ finish_label_stmt ($1); }
| SELFNAME ':'
{ finish_label_stmt ($1); }
{ $$ = finish_parmlist ($1, 1); }
| type_id ELLIPSIS
{ $$ = finish_parmlist (build_tree_list (NULL_TREE,
- $1.t), 1); }
+ $1.t), 1); }
| ELLIPSIS
{ $$ = finish_parmlist (NULL_TREE, 1); }
| parms ':'
parenthesis. */
yyerror ("possibly missing ')'");
$$ = finish_parmlist (build_tree_list (NULL_TREE,
- $1.t), 0);
+ $1.t), 0);
yyungetc (':', 0);
yychar = ')';
}
{ $$.new_type_flag = $1.new_type_flag;
$$.t = build_tree_list ($1.t, $2); }
| typed_typespecs declarator
- { $$.t = build_tree_list ($1.t, $2);
+ { $$.t = build_tree_list ($1.t, $2);
$$.new_type_flag = $1.new_type_flag; }
| typespec declarator
{ $$.t = build_tree_list (build_tree_list (NULL_TREE, $1.t),
- $2);
+ $2);
$$.new_type_flag = $1.new_type_flag; }
| typed_declspecs1 absdcl
{ $$.t = build_tree_list ($1.t, $2);
$$.new_type_flag = $1.new_type_flag; }
| typed_declspecs1 %prec EMPTY
- { $$.t = build_tree_list ($1.t, NULL_TREE);
+ { $$.t = build_tree_list ($1.t, NULL_TREE);
$$.new_type_flag = $1.new_type_flag; }
| declmods notype_declarator
- { $$.t = build_tree_list ($1.t, $2);
+ { $$.t = build_tree_list ($1.t, $2);
$$.new_type_flag = 0; }
;