summaryrefslogtreecommitdiff
path: root/gcc/cpphash.h
diff options
context:
space:
mode:
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2001-09-24 22:53:12 +0000
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2001-09-24 22:53:12 +0000
commitf9b5f7426b95ed5809c2ef8257b962306844f87b (patch)
treef2b5dd04bb961bbe8dac8d988d52d574f0cb2b47 /gcc/cpphash.h
parent0be2ebc785cd4b366423534d0bfdce0499483e80 (diff)
downloadgcc-f9b5f7426b95ed5809c2ef8257b962306844f87b.tar.gz
* c-lex.c (cb_def_pragma): Update.
(c_lex): Update, and skip padding. * cppexp.c (lex, parse_defined): Update, remove unused variable. * cpphash.h (struct toklist): Delete. (union utoken): New. (struct cpp_context): Update. (struct cpp_reader): New members eof, avoid_paste. (_cpp_temp_token): New. * cppinit.c (cpp_create_reader): Update. * cpplex.c (_cpp_temp_token): New. (_cpp_lex_direct): Add PREV_WHITE when parsing args. (cpp_output_token): Don't print leading whitespace. (cpp_output_line): Update. * cpplib.c (glue_header_name, parse_include, get__Pragma_string, do_include_common, do_line, do_ident, do_pragma, do_pragma_dependency, _cpp_do__Pragma, parse_answer, parse_assertion): Update. (get_token_no_padding): New. * cpplib.h (CPP_PADDING): New. (AVOID_LPASTE): Delete. (struct cpp_token): New union member source. (cpp_get_token): Update. * cppmacro.c (macro_arg): Convert to use pointers to const tokens. (builtin_macro, paste_all_tokens, paste_tokens, funlike_invocation_p, replace_args, quote_string, stringify_arg, parse_arg, next_context, enter_macro_context, expand_arg, _cpp_pop_context, cpp_scan_nooutput, _cpp_backup_tokens, _cpp_create_definition): Update. (push_arg_context): Delete. (padding_token, push_token_context, push_ptoken_context): New. (make_string_token, make_number_token): Update, rename. (cpp_get_token): Update to handle tokens as pointers to const, and insert padding appropriately. * cppmain.c (struct printer): New member prev. (check_multiline_token): Constify. (do_preprocessing, cb_line_change): Update. (scan_translation_unit): Update to handle spacing. * scan-decls.c (get_a_token): New. (skip_to_closing_brace, scan_decls): Update. * fix-header.c (read_scan_file): Update. * doc/cpp.texi: Update. * gcc.dg/cpp/macro10.c: New test. * gcc.dg/cpp/strify3.c: New test. * gcc.dg/cpp/spacing1.c: Add tests. * gcc.dg/cpp/19990703-1.c: Remove bogus test. * gcc.dg/cpp/20000625-2.c: Fudge to pass. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45793 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cpphash.h')
-rw-r--r--gcc/cpphash.h18
1 files changed, 13 insertions, 5 deletions
diff --git a/gcc/cpphash.h b/gcc/cpphash.h
index 64deaa2fa23..001ac60c53e 100644
--- a/gcc/cpphash.h
+++ b/gcc/cpphash.h
@@ -95,11 +95,10 @@ struct search_path
/* #include types. */
enum include_type {IT_INCLUDE, IT_INCLUDE_NEXT, IT_IMPORT, IT_CMDLINE};
-typedef struct toklist toklist;
-struct toklist
+union utoken
{
- cpp_token *first;
- cpp_token *limit;
+ const cpp_token *token;
+ const cpp_token **ptoken;
};
typedef struct tokenrun tokenrun;
@@ -117,10 +116,14 @@ struct cpp_context
/* Contexts other than the base context are contiguous tokens.
e.g. macro expansions, expanded argument tokens. */
- struct toklist list;
+ union utoken first;
+ union utoken last;
/* For a macro context, these are the macro and its arguments. */
cpp_macro *macro;
+
+ /* True if utoken element is token, else ptoken. */
+ bool direct_p;
};
struct lexer_state
@@ -294,6 +297,10 @@ struct cpp_reader
cpp_token date;
cpp_token time;
+ /* EOF token, and a token forcing paste avoidance. */
+ cpp_token avoid_paste;
+ cpp_token eof;
+
/* Opaque handle to the dependencies of mkdeps.c. Used by -M etc. */
struct deps *deps;
@@ -398,6 +405,7 @@ extern void _cpp_pop_file_buffer PARAMS ((cpp_reader *,
extern int _cpp_parse_expr PARAMS ((cpp_reader *));
/* In cpplex.c */
+extern cpp_token *_cpp_temp_token PARAMS ((cpp_reader *));
extern const cpp_token *_cpp_lex_token PARAMS ((cpp_reader *));
extern cpp_token *_cpp_lex_direct PARAMS ((cpp_reader *));
extern int _cpp_equiv_tokens PARAMS ((const cpp_token *,