This commit is contained in:
David Rose
2009-06-14 16:27:44 +00:00
parent 49dfc46215
commit aee00fc3de
16 changed files with 8194 additions and 5805 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -11,6 +11,7 @@
#include "dcParser.h"
#include "dcFile.h"
#include "dcindent.h"
#include "pstrtod.h"
static int yyinput(void); // declared by flex.
@@ -694,7 +695,7 @@ REALNUM ([+-]?(([0-9]+[.])|([0-9]*[.][0-9]+))([eE][+-]?[0-9]+)?)
{REALNUM} {
// A floating-point number.
accept();
dcyylval.u.real = atof(dcyytext);
dcyylval.u.real = patof(dcyytext);
dcyylval.str = dcyytext;
return REAL;
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,9 @@
/* A Bison parser, made by GNU Bison 2.1. */
/* A Bison parser, made by GNU Bison 2.3. */
/* Skeleton parser for Yacc-like parsing with Bison,
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
/* Skeleton interface for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
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
@@ -18,10 +20,18 @@
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. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice, so long as that work isn't itself a
parser generator using the skeleton or a modified version thereof
as a parser skeleton. Alternatively, if you modify or redistribute
the parser skeleton itself, you may (at your option) remove this
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
/* Tokens. */
#ifndef YYTOKENTYPE
@@ -116,7 +126,7 @@
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef int YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
@@ -125,5 +135,3 @@ typedef int YYSTYPE;
extern YYSTYPE dcyylval;

File diff suppressed because it is too large Load Diff

View File

@@ -15,6 +15,7 @@
#include "pnotify.h"
#include "lightMutex.h"
#include "thread.h"
#include "pstrtod.h"
#include <math.h>
@@ -677,7 +678,7 @@ NUMERIC ([+-]?(([0-9]+[.]?)|([0-9]*[.][0-9]+))([eE][+-]?[0-9]+)?)
{NUMERIC} {
// An integer or floating-point number.
accept();
eggyylval._number = atof(eggyytext);
eggyylval._number = patof(eggyytext);
eggyylval._string = yytext;
return EGG_NUMBER;
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,90 +1,231 @@
#define EGG_NUMBER 257
#define EGG_ULONG 258
#define EGG_STRING 259
#define ANIMPRELOAD 260
#define BEZIERCURVE 261
#define BFACE 262
#define BILLBOARD 263
#define BILLBOARDCENTER 264
#define BINORMAL 265
#define BUNDLE 266
#define CLOSED 267
#define COLLIDE 268
#define COMMENT 269
#define COMPONENT 270
#define COORDSYSTEM 271
#define CV 272
#define DART 273
#define DNORMAL 274
#define DRGBA 275
#define DUV 276
#define DXYZ 277
#define DCS 278
#define DISTANCE 279
#define DTREF 280
#define DYNAMICVERTEXPOOL 281
#define EXTERNAL_FILE 282
#define GROUP 283
#define DEFAULTPOSE 284
#define JOINT 285
#define KNOTS 286
#define INCLUDE 287
#define INSTANCE 288
#define LINE 289
#define LOOP 290
#define MATERIAL 291
#define MATRIX3 292
#define MATRIX4 293
#define MODEL 294
#define MREF 295
#define NORMAL 296
#define NURBSCURVE 297
#define NURBSSURFACE 298
#define OBJECTTYPE 299
#define ORDER 300
#define OUTTANGENT 301
#define POINTLIGHT 302
#define POLYGON 303
#define REF 304
#define RGBA 305
#define ROTATE 306
#define ROTX 307
#define ROTY 308
#define ROTZ 309
#define SANIM 310
#define SCALAR 311
#define SCALE 312
#define SEQUENCE 313
#define SHADING 314
#define SWITCH 315
#define SWITCHCONDITION 316
#define TABLE 317
#define TABLE_V 318
#define TAG 319
#define TANGENT 320
#define TEXLIST 321
#define TEXTURE 322
#define TLENGTHS 323
#define TRANSFORM 324
#define TRANSLATE 325
#define TREF 326
#define TRIANGLEFAN 327
#define TRIANGLESTRIP 328
#define TRIM 329
#define TXT 330
#define UKNOTS 331
#define UV 332
#define VKNOTS 333
#define VERTEX 334
#define VERTEXANIM 335
#define VERTEXPOOL 336
#define VERTEXREF 337
#define XFMANIM 338
#define XFMSANIM 339
#define START_EGG 340
#define START_GROUP_BODY 341
#define START_TEXTURE_BODY 342
#define START_PRIMITIVE_BODY 343
/* A Bison parser, made by GNU Bison 2.3. */
/* Skeleton interface for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
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, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice, so long as that work isn't itself a
parser generator using the skeleton or a modified version thereof
as a parser skeleton. Alternatively, if you modify or redistribute
the parser skeleton itself, you may (at your option) remove this
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 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 {
EGG_NUMBER = 258,
EGG_ULONG = 259,
EGG_STRING = 260,
ANIMPRELOAD = 261,
BEZIERCURVE = 262,
BFACE = 263,
BILLBOARD = 264,
BILLBOARDCENTER = 265,
BINORMAL = 266,
BUNDLE = 267,
CLOSED = 268,
COLLIDE = 269,
COMMENT = 270,
COMPONENT = 271,
COORDSYSTEM = 272,
CV = 273,
DART = 274,
DNORMAL = 275,
DRGBA = 276,
DUV = 277,
DXYZ = 278,
DCS = 279,
DISTANCE = 280,
DTREF = 281,
DYNAMICVERTEXPOOL = 282,
EXTERNAL_FILE = 283,
GROUP = 284,
DEFAULTPOSE = 285,
JOINT = 286,
KNOTS = 287,
INCLUDE = 288,
INSTANCE = 289,
LINE = 290,
LOOP = 291,
MATERIAL = 292,
MATRIX3 = 293,
MATRIX4 = 294,
MODEL = 295,
MREF = 296,
NORMAL = 297,
NURBSCURVE = 298,
NURBSSURFACE = 299,
OBJECTTYPE = 300,
ORDER = 301,
OUTTANGENT = 302,
POINTLIGHT = 303,
POLYGON = 304,
REF = 305,
RGBA = 306,
ROTATE = 307,
ROTX = 308,
ROTY = 309,
ROTZ = 310,
SANIM = 311,
SCALAR = 312,
SCALE = 313,
SEQUENCE = 314,
SHADING = 315,
SWITCH = 316,
SWITCHCONDITION = 317,
TABLE = 318,
TABLE_V = 319,
TAG = 320,
TANGENT = 321,
TEXLIST = 322,
TEXTURE = 323,
TLENGTHS = 324,
TRANSFORM = 325,
TRANSLATE = 326,
TREF = 327,
TRIANGLEFAN = 328,
TRIANGLESTRIP = 329,
TRIM = 330,
TXT = 331,
UKNOTS = 332,
UV = 333,
VKNOTS = 334,
VERTEX = 335,
VERTEXANIM = 336,
VERTEXPOOL = 337,
VERTEXREF = 338,
XFMANIM = 339,
XFMSANIM = 340,
START_EGG = 341,
START_GROUP_BODY = 342,
START_TEXTURE_BODY = 343,
START_PRIMITIVE_BODY = 344
};
#endif
/* Tokens. */
#define EGG_NUMBER 258
#define EGG_ULONG 259
#define EGG_STRING 260
#define ANIMPRELOAD 261
#define BEZIERCURVE 262
#define BFACE 263
#define BILLBOARD 264
#define BILLBOARDCENTER 265
#define BINORMAL 266
#define BUNDLE 267
#define CLOSED 268
#define COLLIDE 269
#define COMMENT 270
#define COMPONENT 271
#define COORDSYSTEM 272
#define CV 273
#define DART 274
#define DNORMAL 275
#define DRGBA 276
#define DUV 277
#define DXYZ 278
#define DCS 279
#define DISTANCE 280
#define DTREF 281
#define DYNAMICVERTEXPOOL 282
#define EXTERNAL_FILE 283
#define GROUP 284
#define DEFAULTPOSE 285
#define JOINT 286
#define KNOTS 287
#define INCLUDE 288
#define INSTANCE 289
#define LINE 290
#define LOOP 291
#define MATERIAL 292
#define MATRIX3 293
#define MATRIX4 294
#define MODEL 295
#define MREF 296
#define NORMAL 297
#define NURBSCURVE 298
#define NURBSSURFACE 299
#define OBJECTTYPE 300
#define ORDER 301
#define OUTTANGENT 302
#define POINTLIGHT 303
#define POLYGON 304
#define REF 305
#define RGBA 306
#define ROTATE 307
#define ROTX 308
#define ROTY 309
#define ROTZ 310
#define SANIM 311
#define SCALAR 312
#define SCALE 313
#define SEQUENCE 314
#define SHADING 315
#define SWITCH 316
#define SWITCHCONDITION 317
#define TABLE 318
#define TABLE_V 319
#define TAG 320
#define TANGENT 321
#define TEXLIST 322
#define TEXTURE 323
#define TLENGTHS 324
#define TRANSFORM 325
#define TRANSLATE 326
#define TREF 327
#define TRIANGLEFAN 328
#define TRIANGLESTRIP 329
#define TRIM 330
#define TXT 331
#define UKNOTS 332
#define UV 333
#define VKNOTS 334
#define VERTEX 335
#define VERTEXANIM 336
#define VERTEXPOOL 337
#define VERTEXREF 338
#define XFMANIM 339
#define XFMSANIM 340
#define START_EGG 341
#define START_GROUP_BODY 342
#define START_TEXTURE_BODY 343
#define START_PRIMITIVE_BODY 344
#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
extern YYSTYPE eggyylval;

View File

@@ -15,6 +15,7 @@
#include "luse.h"
#include "lmatrix.h"
#include "compose_matrix.h"
#include "pstrtod.h"
#include "pnotify.h"
#include <stdlib.h>
@@ -115,10 +116,10 @@ int main(int argc, char *argv[]) {
LVecBase3f scale(1.0f, 1.0f, 1.0f);
if (argc > 3) {
hpr.set(atof(argv[1]), atof(argv[2]), atof(argv[3]));
hpr.set(patof(argv[1]), patof(argv[2]), patof(argv[3]));
}
if (argc > 6) {
scale.set(atof(argv[4]), atof(argv[5]), atof(argv[6]));
scale.set(patof(argv[4]), patof(argv[5]), patof(argv[6]));
}
cerr << "< hpr = " << hpr << " scale = " << scale << "\n";

View File

@@ -14,6 +14,7 @@
#include "datagram_ui.h"
#include "datagramIterator.h"
#include "pstrtod.h"
#include <string>
#include <stdlib.h>
@@ -57,7 +58,7 @@ operator >> (istream &in, NetDatagram &datagram) {
while (p < line.length() && isdigit(line[p])) {
p++;
}
double num = atof(line.substr(start, p - start).c_str());
double num = patof(line.substr(start, p - start).c_str());
datagram.add_int8(DE_float64);
datagram.add_float64(num);
} else {

View File

@@ -23,6 +23,7 @@
#include "pointerTo.h"
#include "referenceCount.h"
#include "trueClock.h"
#include "pstrtod.h"
#ifdef WIN32_VC
// Under Windows, the rand() function seems to return a sequence
@@ -133,7 +134,7 @@ main(int argc, char *argv[]) {
double has_run_time = false;
double run_time = 0.0;
if (argc > 1) {
run_time = atof(argv[1]);
run_time = patof(argv[1]);
cerr << "Running for " << run_time << " seconds\n";
has_run_time = true;
} else {

View File

@@ -14,6 +14,7 @@
#include "string_utils.h"
#include "textEncoder.h"
#include "pstrtod.h"
#include <ctype.h>
@@ -370,7 +371,7 @@ double
string_to_double(const string &str, string &tail) {
const char *nptr = str.c_str();
char *endptr;
double result = strtod(nptr, &endptr);
double result = pstrtod(nptr, &endptr);
tail = endptr;
return result;
}

File diff suppressed because it is too large Load Diff

View File

@@ -28,6 +28,7 @@
#include "vrmlNode.h"
#include "vrmlParser.h"
#include "pnotify.h"
#include "pstrtod.h"
static int yyinput(void); // declared by flex.
extern "C" int vrmlyywrap();
@@ -160,13 +161,13 @@ int extract_int() {
}
double extract_float() {
return atof(yytext);
return patof(yytext);
}
void extract_vec(double vec[], int num_elements) {
char *p = yytext;
for (int i = 0; i < num_elements; i++) {
vec[i] = strtod(p, &p);
vec[i] = pstrtod(p, &p);
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -1,7 +1,9 @@
/* A Bison parser, made by GNU Bison 2.0. */
/* A Bison parser, made by GNU Bison 2.3. */
/* Skeleton parser for Yacc-like parsing with Bison,
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
/* Skeleton interface for Bison's Yacc-like parsers in C
Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006
Free Software Foundation, Inc.
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
@@ -15,13 +17,21 @@
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., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
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. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice, so long as that work isn't itself a
parser generator using the skeleton or a modified version thereof
as a parser skeleton. Alternatively, if you modify or redistribute
the parser skeleton itself, you may (at your option) remove this
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
/* Tokens. */
#ifndef YYTOKENTYPE
@@ -63,6 +73,7 @@
MFNODE = 289
};
#endif
/* Tokens. */
#define IDENTIFIER 258
#define DEF 259
#define USE 260
@@ -99,18 +110,20 @@
#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED)
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
#line 116 "vrmlParser.yxx"
typedef union YYSTYPE {
{
char *string;
VrmlFieldValue fv;
VrmlNode *node;
MFArray *mfarray;
SFNodeRef nodeRef;
VrmlScene *scene;
} YYSTYPE;
/* Line 1318 of yacc.c. */
#line 114 "y.tab.h"
}
/* Line 1529 of yacc.c. */
#line 126 "y.tab.h"
YYSTYPE;
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
# define YYSTYPE_IS_TRIVIAL 1
@@ -118,5 +131,3 @@ typedef union YYSTYPE {
extern YYSTYPE vrmlyylval;