aboutsummaryrefslogtreecommitdiff
path: root/gcc/cpplib.h
diff options
context:
space:
mode:
authorNeil Booth <neil@daikokuya.demon.co.uk>2001-09-14 22:04:46 +0000
committerNeil Booth <neil@gcc.gnu.org>2001-09-14 22:04:46 +0000
commit972938978677f76ef6af494932345945947852ee (patch)
tree4c00cb933362af65600541484760cce6502de1a6 /gcc/cpplib.h
parent4fb1661fea89a2d72f69dcbe341e253d4b3fffe3 (diff)
downloadgcc-972938978677f76ef6af494932345945947852ee.zip
gcc-972938978677f76ef6af494932345945947852ee.tar.gz
gcc-972938978677f76ef6af494932345945947852ee.tar.bz2
cpperror.c (print_location): Take line and column, for default positioning use the previously lexed token.
* cpperror.c (print_location): Take line and column, for default positioning use the previously lexed token. (_cpp_begin_message): Take line and column. (cpp_ice, cpp_fatal, cpp_error, cpp_error_with_line, cpp_warning, cpp_warning_with_line, cpp_pedwarn, cpp_pedwarn_with_line): Update. * cpphash.h (_cpp_begin_message): Update prototype. * cppinit.c (push_include): Don't set output line. * cpplex.c (_cpp_lex_token): Callback for start of new output lines. * cpplib.c (do_diagnostic, _cpp_pop_buffer): Update. (do_pragma): Kludge for front ends. Don't expand macros at all. * cpplib.h (cpp_lookahead, cpp_token_with_pos, cpp_get_line): Remove. (struct cpp_token): Remove output_line. (struct cpp_callbacks): New member line_change. * cppmacro.c (builtin_macro, paste_all_tokens, replace_args, cpp_get_token): Preserve BOL flag. (cpp_get_line): Remove. (_cpp_backup_tokens): Remove useless abort(). * cppmain.c (cb_line_change): New. (scan_translation_unit): Don't worry about starting new lines here. * scan-decls.c (scan_decls): Update. * c-lex.c (c_lex, init_c_lex): Update. (cb_line_change, src_lineno): New. From-SVN: r45613
Diffstat (limited to 'gcc/cpplib.h')
-rw-r--r--gcc/cpplib.h35
1 files changed, 9 insertions, 26 deletions
diff --git a/gcc/cpplib.h b/gcc/cpplib.h
index ef6a1a5..7719995 100644
--- a/gcc/cpplib.h
+++ b/gcc/cpplib.h
@@ -42,7 +42,6 @@ typedef struct cpp_string cpp_string;
typedef struct cpp_hashnode cpp_hashnode;
typedef struct cpp_macro cpp_macro;
typedef struct cpp_lexer_pos cpp_lexer_pos;
-typedef struct cpp_lookahead cpp_lookahead;
typedef struct cpp_callbacks cpp_callbacks;
struct answer;
@@ -191,26 +190,9 @@ struct cpp_token
struct cpp_lexer_pos
{
unsigned int line;
- unsigned int output_line;
unsigned short col;
};
-typedef struct cpp_token_with_pos cpp_token_with_pos;
-struct cpp_token_with_pos
-{
- cpp_token token;
- cpp_lexer_pos pos;
-};
-
-/* Token lookahead. */
-struct cpp_lookahead
-{
- struct cpp_lookahead *next;
- cpp_token_with_pos *tokens;
- cpp_lexer_pos pos;
- unsigned int cur, count, cap;
-};
-
/* A standalone character. We may want to make it unsigned for the
same reason we use unsigned char - to avoid signedness issues. */
typedef int cppchar_t;
@@ -390,13 +372,15 @@ struct cpp_options
/* Call backs. */
struct cpp_callbacks
{
- void (*file_change) PARAMS ((cpp_reader *, const struct line_map *));
- void (*include) PARAMS ((cpp_reader *, unsigned int,
- const unsigned char *, const cpp_token *));
- void (*define) PARAMS ((cpp_reader *, unsigned int, cpp_hashnode *));
- void (*undef) PARAMS ((cpp_reader *, unsigned int, cpp_hashnode *));
- void (*ident) PARAMS ((cpp_reader *, unsigned int, const cpp_string *));
- void (*def_pragma) PARAMS ((cpp_reader *, unsigned int));
+ /* Called when a new line of preprocessed output is started. */
+ void (*line_change) PARAMS ((cpp_reader *, const cpp_token *, int));
+ void (*file_change) PARAMS ((cpp_reader *, const struct line_map *));
+ void (*include) PARAMS ((cpp_reader *, unsigned int,
+ const unsigned char *, const cpp_token *));
+ void (*define) PARAMS ((cpp_reader *, unsigned int, cpp_hashnode *));
+ void (*undef) PARAMS ((cpp_reader *, unsigned int, cpp_hashnode *));
+ void (*ident) PARAMS ((cpp_reader *, unsigned int, const cpp_string *));
+ void (*def_pragma) PARAMS ((cpp_reader *, unsigned int));
};
#define CPP_FATAL_LIMIT 1000
@@ -522,7 +506,6 @@ extern int cpp_avoid_paste PARAMS ((cpp_reader *, const cpp_token *,
extern enum cpp_ttype cpp_can_paste PARAMS ((cpp_reader *, const cpp_token *,
const cpp_token *, int *));
extern void cpp_get_token PARAMS ((cpp_reader *, cpp_token *));
-extern const cpp_lexer_pos *cpp_get_line PARAMS ((cpp_reader *));
extern const unsigned char *cpp_macro_definition PARAMS ((cpp_reader *,
const cpp_hashnode *));
extern void _cpp_backup_tokens PARAMS ((cpp_reader *, unsigned int));