Commit fbb18613 by Jason Merrill

c-lex.c: Sync with C++ frontend.

	* c-lex.c: Sync with C++ frontend.
	(linemode): New variable.
	(parse_float): imag, conversion_errno, and type are output only.
	(yylex): Adjust.  Move initial '.' case into main switch.
	Use linemode.
	(handle_generic_pragma): Just deal with tokens.
	(readescape): Use ISXDIGIT and ISGRAPH.
	* c-parse.in: Add END_OF_LINE token.

	* c-lex.c (lang_init): Generalize.
	(nextchar): Remove.  Replace uses with UNGETC.
	(skip_white_space): Handle linemode here.  Optimize for cpplib.
	(skip_white_space_on_line): Remove.
	(extend_token_buffer_to): New fn.
	(extend_token_buffer): Use it.
	(read_line_number, check_newline): Just deal with tokens.
	(token_getch, token_put_back): New fns.
	(yylex): Use them.  More cpplib optimizations.  Simplify.

	* c-lex.c (init_parse): Set cpp_token to CPP_DIRECTIVE.
	(consume_string): Make this smart about USE_CPPLIB.
	(check_newline): Rewrite to be intelligent about USE_CPPLIB.
	(yylex): Rewrite to be intelligent about USE_CPPLIB.
	Also, clean up cases where we redundantly set token_buffer[0].
	(read_line_number): New fn.
	(ignore_escape_flag): New variable.

From-SVN: r28507
parent 825b4dde
Wed Aug 4 12:53:44 1999 Jason Merrill <jason@yorick.cygnus.com>
* c-lex.c: Sync with C++ frontend.
(linemode): New variable.
(parse_float): imag, conversion_errno, and type are output only.
(yylex): Adjust. Move initial '.' case into main switch.
Use linemode.
(handle_generic_pragma): Just deal with tokens.
(readescape): Use ISXDIGIT and ISGRAPH.
* c-parse.in: Add END_OF_LINE token.
* c-lex.c (lang_init): Generalize.
(nextchar): Remove. Replace uses with UNGETC.
(skip_white_space): Handle linemode here. Optimize for cpplib.
(skip_white_space_on_line): Remove.
(extend_token_buffer_to): New fn.
(extend_token_buffer): Use it.
(read_line_number, check_newline): Just deal with tokens.
(token_getch, token_put_back): New fns.
(yylex): Use them. More cpplib optimizations. Simplify.
Wed Aug 4 12:53:44 1999 Michael Tiemann <tiemann@holodeck.cygnus.com>
Jason Merrill <jason@yorick.cygnus.com>
* c-lex.c (init_parse): Set cpp_token to CPP_DIRECTIVE.
(consume_string): Make this smart about USE_CPPLIB.
(check_newline): Rewrite to be intelligent about USE_CPPLIB.
(yylex): Rewrite to be intelligent about USE_CPPLIB.
Also, clean up cases where we redundantly set token_buffer[0].
(read_line_number): New fn.
(ignore_escape_flag): New variable.
Wed Aug 4 13:12:17 1999 Jeffrey A Law (law@cygnus.com) Wed Aug 4 13:12:17 1999 Jeffrey A Law (law@cygnus.com)
* pa.md (divsi3, udivsi3, modsi3, umodsi3 expanders): Clobber a new * pa.md (divsi3, udivsi3, modsi3, umodsi3 expanders): Clobber a new
......
This source diff could not be displayed because it is too large. You can view the blob instead.
typedef union {long itype; tree ttype; enum tree_code code; typedef union {long itype; tree ttype; enum tree_code code;
char *filename; int lineno; int ends_in_label; } YYSTYPE; char *filename; int lineno; int ends_in_label; } YYSTYPE;
#define IDENTIFIER 257 #define IDENTIFIER 258
#define TYPENAME 258 #define TYPENAME 259
#define SCSPEC 259 #define SCSPEC 260
#define TYPESPEC 260 #define TYPESPEC 261
#define TYPE_QUAL 261 #define TYPE_QUAL 262
#define CONSTANT 262 #define CONSTANT 263
#define STRING 263 #define STRING 264
#define ELLIPSIS 264 #define ELLIPSIS 265
#define SIZEOF 265 #define SIZEOF 266
#define ENUM 266 #define ENUM 267
#define STRUCT 267 #define STRUCT 268
#define UNION 268 #define UNION 269
#define IF 269 #define IF 270
#define ELSE 270 #define ELSE 271
#define WHILE 271 #define WHILE 272
#define DO 272 #define DO 273
#define FOR 273 #define FOR 274
#define SWITCH 274 #define SWITCH 275
#define CASE 275 #define CASE 276
#define DEFAULT 276 #define DEFAULT 277
#define BREAK 277 #define BREAK 278
#define CONTINUE 278 #define CONTINUE 279
#define RETURN 279 #define RETURN 280
#define GOTO 280 #define GOTO 281
#define ASM_KEYWORD 281 #define ASM_KEYWORD 282
#define TYPEOF 282 #define TYPEOF 283
#define ALIGNOF 283 #define ALIGNOF 284
#define ATTRIBUTE 284 #define ATTRIBUTE 285
#define EXTENSION 285 #define EXTENSION 286
#define LABEL 286 #define LABEL 287
#define REALPART 287 #define REALPART 288
#define IMAGPART 288 #define IMAGPART 289
#define VA_ARG 289 #define VA_ARG 290
#define ASSIGN 290 #define END_OF_LINE 291
#define OROR 291 #define ASSIGN 292
#define ANDAND 292 #define OROR 293
#define EQCOMPARE 293 #define ANDAND 294
#define ARITHCOMPARE 294 #define EQCOMPARE 295
#define LSHIFT 295 #define ARITHCOMPARE 296
#define RSHIFT 296 #define LSHIFT 297
#define UNARY 297 #define RSHIFT 298
#define PLUSPLUS 298 #define UNARY 299
#define MINUSMINUS 299 #define PLUSPLUS 300
#define HYPERUNARY 300 #define MINUSMINUS 301
#define POINTSAT 301 #define HYPERUNARY 302
#define INTERFACE 302 #define POINTSAT 303
#define IMPLEMENTATION 303 #define INTERFACE 304
#define END 304 #define IMPLEMENTATION 305
#define SELECTOR 305 #define END 306
#define DEFS 306 #define SELECTOR 307
#define ENCODE 307 #define DEFS 308
#define CLASSNAME 308 #define ENCODE 309
#define PUBLIC 309 #define CLASSNAME 310
#define PRIVATE 310 #define PUBLIC 311
#define PROTECTED 311 #define PRIVATE 312
#define PROTOCOL 312 #define PROTECTED 313
#define OBJECTNAME 313 #define PROTOCOL 314
#define CLASS 314 #define OBJECTNAME 315
#define ALIAS 315 #define CLASS 316
#define OBJC_STRING 316 #define ALIAS 317
#define OBJC_STRING 318
extern YYSTYPE yylval; extern YYSTYPE yylval;
...@@ -138,6 +138,9 @@ end ifc ...@@ -138,6 +138,9 @@ end ifc
%token ATTRIBUTE EXTENSION LABEL %token ATTRIBUTE EXTENSION LABEL
%token REALPART IMAGPART VA_ARG %token REALPART IMAGPART VA_ARG
/* Used in c-lex.c for parsing pragmas. */
%token END_OF_LINE
/* Add precedence rules to solve dangling else s/r conflict */ /* Add precedence rules to solve dangling else s/r conflict */
%nonassoc IF %nonassoc IF
%nonassoc ELSE %nonassoc ELSE
......
...@@ -126,6 +126,9 @@ char *language_string = "GNU C"; ...@@ -126,6 +126,9 @@ char *language_string = "GNU C";
%token ATTRIBUTE EXTENSION LABEL %token ATTRIBUTE EXTENSION LABEL
%token REALPART IMAGPART VA_ARG %token REALPART IMAGPART VA_ARG
/* Used in c-lex.c for parsing pragmas. */
%token END_OF_LINE
/* Add precedence rules to solve dangling else s/r conflict */ /* Add precedence rules to solve dangling else s/r conflict */
%nonassoc IF %nonassoc IF
%nonassoc ELSE %nonassoc ELSE
......
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