summaryrefslogtreecommitdiff
path: root/gcc/cpphash.h
diff options
context:
space:
mode:
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2001-09-11 07:00:12 +0000
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2001-09-11 07:00:12 +0000
commit83dcbb5c2cda40183ea0c159c0d5a418b46b3509 (patch)
tree943c0f0881bcaf2f5425616b1754f072979eb4b6 /gcc/cpphash.h
parent3dc88cea431f903b55fbc215a99da441f0f827ca (diff)
downloadgcc-83dcbb5c2cda40183ea0c159c0d5a418b46b3509.tar.gz
* cpphash.h (struct tokenrun): New.
(struct cpp_context): New member bol. (struct cpp_reader): New members. (_cpp_init_tokenrun): New. * cppinit.c (cpp_create_reader): Set up the token runs. * cpplex.c (lex_directive, lex_token, next_tokenrun): New. (lex_token): New internalised version of _cpp_lex_token. Don't handle directives or the multiple include opimisation here any more. Simply lex a token. * cpplib.c (run_directive): Clear bol. (_cpp_pop_buffer): Set bol. * cppmacro.c (funlike_invocation_p): Keep tokens whilst parsing arguments. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45534 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cpphash.h')
-rw-r--r--gcc/cpphash.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/gcc/cpphash.h b/gcc/cpphash.h
index a31368396ef..4224e91a24c 100644
--- a/gcc/cpphash.h
+++ b/gcc/cpphash.h
@@ -102,6 +102,13 @@ struct toklist
cpp_token *limit;
};
+typedef struct tokenrun tokenrun;
+struct tokenrun
+{
+ tokenrun *next;
+ cpp_token *base, *limit;
+};
+
typedef struct cpp_context cpp_context;
struct cpp_context
{
@@ -124,6 +131,9 @@ 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;
@@ -258,6 +268,13 @@ struct cpp_reader
const cpp_hashnode *mi_ind_cmacro;
bool mi_valid;
+ /* Lexing. */
+ cpp_token *cur_token;
+ tokenrun base_run, *cur_run;
+
+ /* 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. */
@@ -397,6 +414,7 @@ extern int _cpp_parse_expr PARAMS ((cpp_reader *));
extern void _cpp_lex_token PARAMS ((cpp_reader *, cpp_token *));
extern int _cpp_equiv_tokens PARAMS ((const cpp_token *,
const cpp_token *));
+extern void _cpp_init_tokenrun PARAMS ((tokenrun *, unsigned int));
extern void _cpp_init_pool PARAMS ((cpp_pool *, unsigned int,
unsigned int, unsigned int));
extern void _cpp_free_pool PARAMS ((cpp_pool *));