aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpplib.h
diff options
context:
space:
mode:
authorNeil Booth <neilb@earthling.net>2000-09-23 21:41:41 +0000
committerNeil Booth <neil@gcc.gnu.org>2000-09-23 21:41:41 +0000
commitcbcff6df5c57b1f2862916680673611398ef1bda (patch)
treeed10891b3898c3d5117b135bd865e1653390160c /gcc/cpplib.h
parent19e223db83b86b7262db77c9ea67e7d6d32a0d73 (diff)
downloadgcc-cbcff6df5c57b1f2862916680673611398ef1bda.zip
gcc-cbcff6df5c57b1f2862916680673611398ef1bda.tar.gz
gcc-cbcff6df5c57b1f2862916680673611398ef1bda.tar.bz2
cpphash.h (CPP_RESERVE, [...]): Delete.
* cpphash.h (CPP_RESERVE, CPP_PUTS_Q, CPP_PUTS, CPP_PUTC_Q, CPP_PUTC, DUMMY_TOKEN, NO_DUMMY_TOKEN): Delete. * cpplex.c (_cpp_expand_token_space, _cpp_init_toklist, _cpp_free_toklist): No need to worry about extra dummy token at the start of token lists any more. (trigraph_ok): Only warn outside comments. (skip_block_comment): Set and clear lexing_comment. (skip_line_comment): Take a cpp_reader not cpp_buffer. Set and clear lexing_comment. (parse_number): Handle leading '.' indicated by pfile->seen_dot. (check_long_token): Delete. (lex_percent, lex_dot): New subroutines of lex_token to handle lexing of '.' and '%' without lookback. (lex_token): Use lex_dot and lex_percent. (lex_line): Don't check for LIST_OFFSET. (_cpp_init_input_buffer): Update for new _cpp_init_toklist. * cpplib.c (_cpp_parse_assertion): Similarly. (cpp_push_buffer): Initialize extra_char. * cpplib.h (LIST_OFFSET): Delete. (struct cpp_buffer): New member extra_char. (struct lexer_state): New members lexing_comment and seen_dot. From-SVN: r36582
Diffstat (limited to 'gcc/cpplib.h')
-rw-r--r--gcc/cpplib.h14
1 files changed, 10 insertions, 4 deletions
diff --git a/gcc/cpplib.h b/gcc/cpplib.h
index 7511537..15c30ab 100644
--- a/gcc/cpplib.h
+++ b/gcc/cpplib.h
@@ -182,9 +182,8 @@ struct cpp_token
};
/* cpp_toklist flags. */
-#define LIST_OFFSET (1 << 0)
-#define VAR_ARGS (1 << 1)
-#define BEG_OF_FILE (1 << 2)
+#define VAR_ARGS (1 << 0)
+#define BEG_OF_FILE (1 << 1)
struct directive; /* These are deliberately incomplete. */
struct answer;
@@ -225,6 +224,7 @@ struct cpp_buffer
const unsigned char *rlimit; /* end of valid data */
const unsigned char *line_base; /* start of current line */
cppchar_t read_ahead; /* read ahead character */
+ cppchar_t extra_char; /* extra read-ahead for long tokens. */
struct cpp_reader *pfile; /* Owns this buffer. */
struct cpp_buffer *prev;
@@ -460,8 +460,14 @@ struct lexer_state
/* Nonzero to get force the lexer to skip newlines. */
unsigned char skip_newlines;
- /* If we're in the subroutine lex_line. */
+ /* Nonzero if we're in the subroutine lex_line. */
unsigned char in_lex_line;
+
+ /* Nonzero if we're mid-comment. */
+ unsigned char lexing_comment;
+
+ /* Tells parse_number we saw a leading period. */
+ unsigned char seen_dot;
};
#define IN_DIRECTIVE(pfile) (pfile->state.in_directive)
#define KNOWN_DIRECTIVE(list) (list->directive != 0)