summaryrefslogtreecommitdiff
path: root/gcc/cp/spew.c
diff options
context:
space:
mode:
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>1999-07-20 19:53:38 +0000
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>1999-07-20 19:53:38 +0000
commit46e5e818eb59baead4f051e734fd254571c8c2c2 (patch)
tree7fb4578f40b67cbe01e6123f6a2be6b9152e074b /gcc/cp/spew.c
parentdd198c78b61643cc598a6eebb4be6da2500b434d (diff)
downloadgcc-46e5e818eb59baead4f051e734fd254571c8c2c2.tar.gz
* lang-specs.h (c++-cpp-output): Pass -fpreprocessed.
* lex.c (token_getch, token_put_back): New fns. (real_yylex): Use them. * lex.c (lang_init): Generalize. (lang_init_options): Tell cpplib this is C++. (nextchar): Remove. Replace uses with put_back. (skip_white_space): Handle linemode here. Optimize for cpplib. (extend_token_buffer_to): New fn. (extend_token_buffer): Use it. (read_line_number, check_newline): Just deal with tokens. (real_yylex): More cpplib optimizations. Simplify. Don't produce EXTERN_LANG_STRING, LEFT_RIGHT or PAREN_STAR_PAREN here. * spew.c (yylex): Produce LEFT_RIGHT and EXTERN_LANG_STRING. * parse.y (PAREN_STAR_PAREN): Remove. * input.c: Don't use the putback machinery with cpplib. (sub_getch): Fold back into getch. (getch): Don't handle linemode here. (feed_input): Unget any text in the token buffer. * lex.c (set_typedecl_interface_info, set_vardecl_interface_info, nextyychar, nextyylval): Remove. * lex.c (indent_level): New variable. (init_parse): Set cpp_token to CPP_DIRECTIVE. (consume_string): Make this smart about USE_CPPLIB. (yyungetc): Use put_back function. (pragma_getc, pragma_ungetc): Functions deleted. (check_newline): Rewrite to be intelligent about USE_CPPLIB. Also, call HANDLE_PRAGMA with getch, yyungetc, not pragma_getc and pragma_ungetc. (real_yylex): Rewrite to be intelligent about USE_CPPLIB. Also, clean up cases where we redundantly set token_buffer[0]. (read_line_number): New fn. * input.c (feed_input): Use integrated cpplib if USE_CPPLIB. (end_input): Call cpp_pop_buffer if USE_CPPLIB. (sub_getch): Conditionalize out code that's not appropriate if USE_CPPLIB. (put_back): Rewrite in case USE_CPPLIB is defined. (input_redirected): Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@28193 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cp/spew.c')
-rw-r--r--gcc/cp/spew.c36
1 files changed, 28 insertions, 8 deletions
diff --git a/gcc/cp/spew.c b/gcc/cp/spew.c
index a573cbac2b0..6e7d06e9e1d 100644
--- a/gcc/cp/spew.c
+++ b/gcc/cp/spew.c
@@ -1,5 +1,5 @@
/* Type Analyzer for GNU C++.
- Copyright (C) 1987, 89, 92-97, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1987, 89, 92-97, 1998, 1999 Free Software Foundation, Inc.
Hacked... nay, bludgeoned... by Mark Eichin (eichin@cygnus.com)
This file is part of GNU CC.
@@ -305,6 +305,16 @@ yylex ()
#endif
goto retry;
+ case '(':
+ scan_tokens (1);
+ if (nth_token (1)->yychar == ')')
+ {
+ consume_token ();
+ tmp_token.yychar = LEFT_RIGHT;
+ }
+ consume_token ();
+ break;
+
case IDENTIFIER:
scan_tokens (1);
if (nth_token (1)->yychar == SCOPE)
@@ -361,21 +371,31 @@ yylex ()
break;
case SCSPEC:
+ if (tmp_token.yylval.ttype == ridpointers[RID_EXTERN])
+ {
+ scan_tokens (1);
+ if (nth_token (1)->yychar == STRING)
+ {
+ tmp_token.yychar = EXTERN_LANG_STRING;
+ tmp_token.yylval.ttype = get_identifier
+ (TREE_STRING_POINTER (nth_token (1)->yylval.ttype));
+ consume_token ();
+ }
+ }
/* If export, warn that it's unimplemented and go on. */
- if (tmp_token.yylval.ttype == get_identifier("export"))
+ else if (tmp_token.yylval.ttype == ridpointers[RID_EXPORT])
{
warning ("keyword 'export' not implemented and will be ignored");
consume_token ();
goto retry;
}
- else
- {
- ++first_token;
- break;
- }
+ /* do_aggr needs to check if the previous token was `friend',
+ so just increment first_token instead of calling consume_token. */
+ ++first_token;
+ break;
case NEW:
- /* do_aggr needs to check if the previous token was RID_NEW,
+ /* do_aggr needs to check if the previous token was `new',
so just increment first_token instead of calling consume_token. */
++first_token;
break;