summaryrefslogtreecommitdiff
path: root/gcc/cpphash.h
diff options
context:
space:
mode:
authorneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2002-06-04 13:07:06 +0000
committerneil <neil@138bc75d-0d04-0410-961f-82ee72b054a4>2002-06-04 13:07:06 +0000
commita854276aec7a199144d8c0ea8977b7dcca55adf2 (patch)
tree3c0127db39d15911aba3137af7f41daa9c7866bf /gcc/cpphash.h
parent3cfec666406d71f8b7d7abcf9883c64117453c15 (diff)
downloadgcc-a854276aec7a199144d8c0ea8977b7dcca55adf2.tar.gz
* cpphash.h (FIRST, LAST, CUR, RLIMIT): New.
(struct cpp_context): Add traditional fields. * cppmacro.c (paste_all_tokens, push_ptoken_context, push_token_context, cpp_get_token, _cpp_backup_tokens): Update. * cpptrad.c (skip_comment, lex_identifier, _cpp_read_logical_line_trad, scan_out_logical_line): Update. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@54242 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cpphash.h')
-rw-r--r--gcc/cpphash.h28
1 files changed, 24 insertions, 4 deletions
diff --git a/gcc/cpphash.h b/gcc/cpphash.h
index a059e2b0aac..6d3f1b9fb09 100644
--- a/gcc/cpphash.h
+++ b/gcc/cpphash.h
@@ -126,16 +126,36 @@ struct tokenrun
cpp_token *base, *limit;
};
+/* Accessor macros for struct cpp_context. */
+#define FIRST(c) (c->u.iso.first)
+#define LAST(c) (c->u.iso.last)
+#define CUR(c) (c->u.trad.cur)
+#define RLIMIT(c) (c->u.trad.rlimit)
+
typedef struct cpp_context cpp_context;
struct cpp_context
{
/* Doubly-linked list. */
cpp_context *next, *prev;
- /* Contexts other than the base context are contiguous tokens.
- e.g. macro expansions, expanded argument tokens. */
- union utoken first;
- union utoken last;
+ union
+ {
+ /* For ISO macro expansion. Contexts other than the base context
+ are contiguous tokens. e.g. macro expansions, expanded
+ argument tokens. */
+ struct
+ {
+ union utoken first;
+ union utoken last;
+ } iso;
+
+ /* For traditional macro expansion. */
+ struct
+ {
+ const uchar *cur;
+ const uchar *rlimit;
+ } trad;
+ } u;
/* If non-NULL, a buffer used for storage related to this context.
When the context is popped, the buffer is released. */