Commit 990ac8d7 by H.J. Lu Committed by Jeff Law

c-parse.in: Recognize protocol qualifiers in class definitions for objc.

        * c-parse.in: Recognize protocol qualifiers in class
        definitions for objc.
        Include "output.h".
        (yyerror): Remove redundant decl.
        (yyprint): Fix prototype.

From-SVN: r18788
parent 47a0b68f
Mon Mar 23 23:59:11 1998 H.J. Lu (hjl@gnu.org)
* c-parse.in: Recognize protocol qualifiers in class
definitions for objc.
Include "output.h".
(yyerror): Remove redundant decl.
(yyprint): Fix prototype.
Mon Mar 23 23:49:47 1998 Jeffrey A Law (law@cygnus.com) Mon Mar 23 23:49:47 1998 Jeffrey A Law (law@cygnus.com)
* cse.c (rtx_cost): Only call CONST_COSTS if it is defined. * cse.c (rtx_cost): Only call CONST_COSTS if it is defined.
......
...@@ -69,6 +69,7 @@ end ifc ...@@ -69,6 +69,7 @@ end ifc
#include "c-lex.h" #include "c-lex.h"
#include "c-tree.h" #include "c-tree.h"
#include "flags.h" #include "flags.h"
#include "output.h"
#ifdef MULTIBYTE_CHARS #ifdef MULTIBYTE_CHARS
#include <stdlib.h> #include <stdlib.h>
...@@ -92,8 +93,6 @@ end ifc ...@@ -92,8 +93,6 @@ end ifc
extern int errno; extern int errno;
#endif #endif
void yyerror ();
/* Like YYERROR but do call yyerror. */ /* Like YYERROR but do call yyerror. */
#define YYERROR1 { yyerror ("syntax error"); YYERROR; } #define YYERROR1 { yyerror ("syntax error"); YYERROR; }
...@@ -270,7 +269,7 @@ end ifobjc ...@@ -270,7 +269,7 @@ end ifobjc
/* Tell yyparse how to print a token's value, if yydebug is set. */ /* Tell yyparse how to print a token's value, if yydebug is set. */
#define YYPRINT(FILE,YYCHAR,YYLVAL) yyprint(FILE,YYCHAR,YYLVAL) #define YYPRINT(FILE,YYCHAR,YYLVAL) yyprint(FILE,YYCHAR,YYLVAL)
extern void yyprint (); extern void yyprint PROTO ((FILE *, int, YYSTYPE));
%} %}
%% %%
...@@ -2726,20 +2725,28 @@ semi_or_error: ...@@ -2726,20 +2725,28 @@ semi_or_error:
methodproto: methodproto:
'+' '+'
{ {
/* Remember protocol qualifiers in prototypes. */
remember_protocol_qualifiers ();
objc_inherit_code = CLASS_METHOD_DECL; objc_inherit_code = CLASS_METHOD_DECL;
} }
methoddecl methoddecl
{ {
/* Forget protocol qualifiers here. */
forget_protocol_qualifiers ();
add_class_method (objc_interface_context, $3); add_class_method (objc_interface_context, $3);
} }
semi_or_error semi_or_error
| '-' | '-'
{ {
/* Remember protocol qualifiers in prototypes. */
remember_protocol_qualifiers ();
objc_inherit_code = INSTANCE_METHOD_DECL; objc_inherit_code = INSTANCE_METHOD_DECL;
} }
methoddecl methoddecl
{ {
/* Forget protocol qualifiers here. */
forget_protocol_qualifiers ();
add_instance_method (objc_interface_context, $3); add_instance_method (objc_interface_context, $3);
} }
semi_or_error semi_or_error
......
...@@ -65,6 +65,7 @@ State 434 contains 2 shift/reduce conflicts. (Four ways to parse this.) */ ...@@ -65,6 +65,7 @@ State 434 contains 2 shift/reduce conflicts. (Four ways to parse this.) */
#include "c-lex.h" #include "c-lex.h"
#include "c-tree.h" #include "c-tree.h"
#include "flags.h" #include "flags.h"
#include "output.h"
#ifdef MULTIBYTE_CHARS #ifdef MULTIBYTE_CHARS
#include <stdlib.h> #include <stdlib.h>
...@@ -80,8 +81,6 @@ char *language_string = "GNU C"; ...@@ -80,8 +81,6 @@ char *language_string = "GNU C";
extern int errno; extern int errno;
#endif #endif
void yyerror ();
/* Like YYERROR but do call yyerror. */ /* Like YYERROR but do call yyerror. */
#define YYERROR1 { yyerror ("syntax error"); YYERROR; } #define YYERROR1 { yyerror ("syntax error"); YYERROR; }
...@@ -232,7 +231,7 @@ static int undeclared_variable_notice; ...@@ -232,7 +231,7 @@ static int undeclared_variable_notice;
/* Tell yyparse how to print a token's value, if yydebug is set. */ /* Tell yyparse how to print a token's value, if yydebug is set. */
#define YYPRINT(FILE,YYCHAR,YYLVAL) yyprint(FILE,YYCHAR,YYLVAL) #define YYPRINT(FILE,YYCHAR,YYLVAL) yyprint(FILE,YYCHAR,YYLVAL)
extern void yyprint (); extern void yyprint PROTO ((FILE *, int, YYSTYPE));
%} %}
%% %%
......
...@@ -141,7 +141,7 @@ int objc_public_flag; ...@@ -141,7 +141,7 @@ int objc_public_flag;
/* Tell yyparse how to print a token's value, if yydebug is set. */ /* Tell yyparse how to print a token's value, if yydebug is set. */
#define YYPRINT(FILE,YYCHAR,YYLVAL) yyprint(FILE,YYCHAR,YYLVAL) #define YYPRINT(FILE,YYCHAR,YYLVAL) yyprint(FILE,YYCHAR,YYLVAL)
extern void yyprint PROTO ((FILE *, int, YYSTYPE)); extern void yyprint PROTO ((FILE *, int, YYSTYPE));
#include <stdio.h> #include <stdio.h>
#ifndef __cplusplus #ifndef __cplusplus
...@@ -1638,7 +1638,7 @@ static const short yycheck[] = { 9, ...@@ -1638,7 +1638,7 @@ static const short yycheck[] = { 9,
48, 49, 50, 51, 52 48, 49, 50, 51, 52
}; };
/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ /* -*-C-*- Note some compilers choke on comments on `#line' lines. */
#line 3 "/usr/share/bison.simple" #line 3 "/usr/cygnus/latest-940103/share/bison.simple"
/* Skeleton output parser for bison, /* Skeleton output parser for bison,
Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc.
...@@ -1831,7 +1831,7 @@ __yy_memcpy (char *to, char *from, int count) ...@@ -1831,7 +1831,7 @@ __yy_memcpy (char *to, char *from, int count)
#endif #endif
#endif #endif
#line 196 "/usr/share/bison.simple" #line 196 "/usr/cygnus/latest-940103/share/bison.simple"
/* The user can define YYPARSE_PARAM as the name of an argument to be passed /* The user can define YYPARSE_PARAM as the name of an argument to be passed
into yyparse. The argument should have type void *. into yyparse. The argument should have type void *.
...@@ -2609,7 +2609,7 @@ case 89: ...@@ -2609,7 +2609,7 @@ case 89:
if (IDENTIFIER_GLOBAL_VALUE (yyvsp[0].ttype) != error_mark_node if (IDENTIFIER_GLOBAL_VALUE (yyvsp[0].ttype) != error_mark_node
|| IDENTIFIER_ERROR_LOCUS (yyvsp[0].ttype) != current_function_decl) || IDENTIFIER_ERROR_LOCUS (yyvsp[0].ttype) != current_function_decl)
{ {
error ("`%s' undeclared (first use this function)", error ("`%s' undeclared (first use in this function)",
IDENTIFIER_POINTER (yyvsp[0].ttype)); IDENTIFIER_POINTER (yyvsp[0].ttype));
if (! undeclared_variable_notice) if (! undeclared_variable_notice)
...@@ -4911,7 +4911,7 @@ case 556: ...@@ -4911,7 +4911,7 @@ case 556:
break;} break;}
} }
/* the action file gets copied in in place of this dollarsign */ /* the action file gets copied in in place of this dollarsign */
#line 498 "/usr/share/bison.simple" #line 498 "/usr/cygnus/latest-940103/share/bison.simple"
yyvsp -= yylen; yyvsp -= yylen;
yyssp -= yylen; yyssp -= yylen;
......
...@@ -231,7 +231,7 @@ int objc_public_flag; ...@@ -231,7 +231,7 @@ int objc_public_flag;
/* Tell yyparse how to print a token's value, if yydebug is set. */ /* Tell yyparse how to print a token's value, if yydebug is set. */
#define YYPRINT(FILE,YYCHAR,YYLVAL) yyprint(FILE,YYCHAR,YYLVAL) #define YYPRINT(FILE,YYCHAR,YYLVAL) yyprint(FILE,YYCHAR,YYLVAL)
extern void yyprint PROTO ((FILE *, int, YYSTYPE)); extern void yyprint PROTO ((FILE *, int, YYSTYPE));
%} %}
%% %%
...@@ -635,7 +635,7 @@ primary: ...@@ -635,7 +635,7 @@ primary:
if (IDENTIFIER_GLOBAL_VALUE ($1) != error_mark_node if (IDENTIFIER_GLOBAL_VALUE ($1) != error_mark_node
|| IDENTIFIER_ERROR_LOCUS ($1) != current_function_decl) || IDENTIFIER_ERROR_LOCUS ($1) != current_function_decl)
{ {
error ("`%s' undeclared (first use this function)", error ("`%s' undeclared (first use in this function)",
IDENTIFIER_POINTER ($1)); IDENTIFIER_POINTER ($1));
if (! undeclared_variable_notice) if (! undeclared_variable_notice)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment