Commit 45b966db by Zack Weinberg Committed by Zack Weinberg

Makefile.in (LIBCPP_OBJS): Add cpplex.o.

	* Makefile.in (LIBCPP_OBJS): Add cpplex.o.
	(cpplex.o): New target.
	* po/POTFILES.in: Add cpplex.c.

	* cpplex.c (_cpp_grow_token_buffer, null_cleanup,
	cpp_push_buffer, cpp_pop_buffer, cpp_scan_buffer,
	cpp_expand_to_buffer, cpp_buf_line_and_col, cpp_file_buffer,
	skip_block_comment, skip_line_comment, skip_comment,
	copy_comment, _cpp_skip_hspace, _cpp_skip_rest_of_line,
	_cpp_parse_name, skip_string, parse_string,
	_cpp_parse_assertion, cpp_get_token, cpp_get_non_space_token,
	_cpp_get_directive_token, find_position,
	_cpp_read_and_prescan, _cpp_init_input_buffer): Move here.
	(maybe_macroexpand, _cpp_lex_token): New functions.

	* cpplib.c (SKIP_WHITE_SPACE, eval_if_expr, parse_set_mark,
	parse_goto_mark): Delete.
	(_cpp_handle_eof): New function.
	(_cpp_handle_directive): Rename from handle_directive.
	(_cpp_output_line_command): Rename from output_line_command.
	(do_if, do_elif): Call _cpp_parse_expr directly.
	* cppfiles.c (_cpp_read_include_file): Don't call
	init_input_buffer here.
	* cpphash.c (quote_string): Move here, rename _cpp_quote_string.
	* cppexp.c (_cpp_parse_expr): Diddle parsing_if_directive
	here; pop the token_buffer and skip the rest of the line here.
	* cppinit.c (cpp_start_read): Call _cpp_init_input_buffer
	here.

	* cpphash.h (CPP_RESERVE, CPP_IS_MACRO_BUFFER, ACTIVE_MARK_P):
	Define here.
	(CPP_SET_BUF_MARK, CPP_GOTO_BUF_MARK, CPP_SET_MARK,
	CPP_GOTO_MARK): New macros.
	(_cpp_quote_string, _cpp_parse_name, _cpp_skip_rest_of_line,
	_cpp_skip_hspace, _cpp_parse_assertion, _cpp_lex_token,
	_cpp_read_and_prescan, _cpp_init_input_buffer,
	_cpp_grow_token_buffer, _cpp_get_directive_token,
	_cpp_handle_directive, _cpp_handle_eof,
	_cpp_output_line_command): Prototype them here.
	* cpplib.h (enum cpp_token): Add CPP_MACRO.
	(CPP_RESERVE, get_directive_token, cpp_grow_buffer,
	quote_string, output_line_command): Remove.

From-SVN: r32513
parent 46089b86
2000-03-13 Zack Weinberg <zack@wolery.cumb.org>
* Makefile.in (LIBCPP_OBJS): Add cpplex.o.
(cpplex.o): New target.
* po/POTFILES.in: Add cpplex.c.
* cpplex.c (_cpp_grow_token_buffer, null_cleanup,
cpp_push_buffer, cpp_pop_buffer, cpp_scan_buffer,
cpp_expand_to_buffer, cpp_buf_line_and_col, cpp_file_buffer,
skip_block_comment, skip_line_comment, skip_comment,
copy_comment, _cpp_skip_hspace, _cpp_skip_rest_of_line,
_cpp_parse_name, skip_string, parse_string,
_cpp_parse_assertion, cpp_get_token, cpp_get_non_space_token,
_cpp_get_directive_token, find_position,
_cpp_read_and_prescan, _cpp_init_input_buffer): Move here.
(maybe_macroexpand, _cpp_lex_token): New functions.
* cpplib.c (SKIP_WHITE_SPACE, eval_if_expr, parse_set_mark,
parse_goto_mark): Delete.
(_cpp_handle_eof): New function.
(_cpp_handle_directive): Rename from handle_directive.
(_cpp_output_line_command): Rename from output_line_command.
(do_if, do_elif): Call _cpp_parse_expr directly.
* cppfiles.c (_cpp_read_include_file): Don't call
init_input_buffer here.
* cpphash.c (quote_string): Move here, rename _cpp_quote_string.
* cppexp.c (_cpp_parse_expr): Diddle parsing_if_directive
here; pop the token_buffer and skip the rest of the line here.
* cppinit.c (cpp_start_read): Call _cpp_init_input_buffer
here.
* cpphash.h (CPP_RESERVE, CPP_IS_MACRO_BUFFER, ACTIVE_MARK_P):
Define here.
(CPP_SET_BUF_MARK, CPP_GOTO_BUF_MARK, CPP_SET_MARK,
CPP_GOTO_MARK): New macros.
(_cpp_quote_string, _cpp_parse_name, _cpp_skip_rest_of_line,
_cpp_skip_hspace, _cpp_parse_assertion, _cpp_lex_token,
_cpp_read_and_prescan, _cpp_init_input_buffer,
_cpp_grow_token_buffer, _cpp_get_directive_token,
_cpp_handle_directive, _cpp_handle_eof,
_cpp_output_line_command): Prototype them here.
* cpplib.h (enum cpp_token): Add CPP_MACRO.
(CPP_RESERVE, get_directive_token, cpp_grow_buffer,
quote_string, output_line_command): Remove.
2000-03-13 Bernd Schmidt <bernds@cygnus.co.uk> 2000-03-13 Bernd Schmidt <bernds@cygnus.co.uk>
* stmt.c (expand_end_case): RANGE may be signed, and when checking * stmt.c (expand_end_case): RANGE may be signed, and when checking
......
...@@ -2025,7 +2025,7 @@ cccp.o: cccp.c $(CONFIG_H) intl.h pcp.h version.c config.status system.h \ ...@@ -2025,7 +2025,7 @@ cccp.o: cccp.c $(CONFIG_H) intl.h pcp.h version.c config.status system.h \
-c `echo $(srcdir)/cccp.c | sed 's,^\./,,'` -c `echo $(srcdir)/cccp.c | sed 's,^\./,,'`
LIBCPP_OBJS = cpplib.o cpphash.o cpperror.o cppexp.o cppfiles.o \ LIBCPP_OBJS = cpplib.o cpphash.o cpperror.o cppexp.o cppfiles.o \
cppinit.o cppulp.o mkdeps.o \ cppinit.o cppulp.o cpplex.o mkdeps.o \
prefix.o version.o mbchar.o @extra_cpp_objs@ prefix.o version.o mbchar.o @extra_cpp_objs@
LIBCPP_DEPS = cpplib.h cpphash.h intl.h system.h LIBCPP_DEPS = cpplib.h cpphash.h intl.h system.h
...@@ -2048,6 +2048,7 @@ cppmain.o: cppmain.c $(CONFIG_H) cpplib.h intl.h system.h ...@@ -2048,6 +2048,7 @@ cppmain.o: cppmain.c $(CONFIG_H) cpplib.h intl.h system.h
cppulp.o: cppulp.c $(CONFIG_H) system.h output.h cppulp.o: cppulp.c $(CONFIG_H) system.h output.h
cpperror.o: cpperror.c $(CONFIG_H) $(LIBCPP_DEPS) cpperror.o: cpperror.c $(CONFIG_H) $(LIBCPP_DEPS)
cppexp.o: cppexp.c $(CONFIG_H) $(LIBCPP_DEPS) cppexp.o: cppexp.c $(CONFIG_H) $(LIBCPP_DEPS)
cpplex.o: cpplex.c $(CONFIG_H) $(LIBCPP_DEPS)
cppfiles.o: cppfiles.c $(CONFIG_H) $(LIBCPP_DEPS) $(HASHTAB_H) cppfiles.o: cppfiles.c $(CONFIG_H) $(LIBCPP_DEPS) $(HASHTAB_H)
cpphash.o: cpphash.c $(CONFIG_H) $(LIBCPP_DEPS) $(HASHTAB_H) cpphash.o: cpphash.c $(CONFIG_H) $(LIBCPP_DEPS) $(HASHTAB_H)
cpplib.o: cpplib.c $(CONFIG_H) $(LIBCPP_DEPS) $(HASHTAB_H) mkdeps.h cpplib.o: cpplib.c $(CONFIG_H) $(LIBCPP_DEPS) $(HASHTAB_H) mkdeps.h
......
...@@ -352,12 +352,12 @@ parse_defined (pfile) ...@@ -352,12 +352,12 @@ parse_defined (pfile)
op.op = INT; op.op = INT;
pfile->no_macro_expand++; pfile->no_macro_expand++;
token = get_directive_token (pfile); token = _cpp_get_directive_token (pfile);
if (token == CPP_LPAREN) if (token == CPP_LPAREN)
{ {
paren++; paren++;
CPP_SET_WRITTEN (pfile, old_written); CPP_SET_WRITTEN (pfile, old_written);
token = get_directive_token (pfile); token = _cpp_get_directive_token (pfile);
} }
if (token != CPP_NAME) if (token != CPP_NAME)
...@@ -369,7 +369,7 @@ parse_defined (pfile) ...@@ -369,7 +369,7 @@ parse_defined (pfile)
if (paren) if (paren)
{ {
if (get_directive_token (pfile) != CPP_RPAREN) if (_cpp_get_directive_token (pfile) != CPP_RPAREN)
goto oops; goto oops;
} }
CPP_SET_WRITTEN (pfile, old_written); CPP_SET_WRITTEN (pfile, old_written);
...@@ -419,7 +419,7 @@ lex (pfile, skip_evaluation) ...@@ -419,7 +419,7 @@ lex (pfile, skip_evaluation)
long old_written; long old_written;
old_written = CPP_WRITTEN (pfile); old_written = CPP_WRITTEN (pfile);
token = get_directive_token (pfile); token = _cpp_get_directive_token (pfile);
tok_start = pfile->token_buffer + old_written; tok_start = pfile->token_buffer + old_written;
tok_end = CPP_PWRITTEN (pfile); tok_end = CPP_PWRITTEN (pfile);
...@@ -689,7 +689,10 @@ _cpp_parse_expr (pfile) ...@@ -689,7 +689,10 @@ _cpp_parse_expr (pfile)
register struct operation *top = stack; register struct operation *top = stack;
unsigned int lprio, rprio = 0; unsigned int lprio, rprio = 0;
int skip_evaluation = 0; int skip_evaluation = 0;
long old_written = CPP_WRITTEN (pfile);
int result;
pfile->parsing_if_directive++;
top->rprio = 0; top->rprio = 0;
top->flags = 0; top->flags = 0;
for (;;) for (;;)
...@@ -999,9 +1002,8 @@ _cpp_parse_expr (pfile) ...@@ -999,9 +1002,8 @@ _cpp_parse_expr (pfile)
{ {
if (top != stack) if (top != stack)
cpp_ice (pfile, "unbalanced stack in #if expression"); cpp_ice (pfile, "unbalanced stack in #if expression");
if (stack != init_stack) result = (top->value != 0);
free (stack); goto done;
return (top->value != 0);
} }
top++; top++;
...@@ -1041,7 +1043,12 @@ _cpp_parse_expr (pfile) ...@@ -1041,7 +1043,12 @@ _cpp_parse_expr (pfile)
} }
} }
syntax_error: syntax_error:
_cpp_skip_rest_of_line (pfile);
result = 0;
done:
pfile->parsing_if_directive--;
CPP_SET_WRITTEN (pfile, old_written);
if (stack != init_stack) if (stack != init_stack)
free (stack); free (stack);
return 0; return result;
} }
...@@ -307,7 +307,7 @@ collect_expansion (pfile, arglist) ...@@ -307,7 +307,7 @@ collect_expansion (pfile, arglist)
last -= 2; /* two extra chars for the leading escape */ last -= 2; /* two extra chars for the leading escape */
for (;;) for (;;)
{ {
/* We use cpp_get_token because get_directive_token would /* We use cpp_get_token because _cpp_get_directive_token would
discard whitespace and we can't cope with that yet. Macro discard whitespace and we can't cope with that yet. Macro
expansion is off, so we are guaranteed not to see POP or EOF. */ expansion is off, so we are guaranteed not to see POP or EOF. */
...@@ -570,7 +570,7 @@ collect_formal_parameters (pfile) ...@@ -570,7 +570,7 @@ collect_formal_parameters (pfile)
long old_written; long old_written;
old_written = CPP_WRITTEN (pfile); old_written = CPP_WRITTEN (pfile);
token = get_directive_token (pfile); token = _cpp_get_directive_token (pfile);
if (token != CPP_LPAREN) if (token != CPP_LPAREN)
{ {
cpp_ice (pfile, "first token = %d not %d in collect_formal_parameters", cpp_ice (pfile, "first token = %d not %d in collect_formal_parameters",
...@@ -584,7 +584,7 @@ collect_formal_parameters (pfile) ...@@ -584,7 +584,7 @@ collect_formal_parameters (pfile)
for (;;) for (;;)
{ {
CPP_SET_WRITTEN (pfile, old_written); CPP_SET_WRITTEN (pfile, old_written);
token = get_directive_token (pfile); token = _cpp_get_directive_token (pfile);
switch (token) switch (token)
{ {
case CPP_NAME: case CPP_NAME:
...@@ -660,7 +660,7 @@ collect_formal_parameters (pfile) ...@@ -660,7 +660,7 @@ collect_formal_parameters (pfile)
argv[argc].rest_arg = 1; argv[argc].rest_arg = 1;
token = get_directive_token (pfile); token = _cpp_get_directive_token (pfile);
if (token != CPP_RPAREN) if (token != CPP_RPAREN)
{ {
cpp_error (pfile, "another parameter follows `...'"); cpp_error (pfile, "another parameter follows `...'");
...@@ -826,6 +826,43 @@ static const char * const monthnames[] = ...@@ -826,6 +826,43 @@ static const char * const monthnames[] =
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec",
}; };
/* Place into PFILE a quoted string representing the string SRC.
Caller must reserve enough space in pfile->token_buffer. */
void
_cpp_quote_string (pfile, src)
cpp_reader *pfile;
const char *src;
{
U_CHAR c;
CPP_PUTC_Q (pfile, '\"');
for (;;)
switch ((c = *src++))
{
default:
if (ISPRINT (c))
CPP_PUTC_Q (pfile, c);
else
{
sprintf ((char *)CPP_PWRITTEN (pfile), "\\%03o", c);
CPP_ADJUST_WRITTEN (pfile, 4);
}
break;
case '\"':
case '\\':
CPP_PUTC_Q (pfile, '\\');
CPP_PUTC_Q (pfile, c);
break;
case '\0':
CPP_PUTC_Q (pfile, '\"');
CPP_NUL_TERMINATE_Q (pfile);
return;
}
}
/* /*
* expand things like __FILE__. Place the expansion into the output * expand things like __FILE__. Place the expansion into the output
* buffer *without* rescanning. * buffer *without* rescanning.
...@@ -857,7 +894,7 @@ special_symbol (hp, pfile) ...@@ -857,7 +894,7 @@ special_symbol (hp, pfile)
if (!buf) if (!buf)
buf = ""; buf = "";
CPP_RESERVE (pfile, 3 + 4 * strlen (buf)); CPP_RESERVE (pfile, 3 + 4 * strlen (buf));
quote_string (pfile, buf); _cpp_quote_string (pfile, buf);
return; return;
} }
...@@ -1597,7 +1634,7 @@ _cpp_dump_definition (pfile, sym, len, defn) ...@@ -1597,7 +1634,7 @@ _cpp_dump_definition (pfile, sym, len, defn)
DEFINITION *defn; DEFINITION *defn;
{ {
if (pfile->lineno == 0) if (pfile->lineno == 0)
output_line_command (pfile, same_file); _cpp_output_line_command (pfile, same_file);
CPP_RESERVE (pfile, len + sizeof "#define "); CPP_RESERVE (pfile, len + sizeof "#define ");
CPP_PUTS_Q (pfile, "#define ", sizeof "#define " -1); CPP_PUTS_Q (pfile, "#define ", sizeof "#define " -1);
......
...@@ -217,6 +217,11 @@ extern unsigned char _cpp_IStable[256]; ...@@ -217,6 +217,11 @@ extern unsigned char _cpp_IStable[256];
((BUFFER)->cur < (BUFFER)->rlimit ? *(BUFFER)->cur++ : EOF) ((BUFFER)->cur < (BUFFER)->rlimit ? *(BUFFER)->cur++ : EOF)
#define CPP_FORWARD(BUFFER, N) ((BUFFER)->cur += (N)) #define CPP_FORWARD(BUFFER, N) ((BUFFER)->cur += (N))
/* Make sure PFILE->token_buffer has space for at least N more characters. */
#define CPP_RESERVE(PFILE, N) \
(CPP_WRITTEN (PFILE) + (size_t)(N) > (PFILE)->token_buffer_size \
&& (_cpp_grow_token_buffer (PFILE, N), 0))
/* Append string STR (of length N) to PFILE's output buffer. /* Append string STR (of length N) to PFILE's output buffer.
Assume there is enough space. */ Assume there is enough space. */
#define CPP_PUTS_Q(PFILE, STR, N) \ #define CPP_PUTS_Q(PFILE, STR, N) \
...@@ -242,6 +247,29 @@ extern unsigned char _cpp_IStable[256]; ...@@ -242,6 +247,29 @@ extern unsigned char _cpp_IStable[256];
#define CPP_PEDANTIC(PFILE) \ #define CPP_PEDANTIC(PFILE) \
(CPP_OPTIONS (PFILE)->pedantic && !CPP_BUFFER (pfile)->system_header_p) (CPP_OPTIONS (PFILE)->pedantic && !CPP_BUFFER (pfile)->system_header_p)
/* CPP_IS_MACRO_BUFFER is true if the buffer contains macro expansion.
(Note that it is false while we're expanding macro *arguments*.) */
#define CPP_IS_MACRO_BUFFER(PBUF) ((PBUF)->data != NULL)
/* Remember the current position of PFILE so it may be returned to
after looking ahead a bit.
Note that when you set a mark, you _must_ return to that mark. You
may not forget about it and continue parsing. You may not pop a
buffer with an active mark. You may not call CPP_BUMP_LINE while a
mark is active. */
#define CPP_SET_BUF_MARK(IP) ((IP)->mark = (IP)->cur - (IP)->buf)
#define CPP_GOTO_BUF_MARK(IP) ((IP)->cur = (IP)->buf + (IP)->mark, \
(IP)->mark = -1)
#define CPP_SET_MARK(PFILE) CPP_SET_BUF_MARK(CPP_BUFFER(PFILE))
#define CPP_GOTO_MARK(PFILE) CPP_GOTO_BUF_MARK(CPP_BUFFER(PFILE))
/* ACTIVE_MARK_P is true if there's a live mark in the buffer. */
#define ACTIVE_MARK_P(PFILE) (CPP_BUFFER (PFILE)->mark != -1)
/* Last arg to output_line_command. */
enum file_change_code {same_file, rename_file, enter_file, leave_file};
/* In cpphash.c */ /* In cpphash.c */
extern HASHNODE *_cpp_make_hashnode PARAMS ((const U_CHAR *, size_t, extern HASHNODE *_cpp_make_hashnode PARAMS ((const U_CHAR *, size_t,
enum node_type, enum node_type,
...@@ -257,6 +285,7 @@ extern void _cpp_dump_definition PARAMS ((cpp_reader *, const U_CHAR *, ...@@ -257,6 +285,7 @@ extern void _cpp_dump_definition PARAMS ((cpp_reader *, const U_CHAR *,
long, DEFINITION *)); long, DEFINITION *));
extern int _cpp_compare_defs PARAMS ((cpp_reader *, DEFINITION *, extern int _cpp_compare_defs PARAMS ((cpp_reader *, DEFINITION *,
DEFINITION *)); DEFINITION *));
extern void _cpp_quote_string PARAMS ((cpp_reader *, const char *));
extern void _cpp_macroexpand PARAMS ((cpp_reader *, HASHNODE *)); extern void _cpp_macroexpand PARAMS ((cpp_reader *, HASHNODE *));
extern void _cpp_init_macro_hash PARAMS ((cpp_reader *)); extern void _cpp_init_macro_hash PARAMS ((cpp_reader *));
extern void _cpp_dump_macro_hash PARAMS ((cpp_reader *)); extern void _cpp_dump_macro_hash PARAMS ((cpp_reader *));
...@@ -272,4 +301,24 @@ extern void _cpp_init_include_hash PARAMS ((cpp_reader *)); ...@@ -272,4 +301,24 @@ extern void _cpp_init_include_hash PARAMS ((cpp_reader *));
/* In cppexp.c */ /* In cppexp.c */
extern int _cpp_parse_expr PARAMS ((cpp_reader *)); extern int _cpp_parse_expr PARAMS ((cpp_reader *));
/* In cpplex.c */
extern void _cpp_parse_name PARAMS ((cpp_reader *, int));
extern void _cpp_skip_rest_of_line PARAMS ((cpp_reader *));
extern void _cpp_skip_hspace PARAMS ((cpp_reader *));
extern int _cpp_parse_assertion PARAMS ((cpp_reader *));
extern enum cpp_token _cpp_lex_token PARAMS ((cpp_reader *));
extern long _cpp_read_and_prescan PARAMS ((cpp_reader *, cpp_buffer *,
int, size_t));
extern void _cpp_init_input_buffer PARAMS ((cpp_reader *));
extern void _cpp_grow_token_buffer PARAMS ((cpp_reader *, long));
extern enum cpp_token _cpp_get_directive_token
PARAMS ((cpp_reader *));
/* In cpplib.c */
extern int _cpp_handle_directive PARAMS ((cpp_reader *));
extern void _cpp_handle_eof PARAMS ((cpp_reader *));
extern void _cpp_output_line_command PARAMS ((cpp_reader *,
enum file_change_code));
#endif #endif
...@@ -519,7 +519,7 @@ dump_special_to_buffer (pfile, macro_name) ...@@ -519,7 +519,7 @@ dump_special_to_buffer (pfile, macro_name)
{ {
static const char define_directive[] = "#define "; static const char define_directive[] = "#define ";
int macro_name_length = strlen (macro_name); int macro_name_length = strlen (macro_name);
output_line_command (pfile, same_file); _cpp_output_line_command (pfile, same_file);
CPP_RESERVE (pfile, sizeof(define_directive) + macro_name_length); CPP_RESERVE (pfile, sizeof(define_directive) + macro_name_length);
CPP_PUTS_Q (pfile, define_directive, sizeof(define_directive)-1); CPP_PUTS_Q (pfile, define_directive, sizeof(define_directive)-1);
CPP_PUTS_Q (pfile, macro_name, macro_name_length); CPP_PUTS_Q (pfile, macro_name, macro_name_length);
...@@ -872,6 +872,9 @@ cpp_start_read (pfile, fname) ...@@ -872,6 +872,9 @@ cpp_start_read (pfile, fname)
with a compiler that supports C99 designated initializers. */ with a compiler that supports C99 designated initializers. */
init_IStable (); init_IStable ();
/* Set up the tables used by read_and_prescan. */
_cpp_init_input_buffer (pfile);
/* Set up the include search path now. */ /* Set up the include search path now. */
if (! opts->no_standard_includes) if (! opts->no_standard_includes)
initialize_standard_includes (pfile); initialize_standard_includes (pfile);
...@@ -933,7 +936,7 @@ cpp_start_read (pfile, fname) ...@@ -933,7 +936,7 @@ cpp_start_read (pfile, fname)
counter accordingly. */ counter accordingly. */
pfile->lineno = CPP_BUFFER (pfile)->lineno; pfile->lineno = CPP_BUFFER (pfile)->lineno;
else else
output_line_command (pfile, same_file); _cpp_output_line_command (pfile, same_file);
pfile->only_seen_white = 2; pfile->only_seen_white = 2;
/* The -imacros files can be scanned now, but the -include files /* The -imacros files can be scanned now, but the -include files
...@@ -957,7 +960,7 @@ cpp_start_read (pfile, fname) ...@@ -957,7 +960,7 @@ cpp_start_read (pfile, fname)
while (p) while (p)
{ {
if (cpp_read_file (pfile, p->arg)) if (cpp_read_file (pfile, p->arg))
output_line_command (pfile, enter_file); _cpp_output_line_command (pfile, enter_file);
q = p->next; q = p->next;
free (p); free (p);
......
This diff is collapsed. Click to expand it.
...@@ -40,6 +40,7 @@ enum cpp_token ...@@ -40,6 +40,7 @@ enum cpp_token
CPP_HSPACE, CPP_HSPACE,
CPP_VSPACE, /* newlines and #line directives */ CPP_VSPACE, /* newlines and #line directives */
CPP_NAME, CPP_NAME,
CPP_MACRO,
CPP_NUMBER, CPP_NUMBER,
CPP_CHAR, CPP_CHAR,
CPP_WCHAR, CPP_WCHAR,
...@@ -233,11 +234,6 @@ struct cpp_reader ...@@ -233,11 +234,6 @@ struct cpp_reader
#define CPP_ADJUST_WRITTEN(PFILE,DELTA) ((PFILE)->limit += (DELTA)) #define CPP_ADJUST_WRITTEN(PFILE,DELTA) ((PFILE)->limit += (DELTA))
#define CPP_SET_WRITTEN(PFILE,N) ((PFILE)->limit = (PFILE)->token_buffer + (N)) #define CPP_SET_WRITTEN(PFILE,N) ((PFILE)->limit = (PFILE)->token_buffer + (N))
/* Make sure PFILE->token_buffer has space for at least N more characters. */
#define CPP_RESERVE(PFILE, N) \
(CPP_WRITTEN (PFILE) + (size_t)(N) > (PFILE)->token_buffer_size \
&& (cpp_grow_buffer (PFILE, N), 0))
#define CPP_OPTIONS(PFILE) ((PFILE)->opts) #define CPP_OPTIONS(PFILE) ((PFILE)->opts)
#define CPP_BUFFER(PFILE) ((PFILE)->buffer) #define CPP_BUFFER(PFILE) ((PFILE)->buffer)
...@@ -438,7 +434,6 @@ extern const char *progname; ...@@ -438,7 +434,6 @@ extern const char *progname;
extern int cpp_handle_options PARAMS ((cpp_reader *, int, char **)); extern int cpp_handle_options PARAMS ((cpp_reader *, int, char **));
extern enum cpp_token cpp_get_token PARAMS ((cpp_reader *)); extern enum cpp_token cpp_get_token PARAMS ((cpp_reader *));
extern enum cpp_token cpp_get_non_space_token PARAMS ((cpp_reader *)); extern enum cpp_token cpp_get_non_space_token PARAMS ((cpp_reader *));
extern enum cpp_token get_directive_token PARAMS ((cpp_reader *));
extern void cpp_reader_init PARAMS ((cpp_reader *)); extern void cpp_reader_init PARAMS ((cpp_reader *));
extern void cpp_options_init PARAMS ((cpp_options *)); extern void cpp_options_init PARAMS ((cpp_options *));
...@@ -482,22 +477,15 @@ extern void cpp_pedwarn_with_file_and_line PARAMS ((cpp_reader *, const char *, ...@@ -482,22 +477,15 @@ extern void cpp_pedwarn_with_file_and_line PARAMS ((cpp_reader *, const char *,
extern void cpp_error_from_errno PARAMS ((cpp_reader *, const char *)); extern void cpp_error_from_errno PARAMS ((cpp_reader *, const char *));
extern void cpp_notice_from_errno PARAMS ((cpp_reader *, const char *)); extern void cpp_notice_from_errno PARAMS ((cpp_reader *, const char *));
extern void cpp_grow_buffer PARAMS ((cpp_reader *, long));
extern cpp_buffer *cpp_push_buffer PARAMS ((cpp_reader *, extern cpp_buffer *cpp_push_buffer PARAMS ((cpp_reader *,
const unsigned char *, long)); const unsigned char *, long));
extern cpp_buffer *cpp_pop_buffer PARAMS ((cpp_reader *)); extern cpp_buffer *cpp_pop_buffer PARAMS ((cpp_reader *));
extern int cpp_defined PARAMS ((cpp_reader *, const unsigned char *, int)); extern int cpp_defined PARAMS ((cpp_reader *, const unsigned char *, int));
extern void quote_string PARAMS ((cpp_reader *, const char *));
extern void cpp_expand_to_buffer PARAMS ((cpp_reader *, extern void cpp_expand_to_buffer PARAMS ((cpp_reader *,
const unsigned char *, int)); const unsigned char *, int));
extern void cpp_scan_buffer PARAMS ((cpp_reader *)); extern void cpp_scan_buffer PARAMS ((cpp_reader *));
/* Last arg to output_line_command. */
enum file_change_code {same_file, rename_file, enter_file, leave_file};
extern void output_line_command PARAMS ((cpp_reader *,
enum file_change_code));
/* In cppfiles.c */ /* In cppfiles.c */
extern int cpp_included PARAMS ((cpp_reader *, const char *)); extern int cpp_included PARAMS ((cpp_reader *, const char *));
extern int cpp_read_file PARAMS ((cpp_reader *, const char *)); extern int cpp_read_file PARAMS ((cpp_reader *, const char *));
......
...@@ -594,6 +594,7 @@ cppfiles.c ...@@ -594,6 +594,7 @@ cppfiles.c
cpphash.c cpphash.c
cpphash.h cpphash.h
cppinit.c cppinit.c
cpplex.c
cpplib.c cpplib.c
cpplib.h cpplib.h
cppmain.c cppmain.c
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment