aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpphash.h
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.demon.co.uk>2001-09-13 20:05:17 +0000
committerNeil Booth <neil@gcc.gnu.org>2001-09-13 20:05:17 +0000
commitbdcbe49686fce1d35955579428aa2ade21dd941c (patch)
treef67a034f6447649165fb6297431354b49c7620fc /gcc/cpphash.h
parent83182544dbfc89d2d974431383d61039cac9b773 (diff)
downloadgcc-bdcbe49686fce1d35955579428aa2ade21dd941c.zip
gcc-bdcbe49686fce1d35955579428aa2ade21dd941c.tar.gz
gcc-bdcbe49686fce1d35955579428aa2ade21dd941c.tar.bz2
c-parse.in (_yylex): Use _cpp_backup_tokens.
* c-parse.in (_yylex): Use _cpp_backup_tokens. * cpphash.h (struct tokenrun): Add prev. (struct lexer_state): Remove bol. (struct cpp_reader): Remove old lookahead stuff, add lookaheads. (_cpp_free_lookaheads, _cpp_release_lookahead, _cpp_push_token) : Remove. * cppinit.c (cpp_create_reader): Don't set bol. (cpp_destroy): Don't free lookaheads. * cpplex.c (lex_directive): Remove. (next_tokenrun): Update. (_cpp_lex_token): Clean up logic. (lex_token): Update to return a pointer to lexed token, since it can move to the start of the buffer. Simpify newline handling. * cpplib.c (SEEN_EOL): Update. (skip_rest_of_line): Remove lookahead stuff. (end_directive): Line numbers are already incremented. Revert to start of lexed token buffer if we can. (_cpp_handle_directive, do_pragma, do_pragma_dependency, parse_answer): Use _cpp_backup_tokens. (run_directive, cpp_pop_buffer): Don't set bol, set saved_flags instead. Don't check for EOL. (do_include_common, do_line, do_pragma_system_header): Use skip_rest_of_line. * cpplib.h (BOL, _cpp_backup_tokens): New. * cppmacro.c (save_lookahead_token, take_lookahead_token, alloc_lookahead, free_lookahead, _cpp_free_lookaheads, cpp_start_lookahead, cpp_stop_lookahead, _cpp_push_token): Remove. (builtin_macro): Don't use cpp_get_line. (cpp_get_line): Short term kludge. (parse_arg): Handle directives in arguments here. Back up when appropriate. Store EOF at end of argument list. (funlike_invocation_p): Use _cpp_backup_tokens. (push_arg_context): Account for EOF at end of list. (cpp_get_token): Remove lookahead stuff. Update. * gcc.dg/cpp/directiv.c: Update. * gcc.dg/cpp/undef1.c: Update. From-SVN: r45582
Diffstat (limited to 'gcc/cpphash.h')
-rw-r--r--gcc/cpphash.h16
1 files changed, 2 insertions, 14 deletions
diff --git a/gcc/cpphash.h b/gcc/cpphash.h
index 4224e91..acf727f 100644
--- a/gcc/cpphash.h
+++ b/gcc/cpphash.h
@@ -105,7 +105,7 @@ struct toklist
typedef struct tokenrun tokenrun;
struct tokenrun
{
- tokenrun *next;
+ tokenrun *next, *prev;
cpp_token *base, *limit;
};
@@ -131,9 +131,6 @@ struct lexer_state
/* True if we are skipping a failed conditional group. */
unsigned char skipping;
- /* Nonzero if next token is the start of a line. */
- unsigned char bol;
-
/* Nonzero if in a directive that takes angle-bracketed headers. */
unsigned char angled_headers;
@@ -271,16 +268,11 @@ struct cpp_reader
/* Lexing. */
cpp_token *cur_token;
tokenrun base_run, *cur_run;
+ unsigned int lookaheads;
/* Non-zero prevents the lexer from re-using the token runs. */
unsigned int keep_tokens;
- /* Token lookahead. */
- struct cpp_lookahead *la_read; /* Read from this lookahead. */
- struct cpp_lookahead *la_write; /* Write to this lookahead. */
- struct cpp_lookahead *la_unused; /* Free store. */
- struct cpp_lookahead *la_saved; /* Backup when entering directive. */
-
/* Error counter for exit code. */
unsigned int errors;
@@ -382,10 +374,6 @@ extern int _cpp_begin_message PARAMS ((cpp_reader *, enum error_type,
extern void _cpp_free_definition PARAMS ((cpp_hashnode *));
extern int _cpp_create_definition PARAMS ((cpp_reader *, cpp_hashnode *));
extern void _cpp_pop_context PARAMS ((cpp_reader *));
-extern void _cpp_free_lookaheads PARAMS ((cpp_reader *));
-extern void _cpp_release_lookahead PARAMS ((cpp_reader *));
-extern void _cpp_push_token PARAMS ((cpp_reader *, const cpp_token *,
- const cpp_lexer_pos *));
/* In cpphash.c */
extern void _cpp_init_hashtable PARAMS ((cpp_reader *, hash_table *));