Browse Source

CHAR -> CHAR_TOK (avoid conflict with Windows SDK)

David Rose 19 years ago
parent
commit
03c35a63ff

File diff suppressed because it is too large
+ 912 - 547
dtool/src/cppparser/cppBison.cxx.prebuilt


+ 249 - 109
dtool/src/cppparser/cppBison.h.prebuilt

@@ -1,119 +1,259 @@
-#ifndef BISON_Y_TAB_H
-# define BISON_Y_TAB_H
+/* A Bison parser, made by GNU Bison 2.1.  */
 
+/* Skeleton parser for Yacc-like parsing with Bison,
+   Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
 
-#ifndef YYLTYPE
-typedef struct yyltype
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2, or (at your option)
+   any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor,
+   Boston, MA 02110-1301, USA.  */
+
+/* As a special exception, when this file is copied by Bison into a
+   Bison output file, you may use that output file without restriction.
+   This special exception was added by the Free Software Foundation
+   in version 1.24 of Bison.  */
+
+/* Tokens.  */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+   /* Put the tokens into the symbol table, so that GDB and other debuggers
+      know about them.  */
+   enum yytokentype {
+     REAL = 258,
+     INTEGER = 259,
+     CHAR_TOK = 260,
+     STRING = 261,
+     SIMPLE_IDENTIFIER = 262,
+     IDENTIFIER = 263,
+     TYPENAME_IDENTIFIER = 264,
+     SCOPING = 265,
+     TYPEDEFNAME = 266,
+     ELLIPSIS = 267,
+     OROR = 268,
+     ANDAND = 269,
+     EQCOMPARE = 270,
+     NECOMPARE = 271,
+     LECOMPARE = 272,
+     GECOMPARE = 273,
+     LSHIFT = 274,
+     RSHIFT = 275,
+     POINTSAT_STAR = 276,
+     DOT_STAR = 277,
+     UNARY = 278,
+     UNARY_NOT = 279,
+     UNARY_NEGATE = 280,
+     UNARY_MINUS = 281,
+     UNARY_STAR = 282,
+     UNARY_REF = 283,
+     POINTSAT = 284,
+     SCOPE = 285,
+     PLUSPLUS = 286,
+     MINUSMINUS = 287,
+     TIMESEQUAL = 288,
+     DIVIDEEQUAL = 289,
+     MODEQUAL = 290,
+     PLUSEQUAL = 291,
+     MINUSEQUAL = 292,
+     OREQUAL = 293,
+     ANDEQUAL = 294,
+     XOREQUAL = 295,
+     LSHIFTEQUAL = 296,
+     RSHIFTEQUAL = 297,
+     TOKENPASTE = 298,
+     KW_BEGIN_PUBLISH = 299,
+     KW_BOOL = 300,
+     KW_CATCH = 301,
+     KW_CHAR = 302,
+     KW_WCHAR_T = 303,
+     KW_CLASS = 304,
+     KW_CONST = 305,
+     KW_DELETE = 306,
+     KW_DOUBLE = 307,
+     KW_DYNAMIC_CAST = 308,
+     KW_ELSE = 309,
+     KW_END_PUBLISH = 310,
+     KW_ENUM = 311,
+     KW_EXTERN = 312,
+     KW_EXPLICIT = 313,
+     KW_PUBLISHED = 314,
+     KW_FALSE = 315,
+     KW_FLOAT = 316,
+     KW_FRIEND = 317,
+     KW_FOR = 318,
+     KW_GOTO = 319,
+     KW_IF = 320,
+     KW_INLINE = 321,
+     KW_INT = 322,
+     KW_LONG = 323,
+     KW_LONGLONG = 324,
+     KW_MUTABLE = 325,
+     KW_NAMESPACE = 326,
+     KW_NEW = 327,
+     KW_OPERATOR = 328,
+     KW_PRIVATE = 329,
+     KW_PROTECTED = 330,
+     KW_PUBLIC = 331,
+     KW_REGISTER = 332,
+     KW_RETURN = 333,
+     KW_SHORT = 334,
+     KW_SIGNED = 335,
+     KW_SIZEOF = 336,
+     KW_STATIC = 337,
+     KW_STATIC_CAST = 338,
+     KW_STRUCT = 339,
+     KW_TEMPLATE = 340,
+     KW_THROW = 341,
+     KW_TRUE = 342,
+     KW_TRY = 343,
+     KW_TYPEDEF = 344,
+     KW_TYPENAME = 345,
+     KW_UNION = 346,
+     KW_UNSIGNED = 347,
+     KW_USING = 348,
+     KW_VIRTUAL = 349,
+     KW_VOID = 350,
+     KW_VOLATILE = 351,
+     KW_WHILE = 352,
+     START_CPP = 353,
+     START_CONST_EXPR = 354,
+     START_TYPE = 355
+   };
+#endif
+/* Tokens.  */
+#define REAL 258
+#define INTEGER 259
+#define CHAR_TOK 260
+#define STRING 261
+#define SIMPLE_IDENTIFIER 262
+#define IDENTIFIER 263
+#define TYPENAME_IDENTIFIER 264
+#define SCOPING 265
+#define TYPEDEFNAME 266
+#define ELLIPSIS 267
+#define OROR 268
+#define ANDAND 269
+#define EQCOMPARE 270
+#define NECOMPARE 271
+#define LECOMPARE 272
+#define GECOMPARE 273
+#define LSHIFT 274
+#define RSHIFT 275
+#define POINTSAT_STAR 276
+#define DOT_STAR 277
+#define UNARY 278
+#define UNARY_NOT 279
+#define UNARY_NEGATE 280
+#define UNARY_MINUS 281
+#define UNARY_STAR 282
+#define UNARY_REF 283
+#define POINTSAT 284
+#define SCOPE 285
+#define PLUSPLUS 286
+#define MINUSMINUS 287
+#define TIMESEQUAL 288
+#define DIVIDEEQUAL 289
+#define MODEQUAL 290
+#define PLUSEQUAL 291
+#define MINUSEQUAL 292
+#define OREQUAL 293
+#define ANDEQUAL 294
+#define XOREQUAL 295
+#define LSHIFTEQUAL 296
+#define RSHIFTEQUAL 297
+#define TOKENPASTE 298
+#define KW_BEGIN_PUBLISH 299
+#define KW_BOOL 300
+#define KW_CATCH 301
+#define KW_CHAR 302
+#define KW_WCHAR_T 303
+#define KW_CLASS 304
+#define KW_CONST 305
+#define KW_DELETE 306
+#define KW_DOUBLE 307
+#define KW_DYNAMIC_CAST 308
+#define KW_ELSE 309
+#define KW_END_PUBLISH 310
+#define KW_ENUM 311
+#define KW_EXTERN 312
+#define KW_EXPLICIT 313
+#define KW_PUBLISHED 314
+#define KW_FALSE 315
+#define KW_FLOAT 316
+#define KW_FRIEND 317
+#define KW_FOR 318
+#define KW_GOTO 319
+#define KW_IF 320
+#define KW_INLINE 321
+#define KW_INT 322
+#define KW_LONG 323
+#define KW_LONGLONG 324
+#define KW_MUTABLE 325
+#define KW_NAMESPACE 326
+#define KW_NEW 327
+#define KW_OPERATOR 328
+#define KW_PRIVATE 329
+#define KW_PROTECTED 330
+#define KW_PUBLIC 331
+#define KW_REGISTER 332
+#define KW_RETURN 333
+#define KW_SHORT 334
+#define KW_SIGNED 335
+#define KW_SIZEOF 336
+#define KW_STATIC 337
+#define KW_STATIC_CAST 338
+#define KW_STRUCT 339
+#define KW_TEMPLATE 340
+#define KW_THROW 341
+#define KW_TRUE 342
+#define KW_TRY 343
+#define KW_TYPEDEF 344
+#define KW_TYPENAME 345
+#define KW_UNION 346
+#define KW_UNSIGNED 347
+#define KW_USING 348
+#define KW_VIRTUAL 349
+#define KW_VOID 350
+#define KW_VOLATILE 351
+#define KW_WHILE 352
+#define START_CPP 353
+#define START_CONST_EXPR 354
+#define START_TYPE 355
+
+
+
+
+#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
+typedef int YYSTYPE;
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+# define YYSTYPE_IS_TRIVIAL 1
+#endif
+
+
+
+#if ! defined (YYLTYPE) && ! defined (YYLTYPE_IS_DECLARED)
+typedef struct YYLTYPE
 {
   int first_line;
   int first_column;
-
   int last_line;
   int last_column;
-} yyltype;
-
-# define YYLTYPE yyltype
+} YYLTYPE;
+# define yyltype YYLTYPE /* obsolescent; will be withdrawn */
+# define YYLTYPE_IS_DECLARED 1
 # define YYLTYPE_IS_TRIVIAL 1
 #endif
 
-# define	REAL	257
-# define	INTEGER	258
-# define	CHAR	259
-# define	STRING	260
-# define	SIMPLE_IDENTIFIER	261
-# define	IDENTIFIER	262
-# define	TYPENAME_IDENTIFIER	263
-# define	SCOPING	264
-# define	TYPEDEFNAME	265
-# define	ELLIPSIS	266
-# define	OROR	267
-# define	ANDAND	268
-# define	EQCOMPARE	269
-# define	NECOMPARE	270
-# define	LECOMPARE	271
-# define	GECOMPARE	272
-# define	LSHIFT	273
-# define	RSHIFT	274
-# define	POINTSAT_STAR	275
-# define	DOT_STAR	276
-# define	UNARY	277
-# define	UNARY_NOT	278
-# define	UNARY_NEGATE	279
-# define	UNARY_MINUS	280
-# define	UNARY_STAR	281
-# define	UNARY_REF	282
-# define	POINTSAT	283
-# define	SCOPE	284
-# define	PLUSPLUS	285
-# define	MINUSMINUS	286
-# define	TIMESEQUAL	287
-# define	DIVIDEEQUAL	288
-# define	MODEQUAL	289
-# define	PLUSEQUAL	290
-# define	MINUSEQUAL	291
-# define	OREQUAL	292
-# define	ANDEQUAL	293
-# define	XOREQUAL	294
-# define	LSHIFTEQUAL	295
-# define	RSHIFTEQUAL	296
-# define	TOKENPASTE	297
-# define	KW_BEGIN_PUBLISH	298
-# define	KW_BOOL	299
-# define	KW_CATCH	300
-# define	KW_CHAR	301
-# define	KW_WCHAR_T	302
-# define	KW_CLASS	303
-# define	KW_CONST	304
-# define	KW_DELETE	305
-# define	KW_DOUBLE	306
-# define	KW_DYNAMIC_CAST	307
-# define	KW_ELSE	308
-# define	KW_END_PUBLISH	309
-# define	KW_ENUM	310
-# define	KW_EXTERN	311
-# define	KW_EXPLICIT	312
-# define	KW_PUBLISHED	313
-# define	KW_FALSE	314
-# define	KW_FLOAT	315
-# define	KW_FRIEND	316
-# define	KW_FOR	317
-# define	KW_GOTO	318
-# define	KW_IF	319
-# define	KW_INLINE	320
-# define	KW_INT	321
-# define	KW_LONG	322
-# define	KW_LONGLONG	323
-# define	KW_MUTABLE	324
-# define	KW_NAMESPACE	325
-# define	KW_NEW	326
-# define	KW_OPERATOR	327
-# define	KW_PRIVATE	328
-# define	KW_PROTECTED	329
-# define	KW_PUBLIC	330
-# define	KW_REGISTER	331
-# define	KW_RETURN	332
-# define	KW_SHORT	333
-# define	KW_SIGNED	334
-# define	KW_SIZEOF	335
-# define	KW_STATIC	336
-# define	KW_STATIC_CAST	337
-# define	KW_STRUCT	338
-# define	KW_TEMPLATE	339
-# define	KW_THROW	340
-# define	KW_TRUE	341
-# define	KW_TRY	342
-# define	KW_TYPEDEF	343
-# define	KW_TYPENAME	344
-# define	KW_UNION	345
-# define	KW_UNSIGNED	346
-# define	KW_USING	347
-# define	KW_VIRTUAL	348
-# define	KW_VOID	349
-# define	KW_VOLATILE	350
-# define	KW_WHILE	351
-# define	START_CPP	352
-# define	START_CONST_EXPR	353
-# define	START_TYPE	354
-
-
-#endif /* not BISON_Y_TAB_H */
+
+
+

+ 4 - 4
dtool/src/cppparser/cppBison.yxx

@@ -197,7 +197,7 @@ pop_struct() {
 
 %token <u.real> REAL
 %token <u.integer> INTEGER
-%token <u.integer> CHAR
+%token <u.integer> CHAR_TOK
 %token <str> STRING SIMPLE_IDENTIFIER
 %token <u.identifier> IDENTIFIER TYPENAME_IDENTIFIER SCOPING
 %token <u.type> TYPEDEFNAME
@@ -2030,7 +2030,7 @@ element:
         | STRING
 {
 }
-        | CHAR
+        | CHAR_TOK
 {
 }
         | IDENTIFIER
@@ -2482,7 +2482,7 @@ const_operand:
 {
   $$ = new CPPExpression(false);
 }
-        | CHAR
+        | CHAR_TOK
 {
   $$ = new CPPExpression($1);
 }
@@ -2671,7 +2671,7 @@ formal_const_operand:
 {
   $$ = new CPPExpression(false);
 }
-        | CHAR
+        | CHAR_TOK
 {
   $$ = new CPPExpression($1);
 }

+ 1 - 1
dtool/src/cppparser/cppPreprocessor.cxx

@@ -1500,7 +1500,7 @@ get_quoted_char(int c) {
   } else {
     result.u.integer = 0;
   }
-  return CPPToken(CHAR, first_line, first_col, first_file, str, result);
+  return CPPToken(CHAR_TOK, first_line, first_col, first_file, str, result);
 }
 
 ////////////////////////////////////////////////////////////////////

+ 2 - 2
dtool/src/cppparser/cppToken.cxx

@@ -107,8 +107,8 @@ output(ostream &out) const {
     out << "INTEGER " << _lval.u.integer;
     break;
 
-  case CHAR:
-    out << "CHAR " << _lval.u.integer << " = " << _lval.str;
+  case CHAR_TOK:
+    out << "CHAR_TOK " << _lval.u.integer << " = " << _lval.str;
     break;
 
   case STRING:

Some files were not shown because too many files changed in this diff