diff options
author | Neil Booth <neil@daikokuya.demon.co.uk> | 2002-06-04 13:07:06 +0000 |
---|---|---|
committer | Neil Booth <neil@gcc.gnu.org> | 2002-06-04 13:07:06 +0000 |
commit | 82eda77ed5c4548bd5cbb3f5bbe6f3453a3d1eea (patch) | |
tree | 3c0127db39d15911aba3137af7f41daa9c7866bf /gcc/cpphash.h | |
parent | 589005ff217dde6c3c22842e27315d597a8fe710 (diff) | |
download | gcc-82eda77ed5c4548bd5cbb3f5bbe6f3453a3d1eea.zip gcc-82eda77ed5c4548bd5cbb3f5bbe6f3453a3d1eea.tar.gz gcc-82eda77ed5c4548bd5cbb3f5bbe6f3453a3d1eea.tar.bz2 |
cpphash.h (FIRST, [...]): New.
* 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.
From-SVN: r54242
Diffstat (limited to 'gcc/cpphash.h')
-rw-r--r-- | gcc/cpphash.h | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/gcc/cpphash.h b/gcc/cpphash.h index a059e2b..6d3f1b9 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. */ |