From 58e0537e3cc3fe942629caaf62fb305de5fa9dad Mon Sep 17 00:00:00 2001 From: David Rose Date: Fri, 7 Nov 2008 21:12:42 +0000 Subject: [PATCH] wide interrogate improvements: sequence protocol, MAKE_SEQ, __setitem__, and parameter coercion --- dtool/src/cppparser/Sources.pp | 6 +- dtool/src/cppparser/cppBison.cxx.prebuilt | 10192 +++++++--------- dtool/src/cppparser/cppBison.h.prebuilt | 368 +- dtool/src/cppparser/cppBison.yxx | 7 + dtool/src/cppparser/cppDeclaration.cxx | 10 + dtool/src/cppparser/cppDeclaration.h | 3 + dtool/src/cppparser/cppExpression.cxx | 18 +- dtool/src/cppparser/cppMakeSeq.cxx | 61 + dtool/src/cppparser/cppMakeSeq.h | 48 + dtool/src/cppparser/cppParser_composite1.cxx | 1 + dtool/src/cppparser/cppPreprocessor.cxx | 1 + dtool/src/dtoolbase/dtoolbase.h | 2 + dtool/src/interrogate/functionRemap.cxx | 38 +- dtool/src/interrogate/functionRemap.h | 11 +- dtool/src/interrogate/interfaceMaker.cxx | 76 +- dtool/src/interrogate/interfaceMaker.h | 23 +- .../interfaceMakerPythonNative.cxx | 1055 +- .../interrogate/interfaceMakerPythonNative.h | 181 +- dtool/src/interrogate/typeManager.cxx | 18 + dtool/src/interrogate/typeManager.h | 1 + dtool/src/interrogatedb/py_panda.cxx | 130 +- dtool/src/interrogatedb/py_panda.h | 31 +- dtool/src/pystub/pystub.cxx | 13 + panda/src/chan/animControlCollection.h | 3 + panda/src/chan/animGroup.h | 2 + panda/src/chan/partBundle.h | 1 + panda/src/chan/partGroup.h | 2 + panda/src/collide/collisionFloorMesh.I | 10 +- panda/src/collide/collisionFloorMesh.h | 6 +- panda/src/collide/collisionHandlerEvent.h | 3 + panda/src/collide/collisionHandlerQueue.h | 1 + panda/src/collide/collisionNode.h | 1 + panda/src/collide/collisionPolygon.h | 1 + panda/src/collide/collisionTraverser.h | 1 + panda/src/display/graphicsEngine.h | 1 + panda/src/display/graphicsOutput.h | 2 + panda/src/display/graphicsPipeSelection.h | 1 + panda/src/display/graphicsWindow.h | 1 + panda/src/distort/nonlinearImager.h | 4 + panda/src/downloader/httpChannel.I | 12 +- panda/src/downloader/httpChannel.h | 5 +- panda/src/egg/eggCompositePrimitive.h | 1 + panda/src/egg/eggGroup.h | 2 + panda/src/egg/eggNurbsCurve.h | 1 + panda/src/egg/eggNurbsSurface.h | 2 + panda/src/egg/eggPrimitive.h | 2 + panda/src/egg/eggTextureCollection.h | 1 + panda/src/egg/eggVertexPool.h | 3 +- panda/src/event/asyncTaskCollection.cxx | 11 + panda/src/event/asyncTaskCollection.h | 2 + panda/src/event/asyncTaskManager.h | 1 + panda/src/event/event.h | 1 + panda/src/express/memoryUsagePointers.h | 3 + panda/src/express/multifile.h | 1 + panda/src/express/pointerToArray.I | 13 + panda/src/express/pointerToArray.h | 5 + panda/src/express/virtualFileList.I | 21 + panda/src/express/virtualFileList.h | 6 +- panda/src/gobj/geom.h | 1 + panda/src/gobj/geomPrimitive.h | 1 + panda/src/gobj/geomVertexData.h | 1 + panda/src/gobj/geomVertexFormat.h | 7 + panda/src/gobj/sliderTable.h | 1 + panda/src/gobj/transformBlend.h | 1 + panda/src/gobj/transformBlendTable.h | 1 + panda/src/gobj/transformTable.h | 1 + panda/src/grutil/lineSegs.h | 3 +- panda/src/linmath/lmatrix3_src.I | 117 + panda/src/linmath/lmatrix3_src.h | 34 + panda/src/linmath/lmatrix4_src.I | 117 + panda/src/linmath/lmatrix4_src.h | 34 +- panda/src/linmath/lvecBase2_src.I | 23 + panda/src/linmath/lvecBase2_src.h | 4 + panda/src/linmath/lvecBase3_src.I | 23 + panda/src/linmath/lvecBase3_src.h | 4 + panda/src/linmath/lvecBase4_src.I | 23 + panda/src/linmath/lvecBase4_src.h | 4 + panda/src/mathutil/boundingBox.h | 2 + panda/src/mathutil/boundingHexahedron.h | 2 + panda/src/mathutil/triangulator.h | 1 + panda/src/movies/microphoneAudio.h | 1 + panda/src/movies/webcamVideo.h | 1 + panda/src/ode/odeAMotorJoint.h | 1 + panda/src/ode/odeBody.h | 1 + panda/src/ode/odeJointCollection.cxx | 11 + panda/src/ode/odeJointCollection.h | 2 + panda/src/ode/odeLMotorJoint.h | 1 + panda/src/parametrics/nurbsCurveEvaluator.h | 2 + panda/src/parametrics/nurbsCurveResult.h | 2 + panda/src/parametrics/nurbsSurfaceEvaluator.h | 2 + .../particlesystem/spriteParticleRenderer.h | 1 + panda/src/pgraph/attribNodeRegistry.h | 1 + panda/src/pgraph/camera.h | 1 + panda/src/pgraph/clipPlaneAttrib.h | 2 + panda/src/pgraph/cullBinManager.h | 1 + panda/src/pgraph/geomNode.h | 2 + panda/src/pgraph/internalNameCollection.cxx | 11 + panda/src/pgraph/internalNameCollection.h | 2 + panda/src/pgraph/lightAttrib.h | 2 + panda/src/pgraph/loader.h | 2 + panda/src/pgraph/loaderFileTypeRegistry.h | 1 + panda/src/pgraph/lodNode.h | 2 + panda/src/pgraph/materialCollection.cxx | 11 + panda/src/pgraph/materialCollection.h | 1 + panda/src/pgraph/nodePath.h | 2 + panda/src/pgraph/nodePathCollection.cxx | 11 + panda/src/pgraph/nodePathCollection.h | 2 + panda/src/pgraph/portalNode.h | 1 + panda/src/pgraph/scissorEffect.h | 2 + panda/src/pgraph/texMatrixAttrib.h | 1 + panda/src/pgraph/textureAttrib.h | 3 + panda/src/pgraph/textureCollection.cxx | 11 + panda/src/pgraph/textureCollection.h | 2 + panda/src/pgraph/textureStageCollection.cxx | 12 + panda/src/pgraph/textureStageCollection.h | 2 + panda/src/pgui/pgItem.h | 1 + panda/src/physics/forceNode.h | 1 + panda/src/physics/physical.h | 2 + panda/src/physics/physicalNode.h | 1 + panda/src/physics/physicsObjectCollection.cxx | 12 + panda/src/physics/physicsObjectCollection.h | 3 +- panda/src/pnmimage/pnmFileType.h | 1 + panda/src/pnmimage/pnmFileTypeRegistry.h | 1 + panda/src/pstatclient/pStatClient.h | 2 + panda/src/putil/modifierButtons.h | 1 + panda/src/text/dynamicTextFont.h | 1 + panda/src/tform/buttonThrower.h | 1 + panda/src/tform/mouseWatcher.h | 1 + panda/src/tform/mouseWatcherGroup.h | 1 + 129 files changed, 6614 insertions(+), 6360 deletions(-) create mode 100644 dtool/src/cppparser/cppMakeSeq.cxx create mode 100644 dtool/src/cppparser/cppMakeSeq.h diff --git a/dtool/src/cppparser/Sources.pp b/dtool/src/cppparser/Sources.pp index e2b1cddfd8..24dd507c64 100644 --- a/dtool/src/cppparser/Sources.pp +++ b/dtool/src/cppparser/Sources.pp @@ -15,7 +15,8 @@ cppExpressionParser.h cppExtensionType.h cppFile.h \ cppFunctionGroup.h cppFunctionType.h cppGlobals.h \ cppIdentifier.h cppInstance.h cppInstanceIdentifier.h \ - cppManifest.h cppNameComponent.h cppNamespace.h \ + cppMakeSeq.h cppManifest.h \ + cppNameComponent.h cppNamespace.h \ cppParameterList.h cppParser.h cppPointerType.h \ cppPreprocessor.h cppReferenceType.h cppScope.h \ cppSimpleType.h cppStructType.h cppTBDType.h \ @@ -29,7 +30,8 @@ cppEnumType.cxx cppExpression.cxx cppExpressionParser.cxx \ cppExtensionType.cxx cppFile.cxx cppFunctionGroup.cxx \ cppFunctionType.cxx cppGlobals.cxx cppIdentifier.cxx \ - cppInstance.cxx cppInstanceIdentifier.cxx cppManifest.cxx \ + cppInstance.cxx cppInstanceIdentifier.cxx \ + cppMakeSeq.cxx cppManifest.cxx \ cppNameComponent.cxx cppNamespace.cxx cppParameterList.cxx \ cppParser.cxx cppPointerType.cxx cppPreprocessor.cxx \ cppReferenceType.cxx cppScope.cxx cppSimpleType.cxx \ diff --git a/dtool/src/cppparser/cppBison.cxx.prebuilt b/dtool/src/cppparser/cppBison.cxx.prebuilt index 0273b7dbc2..cc37479c78 100644 --- a/dtool/src/cppparser/cppBison.cxx.prebuilt +++ b/dtool/src/cppparser/cppBison.cxx.prebuilt @@ -1,271 +1,119 @@ -/* A Bison parser, made by GNU Bison 2.0. */ -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +/* A Bison parser, made from cppBison.yxx + by GNU Bison version 1.28 */ - 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. +#define YYBISON 1 /* Identify Bison output. */ - 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, 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. */ - -/* Written by Richard Stallman by simplifying the original so called - ``semantic'' parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 1 - -/* Using locations. */ -#define YYLSP_NEEDED 1 - -/* Substitute the variable and function names. */ #define yyparse cppyyparse -#define yylex cppyylex +#define yylex cppyylex #define yyerror cppyyerror -#define yylval cppyylval -#define yychar cppyychar +#define yylval cppyylval +#define yychar cppyychar #define yydebug cppyydebug #define yynerrs cppyynerrs -#define yylloc cppyylloc +#define YYLSP_NEEDED -/* 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_BLOCKING = 300, - KW_BOOL = 301, - KW_CATCH = 302, - KW_CHAR = 303, - KW_WCHAR_T = 304, - KW_CLASS = 305, - KW_CONST = 306, - KW_DELETE = 307, - KW_DOUBLE = 308, - KW_DYNAMIC_CAST = 309, - KW_ELSE = 310, - KW_END_PUBLISH = 311, - KW_ENUM = 312, - KW_EXTERN = 313, - KW_EXPLICIT = 314, - KW_PUBLISHED = 315, - KW_FALSE = 316, - KW_FLOAT = 317, - KW_FRIEND = 318, - KW_FOR = 319, - KW_GOTO = 320, - KW_IF = 321, - KW_INLINE = 322, - KW_INT = 323, - KW_LONG = 324, - KW_LONGLONG = 325, - KW_MUTABLE = 326, - KW_NAMESPACE = 327, - KW_NEW = 328, - KW_OPERATOR = 329, - KW_PRIVATE = 330, - KW_PROTECTED = 331, - KW_PUBLIC = 332, - KW_REGISTER = 333, - KW_RETURN = 334, - KW_SHORT = 335, - KW_SIGNED = 336, - KW_SIZEOF = 337, - KW_STATIC = 338, - KW_STATIC_CAST = 339, - KW_STRUCT = 340, - KW_TEMPLATE = 341, - KW_THROW = 342, - KW_TRUE = 343, - KW_TRY = 344, - KW_TYPEDEF = 345, - KW_TYPENAME = 346, - KW_UNION = 347, - KW_UNSIGNED = 348, - KW_USING = 349, - KW_VIRTUAL = 350, - KW_VOID = 351, - KW_VOLATILE = 352, - KW_WHILE = 353, - START_CPP = 354, - START_CONST_EXPR = 355, - START_TYPE = 356 - }; -#endif -#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_BLOCKING 300 -#define KW_BOOL 301 -#define KW_CATCH 302 -#define KW_CHAR 303 -#define KW_WCHAR_T 304 -#define KW_CLASS 305 -#define KW_CONST 306 -#define KW_DELETE 307 -#define KW_DOUBLE 308 -#define KW_DYNAMIC_CAST 309 -#define KW_ELSE 310 -#define KW_END_PUBLISH 311 -#define KW_ENUM 312 -#define KW_EXTERN 313 -#define KW_EXPLICIT 314 -#define KW_PUBLISHED 315 -#define KW_FALSE 316 -#define KW_FLOAT 317 -#define KW_FRIEND 318 -#define KW_FOR 319 -#define KW_GOTO 320 -#define KW_IF 321 -#define KW_INLINE 322 -#define KW_INT 323 -#define KW_LONG 324 -#define KW_LONGLONG 325 -#define KW_MUTABLE 326 -#define KW_NAMESPACE 327 -#define KW_NEW 328 -#define KW_OPERATOR 329 -#define KW_PRIVATE 330 -#define KW_PROTECTED 331 -#define KW_PUBLIC 332 -#define KW_REGISTER 333 -#define KW_RETURN 334 -#define KW_SHORT 335 -#define KW_SIGNED 336 -#define KW_SIZEOF 337 -#define KW_STATIC 338 -#define KW_STATIC_CAST 339 -#define KW_STRUCT 340 -#define KW_TEMPLATE 341 -#define KW_THROW 342 -#define KW_TRUE 343 -#define KW_TRY 344 -#define KW_TYPEDEF 345 -#define KW_TYPENAME 346 -#define KW_UNION 347 -#define KW_UNSIGNED 348 -#define KW_USING 349 -#define KW_VIRTUAL 350 -#define KW_VOID 351 -#define KW_VOLATILE 352 -#define KW_WHILE 353 -#define START_CPP 354 -#define START_CONST_EXPR 355 -#define START_TYPE 356 +#define REAL 257 +#define INTEGER 258 +#define CHAR_TOK 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_BLOCKING 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_MAKE_SEQ 325 +#define KW_MUTABLE 326 +#define KW_NAMESPACE 327 +#define KW_NEW 328 +#define KW_OPERATOR 329 +#define KW_PRIVATE 330 +#define KW_PROTECTED 331 +#define KW_PUBLIC 332 +#define KW_REGISTER 333 +#define KW_RETURN 334 +#define KW_SHORT 335 +#define KW_SIGNED 336 +#define KW_SIZEOF 337 +#define KW_STATIC 338 +#define KW_STATIC_CAST 339 +#define KW_STRUCT 340 +#define KW_TEMPLATE 341 +#define KW_THROW 342 +#define KW_TRUE 343 +#define KW_TRY 344 +#define KW_TYPEDEF 345 +#define KW_TYPENAME 346 +#define KW_UNION 347 +#define KW_UNSIGNED 348 +#define KW_USING 349 +#define KW_VIRTUAL 350 +#define KW_VOID 351 +#define KW_VOLATILE 352 +#define KW_WHILE 353 +#define START_CPP 354 +#define START_CONST_EXPR 355 +#define START_TYPE 356 - - - -/* Copy the first part of user declarations. */ #line 6 "cppBison.yxx" @@ -278,6 +126,7 @@ #include "cppEnumType.h" #include "cppFunctionType.h" #include "cppTBDType.h" +#include "cppMakeSeq.h" #include "cppParameterList.h" #include "cppInstance.h" #include "cppClassTemplateParameter.h" @@ -453,2167 +302,1720 @@ pop_struct() { } +#ifndef YYLTYPE +typedef + struct yyltype + { + int timestamp; + int first_line; + int first_column; + int last_line; + int last_column; + char *text; + } + yyltype; -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 +#define YYLTYPE yyltype #endif -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 +#include + +#ifndef __cplusplus +#ifndef __STDC__ +#define const +#endif +#endif + + + +#define YYFINAL 951 +#define YYFLAG -32768 +#define YYNTBASE 127 + +#define YYTRANSLATE(x) ((unsigned)(x) <= 356 ? yytranslate[x] : 220) + +static const short yytranslate[] = { 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 125, 2, 2, 2, 118, 111, 2, 121, + 123, 116, 114, 104, 115, 120, 117, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 106, 105, 112, + 107, 113, 108, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 122, 2, 126, 110, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 103, 109, 124, 119, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 1, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, + 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, + 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, + 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, + 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, + 97, 98, 99, 100, 101, 102 +}; + +#if YYDEBUG != 0 +static const short yyprhs[] = { 0, + 0, 3, 6, 9, 11, 14, 17, 19, 23, 28, + 29, 35, 37, 39, 41, 43, 45, 47, 50, 52, + 54, 57, 60, 63, 66, 76, 77, 81, 83, 86, + 90, 93, 96, 99, 102, 105, 108, 111, 114, 116, + 120, 124, 125, 130, 131, 137, 140, 145, 148, 153, + 154, 159, 160, 166, 170, 173, 178, 181, 186, 187, + 194, 195, 202, 203, 211, 212, 223, 224, 236, 237, + 246, 247, 257, 259, 261, 263, 268, 274, 276, 278, + 280, 282, 284, 286, 288, 290, 292, 294, 296, 298, + 300, 302, 304, 306, 308, 310, 312, 314, 316, 318, + 320, 322, 324, 326, 328, 330, 332, 334, 336, 338, + 340, 342, 344, 347, 350, 352, 354, 356, 358, 359, + 366, 368, 370, 372, 376, 379, 384, 388, 393, 395, + 397, 399, 402, 404, 407, 410, 413, 416, 420, 425, + 429, 433, 434, 441, 443, 445, 447, 451, 454, 456, + 460, 462, 465, 467, 470, 472, 476, 482, 486, 491, + 493, 495, 498, 500, 504, 508, 514, 518, 522, 527, + 529, 531, 533, 535, 538, 541, 544, 548, 553, 555, + 557, 559, 562, 565, 568, 572, 577, 585, 589, 591, + 594, 597, 600, 604, 609, 617, 619, 621, 624, 626, + 628, 630, 632, 635, 638, 640, 642, 645, 647, 649, + 651, 653, 656, 659, 661, 663, 666, 669, 672, 675, + 679, 680, 686, 687, 695, 697, 699, 702, 706, 709, + 712, 715, 719, 723, 727, 731, 735, 739, 740, 746, + 747, 754, 756, 758, 761, 763, 767, 771, 777, 779, + 781, 783, 785, 786, 793, 798, 801, 805, 807, 809, + 811, 813, 815, 817, 819, 821, 823, 825, 827, 829, + 832, 835, 838, 841, 843, 846, 848, 852, 855, 857, + 858, 861, 863, 866, 868, 870, 872, 874, 876, 878, + 880, 882, 884, 886, 888, 890, 892, 894, 896, 898, + 900, 902, 904, 906, 908, 910, 912, 914, 916, 918, + 920, 922, 924, 926, 928, 930, 932, 934, 936, 938, + 940, 942, 944, 946, 948, 950, 952, 954, 956, 958, + 960, 962, 964, 966, 968, 970, 972, 974, 976, 978, + 980, 982, 984, 986, 988, 990, 992, 994, 996, 998, + 1000, 1002, 1004, 1006, 1008, 1010, 1012, 1014, 1016, 1018, + 1020, 1022, 1024, 1026, 1028, 1030, 1032, 1034, 1036, 1038, + 1040, 1042, 1044, 1046, 1048, 1050, 1052, 1054, 1056, 1058, + 1060, 1062, 1064, 1066, 1068, 1070, 1072, 1074, 1078, 1080, + 1082, 1084, 1086, 1088, 1092, 1094, 1099, 1107, 1115, 1120, + 1123, 1126, 1129, 1132, 1135, 1139, 1143, 1147, 1151, 1155, + 1159, 1163, 1167, 1171, 1175, 1179, 1183, 1187, 1191, 1195, + 1201, 1206, 1211, 1215, 1219, 1223, 1227, 1229, 1234, 1242, + 1250, 1255, 1260, 1265, 1270, 1275, 1280, 1285, 1290, 1295, + 1300, 1305, 1310, 1313, 1319, 1322, 1325, 1328, 1331, 1334, + 1338, 1342, 1346, 1350, 1354, 1358, 1362, 1366, 1370, 1374, + 1378, 1382, 1386, 1390, 1394, 1398, 1402, 1408, 1413, 1418, + 1422, 1426, 1430, 1434, 1436, 1438, 1440, 1442, 1444, 1446, + 1448, 1450, 1455, 1463, 1471, 1476, 1479, 1485, 1488, 1491, + 1494, 1497, 1501, 1505, 1509, 1513, 1517, 1521, 1525, 1529, + 1533, 1537, 1541, 1545, 1549, 1553, 1557, 1561, 1565, 1571, + 1576, 1581, 1585, 1589, 1593, 1597, 1599, 1601, 1603, 1605, + 1607, 1609, 1611, 1614, 1617, 1619, 1621, 1623, 1626 +}; + +static const short yyrhs[] = { 100, + 128, 0, 101, 212, 0, 102, 181, 0, 219, 0, + 128, 105, 0, 128, 133, 0, 130, 0, 129, 104, + 130, 0, 217, 121, 209, 123, 0, 0, 136, 103, + 132, 128, 124, 0, 137, 0, 159, 0, 131, 0, + 197, 0, 199, 0, 134, 0, 91, 143, 0, 44, + 0, 56, 0, 60, 106, 0, 78, 106, 0, 77, + 106, 0, 76, 106, 0, 71, 121, 217, 104, 217, + 104, 217, 123, 105, 0, 0, 63, 135, 133, 0, + 219, 0, 136, 58, 0, 136, 58, 218, 0, 136, + 84, 0, 136, 67, 0, 136, 96, 0, 136, 59, + 0, 136, 98, 0, 136, 72, 0, 136, 79, 0, + 136, 45, 0, 138, 0, 136, 179, 105, 0, 136, + 148, 171, 0, 0, 136, 179, 139, 141, 0, 0, + 136, 51, 178, 140, 142, 0, 165, 171, 0, 165, + 170, 104, 141, 0, 165, 171, 0, 165, 170, 104, + 142, 0, 0, 136, 179, 144, 146, 0, 0, 136, + 51, 178, 145, 147, 0, 136, 148, 171, 0, 165, + 171, 0, 165, 170, 104, 146, 0, 165, 171, 0, + 165, 170, 104, 147, 0, 0, 8, 121, 149, 167, + 123, 156, 0, 0, 9, 121, 150, 167, 123, 156, + 0, 0, 119, 217, 121, 151, 167, 123, 156, 0, + 0, 9, 121, 116, 165, 123, 121, 152, 167, 123, + 156, 0, 0, 9, 121, 10, 116, 165, 123, 121, + 153, 167, 123, 156, 0, 0, 75, 178, 175, 121, + 154, 167, 123, 156, 0, 0, 75, 51, 178, 175, + 121, 155, 167, 123, 156, 0, 8, 0, 219, 0, + 51, 0, 156, 88, 121, 123, 0, 156, 88, 121, + 217, 123, 0, 125, 0, 119, 0, 116, 0, 117, + 0, 118, 0, 114, 0, 115, 0, 109, 0, 111, + 0, 110, 0, 13, 0, 14, 0, 15, 0, 16, + 0, 17, 0, 18, 0, 112, 0, 113, 0, 19, + 0, 20, 0, 107, 0, 104, 0, 31, 0, 32, + 0, 33, 0, 34, 0, 35, 0, 36, 0, 37, + 0, 38, 0, 39, 0, 40, 0, 41, 0, 42, + 0, 29, 0, 122, 126, 0, 121, 123, 0, 74, + 0, 52, 0, 137, 0, 159, 0, 0, 87, 160, + 112, 161, 113, 158, 0, 219, 0, 162, 0, 163, + 0, 162, 104, 163, 0, 50, 217, 0, 50, 217, + 107, 181, 0, 164, 176, 169, 0, 51, 164, 176, + 169, 0, 200, 0, 8, 0, 9, 0, 92, 217, + 0, 217, 0, 75, 157, 0, 51, 165, 0, 116, + 165, 0, 111, 165, 0, 10, 116, 165, 0, 165, + 122, 208, 126, 0, 165, 106, 4, 0, 121, 165, + 123, 0, 0, 165, 121, 166, 167, 123, 156, 0, + 219, 0, 12, 0, 168, 0, 168, 104, 12, 0, + 168, 12, 0, 174, 0, 168, 104, 174, 0, 219, + 0, 107, 211, 0, 219, 0, 107, 212, 0, 105, + 0, 103, 204, 124, 0, 106, 129, 103, 204, 124, + 0, 107, 212, 105, 0, 107, 103, 172, 124, 0, + 219, 0, 173, 0, 173, 104, 0, 212, 0, 103, + 172, 124, 0, 173, 104, 212, 0, 173, 104, 103, + 172, 124, 0, 178, 176, 170, 0, 8, 176, 170, + 0, 51, 178, 176, 170, 0, 214, 0, 219, 0, + 8, 0, 9, 0, 51, 175, 0, 116, 175, 0, + 111, 175, 0, 10, 116, 175, 0, 175, 122, 208, + 126, 0, 219, 0, 8, 0, 9, 0, 51, 176, + 0, 116, 176, 0, 111, 176, 0, 10, 116, 176, + 0, 176, 122, 208, 126, 0, 121, 176, 123, 121, + 167, 123, 156, 0, 121, 176, 123, 0, 219, 0, + 51, 177, 0, 116, 177, 0, 111, 177, 0, 10, + 116, 177, 0, 177, 122, 208, 126, 0, 121, 177, + 123, 121, 167, 123, 156, 0, 200, 0, 9, 0, + 92, 217, 0, 182, 0, 184, 0, 189, 0, 191, + 0, 196, 217, 0, 195, 217, 0, 200, 0, 9, + 0, 92, 217, 0, 182, 0, 184, 0, 189, 0, + 191, 0, 196, 217, 0, 195, 217, 0, 200, 0, + 9, 0, 92, 217, 0, 196, 217, 0, 195, 217, + 0, 178, 177, 0, 51, 178, 177, 0, 0, 196, + 103, 183, 128, 124, 0, 0, 196, 217, 185, 186, + 103, 128, 124, 0, 219, 0, 187, 0, 106, 188, + 0, 187, 104, 188, 0, 78, 216, 0, 77, 216, + 0, 76, 216, 0, 96, 78, 216, 0, 96, 77, + 216, 0, 96, 76, 216, 0, 78, 96, 216, 0, + 77, 96, 216, 0, 76, 96, 216, 0, 0, 195, + 103, 190, 193, 124, 0, 0, 195, 217, 103, 192, + 193, 124, 0, 219, 0, 194, 0, 194, 104, 0, + 217, 0, 217, 107, 212, 0, 194, 104, 217, 0, + 194, 104, 217, 107, 212, 0, 57, 0, 50, 0, + 86, 0, 93, 0, 0, 73, 217, 103, 198, 128, + 124, 0, 73, 103, 128, 124, 0, 95, 217, 0, + 95, 73, 217, 0, 201, 0, 202, 0, 203, 0, + 46, 0, 48, 0, 49, 0, 81, 0, 69, 0, + 70, 0, 94, 0, 82, 0, 68, 0, 81, 201, + 0, 69, 201, 0, 94, 201, 0, 82, 201, 0, + 62, 0, 69, 62, 0, 53, 0, 69, 69, 62, + 0, 69, 53, 0, 97, 0, 0, 205, 206, 0, + 219, 0, 206, 207, 0, 3, 0, 4, 0, 6, + 0, 5, 0, 8, 0, 9, 0, 10, 0, 7, + 0, 12, 0, 13, 0, 14, 0, 15, 0, 16, + 0, 17, 0, 18, 0, 19, 0, 20, 0, 21, + 0, 22, 0, 29, 0, 30, 0, 31, 0, 32, + 0, 33, 0, 34, 0, 35, 0, 36, 0, 37, + 0, 38, 0, 39, 0, 40, 0, 41, 0, 42, + 0, 46, 0, 47, 0, 48, 0, 49, 0, 50, + 0, 51, 0, 52, 0, 53, 0, 54, 0, 55, + 0, 57, 0, 58, 0, 59, 0, 61, 0, 62, + 0, 63, 0, 64, 0, 65, 0, 66, 0, 67, + 0, 68, 0, 69, 0, 72, 0, 74, 0, 76, + 0, 77, 0, 78, 0, 60, 0, 79, 0, 80, + 0, 81, 0, 82, 0, 83, 0, 84, 0, 85, + 0, 86, 0, 88, 0, 89, 0, 90, 0, 91, + 0, 92, 0, 93, 0, 94, 0, 96, 0, 97, + 0, 98, 0, 99, 0, 43, 0, 75, 0, 114, + 0, 115, 0, 116, 0, 117, 0, 111, 0, 109, + 0, 110, 0, 125, 0, 119, 0, 107, 0, 118, + 0, 112, 0, 113, 0, 121, 0, 123, 0, 120, + 0, 104, 0, 105, 0, 106, 0, 122, 0, 126, + 0, 108, 0, 103, 206, 124, 0, 219, 0, 212, + 0, 219, 0, 210, 0, 212, 0, 210, 104, 212, + 0, 213, 0, 121, 181, 123, 211, 0, 85, 112, + 181, 113, 121, 210, 123, 0, 54, 112, 181, 113, + 121, 210, 123, 0, 83, 121, 181, 123, 0, 125, + 211, 0, 119, 211, 0, 115, 211, 0, 116, 211, + 0, 111, 211, 0, 211, 116, 211, 0, 211, 117, + 211, 0, 211, 118, 211, 0, 211, 114, 211, 0, + 211, 115, 211, 0, 211, 109, 211, 0, 211, 111, + 211, 0, 211, 13, 211, 0, 211, 14, 211, 0, + 211, 15, 211, 0, 211, 16, 211, 0, 211, 17, + 211, 0, 211, 18, 211, 0, 211, 19, 211, 0, + 211, 20, 211, 0, 211, 108, 211, 106, 211, 0, + 211, 122, 212, 126, 0, 211, 121, 210, 123, 0, + 211, 121, 123, 0, 211, 120, 211, 0, 211, 29, + 211, 0, 121, 210, 123, 0, 213, 0, 121, 181, + 123, 212, 0, 85, 112, 181, 113, 121, 210, 123, + 0, 54, 112, 181, 113, 121, 210, 123, 0, 9, + 121, 209, 123, 0, 68, 121, 209, 123, 0, 48, + 121, 209, 123, 0, 49, 121, 209, 123, 0, 46, + 121, 209, 123, 0, 81, 121, 209, 123, 0, 69, + 121, 209, 123, 0, 94, 121, 209, 123, 0, 82, + 121, 209, 123, 0, 62, 121, 209, 123, 0, 53, + 121, 209, 123, 0, 83, 121, 181, 123, 0, 74, + 180, 0, 74, 180, 121, 209, 123, 0, 125, 212, + 0, 119, 212, 0, 115, 212, 0, 116, 212, 0, + 111, 212, 0, 212, 116, 212, 0, 212, 117, 212, + 0, 212, 118, 212, 0, 212, 114, 212, 0, 212, + 115, 212, 0, 212, 109, 212, 0, 212, 111, 212, + 0, 212, 13, 212, 0, 212, 14, 212, 0, 212, + 15, 212, 0, 212, 16, 212, 0, 212, 17, 212, + 0, 212, 18, 212, 0, 212, 112, 212, 0, 212, + 113, 212, 0, 212, 19, 212, 0, 212, 20, 212, + 0, 212, 108, 212, 106, 212, 0, 212, 122, 212, + 126, 0, 212, 121, 210, 123, 0, 212, 121, 123, + 0, 212, 120, 212, 0, 212, 29, 212, 0, 121, + 210, 123, 0, 4, 0, 89, 0, 61, 0, 5, + 0, 3, 0, 218, 0, 8, 0, 215, 0, 121, + 181, 123, 212, 0, 85, 112, 181, 113, 121, 210, + 123, 0, 54, 112, 181, 113, 121, 210, 123, 0, + 83, 121, 181, 123, 0, 74, 180, 0, 74, 180, + 121, 209, 123, 0, 125, 212, 0, 119, 212, 0, + 115, 212, 0, 111, 212, 0, 214, 116, 212, 0, + 214, 117, 212, 0, 214, 118, 212, 0, 214, 114, + 212, 0, 214, 115, 212, 0, 214, 109, 212, 0, + 214, 111, 212, 0, 214, 13, 212, 0, 214, 14, + 212, 0, 214, 15, 212, 0, 214, 16, 212, 0, + 214, 17, 212, 0, 214, 18, 212, 0, 214, 112, + 212, 0, 214, 113, 212, 0, 214, 19, 212, 0, + 214, 20, 212, 0, 214, 108, 212, 106, 212, 0, + 214, 122, 212, 126, 0, 214, 121, 210, 123, 0, + 214, 121, 123, 0, 214, 120, 212, 0, 214, 29, + 212, 0, 121, 210, 123, 0, 4, 0, 89, 0, + 61, 0, 5, 0, 3, 0, 218, 0, 217, 0, + 196, 217, 0, 92, 217, 0, 8, 0, 9, 0, + 6, 0, 218, 6, 0, 0 +}; + +#endif + +#if YYDEBUG != 0 +static const short yyrline[] = { 0, + 380, 382, 386, 392, 394, 395, 398, 400, 403, 415, + 421, 427, 429, 430, 431, 432, 433, 434, 435, 448, + 457, 461, 469, 473, 477, 484, 492, 499, 504, 508, + 519, 523, 527, 531, 535, 539, 543, 547, 553, 558, + 567, 577, 590, 593, 601, 610, 619, 629, 639, 651, + 664, 667, 675, 678, 691, 700, 710, 720, 731, 738, + 756, 760, 780, 784, 810, 814, 825, 829, 842, 848, + 873, 879, 899, 911, 916, 920, 924, 930, 935, 939, + 943, 947, 951, 955, 959, 963, 967, 971, 975, 979, + 983, 987, 991, 995, 999, 1003, 1007, 1011, 1015, 1019, + 1023, 1027, 1031, 1035, 1039, 1043, 1047, 1051, 1055, 1059, + 1063, 1067, 1071, 1075, 1079, 1083, 1089, 1091, 1094, 1099, + 1105, 1107, 1110, 1117, 1125, 1130, 1134, 1140, 1149, 1154, + 1159, 1164, 1171, 1176, 1190, 1195, 1200, 1205, 1210, 1215, + 1220, 1225, 1229, 1246, 1251, 1256, 1260, 1265, 1272, 1278, + 1285, 1290, 1296, 1301, 1307, 1312, 1316, 1320, 1324, 1330, + 1332, 1333, 1336, 1340, 1341, 1342, 1345, 1351, 1359, 1365, + 1374, 1379, 1383, 1387, 1392, 1397, 1402, 1407, 1414, 1419, + 1423, 1427, 1432, 1437, 1442, 1447, 1452, 1458, 1465, 1470, + 1475, 1480, 1485, 1490, 1495, 1503, 1508, 1513, 1517, 1521, + 1525, 1529, 1533, 1549, 1567, 1572, 1577, 1581, 1585, 1589, + 1593, 1597, 1613, 1631, 1636, 1641, 1645, 1661, 1679, 1686, + 1695, 1710, 1719, 1740, 1749, 1751, 1754, 1756, 1759, 1764, + 1768, 1772, 1776, 1780, 1784, 1788, 1792, 1798, 1803, 1810, + 1815, 1822, 1824, 1825, 1828, 1834, 1839, 1844, 1851, 1858, + 1863, 1867, 1873, 1892, 1896, 1899, 1906, 1914, 1916, 1917, + 1920, 1925, 1929, 1933, 1938, 1943, 1948, 1953, 1958, 1962, + 1967, 1976, 1981, 1988, 1993, 1998, 2002, 2007, 2014, 2024, + 2029, 2034, 2036, 2039, 2043, 2046, 2049, 2052, 2055, 2058, + 2061, 2064, 2064, 2064, 2065, 2065, 2065, 2065, 2066, 2066, + 2066, 2066, 2066, 2067, 2067, 2067, 2068, 2068, 2068, 2068, + 2068, 2069, 2069, 2069, 2069, 2069, 2070, 2070, 2070, 2070, + 2070, 2070, 2071, 2071, 2071, 2071, 2071, 2072, 2072, 2072, + 2073, 2073, 2073, 2073, 2074, 2074, 2074, 2075, 2075, 2075, + 2075, 2075, 2076, 2076, 2076, 2076, 2077, 2077, 2077, 2077, + 2077, 2078, 2078, 2078, 2078, 2078, 2078, 2079, 2079, 2079, + 2079, 2079, 2080, 2080, 2081, 2084, 2084, 2084, 2084, 2084, + 2084, 2084, 2084, 2084, 2084, 2084, 2085, 2085, 2085, 2085, + 2085, 2085, 2085, 2085, 2085, 2085, 2086, 2086, 2089, 2094, + 2100, 2105, 2111, 2116, 2122, 2127, 2131, 2135, 2139, 2143, + 2147, 2151, 2163, 2167, 2171, 2175, 2179, 2183, 2187, 2191, + 2195, 2199, 2203, 2207, 2211, 2215, 2219, 2223, 2227, 2231, + 2235, 2239, 2243, 2247, 2251, 2255, 2262, 2267, 2271, 2275, + 2279, 2286, 2292, 2298, 2304, 2310, 2317, 2324, 2331, 2338, + 2344, 2350, 2354, 2358, 2362, 2366, 2370, 2382, 2386, 2390, + 2394, 2398, 2402, 2406, 2410, 2414, 2418, 2422, 2426, 2430, + 2434, 2438, 2442, 2446, 2450, 2454, 2458, 2462, 2466, 2470, + 2474, 2478, 2482, 2488, 2493, 2497, 2501, 2505, 2509, 2513, + 2526, 2531, 2535, 2539, 2543, 2547, 2551, 2555, 2559, 2563, + 2575, 2579, 2583, 2587, 2591, 2595, 2599, 2603, 2607, 2611, + 2615, 2619, 2623, 2627, 2631, 2635, 2639, 2643, 2647, 2651, + 2655, 2659, 2663, 2667, 2671, 2677, 2682, 2686, 2690, 2694, + 2698, 2704, 2713, 2721, 2743, 2748, 2754, 2759, 2765 +}; +#endif + + +#if YYDEBUG != 0 || defined (YYERROR_VERBOSE) + +static const char * const yytname[] = { "$","error","$undefined.","REAL","INTEGER", +"CHAR_TOK","STRING","SIMPLE_IDENTIFIER","IDENTIFIER","TYPENAME_IDENTIFIER","SCOPING", +"TYPEDEFNAME","ELLIPSIS","OROR","ANDAND","EQCOMPARE","NECOMPARE","LECOMPARE", +"GECOMPARE","LSHIFT","RSHIFT","POINTSAT_STAR","DOT_STAR","UNARY","UNARY_NOT", +"UNARY_NEGATE","UNARY_MINUS","UNARY_STAR","UNARY_REF","POINTSAT","SCOPE","PLUSPLUS", +"MINUSMINUS","TIMESEQUAL","DIVIDEEQUAL","MODEQUAL","PLUSEQUAL","MINUSEQUAL", +"OREQUAL","ANDEQUAL","XOREQUAL","LSHIFTEQUAL","RSHIFTEQUAL","TOKENPASTE","KW_BEGIN_PUBLISH", +"KW_BLOCKING","KW_BOOL","KW_CATCH","KW_CHAR","KW_WCHAR_T","KW_CLASS","KW_CONST", +"KW_DELETE","KW_DOUBLE","KW_DYNAMIC_CAST","KW_ELSE","KW_END_PUBLISH","KW_ENUM", +"KW_EXTERN","KW_EXPLICIT","KW_PUBLISHED","KW_FALSE","KW_FLOAT","KW_FRIEND","KW_FOR", +"KW_GOTO","KW_IF","KW_INLINE","KW_INT","KW_LONG","KW_LONGLONG","KW_MAKE_SEQ", +"KW_MUTABLE","KW_NAMESPACE","KW_NEW","KW_OPERATOR","KW_PRIVATE","KW_PROTECTED", +"KW_PUBLIC","KW_REGISTER","KW_RETURN","KW_SHORT","KW_SIGNED","KW_SIZEOF","KW_STATIC", +"KW_STATIC_CAST","KW_STRUCT","KW_TEMPLATE","KW_THROW","KW_TRUE","KW_TRY","KW_TYPEDEF", +"KW_TYPENAME","KW_UNION","KW_UNSIGNED","KW_USING","KW_VIRTUAL","KW_VOID","KW_VOLATILE", +"KW_WHILE","START_CPP","START_CONST_EXPR","START_TYPE","'{'","','","';'","':'", +"'='","'?'","'|'","'^'","'&'","'<'","'>'","'+'","'-'","'*'","'/'","'%'","'~'", +"'.'","'('","'['","')'","'}'","'!'","']'","grammar","cpp","constructor_inits", +"constructor_init","extern_c","@1","declaration","friend_declaration","@2","storage_class", +"type_like_declaration","multiple_var_declaration","@3","@4","multiple_instance_identifiers", +"multiple_const_instance_identifiers","typedef_declaration","@5","@6","typedef_instance_identifiers", +"typedef_const_instance_identifiers","function_prototype","@7","@8","@9","@10", +"@11","@12","@13","function_post","function_operator","more_template_declaration", +"template_declaration","@14","template_formal_parameters","template_nonempty_formal_parameters", +"template_formal_parameter","template_formal_parameter_type","instance_identifier", +"@15","formal_parameter_list","formal_parameters","template_parameter_maybe_initialize", +"maybe_initialize","maybe_initialize_or_function_body","structure_init","structure_init_body", +"formal_parameter","not_paren_formal_parameter_identifier","formal_parameter_identifier", +"empty_instance_identifier","type","type_decl","predefined_type","full_type", +"anonymous_struct","@16","named_struct","@17","maybe_class_derivation","class_derivation", +"base_specification","anonymous_enum","@18","named_enum","@19","enum_body","enum_body_no_trailing_comma", +"enum_keyword","struct_keyword","namespace_declaration","@20","using_declaration", +"simple_type","simple_int_type","simple_float_type","simple_void_type","code", +"@21","code_block","element","optional_const_expr","optional_const_expr_comma", +"const_expr_comma","no_angle_bracket_const_expr","const_expr","const_operand", +"formal_const_expr","formal_const_operand","class_derivation_name","name","string", +"empty", NULL +}; +#endif + +static const short yyr1[] = { 0, + 127, 127, 127, 128, 128, 128, 129, 129, 130, 132, + 131, 133, 133, 133, 133, 133, 133, 133, 133, 133, + 133, 133, 133, 133, 133, 135, 134, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 136, 136, 137, 137, + 137, 139, 138, 140, 138, 141, 141, 142, 142, 144, + 143, 145, 143, 143, 146, 146, 147, 147, 149, 148, + 150, 148, 151, 148, 152, 148, 153, 148, 154, 148, + 155, 148, 148, 156, 156, 156, 156, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, + 157, 157, 157, 157, 157, 157, 158, 158, 160, 159, + 161, 161, 162, 162, 163, 163, 163, 163, 164, 164, + 164, 164, 165, 165, 165, 165, 165, 165, 165, 165, + 165, 166, 165, 167, 167, 167, 167, 167, 168, 168, + 169, 169, 170, 170, 171, 171, 171, 171, 171, 172, + 172, 172, 173, 173, 173, 173, 174, 174, 174, 174, + 175, 175, 175, 175, 175, 175, 175, 175, 176, 176, + 176, 176, 176, 176, 176, 176, 176, 176, 177, 177, + 177, 177, 177, 177, 177, 178, 178, 178, 178, 178, + 178, 178, 178, 178, 179, 179, 179, 179, 179, 179, + 179, 179, 179, 180, 180, 180, 180, 180, 181, 181, + 183, 182, 185, 184, 186, 186, 187, 187, 188, 188, + 188, 188, 188, 188, 188, 188, 188, 190, 189, 192, + 191, 193, 193, 193, 194, 194, 194, 194, 195, 196, + 196, 196, 198, 197, 197, 199, 199, 200, 200, 200, + 201, 201, 201, 201, 201, 201, 201, 201, 201, 201, + 201, 201, 201, 202, 202, 202, 202, 202, 203, 205, + 204, 206, 206, 207, 207, 207, 207, 207, 207, 207, + 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, + 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, + 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, + 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, + 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, + 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, + 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, + 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, + 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, + 207, 207, 207, 207, 207, 207, 207, 207, 208, 208, + 209, 209, 210, 210, 211, 211, 211, 211, 211, 211, + 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, + 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, + 211, 211, 211, 211, 211, 211, 212, 212, 212, 212, + 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, + 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, + 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, + 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, + 212, 212, 212, 213, 213, 213, 213, 213, 213, 213, + 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, + 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, + 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, + 214, 214, 214, 214, 214, 215, 215, 215, 215, 215, + 215, 216, 216, 216, 217, 217, 218, 218, 219 +}; + +static const short yyr2[] = { 0, + 2, 2, 2, 1, 2, 2, 1, 3, 4, 0, + 5, 1, 1, 1, 1, 1, 1, 2, 1, 1, + 2, 2, 2, 2, 9, 0, 3, 1, 2, 3, + 2, 2, 2, 2, 2, 2, 2, 2, 1, 3, + 3, 0, 4, 0, 5, 2, 4, 2, 4, 0, + 4, 0, 5, 3, 2, 4, 2, 4, 0, 6, + 0, 6, 0, 7, 0, 10, 0, 11, 0, 8, + 0, 9, 1, 1, 1, 4, 5, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 2, 2, 1, 1, 1, 1, 0, 6, + 1, 1, 1, 3, 2, 4, 3, 4, 1, 1, + 1, 2, 1, 2, 2, 2, 2, 3, 4, 3, + 3, 0, 6, 1, 1, 1, 3, 2, 1, 3, + 1, 2, 1, 2, 1, 3, 5, 3, 4, 1, + 1, 2, 1, 3, 3, 5, 3, 3, 4, 1, + 1, 1, 1, 2, 2, 2, 3, 4, 1, 1, + 1, 2, 2, 2, 3, 4, 7, 3, 1, 2, + 2, 2, 3, 4, 7, 1, 1, 2, 1, 1, + 1, 1, 2, 2, 1, 1, 2, 1, 1, 1, + 1, 2, 2, 1, 1, 2, 2, 2, 2, 3, + 0, 5, 0, 7, 1, 1, 2, 3, 2, 2, + 2, 3, 3, 3, 3, 3, 3, 0, 5, 0, + 6, 1, 1, 2, 1, 3, 3, 5, 1, 1, + 1, 1, 0, 6, 4, 2, 3, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, + 2, 2, 2, 1, 2, 1, 3, 2, 1, 0, + 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 3, 1, 1, + 1, 1, 1, 3, 1, 4, 7, 7, 4, 2, + 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, + 4, 4, 3, 3, 3, 3, 1, 4, 7, 7, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 2, 5, 2, 2, 2, 2, 2, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 5, 4, 4, 3, + 3, 3, 3, 1, 1, 1, 1, 1, 1, 1, + 1, 4, 7, 7, 4, 2, 5, 2, 2, 2, + 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 5, 4, + 4, 3, 3, 3, 3, 1, 1, 1, 1, 1, + 1, 1, 2, 2, 1, 1, 1, 2, 0 +}; + +static const short yydefact[] = { 0, + 529, 0, 0, 529, 4, 478, 474, 477, 527, 480, + 0, 0, 0, 0, 0, 0, 476, 0, 0, 0, + 0, 0, 0, 0, 0, 475, 0, 0, 0, 0, + 0, 0, 0, 2, 427, 479, 197, 261, 262, 263, + 250, 0, 276, 249, 274, 269, 265, 266, 264, 268, + 251, 0, 252, 267, 279, 529, 3, 199, 200, 201, + 202, 0, 0, 196, 258, 259, 260, 19, 20, 0, + 26, 0, 0, 0, 0, 0, 119, 529, 0, 5, + 14, 6, 17, 0, 12, 39, 13, 15, 16, 28, + 529, 529, 529, 529, 529, 0, 529, 529, 529, 215, + 0, 443, 0, 0, 214, 529, 529, 0, 0, 529, + 449, 447, 448, 446, 197, 261, 262, 263, 276, 274, + 269, 265, 264, 268, 267, 0, 0, 393, 445, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 528, 529, 278, 275, 265, 271, 265, 270, 273, + 525, 526, 198, 272, 0, 529, 529, 529, 529, 219, + 189, 238, 204, 221, 203, 21, 529, 0, 529, 0, + 24, 23, 22, 0, 0, 18, 0, 256, 73, 206, + 38, 0, 29, 34, 32, 36, 0, 37, 31, 0, + 33, 35, 10, 0, 0, 42, 208, 209, 210, 211, + 0, 0, 205, 0, 392, 391, 0, 0, 0, 0, + 0, 0, 0, 0, 216, 529, 218, 217, 0, 0, + 0, 0, 0, 0, 0, 473, 457, 458, 459, 460, + 461, 462, 465, 466, 472, 0, 455, 456, 463, 464, + 453, 454, 450, 451, 452, 471, 470, 0, 0, 220, + 277, 529, 190, 192, 191, 0, 529, 529, 240, 529, + 529, 27, 0, 529, 253, 529, 0, 0, 50, 257, + 59, 61, 44, 30, 0, 529, 207, 529, 0, 280, + 155, 0, 0, 41, 40, 0, 213, 212, 431, 435, + 433, 434, 441, 0, 440, 432, 437, 0, 436, 439, + 442, 0, 438, 428, 394, 0, 469, 468, 193, 0, + 0, 390, 389, 0, 243, 245, 242, 529, 529, 0, + 0, 226, 225, 0, 255, 529, 130, 131, 0, 0, + 0, 0, 122, 123, 529, 129, 121, 52, 54, 0, + 529, 0, 0, 529, 0, 529, 172, 173, 0, 529, + 529, 529, 0, 171, 529, 63, 0, 529, 0, 7, + 0, 529, 0, 0, 0, 0, 0, 0, 0, 43, + 529, 133, 0, 444, 0, 467, 529, 194, 239, 244, + 0, 0, 222, 0, 0, 0, 0, 227, 529, 0, + 0, 529, 125, 529, 132, 529, 0, 180, 181, 0, + 529, 529, 529, 529, 529, 179, 0, 51, 529, 520, + 516, 519, 529, 145, 0, 0, 518, 0, 0, 0, + 517, 0, 0, 0, 0, 0, 0, 146, 149, 529, + 170, 481, 521, 144, 0, 0, 0, 45, 529, 0, + 529, 174, 176, 175, 69, 529, 11, 529, 156, 281, + 282, 280, 0, 529, 529, 0, 161, 163, 160, 158, + 0, 135, 88, 89, 90, 91, 92, 93, 96, 97, + 112, 100, 101, 102, 103, 104, 105, 106, 107, 108, + 109, 110, 111, 116, 115, 99, 98, 85, 87, 86, + 94, 95, 83, 84, 80, 81, 82, 79, 0, 0, + 78, 134, 137, 136, 0, 0, 0, 142, 529, 0, + 46, 153, 0, 0, 0, 247, 246, 241, 0, 0, + 0, 231, 522, 0, 230, 0, 229, 0, 0, 0, + 529, 228, 0, 254, 0, 529, 0, 117, 120, 118, + 124, 529, 182, 184, 183, 0, 0, 529, 127, 151, + 53, 529, 0, 55, 529, 529, 0, 486, 0, 0, + 491, 490, 489, 0, 0, 488, 529, 148, 0, 529, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 529, 0, 48, 71, 177, + 529, 0, 0, 284, 285, 287, 286, 291, 288, 289, + 290, 292, 293, 294, 295, 296, 297, 298, 299, 300, + 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, + 311, 312, 313, 314, 315, 316, 364, 317, 318, 319, + 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, + 344, 330, 331, 332, 333, 334, 335, 336, 337, 338, + 339, 340, 365, 341, 342, 343, 345, 346, 347, 348, + 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, + 359, 360, 361, 362, 363, 529, 382, 383, 384, 375, + 387, 371, 372, 370, 377, 378, 366, 367, 368, 369, + 376, 374, 381, 379, 385, 380, 373, 386, 283, 0, + 8, 0, 0, 159, 162, 138, 114, 113, 141, 140, + 154, 529, 0, 0, 430, 429, 529, 0, 524, 237, + 523, 236, 235, 234, 233, 232, 224, 0, 126, 128, + 185, 188, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 152, 395, 0, 0, 57, 0, 0, 168, 529, + 0, 529, 0, 0, 0, 515, 75, 60, 74, 147, + 150, 167, 499, 500, 501, 502, 503, 504, 507, 508, + 514, 0, 497, 498, 505, 506, 495, 496, 492, 493, + 494, 513, 512, 0, 0, 0, 65, 62, 0, 529, + 0, 178, 529, 0, 157, 9, 164, 529, 165, 0, + 139, 47, 195, 248, 0, 529, 0, 0, 0, 404, + 402, 403, 401, 0, 0, 400, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 186, 0, 56, 154, + 169, 0, 0, 485, 0, 482, 0, 0, 511, 510, + 67, 529, 49, 0, 529, 64, 388, 0, 529, 25, + 0, 0, 0, 0, 0, 426, 412, 413, 414, 415, + 416, 417, 418, 419, 425, 0, 410, 411, 408, 409, + 405, 406, 407, 424, 423, 0, 0, 58, 0, 487, + 0, 0, 509, 529, 0, 529, 70, 166, 143, 529, + 0, 399, 0, 396, 0, 422, 421, 0, 0, 76, + 0, 0, 529, 72, 187, 0, 0, 420, 484, 483, + 77, 529, 66, 0, 0, 68, 398, 397, 0, 0, + 0 +}; + +static const short yydefgoto[] = { 949, + 4, 369, 370, 81, 288, 82, 83, 177, 84, 85, + 86, 296, 355, 380, 448, 186, 350, 417, 418, 561, + 205, 351, 354, 458, 872, 914, 611, 810, 778, 512, + 549, 87, 184, 342, 343, 344, 345, 381, 732, 437, + 438, 559, 520, 294, 466, 467, 439, 363, 415, 170, + 56, 206, 102, 57, 58, 270, 59, 271, 331, 332, + 398, 60, 268, 61, 328, 324, 325, 62, 63, 88, + 336, 89, 64, 65, 66, 67, 367, 368, 460, 719, + 321, 214, 215, 762, 128, 35, 441, 442, 532, 382, + 36, 216 +}; + +static const short yypact[] = { 36, +-32768, 2006, 2974, 437,-32768,-32768,-32768,-32768,-32768,-32768, + -51, -37, -17, -15, 39, 61,-32768, 59, 65, 75, + 3074, 104, 122, 127, 167,-32768, 151, 2006, 2006, 2006, + 2006, 1199, 2006, 2209,-32768, 103,-32768,-32768,-32768,-32768, +-32768, 3124,-32768,-32768,-32768,-32768, 1189,-32768, 1937, 1937, +-32768, 26,-32768, 1937,-32768, 133,-32768,-32768,-32768,-32768, +-32768, 19, 43,-32768,-32768,-32768,-32768,-32768,-32768, 162, +-32768, 163, 58, 180, 185, 191,-32768,-32768, 45,-32768, +-32768,-32768,-32768, 2342,-32768,-32768,-32768,-32768,-32768,-32768, + 2006, 2006, 2006, 2006, 2006, 2974, 2006, 2006, 2006,-32768, + 26, 200, 26, 26,-32768, 2006, 2006, 2974, 2974, 2006, + 156, 156, 156, 156, -51, -37, -17, -15, 39, 59, + 65, 1589, 1385, 1676, 1763, 177, -63, 2209, 156, 2006, + 2006, 2006, 2006, 2006, 2006, 2006, 2006, 2006, 2006, 2006, + 2006, 2006, 2006, 2006, 2006, 2006, 2006, 2006, 2006, 1484, + 2006,-32768, 133,-32768,-32768, 1850,-32768, 1937,-32768,-32768, +-32768,-32768,-32768,-32768, 208, 133, 133, 133, 133, 203, +-32768,-32768, 223,-32768, -44,-32768, 2728, 26,-32768, 227, +-32768,-32768,-32768, 222, 2398,-32768, 26,-32768, 224, 225, +-32768, 3124, 334,-32768,-32768,-32768, 3024,-32768,-32768, 26, +-32768,-32768,-32768, 26, 212, 243,-32768,-32768,-32768,-32768, + 19, 43,-32768, 228, 248,-32768, 234, 240, 242, 245, + 256, 247, 249, 251,-32768, 2006,-32768,-32768, 252, 253, + 261, 266, 268, 2006, 2006,-32768, 2594, 2718, 2791, 2791, + 519, 519, 806, 806,-32768, 784, 2733, 661, 519, 519, + 221, 221, 156, 156, 156,-32768,-32768, -47, 2095, 203, +-32768, 133, 203, 203, 203, -10, 2006, 26,-32768,-32768, + 293,-32768, 296, 3151,-32768, 2879, 3124, 212,-32768,-32768, +-32768, 15,-32768, 103, 3124, 147,-32768,-32768, 281,-32768, +-32768, 26, 1571,-32768,-32768, 120, 223, -44,-32768,-32768, +-32768,-32768,-32768, 283,-32768,-32768,-32768, 284,-32768,-32768, +-32768, 300,-32768, 156, 2209, 2006,-32768,-32768, 203, 305, + 301, 2209,-32768, 304, 325, 327,-32768, 26, 3176, 218, + 329, 331,-32768, 26,-32768,-32768,-32768,-32768, 26, 2266, + 26, 332, 336,-32768, 124,-32768,-32768,-32768,-32768, 120, + 1294, 320, 120, 1294, 120, 147,-32768,-32768, 322, 147, + 147, 147, 41,-32768, 3201,-32768, 335,-32768, 148,-32768, + 326, 1658, 1214, 328, 120, 2264, 120, 120, 120,-32768, + 116,-32768, 2006,-32768, 2006, 2209, 1294,-32768,-32768, 26, + 2006, 337,-32768, 434, 694, 734, 179,-32768,-32768, 218, + 345, 3226, 349, 124,-32768, 371, 2879,-32768,-32768, 346, + 124, 124, 124, 124, -75,-32768, 120,-32768, 116,-32768, +-32768,-32768, 124,-32768, 3124, 351,-32768, 3074, 347, 354, +-32768, 2006, 2006, 2006, 1199, 2006, 344, 10,-32768, 124, + 2540,-32768, 103,-32768, 120, 187, 348,-32768, 116, 138, + 147, 350, 350, 350,-32768, 2006,-32768, 1294,-32768, 1075, +-32768,-32768, 26, 2006, 1658, 352, 365, 2209,-32768,-32768, + 120, 190,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 357, 356, +-32768,-32768, 190, 190, 260, 184, 1571,-32768, 2006, 366, +-32768,-32768, -35, -22, 360, 367, 2209,-32768, 26, 323, + 26,-32768,-32768, 323,-32768, 323,-32768, 323, 323, 323, + 3251,-32768, 26,-32768, 2974, -75, 2454,-32768,-32768,-32768, +-32768, 124, 368, 368, 368, 183, 2018, 2006,-32768,-32768, +-32768, 116, 384,-32768, -58, 124, 2974, 370, 2974, 2974, + 156, 156, 156, 369, -13, 156, 443,-32768, 1389, -58, + 2006, 2006, 2006, 2006, 2006, 2006, 2006, 2006, 2006, 2006, + 2006, 2006, 2006, 2006, 2006, 2006, 2006, 2006, 2006, 2006, + 1745, 2006, 400, 491, 375, 443, 394,-32768,-32768, 350, + 1294, 373, 381,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, 383, +-32768, 389, 392,-32768, 1832, 190,-32768,-32768,-32768,-32768, + 1214, 1294, 393, 120,-32768,-32768, 443, 2006,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768, 406,-32768,-32768, + 368, 410, 421, 416, 431, 2018, 2018, 2018, 2018, 1199, + 2018, 2578,-32768, 420, 445,-32768, 120, 2006,-32768, -58, + 439, 2006, 427, 441, 2006,-32768,-32768, 467,-32768,-32768, +-32768,-32768, 2594, 2718, 2791, 2791, 519, 519, 806, 806, +-32768, 1407, 2733, 661, 519, 519, 221, 221, 156, 156, + 156,-32768,-32768, -12, 2131, 438,-32768, 467, 120, 1294, + 440,-32768, 443, 939,-32768,-32768,-32768, 1658, 2209, 444, +-32768,-32768, 467, 2209, 457, 1294, 2974, 2974, 2974, 168, + 168, 168, 168, 446, 4, 168, 2018, 2018, 2018, 2018, + 2018, 2018, 2018, 2018, 2018, 2018, 2018, 2018, 2018, 2018, + 2018, 2018, 2018, 2018, 1919, 2006,-32768, 120,-32768, 2209, +-32768, 447, 449,-32768, 461, 156, 462, 2006,-32768,-32768, +-32768, 1294,-32768, 466, 443, 467,-32768, 460, 443,-32768, + 469, 472, 471, 477, 2018,-32768, 2610, 2748, 2897, 2897, + 1476, 1476, 954, 954,-32768, 2561, 2763, 2778, 272, 272, + 168, 168, 168,-32768,-32768, 35, 2150,-32768, 2006,-32768, + 2006, 22, 2209, 1294, 475, 443, 467,-32768, 467, 443, + 478,-32768, 479, 168, 2018,-32768,-32768, 47, 123,-32768, + 480, 483, 443, 467, 467, 2006, 2006, 2578,-32768,-32768, +-32768, 443, 467, 160, 176, 467,-32768,-32768, 570, 601, +-32768 +}; + +static const short yypgoto[] = {-32768, + -146,-32768, 139,-32768,-32768, 442,-32768,-32768, -59, 202, +-32768,-32768,-32768, -123, -192,-32768,-32768,-32768, -149, -238, + 436,-32768,-32768,-32768,-32768,-32768,-32768,-32768, -304,-32768, +-32768, 216,-32768,-32768,-32768, 235, 290, -292,-32768, -337, +-32768, 85, -393, -255, -464,-32768, 53, -316, -375, -73, + -38, 458, 217, 11, -82,-32768, -70,-32768,-32768,-32768, + 244, -69,-32768, -68,-32768, 318,-32768, -3, 57,-32768, +-32768,-32768, -11, 25,-32768,-32768, 186,-32768, -49,-32768, + -414, -86, -27, 9, 69, -133,-32768,-32768, -306, 219, + -125, -1 +}; + + +#define YYLAST 3375 + + +static const short yytable[] = { 5, + 723, 207, 90, 153, 127, 217, 218, 219, 220, 105, + 222, 223, 224, 208, 209, 210, 447, 103, 185, 229, + 230, 578, 349, 233, 352, 563, 161, 162, 546, 161, + 162, 557, 274, 161, 162, 553, 554, 555, 556, 450, + 235, 612, 126, 452, 453, 454, 558, 565, 768, 525, + 161, 162, 161, 162, 171, 607, 235, 419, -223, 236, + 446, -223, 449, 558, 580, 161, 162, 284, 235, 91, + 34, 157, 213, 159, 160, 317, 90, 104, 164, 260, + 211, 235, 472, 92, 513, 514, 515, 735, 535, 537, + 235, 235, 263, 264, 265, 266, 111, 112, 113, 114, + 736, 129, 207, 93, 733, 94, 221, 235, 152, 776, + 869, 267, 320, 579, 208, 209, 210, 187, 231, 232, + 613, 172, 258, 329, 562, 521, 886, 161, 162, 374, + 353, 408, 409, 410, 610, 1, 2, 3, 235, 308, + 212, 365, 165, 764, 930, 174, 157, 159, 160, 164, + 235, 171, 603, 283, 357, 358, 359, 926, 286, 95, + 179, 455, 456, 564, 171, 171, 171, 171, 765, 939, + 375, 769, 96, 213, 411, 90, 751, 5, 726, 97, + 157, 211, 157, 166, 138, 98, 782, 730, 319, 402, + 770, 161, 162, 608, 376, 99, 845, 360, 237, 238, + 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, + 249, 250, 251, 252, 253, 254, 255, 256, 290, 259, + 291, 516, 517, 740, 106, 443, 235, 742, 443, 743, + 377, 744, 745, 746, 412, 378, 518, 519, 348, 413, + 379, 212, 107, 167, 414, 940, 356, 108, 168, 138, + 462, 463, 541, 169, 538, 539, 540, 361, 609, 456, + 171, 443, 362, 235, 346, 323, 327, 176, 5, 333, + 163, 110, 90, 811, 347, 149, 150, 151, 109, 235, + 173, 175, 947, 178, 364, 181, 5, 854, 855, 856, + 182, 180, 604, 394, 395, 396, 183, 188, 948, 234, + 845, 808, 314, 315, 558, 752, 766, 518, 519, 605, + 518, 519, 440, 397, 290, 440, 291, 292, 293, 225, + 226, 227, 228, 262, 267, 269, 327, 90, 346, 275, + 161, 162, 443, 276, 5, 322, 146, 147, 148, 9, + 149, 150, 151, 416, 281, 282, 547, 295, 440, 444, + 299, 235, 444, 878, 364, 523, 300, 524, 364, 364, + 364, 373, 301, 90, 302, 604, 461, 303, 304, 305, + 469, 306, 41, 307, 309, 310, 861, 722, 312, 522, + 518, 519, 729, 311, 386, 444, 566, 851, 852, 853, + 313, 854, 855, 856, 820, 346, 273, 5, 330, 334, + 90, 366, 416, 383, 90, 280, 384, 575, 51, 416, + 416, 416, 416, 560, 529, 53, 105, 522, 287, 440, + 385, 416, 289, 763, 103, 387, 388, 389, 390, 297, + 298, 399, 823, 391, 400, 445, -1, 451, 416, 407, + 468, 161, 162, 471, 406, 574, 464, 522, 543, 364, + 531, 531, 531, 443, 323, 545, 444, 77, 459, 527, + 528, 552, 567, 469, 207, 570, 577, 569, 725, 734, + 606, 456, 874, 738, 419, 724, 208, 209, 210, 727, + 68, 728, 737, 41, 104, 443, 326, 767, 881, 558, + 772, 775, 69, 777, 730, 807, 70, 809, 812, 71, + 571, 572, 573, 813, 576, 604, 815, 72, 876, 73, + 371, 816, 74, 75, 76, 817, 449, 323, 821, 51, + 518, 519, 806, 77, 322, 529, 53, 78, 825, 530, + 826, 79, 827, 468, 915, 213, 828, 136, 137, 90, + 440, 80, 829, 211, 560, 857, 326, 138, 858, 864, + 416, 862, 401, 865, 867, 749, 323, 403, 871, 405, + 522, 880, 875, 522, 416, 562, 879, 909, 885, 950, + 917, 910, 440, 804, 919, 779, 932, 771, 522, 773, + 774, 911, 912, 918, 921, 731, 531, 322, 916, 923, + 531, 920, 531, 922, 531, 531, 531, 933, 936, 937, + 951, 721, 941, 212, 779, 942, 443, 548, 526, 444, + 822, 934, 533, 533, 533, 935, 873, 859, 272, 908, + 278, 550, 763, 763, 763, 763, 322, 763, 943, 404, + 750, 781, 144, 145, 146, 147, 148, 946, 149, 150, + 151, 551, 279, 542, 568, 392, 814, 720, 0, 783, + 784, 785, 786, 787, 788, 789, 790, 791, 792, 793, + 794, 795, 796, 797, 798, 799, 800, 801, 802, 0, + 805, 0, 0, 0, 0, 132, 133, 134, 135, 136, + 137, 371, 0, 0, 443, 863, 0, 0, 0, 138, + 0, 0, 0, 440, 461, 0, 0, 0, 0, 0, + 443, 161, 162, 763, 763, 763, 763, 763, 763, 763, + 763, 763, 763, 763, 763, 763, 763, 763, 763, 763, + 763, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 444, 0, 835, 0, 371, 779, 0, 0, 0, 0, + 0, 161, 162, 41, 0, 0, 443, 739, 533, 741, + 0, 763, 533, 0, 533, 0, 533, 533, 533, 0, + 0, 748, 0, 0, 830, 831, 832, 833, 522, 836, + 834, 440, 142, 143, 144, 145, 146, 147, 148, 51, + 149, 150, 151, 41, 0, 529, 53, 440, 443, 534, + 0, 763, 0, 819, 0, 0, 130, 131, 132, 133, + 134, 135, 136, 137, 0, 0, 824, 0, 444, 0, + 0, 779, 138, 0, 0, 0, 469, 0, 0, 51, + 0, 0, 0, 0, 444, 529, 53, 906, 0, 536, + 0, 0, 0, 440, 138, 0, 860, 882, 883, 884, + 0, 0, 0, 866, 0, 887, 888, 889, 890, 891, + 892, 893, 894, 895, 896, 897, 898, 899, 900, 901, + 902, 903, 904, 0, 0, 0, 0, 0, 0, 0, + 444, 0, 0, 779, 0, 440, 0, 779, 0, 0, + 0, 928, 0, 929, 0, 0, 468, 0, 0, 316, + 0, 139, 140, 924, 141, 142, 143, 144, 145, 146, + 147, 148, 0, 149, 150, 151, 0, 0, 944, 945, + 0, 0, 444, 0, 779, 0, 0, 0, 779, 144, + 145, 146, 147, 148, 907, 149, 150, 151, 0, 0, + 0, 779, 0, 938, 0, 0, 913, 0, 0, 0, + 779, 614, 615, 616, 617, 618, 619, 620, 621, 0, + 622, 623, 624, 625, 626, 627, 628, 629, 630, 631, + 632, 0, 0, 0, 0, 0, 0, 633, 634, 635, + 636, 637, 638, 639, 640, 641, 642, 643, 644, 645, + 646, 647, 845, 0, 648, 649, 650, 651, 652, 653, + 654, 655, 656, 657, 0, 658, 659, 660, 661, 662, + 663, 664, 665, 666, 667, 668, 669, 670, 0, 0, + 671, 0, 672, 673, 674, 675, 676, 677, 678, 679, + 680, 681, 682, 683, 684, 0, 685, 686, 687, 688, + 689, 690, 691, 0, 692, 693, 694, 695, 0, 0, + 0, 696, 697, 698, 699, 700, 701, 702, 703, 704, + 705, 706, 707, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 877, 717, 718, 0, 0, 849, 850, 851, + 852, 853, 0, 854, 855, 856, 0, 614, 615, 616, + 617, 618, 619, 620, 621, 0, 622, 623, 624, 625, + 626, 627, 628, 629, 630, 631, 632, 0, 0, 0, + 0, 0, 0, 633, 634, 635, 636, 637, 638, 639, + 640, 641, 642, 643, 644, 645, 646, 647, 0, 0, + 648, 649, 650, 651, 652, 653, 654, 655, 656, 657, + 931, 658, 659, 660, 661, 662, 663, 664, 665, 666, + 667, 668, 669, 670, 0, 0, 671, 0, 672, 673, + 674, 675, 676, 677, 678, 679, 680, 681, 682, 683, + 684, 0, 685, 686, 687, 688, 689, 690, 691, 0, + 692, 693, 694, 695, 0, 0, 0, 696, 697, 698, + 699, 700, 701, 702, 703, 704, 705, 706, 707, 708, + 709, 710, 711, 712, 713, 714, 715, 716, 0, 717, + 718, 6, 7, 8, 9, 0, 10, 115, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 130, 131, 132, 133, + 134, 135, 136, 137, 38, 0, 39, 40, 0, 0, + 0, 154, 138, 0, 116, 0, 117, 118, 41, 42, + 155, 119, 16, 0, 0, 44, 46, 156, 48, 17, + 120, 0, 0, 0, 0, 0, 121, 122, 48, 49, + 50, 0, 21, 0, 0, 0, 0, 0, 0, 123, + 124, 24, 54, 25, 51, 0, 0, 26, 0, 0, + 52, 53, 125, 0, 0, 55, 420, 421, 422, 9, + 0, 423, 37, 0, 0, 424, 0, 0, 0, 28, + 0, 0, 0, 29, 30, 0, 0, 31, 470, 32, + 0, 139, 140, 33, 141, 142, 143, 144, 145, 146, + 147, 148, 0, 149, 150, 151, 0, 0, 0, 38, + 0, 39, 40, 41, 425, 0, 43, 426, 0, 0, + 44, 0, 0, 0, 427, 45, 0, 0, 0, 0, + 0, 46, 47, 48, 0, 0, 0, 428, 0, 0, + 0, 0, 0, 0, 49, 50, 429, 0, 430, 51, + 0, 0, 431, 0, 0, 52, 53, 54, 0, 0, + 55, 420, 421, 422, 9, 0, 423, 37, 0, 0, + 780, 0, 0, 0, 432, 0, 0, 0, 433, 0, + 0, 0, 434, 0, 435, 0, 0, 0, 436, 130, + 131, 132, 133, 134, 135, 136, 137, 0, 0, 0, + 38, 0, 39, 40, 38, 138, 39, 40, 41, 425, + 0, 43, 426, 0, 0, 44, 0, 0, 0, 427, + 45, 0, 46, 158, 48, 0, 46, 47, 48, 0, + 0, 0, 428, 0, 0, 49, 50, 0, 0, 49, + 50, 429, 0, 430, 51, 0, 0, 431, 54, 0, + 52, 53, 54, 0, 0, 55, 6, 7, 8, 9, + 0, 10, 11, 0, 843, 844, 0, 0, 0, 432, + 0, 0, 0, 433, 845, 106, 0, 434, 0, 435, + 0, 0, 868, 436, 139, 140, 0, 141, 142, 143, + 144, 145, 146, 147, 148, 0, 149, 150, 151, 12, + 0, 13, 14, 0, 0, 0, 15, 16, 0, 0, + 0, 0, 0, 0, 17, 18, 0, 0, 0, 0, + 0, 19, 20, 0, 0, 0, 0, 21, 0, 0, + 0, 0, 0, 0, 22, 23, 24, 0, 25, 0, + 0, 0, 26, 6, 7, 8, 9, 27, 10, 11, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 849, + 850, 851, 852, 853, 28, 854, 855, 856, 29, 30, + 0, 0, 31, 0, 32, 0, 257, 0, 33, 0, + 0, 0, 0, 0, 0, 0, 12, 0, 13, 14, + 0, 0, 0, 15, 16, 0, 0, 0, 0, 0, + 0, 17, 18, 0, 38, 0, 39, 40, 19, 20, + 0, 154, 0, 0, 21, 0, 0, 0, 0, 0, + 155, 22, 23, 24, 0, 25, 46, 156, 48, 26, + 6, 7, 8, 9, 27, 10, 11, 0, 0, 49, + 50, 0, 0, 372, 0, 0, 0, 0, 0, 0, + 0, 28, 54, 0, 0, 29, 30, 0, 0, 31, + 0, 32, 0, 0, 0, 33, 0, 0, 0, 0, + 0, 0, 0, 12, 0, 13, 14, 0, 0, 99, + 15, 16, 0, 0, 0, 0, 0, 0, 17, 18, + 0, 38, 0, 39, 40, 19, 20, 0, 0, 0, + 0, 21, 0, 0, 0, 0, 0, 0, 22, 23, + 24, 0, 25, 46, 158, 48, 26, 6, 7, 8, + 9, 27, 10, 11, 0, 0, 49, 50, 0, 0, + 465, 0, 0, 0, 0, 0, 0, 0, 28, 54, + 0, 0, 29, 30, 0, 0, 31, 0, 32, 0, + 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, + 12, 0, 13, 14, 0, 0, 107, 15, 16, 0, + 0, 0, 0, 0, 0, 17, 18, 0, 38, 0, + 39, 40, 19, 20, 0, 0, 0, 0, 21, 0, + 0, 0, 0, 0, 0, 22, 23, 24, 0, 25, + 46, 158, 48, 26, 6, 7, 8, 9, 27, 10, + 11, 0, 0, 49, 50, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 28, 54, 0, 0, 29, + 30, 0, 0, 31, 0, 32, 0, 803, 0, 33, + 0, 0, 0, 0, 0, 0, 0, 12, 0, 13, + 14, 0, 0, 110, 15, 16, 0, 0, 0, 0, + 0, 0, 17, 18, 0, 38, 0, 39, 40, 19, + 20, 0, 0, 0, 0, 21, 0, 0, 0, 0, + 0, 261, 22, 23, 24, 0, 25, 46, 158, 48, + 26, 6, 7, 8, 9, 27, 10, 11, 0, 0, + 49, 50, 0, 0, 818, 0, 0, 0, 0, 0, + 0, 0, 28, 54, 0, 0, 29, 30, 0, 0, + 31, 0, 32, 0, 0, 0, 33, 0, 0, 0, + 0, 0, 0, 0, 12, 0, 13, 14, 0, 0, + 0, 15, 16, 0, 0, 0, 0, 0, 0, 17, + 18, 0, 38, 0, 39, 40, 19, 20, 0, 0, + 0, 0, 21, 0, 0, 0, 0, 0, 0, 22, + 23, 24, 0, 25, 46, 158, 48, 26, 6, 7, + 8, 9, 27, 10, 11, 0, 0, 49, 50, 0, + 6, 7, 8, 9, 0, 10, 0, 0, 0, 28, + 54, 0, 0, 29, 30, 0, 0, 31, 0, 32, + 0, 905, 0, 33, 0, 0, 0, 0, 0, 0, + 0, 12, 0, 13, 14, 0, 0, 0, 15, 16, + 0, 0, 0, 0, 0, 0, 17, 18, 0, 0, + 0, 753, 0, 19, 20, 0, 0, 0, 17, 21, + 0, 0, 0, 0, 0, 0, 22, 23, 24, 0, + 25, 0, 0, 0, 26, 0, 0, 0, 0, 27, + 754, 0, 755, 0, 0, 0, 26, 130, 131, 132, + 133, 134, 135, 136, 137, 0, 28, 0, 0, 0, + 29, 30, 0, 138, 31, 0, 32, 0, 756, 0, + 33, 0, 757, 758, 0, 0, 759, 0, 760, 0, + 0, 0, 761, 130, 131, 132, 133, 134, 135, 136, + 137, 0, 0, 0, 0, 0, 0, 0, 0, 138, + 0, 0, 130, 131, 132, 133, 134, 135, 136, 137, + 0, 0, 0, 0, 0, 0, 0, 0, 138, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 139, 140, 0, 141, 142, 143, 144, 145, + 146, 147, 148, 0, 149, 150, 151, 0, 0, 0, + 318, 130, 131, 132, 133, 134, 135, 136, 137, 0, + 0, 0, 0, 0, 0, 0, 0, 138, 139, 140, + 0, 141, 142, 143, 144, 145, 146, 147, 148, 0, + 149, 150, 151, 0, 0, 0, 870, 139, 140, 0, + 141, 142, 143, 144, 145, 146, 147, 148, 0, 149, + 150, 151, 0, 337, 338, 927, 473, 474, 475, 476, + 477, 478, 479, 480, 0, 0, 0, 0, 0, 0, + 0, 0, 481, 0, 482, 483, 484, 485, 486, 487, + 488, 489, 490, 491, 492, 493, 0, 0, 0, 0, + 0, 38, 0, 39, 40, 494, 139, 140, 43, 141, + 142, 143, 144, 145, 146, 147, 148, 45, 149, 150, + 151, 0, 0, 46, 47, 48, 0, 495, 0, 0, + 0, 0, 0, 0, 0, 0, 49, 50, 0, 189, + 190, 0, 0, 0, 0, 0, 0, 341, 0, 54, + 0, 0, 55, 0, 0, 0, 0, 496, 0, 0, + 497, 0, 498, 499, 500, 501, 502, 503, 504, 505, + 506, 507, 508, 0, 509, 510, 191, 38, 511, 39, + 40, 41, 192, 0, 43, 0, 0, 0, 44, 193, + 194, 0, 0, 45, 0, 189, 190, 0, 195, 46, + 47, 48, 0, 196, 0, 0, 197, 0, 0, 0, + 198, 0, 49, 50, 0, 199, 0, 51, 0, 0, + 0, 0, 0, 200, 53, 54, 0, 201, 55, 202, + 0, 0, 191, 38, 203, 39, 40, 41, 277, 0, + 43, 0, 0, 0, 44, 193, 194, 0, 0, 45, + 204, 189, 190, 0, 195, 46, 47, 48, 0, 196, + 0, 0, 197, 0, 0, 0, 198, 0, 49, 50, + 0, 199, 0, 51, 0, 0, 0, 0, 0, 200, + 53, 54, 0, 201, 55, 202, 0, 0, 191, 38, + 0, 39, 40, 41, 192, 0, 43, 0, 0, 0, + 44, 193, 194, 0, 0, 45, 204, 0, 0, 0, + 195, 46, 47, 48, 0, 196, 0, 0, 197, 0, + 0, 0, 198, 0, 49, 50, 0, 199, 0, 51, + 0, 0, 0, 0, 0, 200, 53, 54, 0, 201, + 55, 202, 581, 582, 583, 584, 585, 586, 587, 588, + 0, 0, 0, 0, 0, 0, 0, 0, 589, 0, + 0, 0, 204, 837, 838, 839, 840, 841, 842, 843, + 844, 0, 0, 0, 0, 0, 0, 0, 0, 845, + 837, 838, 839, 840, 841, 842, 843, 844, 0, 0, + 0, 0, 0, 0, 0, 0, 845, 131, 132, 133, + 134, 135, 136, 137, 0, 0, 0, 0, 0, 0, + 0, 0, 138, 838, 839, 840, 841, 842, 843, 844, + 0, 0, 0, 0, 0, 0, 0, 0, 845, 0, + 0, 0, 0, 0, 0, 0, 0, 590, 591, 0, + 592, 593, 594, 595, 596, 597, 598, 599, 0, 600, + 601, 602, 0, 0, 0, 0, 925, 0, 846, 847, + 0, 848, 0, 0, 849, 850, 851, 852, 853, 0, + 854, 855, 856, 0, 0, 846, 847, 0, 848, 0, + 0, 849, 850, 851, 852, 853, 0, 854, 855, 856, + 0, 0, 140, 0, 141, 142, 143, 144, 145, 146, + 147, 148, 0, 149, 150, 151, 0, 0, 847, 0, + 848, 0, 0, 849, 850, 851, 852, 853, 0, 854, + 855, 856, 132, 133, 134, 135, 136, 137, 0, 0, + 0, 0, 0, 0, 0, 0, 138, 132, 133, 134, + 135, 136, 137, 0, 0, 0, 0, 0, 0, 0, + 0, 138, 839, 840, 841, 842, 843, 844, 0, 0, + 0, 68, 0, 0, 0, 0, 845, 839, 840, 841, + 842, 843, 844, 69, 0, 0, 0, 70, 0, 0, + 71, 845, 839, 840, 841, 842, 843, 844, 72, 0, + 73, 0, 0, 74, 75, 76, 845, 134, 135, 136, + 137, 0, 0, 0, 77, 0, 0, 0, 78, 138, + 0, 0, 79, 0, 0, 0, 140, 0, 141, 142, + 143, 144, 145, 146, 147, 148, 0, 149, 150, 151, + 0, 0, 0, 141, 142, 143, 144, 145, 146, 147, + 148, 0, 149, 150, 151, 0, 847, 0, 848, 0, + 0, 849, 850, 851, 852, 853, 0, 854, 855, 856, + 0, 0, 0, 848, 0, 0, 849, 850, 851, 852, + 853, 0, 854, 855, 856, 0, 337, 338, 0, 0, + 0, 849, 850, 851, 852, 853, 0, 854, 855, 856, + 0, 0, 142, 143, 144, 145, 146, 147, 148, 0, + 149, 150, 151, 841, 842, 843, 844, 0, 0, 0, + 0, 0, 0, 0, 38, 845, 39, 40, 339, 340, + 0, 43, 0, 0, 0, 0, 0, 0, 0, 0, + 45, 0, 0, 0, 0, 0, 46, 47, 48, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, + 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 341, 0, 54, 0, 0, 55, 0, 0, 0, 0, + 0, 0, 37, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 849, 850, 851, 852, 853, 0, 854, 855, 856, 38, + 0, 39, 40, 41, 42, 0, 43, 0, 0, 0, + 44, 0, 37, 0, 0, 45, 0, 0, 0, 0, + 0, 46, 47, 48, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 49, 50, 0, 0, 0, 51, + 0, 0, 0, 0, 0, 52, 53, 54, 0, 38, + 55, 39, 40, 41, 285, 0, 43, 0, 0, 0, + 44, 0, 100, 0, 0, 45, 0, 0, 0, 0, + 0, 46, 47, 48, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 49, 50, 0, 0, 0, 51, + 0, 0, 0, 0, 0, 52, 53, 54, 0, 38, + 55, 39, 40, 41, 0, 0, 43, 0, 0, 0, + 44, 0, 37, 0, 0, 45, 0, 0, 0, 0, + 0, 46, 47, 48, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 49, 50, 0, 0, 0, 51, + 0, 0, 0, 0, 0, 101, 53, 54, 0, 38, + 55, 39, 40, 41, 0, 0, 43, 0, 0, 0, + 44, 0, 0, 0, 0, 45, 0, 0, 0, 0, + 0, 46, 47, 48, 68, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 49, 50, 69, 0, 0, 51, + 70, 0, 0, 71, 0, 52, 53, 54, 0, 68, + 55, 72, 0, 73, 0, 0, 74, 75, 76, 0, + 0, 69, 0, 0, 0, 70, 0, 77, 71, 0, + 0, 78, 0, 0, 68, 79, 72, 0, 73, 0, + 0, 74, 75, 76, 0, 80, 69, 0, 0, 0, + 70, 0, 77, 71, 0, 0, 78, 0, 0, 68, + 79, 72, 0, 73, 335, 0, 74, 75, 76, 0, + 80, 69, 0, 0, 0, 70, 0, 77, 71, 0, + 0, 78, 0, 0, 68, 79, 72, 0, 73, 393, + 0, 74, 75, 76, 0, 80, 69, 0, 0, 0, + 70, 0, 77, 71, 0, 0, 78, 0, 0, 0, + 79, 72, 0, 73, 457, 0, 74, 75, 76, 0, + 80, 0, 0, 0, 0, 0, 0, 77, 0, 0, + 0, 78, 0, 0, 0, 79, 0, 0, 0, 544, + 0, 0, 0, 0, 0, 80, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 747 +}; + +static const short yycheck[] = { 1, + 465, 84, 4, 42, 32, 92, 93, 94, 95, 21, + 97, 98, 99, 84, 84, 84, 354, 21, 78, 106, + 107, 12, 278, 110, 10, 419, 8, 9, 404, 8, + 9, 107, 179, 8, 9, 411, 412, 413, 414, 356, + 104, 456, 32, 360, 361, 362, 122, 423, 107, 387, + 8, 9, 8, 9, 56, 449, 104, 350, 103, 123, + 353, 106, 355, 122, 440, 8, 9, 193, 104, 121, + 2, 47, 84, 49, 50, 123, 78, 21, 54, 153, + 84, 104, 375, 121, 377, 378, 379, 123, 395, 396, + 104, 104, 166, 167, 168, 169, 28, 29, 30, 31, + 123, 33, 185, 121, 519, 121, 96, 104, 6, 123, + 123, 122, 123, 104, 185, 185, 185, 73, 108, 109, + 458, 103, 150, 270, 417, 381, 123, 8, 9, 10, + 116, 8, 9, 10, 451, 100, 101, 102, 104, 226, + 84, 288, 10, 558, 123, 103, 122, 123, 124, 125, + 104, 153, 445, 192, 8, 9, 10, 123, 197, 121, + 103, 121, 122, 419, 166, 167, 168, 169, 562, 123, + 51, 565, 112, 185, 51, 177, 552, 179, 471, 121, + 156, 185, 158, 51, 29, 121, 580, 4, 262, 336, + 566, 8, 9, 449, 75, 121, 29, 51, 130, 131, + 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 144, 145, 146, 147, 148, 149, 103, 151, + 105, 106, 107, 530, 121, 351, 104, 534, 354, 536, + 111, 538, 539, 540, 111, 116, 121, 122, 277, 116, + 121, 185, 121, 111, 121, 123, 285, 121, 116, 29, + 103, 104, 399, 121, 76, 77, 78, 111, 121, 122, + 262, 387, 116, 104, 276, 267, 268, 106, 270, 271, + 52, 121, 274, 611, 276, 120, 121, 122, 112, 104, + 62, 63, 123, 121, 286, 106, 288, 120, 121, 122, + 106, 73, 106, 76, 77, 78, 106, 79, 123, 123, + 29, 606, 234, 235, 122, 123, 562, 121, 122, 123, + 121, 122, 351, 96, 103, 354, 105, 106, 107, 101, + 121, 103, 104, 116, 122, 103, 328, 329, 340, 103, + 8, 9, 458, 112, 336, 267, 116, 117, 118, 6, + 120, 121, 122, 345, 121, 121, 406, 105, 387, 351, + 123, 104, 354, 818, 356, 383, 123, 385, 360, 361, + 362, 293, 123, 365, 123, 106, 368, 123, 113, 123, + 372, 123, 50, 123, 123, 123, 770, 464, 113, 381, + 121, 122, 123, 123, 316, 387, 425, 116, 117, 118, + 123, 120, 121, 122, 732, 407, 178, 399, 106, 104, + 402, 121, 404, 121, 406, 187, 123, 435, 86, 411, + 412, 413, 414, 415, 92, 93, 428, 419, 200, 458, + 121, 423, 204, 557, 428, 121, 126, 124, 104, 211, + 212, 103, 737, 107, 104, 116, 0, 116, 440, 104, + 372, 8, 9, 116, 113, 435, 121, 449, 104, 451, + 394, 395, 396, 579, 456, 107, 458, 87, 124, 391, + 124, 116, 112, 465, 547, 112, 123, 121, 104, 104, + 123, 122, 810, 107, 767, 124, 547, 547, 547, 123, + 44, 126, 123, 50, 428, 611, 268, 104, 826, 122, + 121, 123, 56, 51, 4, 121, 60, 104, 126, 63, + 432, 433, 434, 123, 436, 106, 124, 71, 813, 73, + 292, 123, 76, 77, 78, 124, 809, 519, 126, 86, + 121, 122, 123, 87, 456, 92, 93, 91, 123, 96, + 121, 95, 112, 465, 872, 547, 121, 19, 20, 541, + 579, 105, 112, 547, 546, 126, 328, 29, 104, 123, + 552, 113, 334, 113, 88, 545, 558, 339, 121, 341, + 562, 105, 123, 565, 566, 858, 123, 121, 123, 0, + 875, 123, 611, 601, 879, 577, 914, 567, 580, 569, + 570, 121, 121, 124, 113, 517, 530, 519, 123, 113, + 534, 123, 536, 123, 538, 539, 540, 123, 121, 121, + 0, 463, 123, 547, 606, 123, 732, 406, 390, 611, + 734, 916, 394, 395, 396, 920, 809, 767, 177, 858, + 185, 406, 756, 757, 758, 759, 558, 761, 933, 340, + 546, 579, 114, 115, 116, 117, 118, 942, 120, 121, + 122, 407, 185, 400, 428, 328, 696, 462, -1, 581, + 582, 583, 584, 585, 586, 587, 588, 589, 590, 591, + 592, 593, 594, 595, 596, 597, 598, 599, 600, -1, + 602, -1, -1, -1, -1, 15, 16, 17, 18, 19, + 20, 463, -1, -1, 810, 772, -1, -1, -1, 29, + -1, -1, -1, 732, 696, -1, -1, -1, -1, -1, + 826, 8, 9, 837, 838, 839, 840, 841, 842, 843, + 844, 845, 846, 847, 848, 849, 850, 851, 852, 853, + 854, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 732, -1, 760, -1, 516, 737, -1, -1, -1, -1, + -1, 8, 9, 50, -1, -1, 872, 529, 530, 531, + -1, 885, 534, -1, 536, -1, 538, 539, 540, -1, + -1, 543, -1, -1, 756, 757, 758, 759, 770, 761, + 760, 810, 112, 113, 114, 115, 116, 117, 118, 86, + 120, 121, 122, 50, -1, 92, 93, 826, 914, 96, + -1, 925, -1, 725, -1, -1, 13, 14, 15, 16, + 17, 18, 19, 20, -1, -1, 738, -1, 810, -1, + -1, 813, 29, -1, -1, -1, 818, -1, -1, 86, + -1, -1, -1, -1, 826, 92, 93, 855, -1, 96, + -1, -1, -1, 872, 29, -1, 768, 827, 828, 829, + -1, -1, -1, 775, -1, 837, 838, 839, 840, 841, + 842, 843, 844, 845, 846, 847, 848, 849, 850, 851, + 852, 853, 854, -1, -1, -1, -1, -1, -1, -1, + 872, -1, -1, 875, -1, 914, -1, 879, -1, -1, + -1, 909, -1, 911, -1, -1, 818, -1, -1, 106, + -1, 108, 109, 885, 111, 112, 113, 114, 115, 116, + 117, 118, -1, 120, 121, 122, -1, -1, 936, 937, + -1, -1, 914, -1, 916, -1, -1, -1, 920, 114, + 115, 116, 117, 118, 856, 120, 121, 122, -1, -1, + -1, 933, -1, 925, -1, -1, 868, -1, -1, -1, + 942, 3, 4, 5, 6, 7, 8, 9, 10, -1, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, -1, -1, -1, -1, -1, -1, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 29, -1, 46, 47, 48, 49, 50, 51, + 52, 53, 54, 55, -1, 57, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 68, 69, -1, -1, + 72, -1, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, -1, 88, 89, 90, 91, + 92, 93, 94, -1, 96, 97, 98, 99, -1, -1, + -1, 103, 104, 105, 106, 107, 108, 109, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, + 122, 123, 124, 125, 126, -1, -1, 114, 115, 116, + 117, 118, -1, 120, 121, 122, -1, 3, 4, 5, + 6, 7, 8, 9, 10, -1, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, + -1, -1, -1, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, -1, -1, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 912, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, -1, -1, 72, -1, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, -1, 88, 89, 90, 91, 92, 93, 94, -1, + 96, 97, 98, 99, -1, -1, -1, 103, 104, 105, + 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, + 116, 117, 118, 119, 120, 121, 122, 123, -1, 125, + 126, 3, 4, 5, 6, -1, 8, 9, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 13, 14, 15, 16, + 17, 18, 19, 20, 46, -1, 48, 49, -1, -1, + -1, 53, 29, -1, 46, -1, 48, 49, 50, 51, + 62, 53, 54, -1, -1, 57, 68, 69, 70, 61, + 62, -1, -1, -1, -1, -1, 68, 69, 70, 81, + 82, -1, 74, -1, -1, -1, -1, -1, -1, 81, + 82, 83, 94, 85, 86, -1, -1, 89, -1, -1, + 92, 93, 94, -1, -1, 97, 3, 4, 5, 6, + -1, 8, 9, -1, -1, 12, -1, -1, -1, 111, + -1, -1, -1, 115, 116, -1, -1, 119, 105, 121, + -1, 108, 109, 125, 111, 112, 113, 114, 115, 116, + 117, 118, -1, 120, 121, 122, -1, -1, -1, 46, + -1, 48, 49, 50, 51, -1, 53, 54, -1, -1, + 57, -1, -1, -1, 61, 62, -1, -1, -1, -1, + -1, 68, 69, 70, -1, -1, -1, 74, -1, -1, + -1, -1, -1, -1, 81, 82, 83, -1, 85, 86, + -1, -1, 89, -1, -1, 92, 93, 94, -1, -1, + 97, 3, 4, 5, 6, -1, 8, 9, -1, -1, + 12, -1, -1, -1, 111, -1, -1, -1, 115, -1, + -1, -1, 119, -1, 121, -1, -1, -1, 125, 13, + 14, 15, 16, 17, 18, 19, 20, -1, -1, -1, + 46, -1, 48, 49, 46, 29, 48, 49, 50, 51, + -1, 53, 54, -1, -1, 57, -1, -1, -1, 61, + 62, -1, 68, 69, 70, -1, 68, 69, 70, -1, + -1, -1, 74, -1, -1, 81, 82, -1, -1, 81, + 82, 83, -1, 85, 86, -1, -1, 89, 94, -1, + 92, 93, 94, -1, -1, 97, 3, 4, 5, 6, + -1, 8, 9, -1, 19, 20, -1, -1, -1, 111, + -1, -1, -1, 115, 29, 121, -1, 119, -1, 121, + -1, -1, 106, 125, 108, 109, -1, 111, 112, 113, + 114, 115, 116, 117, 118, -1, 120, 121, 122, 46, + -1, 48, 49, -1, -1, -1, 53, 54, -1, -1, + -1, -1, -1, -1, 61, 62, -1, -1, -1, -1, + -1, 68, 69, -1, -1, -1, -1, 74, -1, -1, + -1, -1, -1, -1, 81, 82, 83, -1, 85, -1, + -1, -1, 89, 3, 4, 5, 6, 94, 8, 9, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 114, + 115, 116, 117, 118, 111, 120, 121, 122, 115, 116, + -1, -1, 119, -1, 121, -1, 123, -1, 125, -1, + -1, -1, -1, -1, -1, -1, 46, -1, 48, 49, + -1, -1, -1, 53, 54, -1, -1, -1, -1, -1, + -1, 61, 62, -1, 46, -1, 48, 49, 68, 69, + -1, 53, -1, -1, 74, -1, -1, -1, -1, -1, + 62, 81, 82, 83, -1, 85, 68, 69, 70, 89, + 3, 4, 5, 6, 94, 8, 9, -1, -1, 81, + 82, -1, -1, 103, -1, -1, -1, -1, -1, -1, + -1, 111, 94, -1, -1, 115, 116, -1, -1, 119, + -1, 121, -1, -1, -1, 125, -1, -1, -1, -1, + -1, -1, -1, 46, -1, 48, 49, -1, -1, 121, + 53, 54, -1, -1, -1, -1, -1, -1, 61, 62, + -1, 46, -1, 48, 49, 68, 69, -1, -1, -1, + -1, 74, -1, -1, -1, -1, -1, -1, 81, 82, + 83, -1, 85, 68, 69, 70, 89, 3, 4, 5, + 6, 94, 8, 9, -1, -1, 81, 82, -1, -1, + 103, -1, -1, -1, -1, -1, -1, -1, 111, 94, + -1, -1, 115, 116, -1, -1, 119, -1, 121, -1, + -1, -1, 125, -1, -1, -1, -1, -1, -1, -1, + 46, -1, 48, 49, -1, -1, 121, 53, 54, -1, + -1, -1, -1, -1, -1, 61, 62, -1, 46, -1, + 48, 49, 68, 69, -1, -1, -1, -1, 74, -1, + -1, -1, -1, -1, -1, 81, 82, 83, -1, 85, + 68, 69, 70, 89, 3, 4, 5, 6, 94, 8, + 9, -1, -1, 81, 82, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 111, 94, -1, -1, 115, + 116, -1, -1, 119, -1, 121, -1, 123, -1, 125, + -1, -1, -1, -1, -1, -1, -1, 46, -1, 48, + 49, -1, -1, 121, 53, 54, -1, -1, -1, -1, + -1, -1, 61, 62, -1, 46, -1, 48, 49, 68, + 69, -1, -1, -1, -1, 74, -1, -1, -1, -1, + -1, 62, 81, 82, 83, -1, 85, 68, 69, 70, + 89, 3, 4, 5, 6, 94, 8, 9, -1, -1, + 81, 82, -1, -1, 103, -1, -1, -1, -1, -1, + -1, -1, 111, 94, -1, -1, 115, 116, -1, -1, + 119, -1, 121, -1, -1, -1, 125, -1, -1, -1, + -1, -1, -1, -1, 46, -1, 48, 49, -1, -1, + -1, 53, 54, -1, -1, -1, -1, -1, -1, 61, + 62, -1, 46, -1, 48, 49, 68, 69, -1, -1, + -1, -1, 74, -1, -1, -1, -1, -1, -1, 81, + 82, 83, -1, 85, 68, 69, 70, 89, 3, 4, + 5, 6, 94, 8, 9, -1, -1, 81, 82, -1, + 3, 4, 5, 6, -1, 8, -1, -1, -1, 111, + 94, -1, -1, 115, 116, -1, -1, 119, -1, 121, + -1, 123, -1, 125, -1, -1, -1, -1, -1, -1, + -1, 46, -1, 48, 49, -1, -1, -1, 53, 54, + -1, -1, -1, -1, -1, -1, 61, 62, -1, -1, + -1, 54, -1, 68, 69, -1, -1, -1, 61, 74, + -1, -1, -1, -1, -1, -1, 81, 82, 83, -1, + 85, -1, -1, -1, 89, -1, -1, -1, -1, 94, + 83, -1, 85, -1, -1, -1, 89, 13, 14, 15, + 16, 17, 18, 19, 20, -1, 111, -1, -1, -1, + 115, 116, -1, 29, 119, -1, 121, -1, 111, -1, + 125, -1, 115, 116, -1, -1, 119, -1, 121, -1, + -1, -1, 125, 13, 14, 15, 16, 17, 18, 19, + 20, -1, -1, -1, -1, -1, -1, -1, -1, 29, + -1, -1, 13, 14, 15, 16, 17, 18, 19, 20, + -1, -1, -1, -1, -1, -1, -1, -1, 29, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, 108, 109, -1, 111, 112, 113, 114, 115, + 116, 117, 118, -1, 120, 121, 122, -1, -1, -1, + 126, 13, 14, 15, 16, 17, 18, 19, 20, -1, + -1, -1, -1, -1, -1, -1, -1, 29, 108, 109, + -1, 111, 112, 113, 114, 115, 116, 117, 118, -1, + 120, 121, 122, -1, -1, -1, 126, 108, 109, -1, + 111, 112, 113, 114, 115, 116, 117, 118, -1, 120, + 121, 122, -1, 8, 9, 126, 13, 14, 15, 16, + 17, 18, 19, 20, -1, -1, -1, -1, -1, -1, + -1, -1, 29, -1, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 41, 42, -1, -1, -1, -1, + -1, 46, -1, 48, 49, 52, 108, 109, 53, 111, + 112, 113, 114, 115, 116, 117, 118, 62, 120, 121, + 122, -1, -1, 68, 69, 70, -1, 74, -1, -1, + -1, -1, -1, -1, -1, -1, 81, 82, -1, 8, + 9, -1, -1, -1, -1, -1, -1, 92, -1, 94, + -1, -1, 97, -1, -1, -1, -1, 104, -1, -1, + 107, -1, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, -1, 121, 122, 45, 46, 125, 48, + 49, 50, 51, -1, 53, -1, -1, -1, 57, 58, + 59, -1, -1, 62, -1, 8, 9, -1, 67, 68, + 69, 70, -1, 72, -1, -1, 75, -1, -1, -1, + 79, -1, 81, 82, -1, 84, -1, 86, -1, -1, + -1, -1, -1, 92, 93, 94, -1, 96, 97, 98, + -1, -1, 45, 46, 103, 48, 49, 50, 51, -1, + 53, -1, -1, -1, 57, 58, 59, -1, -1, 62, + 119, 8, 9, -1, 67, 68, 69, 70, -1, 72, + -1, -1, 75, -1, -1, -1, 79, -1, 81, 82, + -1, 84, -1, 86, -1, -1, -1, -1, -1, 92, + 93, 94, -1, 96, 97, 98, -1, -1, 45, 46, + -1, 48, 49, 50, 51, -1, 53, -1, -1, -1, + 57, 58, 59, -1, -1, 62, 119, -1, -1, -1, + 67, 68, 69, 70, -1, 72, -1, -1, 75, -1, + -1, -1, 79, -1, 81, 82, -1, 84, -1, 86, + -1, -1, -1, -1, -1, 92, 93, 94, -1, 96, + 97, 98, 13, 14, 15, 16, 17, 18, 19, 20, + -1, -1, -1, -1, -1, -1, -1, -1, 29, -1, + -1, -1, 119, 13, 14, 15, 16, 17, 18, 19, + 20, -1, -1, -1, -1, -1, -1, -1, -1, 29, + 13, 14, 15, 16, 17, 18, 19, 20, -1, -1, + -1, -1, -1, -1, -1, -1, 29, 14, 15, 16, + 17, 18, 19, 20, -1, -1, -1, -1, -1, -1, + -1, -1, 29, 14, 15, 16, 17, 18, 19, 20, + -1, -1, -1, -1, -1, -1, -1, -1, 29, -1, + -1, -1, -1, -1, -1, -1, -1, 108, 109, -1, + 111, 112, 113, 114, 115, 116, 117, 118, -1, 120, + 121, 122, -1, -1, -1, -1, 106, -1, 108, 109, + -1, 111, -1, -1, 114, 115, 116, 117, 118, -1, + 120, 121, 122, -1, -1, 108, 109, -1, 111, -1, + -1, 114, 115, 116, 117, 118, -1, 120, 121, 122, + -1, -1, 109, -1, 111, 112, 113, 114, 115, 116, + 117, 118, -1, 120, 121, 122, -1, -1, 109, -1, + 111, -1, -1, 114, 115, 116, 117, 118, -1, 120, + 121, 122, 15, 16, 17, 18, 19, 20, -1, -1, + -1, -1, -1, -1, -1, -1, 29, 15, 16, 17, + 18, 19, 20, -1, -1, -1, -1, -1, -1, -1, + -1, 29, 15, 16, 17, 18, 19, 20, -1, -1, + -1, 44, -1, -1, -1, -1, 29, 15, 16, 17, + 18, 19, 20, 56, -1, -1, -1, 60, -1, -1, + 63, 29, 15, 16, 17, 18, 19, 20, 71, -1, + 73, -1, -1, 76, 77, 78, 29, 17, 18, 19, + 20, -1, -1, -1, 87, -1, -1, -1, 91, 29, + -1, -1, 95, -1, -1, -1, 109, -1, 111, 112, + 113, 114, 115, 116, 117, 118, -1, 120, 121, 122, + -1, -1, -1, 111, 112, 113, 114, 115, 116, 117, + 118, -1, 120, 121, 122, -1, 109, -1, 111, -1, + -1, 114, 115, 116, 117, 118, -1, 120, 121, 122, + -1, -1, -1, 111, -1, -1, 114, 115, 116, 117, + 118, -1, 120, 121, 122, -1, 8, 9, -1, -1, + -1, 114, 115, 116, 117, 118, -1, 120, 121, 122, + -1, -1, 112, 113, 114, 115, 116, 117, 118, -1, + 120, 121, 122, 17, 18, 19, 20, -1, -1, -1, + -1, -1, -1, -1, 46, 29, 48, 49, 50, 51, + -1, 53, -1, -1, -1, -1, -1, -1, -1, -1, + 62, -1, -1, -1, -1, -1, 68, 69, 70, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 81, + 82, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 92, -1, 94, -1, -1, 97, -1, -1, -1, -1, + -1, -1, 9, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 114, 115, 116, 117, 118, -1, 120, 121, 122, 46, + -1, 48, 49, 50, 51, -1, 53, -1, -1, -1, + 57, -1, 9, -1, -1, 62, -1, -1, -1, -1, + -1, 68, 69, 70, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 81, 82, -1, -1, -1, 86, + -1, -1, -1, -1, -1, 92, 93, 94, -1, 46, + 97, 48, 49, 50, 51, -1, 53, -1, -1, -1, + 57, -1, 9, -1, -1, 62, -1, -1, -1, -1, + -1, 68, 69, 70, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 81, 82, -1, -1, -1, 86, + -1, -1, -1, -1, -1, 92, 93, 94, -1, 46, + 97, 48, 49, 50, -1, -1, 53, -1, -1, -1, + 57, -1, 9, -1, -1, 62, -1, -1, -1, -1, + -1, 68, 69, 70, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 81, 82, -1, -1, -1, 86, + -1, -1, -1, -1, -1, 92, 93, 94, -1, 46, + 97, 48, 49, 50, -1, -1, 53, -1, -1, -1, + 57, -1, -1, -1, -1, 62, -1, -1, -1, -1, + -1, 68, 69, 70, 44, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 81, 82, 56, -1, -1, 86, + 60, -1, -1, 63, -1, 92, 93, 94, -1, 44, + 97, 71, -1, 73, -1, -1, 76, 77, 78, -1, + -1, 56, -1, -1, -1, 60, -1, 87, 63, -1, + -1, 91, -1, -1, 44, 95, 71, -1, 73, -1, + -1, 76, 77, 78, -1, 105, 56, -1, -1, -1, + 60, -1, 87, 63, -1, -1, 91, -1, -1, 44, + 95, 71, -1, 73, 124, -1, 76, 77, 78, -1, + 105, 56, -1, -1, -1, 60, -1, 87, 63, -1, + -1, 91, -1, -1, 44, 95, 71, -1, 73, 124, + -1, 76, 77, 78, -1, 105, 56, -1, -1, -1, + 60, -1, 87, 63, -1, -1, 91, -1, -1, -1, + 95, 71, -1, 73, 124, -1, 76, 77, 78, -1, + 105, -1, -1, -1, -1, -1, -1, 87, -1, -1, + -1, 91, -1, -1, -1, 95, -1, -1, -1, 124, + -1, -1, -1, -1, -1, 105, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, 124 +}; +#define YYPURE 1 + +/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ +#line 3 "/usr/share/bison.simple" +/* This file comes from bison-1.28. */ + +/* Skeleton output parser for bison, + Copyright (C) 1984, 1989, 1990 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., 59 Temple Place - Suite 330, + Boston, MA 02111-1307, 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. */ + +/* This is the parser code that is written into each bison parser + when the %semantic_parser declaration is not specified in the grammar. + It was written by Richard Stallman by simplifying the hairy parser + used when %semantic_parser is specified. */ + +#ifndef YYSTACK_USE_ALLOCA +#ifdef alloca +#define YYSTACK_USE_ALLOCA +#else /* alloca not defined */ +#ifdef __GNUC__ +#define YYSTACK_USE_ALLOCA +#define alloca __builtin_alloca +#else /* not GNU C. */ +#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) || (defined (__sun) && defined (__i386)) +#define YYSTACK_USE_ALLOCA +#include +#else /* not sparc */ +/* We think this test detects Watcom and Microsoft C. */ +/* This used to test MSDOS, but that is a bad idea + since that symbol is in the user namespace. */ +#if (defined (_MSDOS) || defined (_MSDOS_)) && !defined (__TURBOC__) +#if 0 /* No need for malloc.h, which pollutes the namespace; + instead, just don't use alloca. */ +#include +#endif +#else /* not MSDOS, or __TURBOC__ */ +#if defined(_AIX) +/* I don't know what this was needed for, but it pollutes the namespace. + So I turned it off. rms, 2 May 1997. */ +/* #include */ + #pragma alloca +#define YYSTACK_USE_ALLOCA +#else /* not MSDOS, or __TURBOC__, or _AIX */ +#if 0 +#ifdef __hpux /* haible@ilog.fr says this works for HPUX 9.05 and up, + and on HPUX 10. Eventually we can turn this on. */ +#define YYSTACK_USE_ALLOCA +#define alloca __builtin_alloca +#endif /* __hpux */ +#endif +#endif /* not _AIX */ +#endif /* not MSDOS, or __TURBOC__ */ +#endif /* not sparc */ +#endif /* not GNU C */ +#endif /* alloca not defined */ +#endif /* YYSTACK_USE_ALLOCA not defined */ + +#ifdef YYSTACK_USE_ALLOCA +#define YYSTACK_ALLOC alloca #else -# define YYERROR_VERBOSE 0 +#define YYSTACK_ALLOC malloc #endif -#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 /* obsolescent; will be withdrawn */ -# define YYLTYPE_IS_DECLARED 1 -# define YYLTYPE_IS_TRIVIAL 1 -#endif - - -/* Copy the second part of user declarations. */ - - -/* Line 213 of yacc.c. */ -#line 496 "y.tab.c" - -#if ! defined (yyoverflow) || YYERROR_VERBOSE - -# ifndef YYFREE -# define YYFREE free -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# endif - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# else -# define YYSTACK_ALLOC alloca -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) -# else -# if defined (__STDC__) || defined (__cplusplus) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# endif -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# endif -#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ - - -#if (! defined (yyoverflow) \ - && (! defined (__cplusplus) \ - || (defined (YYLTYPE_IS_TRIVIAL) && YYLTYPE_IS_TRIVIAL \ - && defined (YYSTYPE_IS_TRIVIAL) && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - short int yyss; - YYSTYPE yyvs; - YYLTYPE yyls; -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short int) + sizeof (YYSTYPE) + sizeof (YYLTYPE)) \ - + 2 * YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined (__GNUC__) && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - register YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (0) -# endif -# endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - elements in the stack, and YYPTR gives the new location of the - stack. Advance YYPTR to a properly aligned location for the next - stack. */ -# define YYSTACK_RELOCATE(Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (0) - -#endif - -#if defined (__STDC__) || defined (__cplusplus) - typedef signed char yysigned_char; -#else - typedef short int yysigned_char; -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 69 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 3404 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 126 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 94 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 529 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 942 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 356 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const unsigned char yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 124, 2, 2, 2, 117, 110, 2, - 120, 122, 115, 113, 103, 114, 119, 116, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 105, 104, - 111, 106, 112, 107, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 121, 2, 125, 109, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 102, 108, 123, 118, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101 -}; - -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const unsigned short int yyprhs[] = -{ - 0, 0, 3, 6, 9, 12, 14, 17, 20, 22, - 26, 31, 32, 38, 40, 42, 44, 46, 48, 50, - 53, 55, 57, 60, 63, 66, 69, 70, 74, 76, - 79, 83, 86, 89, 92, 95, 98, 101, 104, 107, - 109, 113, 117, 118, 123, 124, 130, 133, 138, 141, - 146, 147, 152, 153, 159, 163, 166, 171, 174, 179, - 180, 187, 188, 195, 196, 204, 205, 216, 217, 229, - 230, 239, 240, 250, 252, 254, 256, 261, 267, 269, - 271, 273, 275, 277, 279, 281, 283, 285, 287, 289, - 291, 293, 295, 297, 299, 301, 303, 305, 307, 309, - 311, 313, 315, 317, 319, 321, 323, 325, 327, 329, - 331, 333, 335, 337, 340, 343, 345, 347, 349, 351, - 352, 359, 361, 363, 365, 369, 372, 377, 381, 386, - 388, 390, 392, 395, 397, 400, 403, 406, 409, 413, - 418, 422, 426, 427, 434, 436, 438, 440, 444, 447, - 449, 453, 455, 458, 460, 463, 465, 469, 475, 479, - 484, 486, 488, 491, 493, 497, 501, 507, 511, 515, - 520, 522, 524, 526, 528, 531, 534, 537, 541, 546, - 548, 550, 552, 555, 558, 561, 565, 570, 578, 582, - 584, 587, 590, 593, 597, 602, 610, 612, 614, 617, - 619, 621, 623, 625, 628, 631, 633, 635, 638, 640, - 642, 644, 646, 649, 652, 654, 656, 659, 662, 665, - 668, 672, 673, 679, 680, 688, 690, 692, 695, 699, - 702, 705, 708, 712, 716, 720, 724, 728, 732, 733, - 739, 740, 747, 749, 751, 754, 756, 760, 764, 770, - 772, 774, 776, 778, 779, 786, 791, 794, 798, 800, - 802, 804, 806, 808, 810, 812, 814, 816, 818, 820, - 822, 825, 828, 831, 834, 836, 839, 841, 845, 848, - 850, 851, 854, 856, 859, 861, 863, 865, 867, 869, - 871, 873, 875, 877, 879, 881, 883, 885, 887, 889, - 891, 893, 895, 897, 899, 901, 903, 905, 907, 909, - 911, 913, 915, 917, 919, 921, 923, 925, 927, 929, - 931, 933, 935, 937, 939, 941, 943, 945, 947, 949, - 951, 953, 955, 957, 959, 961, 963, 965, 967, 969, - 971, 973, 975, 977, 979, 981, 983, 985, 987, 989, - 991, 993, 995, 997, 999, 1001, 1003, 1005, 1007, 1009, - 1011, 1013, 1015, 1017, 1019, 1021, 1023, 1025, 1027, 1029, - 1031, 1033, 1035, 1037, 1039, 1041, 1043, 1045, 1047, 1049, - 1051, 1053, 1055, 1057, 1059, 1061, 1063, 1065, 1067, 1071, - 1073, 1075, 1077, 1079, 1081, 1085, 1087, 1092, 1100, 1108, - 1113, 1116, 1119, 1122, 1125, 1128, 1132, 1136, 1140, 1144, - 1148, 1152, 1156, 1160, 1164, 1168, 1172, 1176, 1180, 1184, - 1188, 1194, 1199, 1204, 1208, 1212, 1216, 1220, 1222, 1227, - 1235, 1243, 1248, 1253, 1258, 1263, 1268, 1273, 1278, 1283, - 1288, 1293, 1298, 1303, 1306, 1312, 1315, 1318, 1321, 1324, - 1327, 1331, 1335, 1339, 1343, 1347, 1351, 1355, 1359, 1363, - 1367, 1371, 1375, 1379, 1383, 1387, 1391, 1395, 1401, 1406, - 1411, 1415, 1419, 1423, 1427, 1429, 1431, 1433, 1435, 1437, - 1439, 1441, 1443, 1448, 1456, 1464, 1469, 1472, 1478, 1481, - 1484, 1487, 1490, 1494, 1498, 1502, 1506, 1510, 1514, 1518, - 1522, 1526, 1530, 1534, 1538, 1542, 1546, 1550, 1554, 1558, - 1564, 1569, 1574, 1578, 1582, 1586, 1590, 1592, 1594, 1596, - 1598, 1600, 1602, 1604, 1607, 1610, 1612, 1614, 1616, 1619 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const short int yyrhs[] = -{ - 127, 0, -1, 99, 128, -1, 100, 212, -1, 101, - 181, -1, 219, -1, 128, 104, -1, 128, 133, -1, - 130, -1, 129, 103, 130, -1, 217, 120, 209, 122, - -1, -1, 136, 102, 132, 128, 123, -1, 137, -1, - 159, -1, 131, -1, 197, -1, 199, -1, 134, -1, - 90, 143, -1, 44, -1, 56, -1, 60, 105, -1, - 77, 105, -1, 76, 105, -1, 75, 105, -1, -1, - 63, 135, 133, -1, 219, -1, 136, 58, -1, 136, - 58, 218, -1, 136, 83, -1, 136, 67, -1, 136, - 95, -1, 136, 59, -1, 136, 97, -1, 136, 71, - -1, 136, 78, -1, 136, 45, -1, 138, -1, 136, - 179, 104, -1, 136, 148, 171, -1, -1, 136, 179, - 139, 141, -1, -1, 136, 51, 178, 140, 142, -1, - 165, 171, -1, 165, 170, 103, 141, -1, 165, 171, - -1, 165, 170, 103, 142, -1, -1, 136, 179, 144, - 146, -1, -1, 136, 51, 178, 145, 147, -1, 136, - 148, 171, -1, 165, 171, -1, 165, 170, 103, 146, - -1, 165, 171, -1, 165, 170, 103, 147, -1, -1, - 8, 120, 149, 167, 122, 156, -1, -1, 9, 120, - 150, 167, 122, 156, -1, -1, 118, 217, 120, 151, - 167, 122, 156, -1, -1, 9, 120, 115, 165, 122, - 120, 152, 167, 122, 156, -1, -1, 9, 120, 10, - 115, 165, 122, 120, 153, 167, 122, 156, -1, -1, - 74, 178, 175, 120, 154, 167, 122, 156, -1, -1, - 74, 51, 178, 175, 120, 155, 167, 122, 156, -1, - 8, -1, 219, -1, 51, -1, 156, 87, 120, 122, - -1, 156, 87, 120, 217, 122, -1, 124, -1, 118, - -1, 115, -1, 116, -1, 117, -1, 113, -1, 114, - -1, 108, -1, 110, -1, 109, -1, 13, -1, 14, - -1, 15, -1, 16, -1, 17, -1, 18, -1, 111, - -1, 112, -1, 19, -1, 20, -1, 106, -1, 103, - -1, 31, -1, 32, -1, 33, -1, 34, -1, 35, - -1, 36, -1, 37, -1, 38, -1, 39, -1, 40, - -1, 41, -1, 42, -1, 29, -1, 121, 125, -1, - 120, 122, -1, 73, -1, 52, -1, 137, -1, 159, - -1, -1, 86, 160, 111, 161, 112, 158, -1, 219, - -1, 162, -1, 163, -1, 162, 103, 163, -1, 50, - 217, -1, 50, 217, 106, 181, -1, 164, 176, 169, - -1, 51, 164, 176, 169, -1, 200, -1, 8, -1, - 9, -1, 91, 217, -1, 217, -1, 74, 157, -1, - 51, 165, -1, 115, 165, -1, 110, 165, -1, 10, - 115, 165, -1, 165, 121, 208, 125, -1, 165, 105, - 4, -1, 120, 165, 122, -1, -1, 165, 120, 166, - 167, 122, 156, -1, 219, -1, 12, -1, 168, -1, - 168, 103, 12, -1, 168, 12, -1, 174, -1, 168, - 103, 174, -1, 219, -1, 106, 211, -1, 219, -1, - 106, 212, -1, 104, -1, 102, 204, 123, -1, 105, - 129, 102, 204, 123, -1, 106, 212, 104, -1, 106, - 102, 172, 123, -1, 219, -1, 173, -1, 173, 103, - -1, 212, -1, 102, 172, 123, -1, 173, 103, 212, - -1, 173, 103, 102, 172, 123, -1, 178, 176, 170, - -1, 8, 176, 170, -1, 51, 178, 176, 170, -1, - 214, -1, 219, -1, 8, -1, 9, -1, 51, 175, - -1, 115, 175, -1, 110, 175, -1, 10, 115, 175, - -1, 175, 121, 208, 125, -1, 219, -1, 8, -1, - 9, -1, 51, 176, -1, 115, 176, -1, 110, 176, - -1, 10, 115, 176, -1, 176, 121, 208, 125, -1, - 120, 176, 122, 120, 167, 122, 156, -1, 120, 176, - 122, -1, 219, -1, 51, 177, -1, 115, 177, -1, - 110, 177, -1, 10, 115, 177, -1, 177, 121, 208, - 125, -1, 120, 177, 122, 120, 167, 122, 156, -1, - 200, -1, 9, -1, 91, 217, -1, 182, -1, 184, - -1, 189, -1, 191, -1, 196, 217, -1, 195, 217, - -1, 200, -1, 9, -1, 91, 217, -1, 182, -1, - 184, -1, 189, -1, 191, -1, 196, 217, -1, 195, - 217, -1, 200, -1, 9, -1, 91, 217, -1, 196, - 217, -1, 195, 217, -1, 178, 177, -1, 51, 178, - 177, -1, -1, 196, 102, 183, 128, 123, -1, -1, - 196, 217, 185, 186, 102, 128, 123, -1, 219, -1, - 187, -1, 105, 188, -1, 187, 103, 188, -1, 77, - 216, -1, 76, 216, -1, 75, 216, -1, 95, 77, - 216, -1, 95, 76, 216, -1, 95, 75, 216, -1, - 77, 95, 216, -1, 76, 95, 216, -1, 75, 95, - 216, -1, -1, 195, 102, 190, 193, 123, -1, -1, - 195, 217, 102, 192, 193, 123, -1, 219, -1, 194, - -1, 194, 103, -1, 217, -1, 217, 106, 212, -1, - 194, 103, 217, -1, 194, 103, 217, 106, 212, -1, - 57, -1, 50, -1, 85, -1, 92, -1, -1, 72, - 217, 102, 198, 128, 123, -1, 72, 102, 128, 123, - -1, 94, 217, -1, 94, 72, 217, -1, 201, -1, - 202, -1, 203, -1, 46, -1, 48, -1, 49, -1, - 80, -1, 69, -1, 70, -1, 93, -1, 81, -1, - 68, -1, 80, 201, -1, 69, 201, -1, 93, 201, - -1, 81, 201, -1, 62, -1, 69, 62, -1, 53, - -1, 69, 69, 62, -1, 69, 53, -1, 96, -1, - -1, 205, 206, -1, 219, -1, 206, 207, -1, 3, - -1, 4, -1, 6, -1, 5, -1, 8, -1, 9, - -1, 10, -1, 7, -1, 12, -1, 13, -1, 14, - -1, 15, -1, 16, -1, 17, -1, 18, -1, 19, - -1, 20, -1, 21, -1, 22, -1, 29, -1, 30, - -1, 31, -1, 32, -1, 33, -1, 34, -1, 35, - -1, 36, -1, 37, -1, 38, -1, 39, -1, 40, - -1, 41, -1, 42, -1, 46, -1, 47, -1, 48, - -1, 49, -1, 50, -1, 51, -1, 52, -1, 53, - -1, 54, -1, 55, -1, 57, -1, 58, -1, 59, - -1, 61, -1, 62, -1, 63, -1, 64, -1, 65, - -1, 66, -1, 67, -1, 68, -1, 69, -1, 71, - -1, 73, -1, 75, -1, 76, -1, 77, -1, 60, - -1, 78, -1, 79, -1, 80, -1, 81, -1, 82, - -1, 83, -1, 84, -1, 85, -1, 87, -1, 88, - -1, 89, -1, 90, -1, 91, -1, 92, -1, 93, - -1, 95, -1, 96, -1, 97, -1, 98, -1, 43, - -1, 74, -1, 113, -1, 114, -1, 115, -1, 116, - -1, 110, -1, 108, -1, 109, -1, 124, -1, 118, - -1, 106, -1, 117, -1, 111, -1, 112, -1, 120, - -1, 122, -1, 119, -1, 103, -1, 104, -1, 105, - -1, 121, -1, 125, -1, 107, -1, 102, 206, 123, - -1, 219, -1, 212, -1, 219, -1, 210, -1, 212, - -1, 210, 103, 212, -1, 213, -1, 120, 181, 122, - 211, -1, 84, 111, 181, 112, 120, 210, 122, -1, - 54, 111, 181, 112, 120, 210, 122, -1, 82, 120, - 181, 122, -1, 124, 211, -1, 118, 211, -1, 114, - 211, -1, 115, 211, -1, 110, 211, -1, 211, 115, - 211, -1, 211, 116, 211, -1, 211, 117, 211, -1, - 211, 113, 211, -1, 211, 114, 211, -1, 211, 108, - 211, -1, 211, 110, 211, -1, 211, 13, 211, -1, - 211, 14, 211, -1, 211, 15, 211, -1, 211, 16, - 211, -1, 211, 17, 211, -1, 211, 18, 211, -1, - 211, 19, 211, -1, 211, 20, 211, -1, 211, 107, - 211, 105, 211, -1, 211, 121, 212, 125, -1, 211, - 120, 210, 122, -1, 211, 120, 122, -1, 211, 119, - 211, -1, 211, 29, 211, -1, 120, 210, 122, -1, - 213, -1, 120, 181, 122, 212, -1, 84, 111, 181, - 112, 120, 210, 122, -1, 54, 111, 181, 112, 120, - 210, 122, -1, 9, 120, 209, 122, -1, 68, 120, - 209, 122, -1, 48, 120, 209, 122, -1, 49, 120, - 209, 122, -1, 46, 120, 209, 122, -1, 80, 120, - 209, 122, -1, 69, 120, 209, 122, -1, 93, 120, - 209, 122, -1, 81, 120, 209, 122, -1, 62, 120, - 209, 122, -1, 53, 120, 209, 122, -1, 82, 120, - 181, 122, -1, 73, 180, -1, 73, 180, 120, 209, - 122, -1, 124, 212, -1, 118, 212, -1, 114, 212, - -1, 115, 212, -1, 110, 212, -1, 212, 115, 212, - -1, 212, 116, 212, -1, 212, 117, 212, -1, 212, - 113, 212, -1, 212, 114, 212, -1, 212, 108, 212, - -1, 212, 110, 212, -1, 212, 13, 212, -1, 212, - 14, 212, -1, 212, 15, 212, -1, 212, 16, 212, - -1, 212, 17, 212, -1, 212, 18, 212, -1, 212, - 111, 212, -1, 212, 112, 212, -1, 212, 19, 212, - -1, 212, 20, 212, -1, 212, 107, 212, 105, 212, - -1, 212, 121, 212, 125, -1, 212, 120, 210, 122, - -1, 212, 120, 122, -1, 212, 119, 212, -1, 212, - 29, 212, -1, 120, 210, 122, -1, 4, -1, 88, - -1, 61, -1, 5, -1, 3, -1, 218, -1, 8, - -1, 215, -1, 120, 181, 122, 212, -1, 84, 111, - 181, 112, 120, 210, 122, -1, 54, 111, 181, 112, - 120, 210, 122, -1, 82, 120, 181, 122, -1, 73, - 180, -1, 73, 180, 120, 209, 122, -1, 124, 212, - -1, 118, 212, -1, 114, 212, -1, 110, 212, -1, - 214, 115, 212, -1, 214, 116, 212, -1, 214, 117, - 212, -1, 214, 113, 212, -1, 214, 114, 212, -1, - 214, 108, 212, -1, 214, 110, 212, -1, 214, 13, - 212, -1, 214, 14, 212, -1, 214, 15, 212, -1, - 214, 16, 212, -1, 214, 17, 212, -1, 214, 18, - 212, -1, 214, 111, 212, -1, 214, 112, 212, -1, - 214, 19, 212, -1, 214, 20, 212, -1, 214, 107, - 212, 105, 212, -1, 214, 121, 212, 125, -1, 214, - 120, 210, 122, -1, 214, 120, 122, -1, 214, 119, - 212, -1, 214, 29, 212, -1, 120, 210, 122, -1, - 4, -1, 88, -1, 61, -1, 5, -1, 3, -1, - 218, -1, 217, -1, 196, 217, -1, 91, 217, -1, - 8, -1, 9, -1, 6, -1, 218, 6, -1, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const unsigned short int yyrline[] = -{ - 0, 379, 379, 380, 384, 391, 392, 393, 397, 398, - 402, 415, 414, 426, 427, 428, 429, 430, 431, 432, - 433, 446, 455, 459, 467, 471, 479, 478, 493, 497, - 501, 512, 516, 520, 524, 528, 532, 536, 540, 547, - 551, 560, 572, 571, 587, 586, 604, 612, 623, 632, - 646, 645, 661, 660, 671, 685, 693, 704, 713, 728, - 727, 750, 749, 774, 773, 804, 803, 819, 818, 836, - 835, 867, 866, 892, 905, 909, 913, 917, 924, 928, - 932, 936, 940, 944, 948, 952, 956, 960, 964, 968, - 972, 976, 980, 984, 988, 992, 996, 1000, 1004, 1008, - 1012, 1016, 1020, 1024, 1028, 1032, 1036, 1040, 1044, 1048, - 1052, 1056, 1060, 1064, 1068, 1072, 1076, 1083, 1084, 1089, - 1088, 1099, 1100, 1104, 1110, 1119, 1123, 1127, 1133, 1143, - 1147, 1152, 1157, 1165, 1169, 1183, 1188, 1193, 1198, 1203, - 1208, 1213, 1219, 1218, 1240, 1244, 1249, 1253, 1258, 1266, - 1271, 1279, 1283, 1290, 1294, 1301, 1305, 1309, 1313, 1317, - 1324, 1325, 1326, 1330, 1333, 1334, 1335, 1339, 1344, 1352, - 1358, 1368, 1372, 1376, 1380, 1385, 1390, 1395, 1400, 1408, - 1412, 1416, 1420, 1425, 1430, 1435, 1440, 1445, 1451, 1459, - 1463, 1468, 1473, 1478, 1483, 1488, 1497, 1501, 1506, 1510, - 1514, 1518, 1522, 1526, 1542, 1561, 1565, 1570, 1574, 1578, - 1582, 1586, 1590, 1606, 1625, 1629, 1634, 1638, 1654, 1673, - 1679, 1690, 1689, 1714, 1713, 1743, 1744, 1748, 1749, 1753, - 1757, 1761, 1765, 1769, 1773, 1777, 1781, 1785, 1793, 1792, - 1805, 1804, 1816, 1817, 1818, 1822, 1827, 1832, 1837, 1845, - 1852, 1856, 1860, 1868, 1867, 1889, 1893, 1899, 1908, 1909, - 1910, 1914, 1918, 1922, 1926, 1931, 1936, 1941, 1946, 1951, - 1955, 1960, 1969, 1974, 1982, 1986, 1991, 1995, 2000, 2008, - 2018, 2018, 2028, 2029, 2033, 2036, 2039, 2042, 2045, 2048, - 2051, 2054, 2057, 2057, 2057, 2058, 2058, 2058, 2058, 2059, - 2059, 2059, 2059, 2059, 2060, 2060, 2060, 2061, 2061, 2061, - 2061, 2061, 2062, 2062, 2062, 2062, 2062, 2063, 2063, 2063, - 2063, 2063, 2063, 2064, 2064, 2064, 2064, 2064, 2065, 2065, - 2065, 2066, 2066, 2066, 2066, 2067, 2067, 2067, 2068, 2068, - 2068, 2068, 2068, 2069, 2069, 2069, 2069, 2070, 2070, 2070, - 2070, 2070, 2071, 2071, 2071, 2071, 2071, 2071, 2072, 2072, - 2072, 2072, 2072, 2073, 2073, 2074, 2077, 2077, 2077, 2077, - 2077, 2077, 2077, 2077, 2077, 2077, 2077, 2078, 2078, 2078, - 2078, 2078, 2078, 2078, 2078, 2078, 2078, 2079, 2079, 2083, - 2087, 2094, 2098, 2105, 2109, 2116, 2120, 2124, 2128, 2132, - 2136, 2140, 2144, 2156, 2160, 2164, 2168, 2172, 2176, 2180, - 2184, 2188, 2192, 2196, 2200, 2204, 2208, 2212, 2216, 2220, - 2224, 2228, 2232, 2236, 2240, 2244, 2248, 2256, 2260, 2264, - 2268, 2272, 2279, 2285, 2291, 2297, 2303, 2310, 2317, 2324, - 2331, 2337, 2343, 2347, 2351, 2355, 2359, 2363, 2375, 2379, - 2383, 2387, 2391, 2395, 2399, 2403, 2407, 2411, 2415, 2419, - 2423, 2427, 2431, 2435, 2439, 2443, 2447, 2451, 2455, 2459, - 2463, 2467, 2471, 2475, 2482, 2486, 2490, 2494, 2498, 2502, - 2506, 2520, 2524, 2528, 2532, 2536, 2540, 2544, 2548, 2552, - 2556, 2568, 2572, 2576, 2580, 2584, 2588, 2592, 2596, 2600, - 2604, 2608, 2612, 2616, 2620, 2624, 2628, 2632, 2636, 2640, - 2644, 2648, 2652, 2656, 2660, 2664, 2671, 2675, 2679, 2683, - 2687, 2691, 2698, 2706, 2714, 2737, 2741, 2748, 2752, 2758 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE -/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "REAL", "INTEGER", "CHAR_TOK", "STRING", - "SIMPLE_IDENTIFIER", "IDENTIFIER", "TYPENAME_IDENTIFIER", "SCOPING", - "TYPEDEFNAME", "ELLIPSIS", "OROR", "ANDAND", "EQCOMPARE", "NECOMPARE", - "LECOMPARE", "GECOMPARE", "LSHIFT", "RSHIFT", "POINTSAT_STAR", - "DOT_STAR", "UNARY", "UNARY_NOT", "UNARY_NEGATE", "UNARY_MINUS", - "UNARY_STAR", "UNARY_REF", "POINTSAT", "SCOPE", "PLUSPLUS", "MINUSMINUS", - "TIMESEQUAL", "DIVIDEEQUAL", "MODEQUAL", "PLUSEQUAL", "MINUSEQUAL", - "OREQUAL", "ANDEQUAL", "XOREQUAL", "LSHIFTEQUAL", "RSHIFTEQUAL", - "TOKENPASTE", "KW_BEGIN_PUBLISH", "KW_BLOCKING", "KW_BOOL", "KW_CATCH", - "KW_CHAR", "KW_WCHAR_T", "KW_CLASS", "KW_CONST", "KW_DELETE", - "KW_DOUBLE", "KW_DYNAMIC_CAST", "KW_ELSE", "KW_END_PUBLISH", "KW_ENUM", - "KW_EXTERN", "KW_EXPLICIT", "KW_PUBLISHED", "KW_FALSE", "KW_FLOAT", - "KW_FRIEND", "KW_FOR", "KW_GOTO", "KW_IF", "KW_INLINE", "KW_INT", - "KW_LONG", "KW_LONGLONG", "KW_MUTABLE", "KW_NAMESPACE", "KW_NEW", - "KW_OPERATOR", "KW_PRIVATE", "KW_PROTECTED", "KW_PUBLIC", "KW_REGISTER", - "KW_RETURN", "KW_SHORT", "KW_SIGNED", "KW_SIZEOF", "KW_STATIC", - "KW_STATIC_CAST", "KW_STRUCT", "KW_TEMPLATE", "KW_THROW", "KW_TRUE", - "KW_TRY", "KW_TYPEDEF", "KW_TYPENAME", "KW_UNION", "KW_UNSIGNED", - "KW_USING", "KW_VIRTUAL", "KW_VOID", "KW_VOLATILE", "KW_WHILE", - "START_CPP", "START_CONST_EXPR", "START_TYPE", "'{'", "','", "';'", - "':'", "'='", "'?'", "'|'", "'^'", "'&'", "'<'", "'>'", "'+'", "'-'", - "'*'", "'/'", "'%'", "'~'", "'.'", "'('", "'['", "')'", "'}'", "'!'", - "']'", "$accept", "grammar", "cpp", "constructor_inits", - "constructor_init", "extern_c", "@1", "declaration", - "friend_declaration", "@2", "storage_class", "type_like_declaration", - "multiple_var_declaration", "@3", "@4", "multiple_instance_identifiers", - "multiple_const_instance_identifiers", "typedef_declaration", "@5", "@6", - "typedef_instance_identifiers", "typedef_const_instance_identifiers", - "function_prototype", "@7", "@8", "@9", "@10", "@11", "@12", "@13", - "function_post", "function_operator", "more_template_declaration", - "template_declaration", "@14", "template_formal_parameters", - "template_nonempty_formal_parameters", "template_formal_parameter", - "template_formal_parameter_type", "instance_identifier", "@15", - "formal_parameter_list", "formal_parameters", - "template_parameter_maybe_initialize", "maybe_initialize", - "maybe_initialize_or_function_body", "structure_init", - "structure_init_body", "formal_parameter", - "not_paren_formal_parameter_identifier", "formal_parameter_identifier", - "empty_instance_identifier", "type", "type_decl", "predefined_type", - "full_type", "anonymous_struct", "@16", "named_struct", "@17", - "maybe_class_derivation", "class_derivation", "base_specification", - "anonymous_enum", "@18", "named_enum", "@19", "enum_body", - "enum_body_no_trailing_comma", "enum_keyword", "struct_keyword", - "namespace_declaration", "@20", "using_declaration", "simple_type", - "simple_int_type", "simple_float_type", "simple_void_type", "code", - "@21", "code_block", "element", "optional_const_expr", - "optional_const_expr_comma", "const_expr_comma", - "no_angle_bracket_const_expr", "const_expr", "const_operand", - "formal_const_expr", "formal_const_operand", "class_derivation_name", - "name", "string", "empty", 0 -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const unsigned short int yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 123, 44, 59, 58, 61, 63, 124, 94, - 38, 60, 62, 43, 45, 42, 47, 37, 126, 46, - 40, 91, 41, 125, 33, 93 -}; -# endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const unsigned char yyr1[] = -{ - 0, 126, 127, 127, 127, 128, 128, 128, 129, 129, - 130, 132, 131, 133, 133, 133, 133, 133, 133, 133, - 133, 133, 133, 133, 133, 133, 135, 134, 136, 136, - 136, 136, 136, 136, 136, 136, 136, 136, 136, 137, - 137, 137, 139, 138, 140, 138, 141, 141, 142, 142, - 144, 143, 145, 143, 143, 146, 146, 147, 147, 149, - 148, 150, 148, 151, 148, 152, 148, 153, 148, 154, - 148, 155, 148, 148, 156, 156, 156, 156, 157, 157, - 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, - 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, - 157, 157, 157, 157, 157, 157, 157, 157, 157, 157, - 157, 157, 157, 157, 157, 157, 157, 158, 158, 160, - 159, 161, 161, 162, 162, 163, 163, 163, 163, 164, - 164, 164, 164, 165, 165, 165, 165, 165, 165, 165, - 165, 165, 166, 165, 167, 167, 167, 167, 167, 168, - 168, 169, 169, 170, 170, 171, 171, 171, 171, 171, - 172, 172, 172, 173, 173, 173, 173, 174, 174, 174, - 174, 175, 175, 175, 175, 175, 175, 175, 175, 176, - 176, 176, 176, 176, 176, 176, 176, 176, 176, 177, - 177, 177, 177, 177, 177, 177, 178, 178, 178, 178, - 178, 178, 178, 178, 178, 179, 179, 179, 179, 179, - 179, 179, 179, 179, 180, 180, 180, 180, 180, 181, - 181, 183, 182, 185, 184, 186, 186, 187, 187, 188, - 188, 188, 188, 188, 188, 188, 188, 188, 190, 189, - 192, 191, 193, 193, 193, 194, 194, 194, 194, 195, - 196, 196, 196, 198, 197, 197, 199, 199, 200, 200, - 200, 201, 201, 201, 201, 201, 201, 201, 201, 201, - 201, 201, 201, 201, 202, 202, 202, 202, 202, 203, - 205, 204, 206, 206, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, - 207, 207, 207, 207, 207, 207, 207, 207, 207, 208, - 208, 209, 209, 210, 210, 211, 211, 211, 211, 211, - 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, - 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, - 211, 211, 211, 211, 211, 211, 211, 212, 212, 212, - 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, - 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, - 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, - 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, - 212, 212, 212, 212, 213, 213, 213, 213, 213, 213, - 213, 214, 214, 214, 214, 214, 214, 214, 214, 214, - 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, - 214, 214, 214, 214, 214, 214, 214, 214, 214, 214, - 214, 214, 214, 214, 214, 214, 215, 215, 215, 215, - 215, 215, 216, 216, 216, 217, 217, 218, 218, 219 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const unsigned char yyr2[] = -{ - 0, 2, 2, 2, 2, 1, 2, 2, 1, 3, - 4, 0, 5, 1, 1, 1, 1, 1, 1, 2, - 1, 1, 2, 2, 2, 2, 0, 3, 1, 2, - 3, 2, 2, 2, 2, 2, 2, 2, 2, 1, - 3, 3, 0, 4, 0, 5, 2, 4, 2, 4, - 0, 4, 0, 5, 3, 2, 4, 2, 4, 0, - 6, 0, 6, 0, 7, 0, 10, 0, 11, 0, - 8, 0, 9, 1, 1, 1, 4, 5, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 2, 2, 1, 1, 1, 1, 0, - 6, 1, 1, 1, 3, 2, 4, 3, 4, 1, - 1, 1, 2, 1, 2, 2, 2, 2, 3, 4, - 3, 3, 0, 6, 1, 1, 1, 3, 2, 1, - 3, 1, 2, 1, 2, 1, 3, 5, 3, 4, - 1, 1, 2, 1, 3, 3, 5, 3, 3, 4, - 1, 1, 1, 1, 2, 2, 2, 3, 4, 1, - 1, 1, 2, 2, 2, 3, 4, 7, 3, 1, - 2, 2, 2, 3, 4, 7, 1, 1, 2, 1, - 1, 1, 1, 2, 2, 1, 1, 2, 1, 1, - 1, 1, 2, 2, 1, 1, 2, 2, 2, 2, - 3, 0, 5, 0, 7, 1, 1, 2, 3, 2, - 2, 2, 3, 3, 3, 3, 3, 3, 0, 5, - 0, 6, 1, 1, 2, 1, 3, 3, 5, 1, - 1, 1, 1, 0, 6, 4, 2, 3, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 1, 2, 1, 3, 2, 1, - 0, 2, 1, 2, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 3, 1, - 1, 1, 1, 1, 3, 1, 4, 7, 7, 4, - 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 5, 4, 4, 3, 3, 3, 3, 1, 4, 7, - 7, 4, 4, 4, 4, 4, 4, 4, 4, 4, - 4, 4, 4, 2, 5, 2, 2, 2, 2, 2, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 5, 4, 4, - 3, 3, 3, 3, 1, 1, 1, 1, 1, 1, - 1, 1, 4, 7, 7, 4, 2, 5, 2, 2, - 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 5, - 4, 4, 3, 3, 3, 3, 1, 1, 1, 1, - 1, 1, 1, 2, 2, 1, 1, 1, 2, 0 -}; - -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const unsigned short int yydefact[] = -{ - 0, 529, 0, 0, 0, 529, 5, 478, 474, 477, - 527, 480, 0, 0, 0, 0, 0, 0, 476, 0, - 0, 0, 0, 0, 0, 0, 0, 475, 0, 0, - 0, 0, 0, 0, 0, 3, 427, 479, 197, 261, - 262, 263, 250, 0, 276, 249, 274, 269, 265, 266, - 264, 268, 251, 0, 252, 267, 279, 529, 4, 199, - 200, 201, 202, 0, 0, 196, 258, 259, 260, 1, - 20, 21, 0, 26, 0, 0, 0, 0, 119, 529, - 0, 6, 15, 7, 18, 0, 13, 39, 14, 16, - 17, 28, 529, 529, 529, 529, 529, 0, 529, 529, - 529, 215, 0, 443, 0, 0, 214, 529, 529, 0, - 0, 529, 449, 447, 448, 446, 197, 261, 262, 263, - 276, 274, 269, 265, 264, 268, 267, 0, 0, 393, - 445, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 528, 529, 278, 275, 265, 271, 265, - 270, 273, 525, 526, 198, 272, 0, 529, 529, 529, - 529, 219, 189, 238, 204, 221, 203, 22, 529, 529, - 0, 25, 24, 23, 0, 0, 19, 0, 256, 73, - 206, 38, 0, 29, 34, 32, 36, 0, 37, 31, - 0, 33, 35, 11, 0, 0, 42, 208, 209, 210, - 211, 0, 0, 205, 0, 392, 391, 0, 0, 0, - 0, 0, 0, 0, 0, 216, 529, 218, 217, 0, - 0, 0, 0, 0, 0, 0, 473, 457, 458, 459, - 460, 461, 462, 465, 466, 472, 0, 455, 456, 463, - 464, 453, 454, 450, 451, 452, 471, 470, 0, 0, - 220, 277, 529, 190, 192, 191, 0, 529, 529, 240, - 529, 529, 27, 529, 253, 529, 0, 0, 50, 257, - 59, 61, 44, 30, 0, 529, 207, 529, 0, 280, - 155, 0, 0, 41, 40, 0, 213, 212, 431, 435, - 433, 434, 441, 0, 440, 432, 437, 0, 436, 439, - 442, 0, 438, 428, 394, 0, 469, 468, 193, 0, - 0, 390, 389, 0, 243, 245, 242, 529, 529, 0, - 0, 226, 225, 255, 529, 130, 131, 0, 0, 0, - 0, 122, 123, 529, 129, 121, 52, 54, 0, 529, - 0, 0, 529, 0, 529, 172, 173, 0, 529, 529, - 529, 0, 171, 529, 63, 0, 529, 0, 8, 0, - 529, 0, 0, 0, 0, 0, 0, 0, 43, 529, - 133, 0, 444, 0, 467, 529, 194, 239, 244, 0, - 0, 222, 0, 0, 0, 0, 227, 529, 0, 529, - 125, 529, 132, 529, 0, 180, 181, 0, 529, 529, - 529, 529, 529, 179, 0, 51, 529, 520, 516, 519, - 529, 145, 0, 0, 518, 0, 0, 0, 517, 0, - 0, 0, 0, 0, 0, 146, 149, 529, 170, 481, - 521, 144, 0, 0, 0, 45, 529, 0, 529, 174, - 176, 175, 69, 529, 12, 529, 156, 281, 282, 280, - 0, 529, 529, 0, 161, 163, 160, 158, 0, 135, - 88, 89, 90, 91, 92, 93, 96, 97, 112, 100, - 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, - 111, 116, 115, 99, 98, 85, 87, 86, 94, 95, - 83, 84, 80, 81, 82, 79, 0, 0, 78, 134, - 137, 136, 0, 0, 0, 142, 529, 0, 46, 153, - 0, 0, 0, 247, 246, 241, 0, 0, 0, 231, - 522, 0, 230, 0, 229, 0, 0, 0, 529, 228, - 254, 0, 529, 0, 117, 120, 118, 124, 529, 182, - 184, 183, 0, 0, 529, 127, 151, 53, 529, 0, - 55, 529, 529, 0, 486, 0, 0, 491, 490, 489, - 0, 0, 488, 529, 148, 0, 529, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 529, 0, 48, 71, 177, 529, 0, 0, - 284, 285, 287, 286, 291, 288, 289, 290, 292, 293, - 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, - 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, - 314, 315, 316, 364, 317, 318, 319, 320, 321, 322, - 323, 324, 325, 326, 327, 328, 329, 344, 330, 331, - 332, 333, 334, 335, 336, 337, 338, 339, 340, 365, - 341, 342, 343, 345, 346, 347, 348, 349, 350, 351, - 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, - 362, 363, 529, 382, 383, 384, 375, 387, 371, 372, - 370, 377, 378, 366, 367, 368, 369, 376, 374, 381, - 379, 385, 380, 373, 386, 283, 0, 9, 0, 0, - 159, 162, 138, 114, 113, 141, 140, 154, 529, 0, - 0, 430, 429, 529, 0, 524, 237, 523, 236, 235, - 234, 233, 232, 224, 126, 128, 185, 188, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 152, 395, 0, - 0, 57, 0, 0, 168, 529, 0, 529, 0, 0, - 0, 515, 75, 60, 74, 147, 150, 167, 499, 500, - 501, 502, 503, 504, 507, 508, 514, 0, 497, 498, - 505, 506, 495, 496, 492, 493, 494, 513, 512, 0, - 0, 0, 65, 62, 0, 529, 0, 178, 529, 0, - 157, 10, 164, 529, 165, 0, 139, 47, 195, 248, - 529, 0, 0, 0, 404, 402, 403, 401, 0, 0, - 400, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 186, 0, 56, 154, 169, 0, 0, 485, 0, - 482, 0, 0, 511, 510, 67, 529, 49, 0, 529, - 64, 388, 0, 529, 0, 0, 0, 0, 0, 426, - 412, 413, 414, 415, 416, 417, 418, 419, 425, 0, - 410, 411, 408, 409, 405, 406, 407, 424, 423, 0, - 0, 58, 0, 487, 0, 0, 509, 529, 0, 529, - 70, 166, 143, 529, 0, 399, 0, 396, 0, 422, - 421, 0, 0, 76, 0, 0, 529, 72, 187, 0, - 0, 420, 484, 483, 77, 529, 66, 0, 0, 68, - 398, 397 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const short int yydefgoto[] = -{ - -1, 4, 5, 367, 368, 82, 287, 83, 84, 178, - 85, 86, 87, 295, 353, 378, 445, 186, 348, 414, - 415, 557, 205, 349, 352, 455, 866, 907, 607, 805, - 773, 509, 545, 88, 184, 340, 341, 342, 343, 379, - 728, 434, 435, 555, 517, 293, 463, 464, 436, 361, - 412, 171, 57, 206, 103, 58, 59, 270, 60, 271, - 330, 331, 396, 61, 268, 62, 327, 323, 324, 63, - 64, 89, 334, 90, 65, 66, 67, 68, 365, 366, - 457, 715, 320, 214, 215, 757, 129, 36, 438, 439, - 529, 380, 37, 216 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -488 -static const short int yypact[] = -{ - -11, -488, 1989, 3039, 29, 2877, -488, -488, -488, -488, - -488, -488, -87, -77, -69, -52, -41, -28, -488, -23, - -17, -7, 3137, 7, 25, 51, 14, -488, 59, 1989, - 1989, 1989, 1989, 1191, 1989, 2577, -488, 129, -488, -488, - -488, -488, -488, 3186, -488, -488, -488, -488, 1463, -488, - 1437, 1437, -488, 101, -488, 1437, -488, 24, -488, -488, - -488, -488, -488, 27, 49, -488, -488, -488, -488, -488, - -488, -488, 81, -488, 52, 88, 118, 120, -488, -488, - 68, -488, -488, -488, -488, 2342, -488, -488, -488, -488, - -488, -488, 1989, 1989, 1989, 1989, 1989, 3039, 1989, 1989, - 1989, -488, 101, 115, 101, 101, -488, 1989, 1989, 3039, - 3039, 1989, 156, 156, 156, 156, -87, -77, -69, -52, - -41, -23, -17, 439, 1187, 1281, 2240, 41, -40, 2577, - 156, 1989, 1989, 1989, 1989, 1989, 1989, 1989, 1989, 1989, - 1989, 1989, 1989, 1989, 1989, 1989, 1989, 1989, 1989, 1989, - 1989, 1473, 1989, -488, 24, -488, -488, 1530, -488, 1437, - -488, -488, -488, -488, -488, -488, 122, 24, 24, 24, - 24, 124, -488, -488, 138, -488, -65, -488, 3005, -488, - 153, -488, -488, -488, 149, 2397, -488, 101, -488, 161, - 177, -488, 3186, 267, -488, -488, -488, 3088, -488, -488, - 101, -488, -488, -488, 101, 183, 196, -488, -488, -488, - -488, 27, 49, -488, 184, 207, -488, 194, 221, 227, - 233, 208, 238, 242, 259, -488, 1989, -488, -488, 261, - 263, 268, 228, 270, 1989, 1989, -488, 776, 2076, 2900, - 2900, 471, 471, 188, 188, -488, 1303, 2735, 2750, 471, - 471, 251, 251, 156, 156, 156, -488, -488, -38, 2114, - 124, -488, 24, 124, 124, 124, 173, 1989, 101, -488, - -488, 288, -488, 2932, -488, 2982, 3186, 183, -488, -488, - -488, 15, -488, 129, 3186, 181, -488, -488, 275, -488, - -488, 101, 1559, -488, -488, 40, 138, -65, -488, -488, - -488, -488, -488, 277, -488, -488, -488, 281, -488, -488, - -488, 279, -488, 156, 2577, 1989, -488, -488, 124, 285, - 289, 2577, -488, 283, 315, 314, -488, 101, 3197, 299, - 319, 320, -488, -488, -488, -488, -488, 101, 2266, 101, - 313, 324, -488, 22, -488, -488, -488, -488, 40, 1285, - 322, 40, 1285, 40, 181, -488, -488, 323, 181, 181, - 181, 28, -488, 3232, -488, 312, -488, 220, -488, 326, - 1645, 2539, 334, 40, 2265, 40, 40, 40, -488, 510, - -488, 1989, -488, 1989, 2577, 1285, -488, -488, 101, 1989, - 328, -488, 689, 725, 824, 366, -488, -488, 299, 3256, - 349, 22, -488, 371, 2982, -488, -488, 343, 22, 22, - 22, 22, -47, -488, 40, -488, 510, -488, -488, -488, - 22, -488, 3186, 359, -488, 3137, 339, 360, -488, 1989, - 1989, 1989, 1191, 1989, 338, 4, -488, 22, 2594, -488, - 129, -488, 40, 143, 352, -488, 510, 209, 181, 354, - 354, 354, -488, 1989, -488, 1285, -488, 1067, -488, -488, - 101, 1989, 1645, 355, 374, 2577, -488, -488, 40, 225, - -488, -488, -488, -488, -488, -488, -488, -488, -488, -488, - -488, -488, -488, -488, -488, -488, -488, -488, -488, -488, - -488, -488, -488, -488, -488, -488, -488, -488, -488, -488, - -488, -488, -488, -488, -488, -488, 364, 377, -488, -488, - 225, 225, 308, 274, 1559, -488, 1989, 393, -488, -488, - -18, 9, 381, 398, 2577, -488, 101, 243, 101, -488, - -488, 243, -488, 243, -488, 243, 243, 243, 3281, -488, - -488, 3039, -47, 2454, -488, -488, -488, -488, 22, 378, - 378, 378, 266, 2002, 1989, -488, -488, -488, 510, 402, - -488, 37, 22, 3039, 386, 3039, 3039, 156, 156, 156, - 388, 30, 156, 461, -488, 1379, 37, 1989, 1989, 1989, - 1989, 1989, 1989, 1989, 1989, 1989, 1989, 1989, 1989, 1989, - 1989, 1989, 1989, 1989, 1989, 1989, 1989, 1731, 1989, 311, - 512, 401, 461, 415, -488, -488, 354, 1285, 399, 403, - -488, -488, -488, -488, -488, -488, -488, -488, -488, -488, - -488, -488, -488, -488, -488, -488, -488, -488, -488, -488, - -488, -488, -488, -488, -488, -488, -488, -488, -488, -488, - -488, -488, -488, -488, -488, -488, -488, -488, -488, -488, - -488, -488, -488, -488, -488, -488, -488, -488, -488, -488, - -488, -488, -488, -488, -488, -488, -488, -488, -488, -488, - -488, -488, -488, -488, -488, -488, -488, -488, -488, -488, - -488, -488, -488, -488, -488, -488, -488, -488, -488, -488, - -488, -488, -488, -488, -488, -488, -488, -488, -488, -488, - -488, -488, -488, -488, -488, -488, -488, -488, -488, -488, - -488, -488, -488, -488, -488, -488, 400, -488, 406, 408, - -488, 1817, 225, -488, -488, -488, -488, 2539, 1285, 404, - 40, -488, -488, 461, 1989, -488, -488, -488, -488, -488, - -488, -488, -488, -488, -488, -488, 378, 413, 423, 416, - 424, 2002, 2002, 2002, 2002, 1191, 2002, 2720, -488, 417, - 437, -488, 40, 1989, -488, 37, 438, 1989, 429, 440, - 1989, -488, -488, 467, -488, -488, -488, -488, 776, 2076, - 2900, 2900, 471, 471, 188, 188, -488, 2560, 2735, 2750, - 471, 471, 251, 251, 156, 156, 156, -488, -488, 43, - 2133, 435, -488, 467, 40, 1285, 434, -488, 461, 944, - -488, -488, -488, 1645, 2577, 436, -488, -488, 467, 2577, - 1285, 3039, 3039, 3039, 218, 218, 218, 218, 441, 54, - 218, 2002, 2002, 2002, 2002, 2002, 2002, 2002, 2002, 2002, - 2002, 2002, 2002, 2002, 2002, 2002, 2002, 2002, 2002, 1903, - 1989, -488, 40, -488, 2577, -488, 442, 443, -488, 444, - 156, 447, 1989, -488, -488, -488, 1285, -488, 455, 461, - 467, -488, 446, 461, 457, 469, 460, 477, 2002, -488, - 652, 2765, 2926, 2926, 519, 519, 198, 198, -488, 2611, - 2780, 2795, 348, 348, 218, 218, 218, -488, -488, 58, - 2152, -488, 1989, -488, 1989, 19, 2577, 1285, 472, 461, - 467, -488, 467, 461, 463, -488, 473, 218, 2002, -488, - -488, 72, 112, -488, 476, 478, 461, 467, 467, 1989, - 1989, 2720, -488, -488, -488, 461, 467, 119, 128, 467, - -488, -488 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const short int yypgoto[] = -{ - -488, -488, -164, -488, 135, -488, -488, 421, -488, -488, - -62, 200, -488, -488, -488, -126, -199, -488, -488, -488, - -155, -244, 425, -488, -488, -488, -488, -488, -488, -488, - -487, -488, -488, 214, -488, -488, -488, 215, 273, -306, - -488, -339, -488, 84, -402, -197, -459, -488, 53, -116, - -309, -115, -5, 452, 204, 8, -64, -488, -63, -488, - -488, -488, 265, -61, -488, -59, -488, 337, -488, -21, - 151, -488, -488, -488, -13, 133, -488, -488, 202, -488, - -27, -488, -435, -88, -31, 5, 64, -129, -488, -488, - -307, 409, -131, -1 -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -224 -static const short int yytable[] = -{ - 6, 104, 128, 719, 91, 217, 218, 219, 220, 106, - 222, 223, 224, 444, 559, 273, 574, 185, 608, 229, - 230, 207, 208, 233, 209, 350, 210, 162, 163, 69, - 405, 406, 407, 92, 166, 162, 163, -223, 154, 260, - -223, 127, 416, 93, 603, 443, 522, 446, 162, 163, - 372, 94, 263, 264, 265, 266, 172, 162, 163, 553, - 162, 163, 283, 235, 211, 235, 35, 469, 95, 510, - 511, 512, 213, 408, 554, 167, 162, 163, 91, 96, - 347, 729, 236, 97, 316, 235, 532, 534, 1, 2, - 3, 373, 542, 112, 113, 114, 115, 98, 130, 549, - 550, 551, 552, 99, 731, 221, 328, 575, 558, 162, - 163, 561, 235, 100, 374, 803, 609, 231, 232, 759, - 258, 207, 208, 363, 209, 110, 210, 107, 576, 173, - 351, 732, 409, 235, 168, 153, 599, 410, 307, 169, - 187, 923, 411, 763, 170, 108, 235, 318, 452, 453, - 375, 175, 771, 172, 179, 376, 760, 235, 554, 764, - 377, 235, 722, 234, 211, 863, 172, 172, 172, 172, - 399, 109, 213, 105, 777, 235, 879, 91, 6, 111, - 919, 158, 518, 160, 161, 139, 177, 282, 165, 355, - 356, 357, 285, 181, 932, 237, 238, 239, 240, 241, - 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, - 252, 253, 254, 255, 256, 235, 259, 139, 440, 560, - 736, 440, 235, 182, 738, 183, 739, 839, 740, 741, - 742, 235, 358, 538, 933, 226, 212, 262, 447, 746, - 269, 940, 449, 450, 451, 267, 818, 839, 600, 604, - 941, 162, 163, 765, 440, 274, 158, 160, 161, 165, - 275, 172, 344, 515, 516, 601, 322, 326, 806, 6, - 332, 346, 91, 10, 345, 150, 151, 152, 726, 354, - 139, 280, 162, 163, 362, 289, 6, 290, 291, 292, - 158, 359, 158, 42, 267, 319, 360, 281, 313, 314, - 294, 145, 146, 147, 148, 149, 298, 150, 151, 152, - 235, 843, 844, 845, 846, 847, 299, 848, 849, 850, - 303, 870, 459, 460, 440, 344, 326, 91, 52, 605, - 453, 321, 606, 6, 526, 54, 212, 848, 849, 850, - 311, 543, 413, 300, 437, 515, 516, 437, 441, 301, - 520, 441, 521, 362, 872, 302, 371, 362, 362, 362, - 304, 761, 91, 855, 305, 458, 147, 148, 149, 466, - 150, 151, 152, 718, 392, 393, 394, 839, 519, 384, - 437, 306, 910, 308, 441, 309, 912, 554, 747, 815, - 310, 344, 312, 329, 395, 364, 6, 381, 91, 383, - 413, 571, 91, 382, 104, 385, 387, 413, 413, 413, - 413, 556, 106, 600, 386, 519, 600, 562, 388, 413, - 389, 397, 927, 398, 758, 403, 928, 404, 515, 516, - 725, 515, 516, 801, 465, 456, 413, 442, 448, 936, - 570, 535, 536, 537, 440, 519, 461, 362, 939, 468, - 437, 525, 322, 524, 441, 541, 416, 78, 548, 565, - 573, 466, 164, 845, 846, 847, 868, 848, 849, 850, - 563, 566, 174, 176, 602, 453, 440, 721, 720, 207, - 208, 874, 209, 180, 210, 39, 723, 40, 41, 188, - 137, 138, 155, 567, 568, 569, 730, 572, 446, 554, - 139, 156, 724, 733, 734, 762, 767, 47, 157, 49, - 770, 225, 772, 227, 228, 322, 726, 321, 804, 50, - 51, 802, 211, 810, 807, 808, 465, 908, 811, 816, - 213, 812, 55, 820, 821, 823, 822, 91, 837, 838, - 852, 556, 851, 528, 528, 528, 558, 413, 839, 744, - 856, 858, 859, 322, 861, 865, 869, 519, 873, 100, - 519, 413, 902, 878, 904, 903, 799, 905, 925, 911, - 437, 766, 774, 768, 769, 519, 105, 909, 727, 913, - 321, 914, 915, 929, 145, 146, 147, 148, 149, 916, - 150, 151, 152, 930, 926, 717, 279, 440, 934, 272, - 935, 774, 437, 544, 817, 867, 441, 853, 901, 286, - 277, 401, 289, 288, 290, 513, 514, 546, 321, 547, - 296, 297, 758, 758, 758, 758, 745, 758, 776, 564, - 515, 516, 843, 844, 845, 846, 847, 278, 848, 849, - 850, 778, 779, 780, 781, 782, 783, 784, 785, 786, - 787, 788, 789, 790, 791, 792, 793, 794, 795, 796, - 797, 716, 800, 539, 390, 809, 832, 833, 834, 835, - 836, 837, 838, 0, 440, 0, 0, 325, 528, 857, - 0, 839, 528, 0, 528, 0, 528, 528, 528, 440, - 0, 458, 0, 0, 212, 0, 0, 162, 163, 0, - 369, 0, 758, 758, 758, 758, 758, 758, 758, 758, - 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, - 0, 0, 0, 437, 829, 0, 0, 441, 0, 0, - 0, 0, 774, 162, 163, 440, 325, 0, 0, 42, - 0, 0, 0, 0, 0, 0, 400, 0, 402, 758, - 0, 0, 0, 0, 0, 0, 824, 825, 826, 827, - 841, 830, 842, 828, 519, 843, 844, 845, 846, 847, - 0, 848, 849, 850, 52, 42, 440, 0, 0, 0, - 526, 54, 0, 0, 527, 814, 0, 0, 0, 758, - 132, 133, 134, 135, 136, 137, 138, 523, 819, 0, - 437, 530, 530, 530, 441, 139, 0, 774, 0, 0, - 52, 0, 466, 0, 0, 437, 526, 54, 899, 441, - 531, 0, 0, 0, 0, 0, 0, 854, 0, 875, - 876, 877, 162, 163, 860, 0, 880, 881, 882, 883, - 884, 885, 886, 887, 888, 889, 890, 891, 892, 893, - 894, 895, 896, 897, 0, 0, 0, 0, 0, 0, - 0, 437, 0, 0, 0, 441, 0, 0, 774, 369, - 0, 921, 774, 922, 42, 0, 0, 465, 0, 0, - 0, 0, 0, 917, 141, 0, 142, 143, 144, 145, - 146, 147, 148, 149, 0, 150, 151, 152, 937, 938, - 0, 0, 437, 0, 0, 0, 441, 0, 774, 52, - 0, 0, 774, 0, 900, 526, 54, 0, 0, 533, - 0, 0, 369, 931, 0, 774, 906, 0, 0, 0, - 0, 0, 0, 0, 774, 735, 530, 737, 0, 0, - 530, 0, 530, 0, 530, 530, 530, 610, 611, 612, - 613, 614, 615, 616, 617, 0, 618, 619, 620, 621, - 622, 623, 624, 625, 626, 627, 628, 0, 0, 0, - 0, 0, 0, 629, 630, 631, 632, 633, 634, 635, - 636, 637, 638, 639, 640, 641, 642, 643, 0, 0, - 644, 645, 646, 647, 648, 649, 650, 651, 652, 653, - 0, 654, 655, 656, 657, 658, 659, 660, 661, 662, - 663, 664, 665, 666, 0, 667, 0, 668, 669, 670, - 671, 672, 673, 674, 675, 676, 677, 678, 679, 680, - 0, 681, 682, 683, 684, 685, 686, 687, 0, 688, - 689, 690, 691, 0, 0, 0, 692, 693, 694, 695, - 696, 697, 698, 699, 700, 701, 702, 703, 704, 705, - 706, 707, 708, 709, 710, 711, 712, 871, 713, 714, - 610, 611, 612, 613, 614, 615, 616, 617, 0, 618, - 619, 620, 621, 622, 623, 624, 625, 626, 627, 628, - 0, 0, 0, 0, 0, 0, 629, 630, 631, 632, - 633, 634, 635, 636, 637, 638, 639, 640, 641, 642, - 643, 0, 0, 644, 645, 646, 647, 648, 649, 650, - 651, 652, 653, 0, 654, 655, 656, 657, 658, 659, - 660, 661, 662, 663, 664, 665, 666, 0, 667, 0, - 668, 669, 670, 671, 672, 673, 674, 675, 676, 677, - 678, 679, 680, 0, 681, 682, 683, 684, 685, 686, - 687, 0, 688, 689, 690, 691, 0, 0, 0, 692, - 693, 694, 695, 696, 697, 698, 699, 700, 701, 702, - 703, 704, 705, 706, 707, 708, 709, 710, 711, 712, - 0, 713, 714, 0, 7, 8, 9, 10, 0, 11, - 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 39, 0, 40, 41, 117, 0, 118, - 119, 42, 43, 0, 120, 17, 0, 0, 45, 0, - 0, 0, 18, 121, 0, 47, 159, 49, 0, 122, - 123, 49, 0, 0, 22, 0, 0, 50, 51, 0, - 0, 124, 125, 25, 0, 26, 52, 0, 0, 27, - 55, 0, 53, 54, 126, 0, 0, 56, 417, 418, - 419, 10, 0, 420, 38, 0, 0, 421, 0, 0, - 0, 29, 0, 0, 0, 30, 31, 107, 0, 32, - 0, 33, 0, 0, 924, 34, 131, 132, 133, 134, - 135, 136, 137, 138, 0, 0, 0, 39, 0, 40, - 41, 39, 139, 40, 41, 42, 422, 0, 44, 423, - 0, 0, 45, 0, 0, 0, 424, 46, 0, 47, - 159, 49, 0, 47, 48, 49, 0, 0, 425, 0, - 0, 50, 51, 0, 0, 50, 51, 426, 0, 427, - 52, 0, 0, 428, 55, 0, 53, 54, 55, 0, - 0, 56, 417, 418, 419, 10, 0, 420, 38, 0, - 0, 775, 0, 0, 0, 429, 0, 0, 0, 430, - 0, 108, 0, 431, 0, 432, 0, 0, 315, 433, - 140, 141, 0, 142, 143, 144, 145, 146, 147, 148, - 149, 0, 150, 151, 152, 39, 0, 40, 41, 42, - 422, 0, 44, 423, 0, 0, 45, 0, 0, 0, - 424, 46, 0, 0, 0, 0, 0, 47, 48, 49, - 0, 0, 425, 0, 0, 0, 0, 0, 0, 50, - 51, 426, 0, 427, 52, 0, 0, 428, 0, 0, - 53, 54, 55, 0, 0, 56, 7, 8, 9, 10, - 0, 11, 12, 39, 0, 40, 41, 0, 0, 429, - 0, 0, 0, 430, 0, 0, 0, 431, 0, 432, - 0, 0, 0, 433, 0, 47, 159, 49, 0, 39, - 0, 40, 41, 0, 0, 0, 155, 50, 51, 13, - 0, 14, 15, 0, 0, 156, 16, 17, 0, 0, - 55, 47, 157, 49, 18, 19, 0, 0, 0, 0, - 0, 20, 21, 50, 51, 0, 22, 0, 0, 0, - 0, 0, 0, 23, 24, 25, 55, 26, 0, 0, - 0, 27, 7, 8, 9, 10, 28, 11, 12, 0, - 0, 0, 0, 0, 0, 0, 39, 0, 40, 41, - 0, 0, 0, 29, 0, 0, 0, 30, 31, 0, - 0, 32, 261, 33, 0, 257, 0, 34, 47, 159, - 49, 0, 0, 0, 0, 13, 0, 14, 15, 0, - 50, 51, 16, 17, 0, 0, 0, 0, 0, 0, - 18, 19, 0, 55, 0, 0, 0, 20, 21, 0, - 0, 0, 22, 0, 0, 0, 0, 0, 0, 23, - 24, 25, 0, 26, 0, 0, 0, 27, 7, 8, - 9, 10, 28, 11, 12, 0, 0, 0, 0, 0, - 0, 370, 0, 0, 0, 0, 0, 0, 0, 29, - 0, 0, 0, 30, 31, 0, 0, 32, 0, 33, - 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, - 0, 13, 0, 14, 15, 0, 0, 0, 16, 17, - 0, 0, 0, 0, 0, 0, 18, 19, 0, 0, - 0, 0, 0, 20, 21, 0, 0, 0, 22, 0, - 0, 0, 0, 0, 0, 23, 24, 25, 0, 26, - 0, 0, 0, 27, 7, 8, 9, 10, 28, 11, - 12, 0, 0, 0, 0, 0, 0, 462, 0, 0, - 0, 0, 0, 0, 0, 29, 0, 0, 0, 30, - 31, 0, 0, 32, 0, 33, 0, 0, 0, 34, - 0, 0, 0, 0, 0, 0, 0, 13, 0, 14, - 15, 0, 0, 0, 16, 17, 0, 0, 0, 0, - 0, 0, 18, 19, 0, 0, 0, 0, 0, 20, - 21, 0, 0, 0, 22, 0, 0, 0, 0, 0, - 0, 23, 24, 25, 0, 26, 0, 0, 0, 27, - 7, 8, 9, 10, 28, 11, 12, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 29, 0, 0, 0, 30, 31, 0, 0, 32, - 0, 33, 0, 798, 0, 34, 0, 0, 0, 0, - 0, 0, 0, 13, 0, 14, 15, 0, 0, 0, - 16, 17, 0, 0, 0, 0, 0, 0, 18, 19, - 0, 0, 0, 0, 0, 20, 21, 0, 0, 0, - 22, 0, 0, 0, 0, 0, 0, 23, 24, 25, - 0, 26, 0, 0, 0, 27, 7, 8, 9, 10, - 28, 11, 12, 0, 0, 0, 0, 0, 0, 813, - 0, 0, 0, 0, 0, 0, 0, 29, 0, 0, - 0, 30, 31, 0, 0, 32, 0, 33, 0, 0, - 0, 34, 0, 0, 0, 0, 0, 0, 0, 13, - 0, 14, 15, 0, 0, 0, 16, 17, 0, 0, - 0, 0, 0, 0, 18, 19, 0, 0, 0, 0, - 0, 20, 21, 0, 0, 0, 22, 0, 0, 0, - 0, 0, 0, 23, 24, 25, 0, 26, 0, 0, - 0, 27, 7, 8, 9, 10, 28, 11, 12, 0, - 0, 0, 0, 0, 0, 7, 8, 9, 10, 0, - 11, 0, 0, 29, 0, 0, 0, 30, 31, 0, - 0, 32, 0, 33, 0, 898, 0, 34, 0, 0, - 0, 0, 0, 0, 0, 13, 0, 14, 15, 0, - 0, 0, 16, 17, 0, 0, 0, 0, 0, 0, - 18, 19, 0, 0, 0, 0, 748, 20, 21, 0, - 0, 0, 22, 18, 0, 0, 0, 0, 0, 23, - 24, 25, 0, 26, 0, 0, 0, 27, 0, 0, - 0, 0, 28, 0, 749, 0, 750, 0, 0, 0, - 27, 133, 134, 135, 136, 137, 138, 0, 0, 29, - 0, 0, 0, 30, 31, 139, 0, 32, 0, 33, - 0, 0, 751, 34, 0, 0, 752, 753, 0, 0, - 754, 0, 755, 0, 0, 0, 756, 131, 132, 133, - 134, 135, 136, 137, 138, 0, 0, 0, 0, 0, - 0, 0, 0, 139, 0, 0, 131, 132, 133, 134, - 135, 136, 137, 138, 0, 0, 0, 0, 0, 0, - 0, 0, 139, 0, 0, 131, 132, 133, 134, 135, - 136, 137, 138, 0, 0, 0, 0, 0, 0, 0, - 0, 139, 0, 0, 141, 0, 142, 143, 144, 145, - 146, 147, 148, 149, 0, 150, 151, 152, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 140, 141, 0, 142, 143, 144, 145, 146, 147, - 148, 149, 0, 150, 151, 152, 0, 0, 0, 317, - 140, 141, 0, 142, 143, 144, 145, 146, 147, 148, - 149, 0, 150, 151, 152, 0, 0, 0, 864, 140, - 141, 0, 142, 143, 144, 145, 146, 147, 148, 149, - 0, 150, 151, 152, 335, 336, 0, 920, 470, 471, - 472, 473, 474, 475, 476, 477, 39, 0, 40, 41, - 0, 0, 0, 0, 478, 0, 479, 480, 481, 482, - 483, 484, 485, 486, 487, 488, 489, 490, 47, 159, - 49, 0, 39, 0, 40, 41, 0, 491, 0, 44, - 50, 51, 0, 0, 0, 0, 0, 0, 46, 0, - 0, 0, 0, 55, 47, 48, 49, 0, 492, 0, - 0, 0, 0, 0, 0, 0, 50, 51, 0, 0, - 189, 190, 0, 0, 0, 0, 0, 339, 0, 55, - 111, 0, 56, 0, 0, 0, 0, 0, 493, 0, - 0, 494, 0, 495, 496, 497, 498, 499, 500, 501, - 502, 503, 504, 505, 0, 506, 507, 191, 39, 508, - 40, 41, 42, 192, 0, 44, 0, 0, 0, 45, - 193, 194, 0, 0, 46, 189, 190, 0, 0, 195, - 47, 48, 49, 196, 0, 0, 197, 0, 0, 0, - 198, 0, 50, 51, 0, 199, 0, 52, 0, 0, - 0, 0, 0, 200, 54, 55, 0, 201, 56, 202, - 0, 0, 191, 39, 203, 40, 41, 42, 276, 0, - 44, 0, 0, 0, 45, 193, 194, 0, 0, 46, - 204, 0, 189, 190, 195, 47, 48, 49, 196, 0, - 0, 197, 0, 0, 0, 198, 0, 50, 51, 0, - 199, 0, 52, 0, 0, 0, 0, 0, 200, 54, - 55, 0, 201, 56, 202, 0, 0, 0, 0, 191, - 39, 0, 40, 41, 42, 192, 0, 44, 0, 0, - 0, 45, 193, 194, 0, 204, 46, 0, 0, 0, - 0, 195, 47, 48, 49, 196, 0, 0, 197, 0, - 0, 0, 198, 0, 50, 51, 0, 199, 0, 52, - 0, 0, 0, 0, 0, 200, 54, 55, 0, 201, - 56, 202, 131, 132, 133, 134, 135, 136, 137, 138, - 0, 0, 0, 0, 0, 0, 0, 0, 139, 0, - 0, 0, 204, 131, 132, 133, 134, 135, 136, 137, - 138, 0, 0, 0, 0, 0, 0, 0, 0, 139, - 131, 132, 133, 134, 135, 136, 137, 138, 0, 0, - 0, 0, 0, 0, 0, 0, 139, 577, 578, 579, - 580, 581, 582, 583, 584, 0, 0, 0, 0, 0, - 0, 0, 0, 585, 831, 832, 833, 834, 835, 836, - 837, 838, 0, 0, 0, 0, 0, 0, 0, 0, - 839, 0, 0, 467, 0, 0, 140, 141, 0, 142, - 143, 144, 145, 146, 147, 148, 149, 0, 150, 151, - 152, 0, 0, 0, 0, 862, 0, 140, 141, 0, - 142, 143, 144, 145, 146, 147, 148, 149, 0, 150, - 151, 152, 0, 0, 140, 141, 0, 142, 143, 144, - 145, 146, 147, 148, 149, 0, 150, 151, 152, 0, - 0, 586, 587, 0, 588, 589, 590, 591, 592, 593, - 594, 595, 0, 596, 597, 598, 918, 0, 840, 841, - 0, 842, 0, 0, 843, 844, 845, 846, 847, 0, - 848, 849, 850, 831, 832, 833, 834, 835, 836, 837, - 838, 0, 0, 0, 0, 0, 0, 0, 0, 839, - 133, 134, 135, 136, 137, 138, 0, 0, 0, 0, - 0, 0, 0, 0, 139, 133, 134, 135, 136, 137, - 138, 0, 0, 0, 0, 0, 0, 0, 0, 139, - 833, 834, 835, 836, 837, 838, 0, 0, 0, 0, - 0, 0, 0, 0, 839, 833, 834, 835, 836, 837, - 838, 0, 0, 0, 0, 0, 0, 0, 0, 839, - 833, 834, 835, 836, 837, 838, 0, 0, 0, 0, - 0, 0, 0, 0, 839, 0, 0, 840, 841, 0, - 842, 0, 0, 843, 844, 845, 846, 847, 0, 848, - 849, 850, 0, 0, 0, 142, 143, 144, 145, 146, - 147, 148, 149, 0, 150, 151, 152, 0, 0, 0, - 0, 143, 144, 145, 146, 147, 148, 149, 0, 150, - 151, 152, 0, 841, 0, 842, 0, -2, 843, 844, - 845, 846, 847, 0, 848, 849, 850, 0, 0, 0, - 842, 0, 0, 843, 844, 845, 846, 847, 0, 848, - 849, 850, 0, 0, 0, 0, 0, 0, 843, 844, - 845, 846, 847, 0, 848, 849, 850, 135, 136, 137, - 138, 70, 0, 0, 0, 0, 0, 0, 0, 139, - 0, 0, 0, 71, 0, 0, 0, 72, 0, 0, - 73, 0, 0, 835, 836, 837, 838, 0, 0, 74, - 0, 0, 75, 76, 77, 839, 0, 0, 0, 0, - 0, 0, 0, 78, 0, 0, 0, 79, 0, 0, - 0, 80, 0, 0, 0, 0, 70, 0, 0, 0, - 0, 81, 0, 0, 0, 0, 0, 0, 71, 0, - 335, 336, 72, 0, 0, 73, 0, 0, 0, 0, - 0, 0, 0, 0, 74, 0, 0, 75, 76, 77, - 0, 143, 144, 145, 146, 147, 148, 149, 78, 150, - 151, 152, 79, 0, 0, 0, 80, 0, 39, 0, - 40, 41, 337, 338, 0, 44, 81, 0, 0, 843, - 844, 845, 846, 847, 46, 848, 849, 850, 38, 70, - 47, 48, 49, 0, 0, 333, 0, 0, 0, 0, - 0, 71, 50, 51, 0, 72, 0, 0, 73, 0, - 0, 0, 0, 339, 0, 55, 0, 74, 56, 0, - 75, 76, 77, 0, 0, 39, 0, 40, 41, 42, - 43, 78, 44, 0, 0, 79, 45, 38, 0, 80, - 0, 46, 0, 0, 0, 0, 0, 47, 48, 49, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 50, - 51, 0, 0, 0, 52, 0, 0, 0, 0, 0, - 53, 54, 55, 0, 39, 56, 40, 41, 42, 284, - 0, 44, 0, 0, 0, 45, 101, 0, 0, 0, - 46, 0, 0, 0, 0, 0, 47, 48, 49, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 50, 51, - 0, 0, 0, 52, 0, 0, 0, 0, 0, 53, - 54, 55, 0, 39, 56, 40, 41, 42, 0, 0, - 44, 0, 0, 0, 45, 38, 0, 0, 0, 46, - 0, 0, 0, 0, 0, 47, 48, 49, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 50, 51, 0, - 0, 0, 52, 0, 0, 0, 0, 0, 102, 54, - 55, 0, 39, 56, 40, 41, 42, 0, 0, 44, - 0, 70, 0, 45, 0, 0, 0, 0, 46, 0, - 0, 0, 0, 71, 47, 48, 49, 72, 0, 0, - 73, 0, 0, 0, 0, 0, 50, 51, 0, 74, - 0, 52, 75, 76, 77, 0, 70, 53, 54, 55, - 0, 0, 56, 78, 0, 0, 0, 79, 71, 0, - 0, 80, 72, 0, 0, 73, 0, 0, 0, 0, - 70, 81, 0, 0, 74, 0, 0, 75, 76, 77, - 0, 0, 71, 0, 0, 0, 72, 0, 78, 73, - 391, 0, 79, 0, 0, 70, 80, 0, 74, 0, - 0, 75, 76, 77, 0, 0, 81, 71, 0, 0, - 0, 72, 78, 0, 73, 0, 79, 0, 0, 0, - 80, 0, 0, 74, 0, 454, 75, 76, 77, 0, - 81, 0, 0, 0, 0, 0, 0, 78, 0, 0, - 0, 79, 0, 0, 0, 80, 0, 0, 0, 540, - 0, 0, 0, 0, 0, 81, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 743 -}; - -static const short int yycheck[] = -{ - 1, 22, 33, 462, 5, 93, 94, 95, 96, 22, - 98, 99, 100, 352, 416, 179, 12, 79, 453, 107, - 108, 85, 85, 111, 85, 10, 85, 8, 9, 0, - 8, 9, 10, 120, 10, 8, 9, 102, 43, 154, - 105, 33, 348, 120, 446, 351, 385, 353, 8, 9, - 10, 120, 167, 168, 169, 170, 57, 8, 9, 106, - 8, 9, 193, 103, 85, 103, 2, 373, 120, 375, - 376, 377, 85, 51, 121, 51, 8, 9, 79, 120, - 277, 516, 122, 111, 122, 103, 393, 394, 99, 100, - 101, 51, 401, 29, 30, 31, 32, 120, 34, 408, - 409, 410, 411, 120, 122, 97, 270, 103, 414, 8, - 9, 420, 103, 120, 74, 602, 455, 109, 110, 554, - 151, 185, 185, 287, 185, 111, 185, 120, 437, 102, - 115, 122, 110, 103, 110, 6, 442, 115, 226, 115, - 72, 122, 120, 106, 120, 120, 103, 262, 120, 121, - 110, 102, 122, 154, 102, 115, 558, 103, 121, 561, - 120, 103, 468, 122, 185, 122, 167, 168, 169, 170, - 334, 120, 185, 22, 576, 103, 122, 178, 179, 120, - 122, 48, 379, 50, 51, 29, 105, 192, 55, 8, - 9, 10, 197, 105, 122, 131, 132, 133, 134, 135, - 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 103, 152, 29, 349, 416, - 527, 352, 103, 105, 531, 105, 533, 29, 535, 536, - 537, 103, 51, 397, 122, 120, 85, 115, 354, 548, - 102, 122, 358, 359, 360, 121, 733, 29, 105, 446, - 122, 8, 9, 562, 385, 102, 123, 124, 125, 126, - 111, 262, 275, 120, 121, 122, 267, 268, 607, 270, - 271, 276, 273, 6, 275, 119, 120, 121, 4, 284, - 29, 120, 8, 9, 285, 102, 287, 104, 105, 106, - 157, 110, 159, 50, 121, 122, 115, 120, 234, 235, - 104, 113, 114, 115, 116, 117, 122, 119, 120, 121, - 103, 113, 114, 115, 116, 117, 122, 119, 120, 121, - 112, 808, 102, 103, 455, 338, 327, 328, 85, 120, - 121, 267, 448, 334, 91, 92, 185, 119, 120, 121, - 112, 403, 343, 122, 349, 120, 121, 352, 349, 122, - 381, 352, 383, 354, 813, 122, 292, 358, 359, 360, - 122, 558, 363, 765, 122, 366, 115, 116, 117, 370, - 119, 120, 121, 461, 75, 76, 77, 29, 379, 315, - 385, 122, 869, 122, 385, 122, 873, 121, 122, 728, - 122, 404, 122, 105, 95, 120, 397, 120, 399, 120, - 401, 432, 403, 122, 425, 120, 123, 408, 409, 410, - 411, 412, 425, 105, 125, 416, 105, 422, 103, 420, - 106, 102, 909, 103, 553, 112, 913, 103, 120, 121, - 122, 120, 121, 122, 370, 123, 437, 115, 115, 926, - 432, 75, 76, 77, 575, 446, 120, 448, 935, 115, - 455, 123, 453, 389, 455, 106, 762, 86, 115, 120, - 122, 462, 53, 115, 116, 117, 805, 119, 120, 121, - 111, 111, 63, 64, 122, 121, 607, 103, 123, 543, - 543, 820, 543, 74, 543, 46, 122, 48, 49, 80, - 19, 20, 53, 429, 430, 431, 103, 433, 804, 121, - 29, 62, 125, 122, 106, 103, 120, 68, 69, 70, - 122, 102, 51, 104, 105, 516, 4, 453, 103, 80, - 81, 120, 543, 123, 125, 122, 462, 866, 122, 125, - 543, 123, 93, 120, 111, 111, 120, 538, 19, 20, - 103, 542, 125, 392, 393, 394, 852, 548, 29, 541, - 112, 122, 112, 554, 87, 120, 122, 558, 122, 120, - 561, 562, 120, 122, 120, 122, 597, 120, 907, 123, - 575, 563, 573, 565, 566, 576, 425, 122, 514, 122, - 516, 112, 122, 120, 113, 114, 115, 116, 117, 112, - 119, 120, 121, 120, 122, 460, 187, 728, 122, 178, - 122, 602, 607, 403, 730, 804, 607, 762, 852, 200, - 185, 338, 102, 204, 104, 105, 106, 403, 554, 404, - 211, 212, 751, 752, 753, 754, 542, 756, 575, 425, - 120, 121, 113, 114, 115, 116, 117, 185, 119, 120, - 121, 577, 578, 579, 580, 581, 582, 583, 584, 585, - 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, - 596, 459, 598, 398, 327, 692, 14, 15, 16, 17, - 18, 19, 20, -1, 805, -1, -1, 268, 527, 767, - -1, 29, 531, -1, 533, -1, 535, 536, 537, 820, - -1, 692, -1, -1, 543, -1, -1, 8, 9, -1, - 291, -1, 831, 832, 833, 834, 835, 836, 837, 838, - 839, 840, 841, 842, 843, 844, 845, 846, 847, 848, - -1, -1, -1, 728, 755, -1, -1, 728, -1, -1, - -1, -1, 733, 8, 9, 866, 327, -1, -1, 50, - -1, -1, -1, -1, -1, -1, 337, -1, 339, 878, - -1, -1, -1, -1, -1, -1, 751, 752, 753, 754, - 108, 756, 110, 755, 765, 113, 114, 115, 116, 117, - -1, 119, 120, 121, 85, 50, 907, -1, -1, -1, - 91, 92, -1, -1, 95, 721, -1, -1, -1, 918, - 14, 15, 16, 17, 18, 19, 20, 388, 734, -1, - 805, 392, 393, 394, 805, 29, -1, 808, -1, -1, - 85, -1, 813, -1, -1, 820, 91, 92, 849, 820, - 95, -1, -1, -1, -1, -1, -1, 763, -1, 821, - 822, 823, 8, 9, 770, -1, 831, 832, 833, 834, - 835, 836, 837, 838, 839, 840, 841, 842, 843, 844, - 845, 846, 847, 848, -1, -1, -1, -1, -1, -1, - -1, 866, -1, -1, -1, 866, -1, -1, 869, 460, - -1, 902, 873, 904, 50, -1, -1, 813, -1, -1, - -1, -1, -1, 878, 108, -1, 110, 111, 112, 113, - 114, 115, 116, 117, -1, 119, 120, 121, 929, 930, - -1, -1, 907, -1, -1, -1, 907, -1, 909, 85, - -1, -1, 913, -1, 850, 91, 92, -1, -1, 95, - -1, -1, 513, 918, -1, 926, 862, -1, -1, -1, - -1, -1, -1, -1, 935, 526, 527, 528, -1, -1, - 531, -1, 533, -1, 535, 536, 537, 3, 4, 5, - 6, 7, 8, 9, 10, -1, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, -1, -1, -1, - -1, -1, -1, 29, 30, 31, 32, 33, 34, 35, - 36, 37, 38, 39, 40, 41, 42, 43, -1, -1, - 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, - -1, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 67, 68, 69, -1, 71, -1, 73, 74, 75, - 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, - -1, 87, 88, 89, 90, 91, 92, 93, -1, 95, - 96, 97, 98, -1, -1, -1, 102, 103, 104, 105, - 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, - 3, 4, 5, 6, 7, 8, 9, 10, -1, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - -1, -1, -1, -1, -1, -1, 29, 30, 31, 32, - 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, -1, -1, 46, 47, 48, 49, 50, 51, 52, - 53, 54, 55, -1, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, -1, 71, -1, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, -1, 87, 88, 89, 90, 91, 92, - 93, -1, 95, 96, 97, 98, -1, -1, -1, 102, - 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, - -1, 124, 125, -1, 3, 4, 5, 6, -1, 8, - 9, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 46, -1, 48, 49, 46, -1, 48, - 49, 50, 51, -1, 53, 54, -1, -1, 57, -1, - -1, -1, 61, 62, -1, 68, 69, 70, -1, 68, - 69, 70, -1, -1, 73, -1, -1, 80, 81, -1, - -1, 80, 81, 82, -1, 84, 85, -1, -1, 88, - 93, -1, 91, 92, 93, -1, -1, 96, 3, 4, - 5, 6, -1, 8, 9, -1, -1, 12, -1, -1, - -1, 110, -1, -1, -1, 114, 115, 120, -1, 118, - -1, 120, -1, -1, 905, 124, 13, 14, 15, 16, - 17, 18, 19, 20, -1, -1, -1, 46, -1, 48, - 49, 46, 29, 48, 49, 50, 51, -1, 53, 54, - -1, -1, 57, -1, -1, -1, 61, 62, -1, 68, - 69, 70, -1, 68, 69, 70, -1, -1, 73, -1, - -1, 80, 81, -1, -1, 80, 81, 82, -1, 84, - 85, -1, -1, 88, 93, -1, 91, 92, 93, -1, - -1, 96, 3, 4, 5, 6, -1, 8, 9, -1, - -1, 12, -1, -1, -1, 110, -1, -1, -1, 114, - -1, 120, -1, 118, -1, 120, -1, -1, 105, 124, - 107, 108, -1, 110, 111, 112, 113, 114, 115, 116, - 117, -1, 119, 120, 121, 46, -1, 48, 49, 50, - 51, -1, 53, 54, -1, -1, 57, -1, -1, -1, - 61, 62, -1, -1, -1, -1, -1, 68, 69, 70, - -1, -1, 73, -1, -1, -1, -1, -1, -1, 80, - 81, 82, -1, 84, 85, -1, -1, 88, -1, -1, - 91, 92, 93, -1, -1, 96, 3, 4, 5, 6, - -1, 8, 9, 46, -1, 48, 49, -1, -1, 110, - -1, -1, -1, 114, -1, -1, -1, 118, -1, 120, - -1, -1, -1, 124, -1, 68, 69, 70, -1, 46, - -1, 48, 49, -1, -1, -1, 53, 80, 81, 46, - -1, 48, 49, -1, -1, 62, 53, 54, -1, -1, - 93, 68, 69, 70, 61, 62, -1, -1, -1, -1, - -1, 68, 69, 80, 81, -1, 73, -1, -1, -1, - -1, -1, -1, 80, 81, 82, 93, 84, -1, -1, - -1, 88, 3, 4, 5, 6, 93, 8, 9, -1, - -1, -1, -1, -1, -1, -1, 46, -1, 48, 49, - -1, -1, -1, 110, -1, -1, -1, 114, 115, -1, - -1, 118, 62, 120, -1, 122, -1, 124, 68, 69, - 70, -1, -1, -1, -1, 46, -1, 48, 49, -1, - 80, 81, 53, 54, -1, -1, -1, -1, -1, -1, - 61, 62, -1, 93, -1, -1, -1, 68, 69, -1, - -1, -1, 73, -1, -1, -1, -1, -1, -1, 80, - 81, 82, -1, 84, -1, -1, -1, 88, 3, 4, - 5, 6, 93, 8, 9, -1, -1, -1, -1, -1, - -1, 102, -1, -1, -1, -1, -1, -1, -1, 110, - -1, -1, -1, 114, 115, -1, -1, 118, -1, 120, - -1, -1, -1, 124, -1, -1, -1, -1, -1, -1, - -1, 46, -1, 48, 49, -1, -1, -1, 53, 54, - -1, -1, -1, -1, -1, -1, 61, 62, -1, -1, - -1, -1, -1, 68, 69, -1, -1, -1, 73, -1, - -1, -1, -1, -1, -1, 80, 81, 82, -1, 84, - -1, -1, -1, 88, 3, 4, 5, 6, 93, 8, - 9, -1, -1, -1, -1, -1, -1, 102, -1, -1, - -1, -1, -1, -1, -1, 110, -1, -1, -1, 114, - 115, -1, -1, 118, -1, 120, -1, -1, -1, 124, - -1, -1, -1, -1, -1, -1, -1, 46, -1, 48, - 49, -1, -1, -1, 53, 54, -1, -1, -1, -1, - -1, -1, 61, 62, -1, -1, -1, -1, -1, 68, - 69, -1, -1, -1, 73, -1, -1, -1, -1, -1, - -1, 80, 81, 82, -1, 84, -1, -1, -1, 88, - 3, 4, 5, 6, 93, 8, 9, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 110, -1, -1, -1, 114, 115, -1, -1, 118, - -1, 120, -1, 122, -1, 124, -1, -1, -1, -1, - -1, -1, -1, 46, -1, 48, 49, -1, -1, -1, - 53, 54, -1, -1, -1, -1, -1, -1, 61, 62, - -1, -1, -1, -1, -1, 68, 69, -1, -1, -1, - 73, -1, -1, -1, -1, -1, -1, 80, 81, 82, - -1, 84, -1, -1, -1, 88, 3, 4, 5, 6, - 93, 8, 9, -1, -1, -1, -1, -1, -1, 102, - -1, -1, -1, -1, -1, -1, -1, 110, -1, -1, - -1, 114, 115, -1, -1, 118, -1, 120, -1, -1, - -1, 124, -1, -1, -1, -1, -1, -1, -1, 46, - -1, 48, 49, -1, -1, -1, 53, 54, -1, -1, - -1, -1, -1, -1, 61, 62, -1, -1, -1, -1, - -1, 68, 69, -1, -1, -1, 73, -1, -1, -1, - -1, -1, -1, 80, 81, 82, -1, 84, -1, -1, - -1, 88, 3, 4, 5, 6, 93, 8, 9, -1, - -1, -1, -1, -1, -1, 3, 4, 5, 6, -1, - 8, -1, -1, 110, -1, -1, -1, 114, 115, -1, - -1, 118, -1, 120, -1, 122, -1, 124, -1, -1, - -1, -1, -1, -1, -1, 46, -1, 48, 49, -1, - -1, -1, 53, 54, -1, -1, -1, -1, -1, -1, - 61, 62, -1, -1, -1, -1, 54, 68, 69, -1, - -1, -1, 73, 61, -1, -1, -1, -1, -1, 80, - 81, 82, -1, 84, -1, -1, -1, 88, -1, -1, - -1, -1, 93, -1, 82, -1, 84, -1, -1, -1, - 88, 15, 16, 17, 18, 19, 20, -1, -1, 110, - -1, -1, -1, 114, 115, 29, -1, 118, -1, 120, - -1, -1, 110, 124, -1, -1, 114, 115, -1, -1, - 118, -1, 120, -1, -1, -1, 124, 13, 14, 15, - 16, 17, 18, 19, 20, -1, -1, -1, -1, -1, - -1, -1, -1, 29, -1, -1, 13, 14, 15, 16, - 17, 18, 19, 20, -1, -1, -1, -1, -1, -1, - -1, -1, 29, -1, -1, 13, 14, 15, 16, 17, - 18, 19, 20, -1, -1, -1, -1, -1, -1, -1, - -1, 29, -1, -1, 108, -1, 110, 111, 112, 113, - 114, 115, 116, 117, -1, 119, 120, 121, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 107, 108, -1, 110, 111, 112, 113, 114, 115, - 116, 117, -1, 119, 120, 121, -1, -1, -1, 125, - 107, 108, -1, 110, 111, 112, 113, 114, 115, 116, - 117, -1, 119, 120, 121, -1, -1, -1, 125, 107, - 108, -1, 110, 111, 112, 113, 114, 115, 116, 117, - -1, 119, 120, 121, 8, 9, -1, 125, 13, 14, - 15, 16, 17, 18, 19, 20, 46, -1, 48, 49, - -1, -1, -1, -1, 29, -1, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 68, 69, - 70, -1, 46, -1, 48, 49, -1, 52, -1, 53, - 80, 81, -1, -1, -1, -1, -1, -1, 62, -1, - -1, -1, -1, 93, 68, 69, 70, -1, 73, -1, - -1, -1, -1, -1, -1, -1, 80, 81, -1, -1, - 8, 9, -1, -1, -1, -1, -1, 91, -1, 93, - 120, -1, 96, -1, -1, -1, -1, -1, 103, -1, - -1, 106, -1, 108, 109, 110, 111, 112, 113, 114, - 115, 116, 117, 118, -1, 120, 121, 45, 46, 124, - 48, 49, 50, 51, -1, 53, -1, -1, -1, 57, - 58, 59, -1, -1, 62, 8, 9, -1, -1, 67, - 68, 69, 70, 71, -1, -1, 74, -1, -1, -1, - 78, -1, 80, 81, -1, 83, -1, 85, -1, -1, - -1, -1, -1, 91, 92, 93, -1, 95, 96, 97, - -1, -1, 45, 46, 102, 48, 49, 50, 51, -1, - 53, -1, -1, -1, 57, 58, 59, -1, -1, 62, - 118, -1, 8, 9, 67, 68, 69, 70, 71, -1, - -1, 74, -1, -1, -1, 78, -1, 80, 81, -1, - 83, -1, 85, -1, -1, -1, -1, -1, 91, 92, - 93, -1, 95, 96, 97, -1, -1, -1, -1, 45, - 46, -1, 48, 49, 50, 51, -1, 53, -1, -1, - -1, 57, 58, 59, -1, 118, 62, -1, -1, -1, - -1, 67, 68, 69, 70, 71, -1, -1, 74, -1, - -1, -1, 78, -1, 80, 81, -1, 83, -1, 85, - -1, -1, -1, -1, -1, 91, 92, 93, -1, 95, - 96, 97, 13, 14, 15, 16, 17, 18, 19, 20, - -1, -1, -1, -1, -1, -1, -1, -1, 29, -1, - -1, -1, 118, 13, 14, 15, 16, 17, 18, 19, - 20, -1, -1, -1, -1, -1, -1, -1, -1, 29, - 13, 14, 15, 16, 17, 18, 19, 20, -1, -1, - -1, -1, -1, -1, -1, -1, 29, 13, 14, 15, - 16, 17, 18, 19, 20, -1, -1, -1, -1, -1, - -1, -1, -1, 29, 13, 14, 15, 16, 17, 18, - 19, 20, -1, -1, -1, -1, -1, -1, -1, -1, - 29, -1, -1, 104, -1, -1, 107, 108, -1, 110, - 111, 112, 113, 114, 115, 116, 117, -1, 119, 120, - 121, -1, -1, -1, -1, 105, -1, 107, 108, -1, - 110, 111, 112, 113, 114, 115, 116, 117, -1, 119, - 120, 121, -1, -1, 107, 108, -1, 110, 111, 112, - 113, 114, 115, 116, 117, -1, 119, 120, 121, -1, - -1, 107, 108, -1, 110, 111, 112, 113, 114, 115, - 116, 117, -1, 119, 120, 121, 105, -1, 107, 108, - -1, 110, -1, -1, 113, 114, 115, 116, 117, -1, - 119, 120, 121, 13, 14, 15, 16, 17, 18, 19, - 20, -1, -1, -1, -1, -1, -1, -1, -1, 29, - 15, 16, 17, 18, 19, 20, -1, -1, -1, -1, - -1, -1, -1, -1, 29, 15, 16, 17, 18, 19, - 20, -1, -1, -1, -1, -1, -1, -1, -1, 29, - 15, 16, 17, 18, 19, 20, -1, -1, -1, -1, - -1, -1, -1, -1, 29, 15, 16, 17, 18, 19, - 20, -1, -1, -1, -1, -1, -1, -1, -1, 29, - 15, 16, 17, 18, 19, 20, -1, -1, -1, -1, - -1, -1, -1, -1, 29, -1, -1, 107, 108, -1, - 110, -1, -1, 113, 114, 115, 116, 117, -1, 119, - 120, 121, -1, -1, -1, 110, 111, 112, 113, 114, - 115, 116, 117, -1, 119, 120, 121, -1, -1, -1, - -1, 111, 112, 113, 114, 115, 116, 117, -1, 119, - 120, 121, -1, 108, -1, 110, -1, 0, 113, 114, - 115, 116, 117, -1, 119, 120, 121, -1, -1, -1, - 110, -1, -1, 113, 114, 115, 116, 117, -1, 119, - 120, 121, -1, -1, -1, -1, -1, -1, 113, 114, - 115, 116, 117, -1, 119, 120, 121, 17, 18, 19, - 20, 44, -1, -1, -1, -1, -1, -1, -1, 29, - -1, -1, -1, 56, -1, -1, -1, 60, -1, -1, - 63, -1, -1, 17, 18, 19, 20, -1, -1, 72, - -1, -1, 75, 76, 77, 29, -1, -1, -1, -1, - -1, -1, -1, 86, -1, -1, -1, 90, -1, -1, - -1, 94, -1, -1, -1, -1, 44, -1, -1, -1, - -1, 104, -1, -1, -1, -1, -1, -1, 56, -1, - 8, 9, 60, -1, -1, 63, -1, -1, -1, -1, - -1, -1, -1, -1, 72, -1, -1, 75, 76, 77, - -1, 111, 112, 113, 114, 115, 116, 117, 86, 119, - 120, 121, 90, -1, -1, -1, 94, -1, 46, -1, - 48, 49, 50, 51, -1, 53, 104, -1, -1, 113, - 114, 115, 116, 117, 62, 119, 120, 121, 9, 44, - 68, 69, 70, -1, -1, 123, -1, -1, -1, -1, - -1, 56, 80, 81, -1, 60, -1, -1, 63, -1, - -1, -1, -1, 91, -1, 93, -1, 72, 96, -1, - 75, 76, 77, -1, -1, 46, -1, 48, 49, 50, - 51, 86, 53, -1, -1, 90, 57, 9, -1, 94, - -1, 62, -1, -1, -1, -1, -1, 68, 69, 70, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 80, - 81, -1, -1, -1, 85, -1, -1, -1, -1, -1, - 91, 92, 93, -1, 46, 96, 48, 49, 50, 51, - -1, 53, -1, -1, -1, 57, 9, -1, -1, -1, - 62, -1, -1, -1, -1, -1, 68, 69, 70, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 80, 81, - -1, -1, -1, 85, -1, -1, -1, -1, -1, 91, - 92, 93, -1, 46, 96, 48, 49, 50, -1, -1, - 53, -1, -1, -1, 57, 9, -1, -1, -1, 62, - -1, -1, -1, -1, -1, 68, 69, 70, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 80, 81, -1, - -1, -1, 85, -1, -1, -1, -1, -1, 91, 92, - 93, -1, 46, 96, 48, 49, 50, -1, -1, 53, - -1, 44, -1, 57, -1, -1, -1, -1, 62, -1, - -1, -1, -1, 56, 68, 69, 70, 60, -1, -1, - 63, -1, -1, -1, -1, -1, 80, 81, -1, 72, - -1, 85, 75, 76, 77, -1, 44, 91, 92, 93, - -1, -1, 96, 86, -1, -1, -1, 90, 56, -1, - -1, 94, 60, -1, -1, 63, -1, -1, -1, -1, - 44, 104, -1, -1, 72, -1, -1, 75, 76, 77, - -1, -1, 56, -1, -1, -1, 60, -1, 86, 63, - 123, -1, 90, -1, -1, 44, 94, -1, 72, -1, - -1, 75, 76, 77, -1, -1, 104, 56, -1, -1, - -1, 60, 86, -1, 63, -1, 90, -1, -1, -1, - 94, -1, -1, 72, -1, 123, 75, 76, 77, -1, - 104, -1, -1, -1, -1, -1, -1, 86, -1, -1, - -1, 90, -1, -1, -1, 94, -1, -1, -1, 123, - -1, -1, -1, -1, -1, 104, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 123 -}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const unsigned char yystos[] = -{ - 0, 99, 100, 101, 127, 128, 219, 3, 4, 5, - 6, 8, 9, 46, 48, 49, 53, 54, 61, 62, - 68, 69, 73, 80, 81, 82, 84, 88, 93, 110, - 114, 115, 118, 120, 124, 212, 213, 218, 9, 46, - 48, 49, 50, 51, 53, 57, 62, 68, 69, 70, - 80, 81, 85, 91, 92, 93, 96, 178, 181, 182, - 184, 189, 191, 195, 196, 200, 201, 202, 203, 0, - 44, 56, 60, 63, 72, 75, 76, 77, 86, 90, - 94, 104, 131, 133, 134, 136, 137, 138, 159, 197, - 199, 219, 120, 120, 120, 120, 120, 111, 120, 120, - 120, 9, 91, 180, 195, 196, 200, 120, 120, 120, - 111, 120, 212, 212, 212, 212, 9, 46, 48, 49, - 53, 62, 68, 69, 80, 81, 93, 181, 210, 212, - 212, 13, 14, 15, 16, 17, 18, 19, 20, 29, - 107, 108, 110, 111, 112, 113, 114, 115, 116, 117, - 119, 120, 121, 6, 178, 53, 62, 69, 201, 69, - 201, 201, 8, 9, 217, 201, 10, 51, 110, 115, - 120, 177, 219, 102, 217, 102, 217, 105, 135, 102, - 217, 105, 105, 105, 160, 136, 143, 72, 217, 8, - 9, 45, 51, 58, 59, 67, 71, 74, 78, 83, - 91, 95, 97, 102, 118, 148, 179, 182, 184, 189, - 191, 195, 196, 200, 209, 210, 219, 209, 209, 209, - 209, 181, 209, 209, 209, 217, 120, 217, 217, 209, - 209, 181, 181, 209, 122, 103, 122, 212, 212, 212, - 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, - 212, 212, 212, 212, 212, 212, 212, 122, 210, 212, - 177, 62, 115, 177, 177, 177, 177, 121, 190, 102, - 183, 185, 133, 128, 102, 111, 51, 148, 179, 217, - 120, 120, 178, 218, 51, 178, 217, 132, 217, 102, - 104, 105, 106, 171, 104, 139, 217, 217, 122, 122, - 122, 122, 122, 112, 122, 122, 122, 209, 122, 122, - 122, 112, 122, 212, 212, 105, 122, 125, 177, 122, - 208, 212, 219, 193, 194, 217, 219, 192, 128, 105, - 186, 187, 219, 123, 198, 8, 9, 50, 51, 91, - 161, 162, 163, 164, 200, 219, 178, 171, 144, 149, - 10, 115, 150, 140, 178, 8, 9, 10, 51, 110, - 115, 175, 219, 128, 120, 204, 205, 129, 130, 217, - 102, 212, 10, 51, 74, 110, 115, 120, 141, 165, - 217, 120, 122, 120, 212, 120, 125, 123, 103, 106, - 193, 123, 75, 76, 77, 95, 188, 102, 103, 128, - 217, 164, 217, 112, 103, 8, 9, 10, 51, 110, - 115, 120, 176, 219, 145, 146, 165, 3, 4, 5, - 8, 12, 51, 54, 61, 73, 82, 84, 88, 110, - 114, 118, 120, 124, 167, 168, 174, 178, 214, 215, - 218, 219, 115, 165, 167, 142, 165, 175, 115, 175, - 175, 175, 120, 121, 123, 151, 123, 206, 219, 102, - 103, 120, 102, 172, 173, 212, 219, 104, 115, 165, - 13, 14, 15, 16, 17, 18, 19, 20, 29, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 52, 73, 103, 106, 108, 109, 110, 111, 112, - 113, 114, 115, 116, 117, 118, 120, 121, 124, 157, - 165, 165, 165, 105, 106, 120, 121, 170, 171, 219, - 210, 210, 167, 217, 212, 123, 91, 95, 196, 216, - 217, 95, 216, 95, 216, 75, 76, 77, 128, 188, - 123, 106, 176, 136, 137, 158, 159, 163, 115, 176, - 176, 176, 176, 106, 121, 169, 219, 147, 165, 170, - 171, 176, 178, 111, 180, 120, 111, 212, 212, 212, - 181, 210, 212, 122, 12, 103, 176, 13, 14, 15, - 16, 17, 18, 19, 20, 29, 107, 108, 110, 111, - 112, 113, 114, 115, 116, 117, 119, 120, 121, 165, - 105, 122, 122, 170, 171, 120, 175, 154, 208, 167, - 3, 4, 5, 6, 7, 8, 9, 10, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 42, 43, 46, 47, 48, 49, 50, 51, - 52, 53, 54, 55, 57, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 68, 69, 71, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 87, 88, 89, 90, 91, 92, 93, 95, 96, - 97, 98, 102, 103, 104, 105, 106, 107, 108, 109, - 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, - 120, 121, 122, 124, 125, 207, 204, 130, 209, 172, - 123, 103, 165, 122, 125, 122, 4, 212, 166, 208, - 103, 122, 122, 122, 106, 217, 216, 217, 216, 216, - 216, 216, 216, 123, 181, 169, 176, 122, 54, 82, - 84, 110, 114, 115, 118, 120, 124, 211, 213, 208, - 170, 171, 103, 106, 170, 176, 181, 120, 181, 181, - 122, 122, 51, 156, 219, 12, 174, 170, 212, 212, - 212, 212, 212, 212, 212, 212, 212, 212, 212, 212, - 212, 212, 212, 212, 212, 212, 212, 212, 122, 210, - 212, 122, 120, 156, 103, 155, 167, 125, 122, 206, - 123, 122, 123, 102, 212, 167, 125, 141, 156, 212, - 120, 111, 120, 111, 211, 211, 211, 211, 181, 210, - 211, 13, 14, 15, 16, 17, 18, 19, 20, 29, - 107, 108, 110, 113, 114, 115, 116, 117, 119, 120, - 121, 125, 103, 146, 212, 170, 112, 209, 122, 112, - 212, 87, 105, 122, 125, 120, 152, 142, 167, 122, - 156, 123, 172, 122, 167, 181, 181, 181, 122, 122, - 211, 211, 211, 211, 211, 211, 211, 211, 211, 211, - 211, 211, 211, 211, 211, 211, 211, 211, 122, 210, - 212, 147, 120, 122, 120, 120, 212, 153, 167, 122, - 156, 123, 156, 122, 112, 122, 112, 211, 105, 122, - 125, 210, 210, 122, 217, 167, 122, 156, 156, 120, - 120, 211, 122, 122, 122, 122, 156, 210, 210, 156, - 122, 122 -}; - -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ -#endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) -# if defined (__STDC__) || defined (__cplusplus) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# endif -#endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int -#endif +/* Note: there must be only one dollar sign in this file. + It is replaced by the list of actions, each action + as one case of the switch. */ #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) +#define YYEMPTY -2 #define YYEOF 0 - #define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrlab1 +/* Like YYERROR except do call yyerror. + This remains here temporarily to ease the + transition to the new meaning of YYERROR, for GCC. Once GCC version 2 has supplanted version 1, this can go. */ - #define YYFAIL goto yyerrlab - #define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ +#define YYBACKUP(token, value) \ do \ if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ + { yychar = (token), yylval = (value); \ + yychar1 = YYTRANSLATE (yychar); \ YYPOPSTACK; \ goto yybackup; \ } \ else \ - { \ - yyerror ("syntax error: cannot back up");\ - YYERROR; \ - } \ + { yyerror ("syntax error: cannot back up"); YYERROR; } \ while (0) - #define YYTERROR 1 #define YYERRCODE 256 - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (N) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (0) +#ifndef YYPURE +#define YYLEX yylex() #endif - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - +#ifdef YYPURE +#ifdef YYLSP_NEEDED #ifdef YYLEX_PARAM -# define YYLEX yylex (&yylval, &yylloc, YYLEX_PARAM) +#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) #else -# define YYLEX yylex (&yylval, &yylloc) +#define YYLEX yylex(&yylval, &yylloc) +#endif +#else /* not YYLSP_NEEDED */ +#ifdef YYLEX_PARAM +#define YYLEX yylex(&yylval, YYLEX_PARAM) +#else +#define YYLEX yylex(&yylval) +#endif +#endif /* not YYLSP_NEEDED */ #endif -/* Enable debugging if requested. */ -#if YYDEBUG +/* If nonreentrant, generate the variables here */ -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif +#ifndef YYPURE -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (0) +int yychar; /* the lookahead symbol */ +YYSTYPE yylval; /* the semantic value of the */ + /* lookahead symbol */ -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yysymprint (stderr, \ - Type, Value, Location); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_stack_print (short int *bottom, short int *top) -#else -static void -yy_stack_print (bottom, top) - short int *bottom; - short int *top; +#ifdef YYLSP_NEEDED +YYLTYPE yylloc; /* location data for the lookahead */ + /* symbol */ #endif -{ - YYFPRINTF (stderr, "Stack now"); - for (/* Nothing. */; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); - YYFPRINTF (stderr, "\n"); -} -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (0) +int yynerrs; /* number of parse errors so far */ +#endif /* not YYPURE */ - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yy_reduce_print (int yyrule) -#else -static void -yy_reduce_print (yyrule) - int yyrule; +#if YYDEBUG != 0 +int yydebug; /* nonzero means print parse trace */ +/* Since this is uninitialized, it does not stop multiple parsers + from coexisting. */ #endif -{ - int yyi; - unsigned int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", - yyrule - 1, yylno); - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) - YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); - YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); -} -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (Rule); \ -} while (0) +/* YYINITDEPTH indicates the initial size of the parser's stacks */ -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH -# define YYINITDEPTH 200 +#define YYINITDEPTH 200 #endif -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). +/* YYMAXDEPTH is the maximum size the stacks can grow to + (effective only if the built-in stack extension method is used). */ - Do not make this value too large; the results are undefined if - SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ +#if YYMAXDEPTH == 0 +#undef YYMAXDEPTH +#endif #ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 +#define YYMAXDEPTH 10000 #endif - +/* Define __yy_memcpy. Note that the size argument + should be passed with type unsigned int, because that is what the non-GCC + definitions require. With GCC, __builtin_memcpy takes an arg + of type size_t, but it can handle unsigned int. */ -#if YYERROR_VERBOSE +#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ +#define __yy_memcpy(TO,FROM,COUNT) __builtin_memcpy(TO,FROM,COUNT) +#else /* not GNU C or C++ */ +#ifndef __cplusplus -# ifndef yystrlen -# if defined (__GLIBC__) && defined (_STRING_H) -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -static YYSIZE_T -# if defined (__STDC__) || defined (__cplusplus) -yystrlen (const char *yystr) -# else -yystrlen (yystr) - const char *yystr; -# endif -{ - register const char *yys = yystr; - - while (*yys++ != '\0') - continue; - - return yys - yystr - 1; -} -# endif -# endif - -# ifndef yystpcpy -# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -static char * -# if defined (__STDC__) || defined (__cplusplus) -yystpcpy (char *yydest, const char *yysrc) -# else -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -# endif -{ - register char *yyd = yydest; - register const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -#endif /* !YYERROR_VERBOSE */ - - - -#if YYDEBUG -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ static void -yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp) -#else +__yy_memcpy (to, from, count) + char *to; + char *from; + unsigned int count; +{ + register char *f = from; + register char *t = to; + register int i = count; + + while (i-- > 0) + *t++ = *f++; +} + +#else /* __cplusplus */ + +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ static void -yysymprint (yyoutput, yytype, yyvaluep, yylocationp) - FILE *yyoutput; - int yytype; - YYSTYPE *yyvaluep; - YYLTYPE *yylocationp; +__yy_memcpy (char *to, char *from, unsigned int count) +{ + register char *t = to; + register char *f = from; + register int i = count; + + while (i-- > 0) + *t++ = *f++; +} + #endif -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - (void) yylocationp; - - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - YY_LOCATION_PRINT (yyoutput, *yylocationp); - fprintf (yyoutput, ": "); - -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - switch (yytype) - { - default: - break; - } - YYFPRINTF (yyoutput, ")"); -} - -#endif /* ! YYDEBUG */ -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -#if defined (__STDC__) || defined (__cplusplus) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, YYLTYPE *yylocationp) -#else -static void -yydestruct (yymsg, yytype, yyvaluep, yylocationp) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; - YYLTYPE *yylocationp; #endif -{ - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; - (void) yylocationp; - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } -} +#line 217 "/usr/share/bison.simple" -/* Prevent warnings from -Wmissing-prototypes. */ +/* The user can define YYPARSE_PARAM as the name of an argument to be passed + into yyparse. The argument should have type void *. + It should actually point to an object. + Grammar actions can access the variable by casting it + to the proper pointer type. */ #ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM); -# else -int yyparse (); -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) +#ifdef __cplusplus +#define YYPARSE_PARAM_ARG void *YYPARSE_PARAM +#define YYPARSE_PARAM_DECL +#else /* not __cplusplus */ +#define YYPARSE_PARAM_ARG YYPARSE_PARAM +#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; +#endif /* not __cplusplus */ +#else /* not YYPARSE_PARAM */ +#define YYPARSE_PARAM_ARG +#define YYPARSE_PARAM_DECL +#endif /* not YYPARSE_PARAM */ + +/* Prevent warning if -Wstrict-prototypes. */ +#ifdef __GNUC__ +#ifdef YYPARSE_PARAM +int yyparse (void *); +#else int yyparse (void); -#else -int yyparse (); #endif -#endif /* ! YYPARSE_PARAM */ +#endif - - - - - -/*----------. -| yyparse. | -`----------*/ - -#ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM) -# else -int yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -# endif -#else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) int -yyparse (void) -#else -int -yyparse () - -#endif -#endif +yyparse(YYPARSE_PARAM_ARG) + YYPARSE_PARAM_DECL { - /* The look-ahead symbol. */ -int yychar; - -/* The semantic value of the look-ahead symbol. */ -YYSTYPE yylval; - -/* Number of syntax errors so far. */ -int yynerrs; -/* Location data for the look-ahead symbol. */ -YYLTYPE yylloc; - register int yystate; register int yyn; - int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; - - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - short int yyssa[YYINITDEPTH]; - short int *yyss = yyssa; - register short int *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; + register short *yyssp; register YYSTYPE *yyvsp; + int yyerrstatus; /* number of tokens to shift before error messages enabled */ + int yychar1 = 0; /* lookahead token as an internal (translated) token number */ - /* The location stack. */ - YYLTYPE yylsa[YYINITDEPTH]; + short yyssa[YYINITDEPTH]; /* the state stack */ + YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ + + short *yyss = yyssa; /* refer to the stacks thru separate pointers */ + YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ + +#ifdef YYLSP_NEEDED + YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ YYLTYPE *yyls = yylsa; YYLTYPE *yylsp; - /* The locations where the error started and ended. */ - YYLTYPE yyerror_range[2]; #define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) +#else +#define YYPOPSTACK (yyvsp--, yyssp--) +#endif - YYSIZE_T yystacksize = YYINITDEPTH; + int yystacksize = YYINITDEPTH; + int yyfree_stacks = 0; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - YYLTYPE yyloc; +#ifdef YYPURE + int yychar; + YYSTYPE yylval; + int yynerrs; +#ifdef YYLSP_NEEDED + YYLTYPE yylloc; +#endif +#endif + + YYSTYPE yyval; /* the variable used to return */ + /* semantic values from the action */ + /* routines */ - /* When reducing, the number of symbols on the RHS of the reduced - rule. */ int yylen; - YYDPRINTF ((stderr, "Starting parse\n")); +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Starting parse\n"); +#endif yystate = 0; yyerrstatus = 0; @@ -2625,244 +2027,278 @@ YYLTYPE yylloc; so that they stay on the same level as the state stack. The wasted elements are never initialized. */ - yyssp = yyss; + yyssp = yyss - 1; yyvsp = yyvs; +#ifdef YYLSP_NEEDED yylsp = yyls; -#if YYLTYPE_IS_TRIVIAL - /* Initialize the default location before parsing starts. */ - yylloc.first_line = yylloc.last_line = 1; - yylloc.first_column = yylloc.last_column = 0; #endif +/* Push a new state, which is found in yystate . */ +/* In all cases, when you get here, the value and location stacks + have just been pushed. so pushing a state here evens the stacks. */ +yynewstate: - yyvsp[0] = yylval; - yylsp[0] = yylloc; + *++yyssp = yystate; - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. - */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) + if (yyssp >= yyss + yystacksize - 1) { + /* Give user a chance to reallocate the stack */ + /* Use copies of these so that the &'s don't force the real ones into memory. */ + YYSTYPE *yyvs1 = yyvs; + short *yyss1 = yyss; +#ifdef YYLSP_NEEDED + YYLTYPE *yyls1 = yyls; +#endif + /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; + int size = yyssp - yyss + 1; #ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - short int *yyss1 = yyss; - YYLTYPE *yyls1 = yyls; + /* Each stack pointer address is followed by the size of + the data in use in that stack, in bytes. */ +#ifdef YYLSP_NEEDED + /* This used to be a conditional around just the two extra args, + but that might be undefined if yyoverflow is a macro. */ + yyoverflow("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yyls1, size * sizeof (*yylsp), + &yystacksize); +#else + yyoverflow("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yystacksize); +#endif - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow ("parser stack overflow", - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yyls1, yysize * sizeof (*yylsp), - &yystacksize); - yyls = yyls1; - yyss = yyss1; - yyvs = yyvs1; - } + yyss = yyss1; yyvs = yyvs1; +#ifdef YYLSP_NEEDED + yyls = yyls1; +#endif #else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyoverflowlab; -# else /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyoverflowlab; + if (yystacksize >= YYMAXDEPTH) + { + yyerror("parser stack overflow"); + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); +#endif + } + return 2; + } yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) + if (yystacksize > YYMAXDEPTH) yystacksize = YYMAXDEPTH; - - { - short int *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyoverflowlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - YYSTACK_RELOCATE (yyls); -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif +#ifndef YYSTACK_USE_ALLOCA + yyfree_stacks = 1; +#endif + yyss = (short *) YYSTACK_ALLOC (yystacksize * sizeof (*yyssp)); + __yy_memcpy ((char *)yyss, (char *)yyss1, + size * (unsigned int) sizeof (*yyssp)); + yyvs = (YYSTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yyvsp)); + __yy_memcpy ((char *)yyvs, (char *)yyvs1, + size * (unsigned int) sizeof (*yyvsp)); +#ifdef YYLSP_NEEDED + yyls = (YYLTYPE *) YYSTACK_ALLOC (yystacksize * sizeof (*yylsp)); + __yy_memcpy ((char *)yyls, (char *)yyls1, + size * (unsigned int) sizeof (*yylsp)); +#endif #endif /* no yyoverflow */ - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - yylsp = yyls + yysize - 1; + yyssp = yyss + size - 1; + yyvsp = yyvs + size - 1; +#ifdef YYLSP_NEEDED + yylsp = yyls + size - 1; +#endif - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Stack size increased to %d\n", yystacksize); +#endif - if (yyss + yystacksize - 1 <= yyssp) + if (yyssp >= yyss + yystacksize - 1) YYABORT; } - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Entering state %d\n", yystate); +#endif goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: + yybackup: /* Do appropriate processing given the current state. */ -/* Read a look-ahead token if we need one and don't already have one. */ +/* Read a lookahead token if we need one and don't already have one. */ /* yyresume: */ - /* First try to decide what to do without reference to look-ahead token. */ + /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) + if (yyn == YYFLAG) goto yydefault; - /* Not known => get a look-ahead token if don't already have one. */ + /* Not known => get a lookahead token if don't already have one. */ + + /* yychar is either YYEMPTY or YYEOF + or a valid token in external form. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { - YYDPRINTF ((stderr, "Reading a token: ")); +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Reading a token: "); +#endif yychar = YYLEX; } - if (yychar <= YYEOF) + /* Convert token to internal form (in yychar1) for indexing tables with */ + + if (yychar <= 0) /* This means end of input. */ { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); + yychar1 = 0; + yychar = YYEOF; /* Don't call YYLEX any more */ + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Now at end of input.\n"); +#endif } else { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); + yychar1 = YYTRANSLATE(yychar); + +#if YYDEBUG != 0 + if (yydebug) + { + fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); + /* Give the individual parser a way to print the precise meaning + of a token, for further debugging info. */ +#ifdef YYPRINT + YYPRINT (stderr, yychar, yylval); +#endif + fprintf (stderr, ")\n"); + } +#endif } - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) + yyn += yychar1; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) goto yydefault; + yyn = yytable[yyn]; - if (yyn <= 0) + + /* yyn is what to do for this token type in this state. + Negative => reduce, -yyn is rule number. + Positive => shift, yyn is new state. + New state is final state => don't bother to shift, + just return success. + 0, or most negative number => error. */ + + if (yyn < 0) { - if (yyn == 0 || yyn == YYTABLE_NINF) + if (yyn == YYFLAG) goto yyerrlab; yyn = -yyn; goto yyreduce; } + else if (yyn == 0) + goto yyerrlab; if (yyn == YYFINAL) YYACCEPT; - /* Shift the look-ahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + /* Shift the lookahead token. */ + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); +#endif /* Discard the token being shifted unless it is eof. */ if (yychar != YYEOF) yychar = YYEMPTY; *++yyvsp = yylval; +#ifdef YYLSP_NEEDED *++yylsp = yylloc; +#endif - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; + /* count tokens shifted since error; after three, turn off error status. */ + if (yyerrstatus) yyerrstatus--; yystate = yyn; goto yynewstate; - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ +/* Do the default action for the current state. */ yydefault: + yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; - goto yyreduce; - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ +/* Do a reduction. yyn is the number of a rule to reduce with. */ yyreduce: - /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; + if (yylen > 0) + yyval = yyvsp[1-yylen]; /* implement default value of the action */ - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - /* Default location. */ - YYLLOC_DEFAULT (yyloc, yylsp - yylen, yylen); - YY_REDUCE_PRINT (yyn); - switch (yyn) +#if YYDEBUG != 0 + if (yydebug) { - case 3: -#line 381 "cppBison.yxx" - { - current_expr = (yyvsp[0].u.expr); -} - break; + int i; - case 4: -#line 385 "cppBison.yxx" - { - current_type = (yyvsp[0].u.type); -} - break; + fprintf (stderr, "Reducing via rule %d (line %d), ", + yyn, yyrline[yyn]); - case 10: -#line 403 "cppBison.yxx" - { - delete (yyvsp[-1].u.expr); -} - break; + /* Print the symbols being reduced, and their result. */ + for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) + fprintf (stderr, "%s ", yytname[yyrhs[i]]); + fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); + } +#endif - case 11: -#line 415 "cppBison.yxx" - { + + switch (yyn) { + +case 2: +#line 383 "cppBison.yxx" +{ + current_expr = yyvsp[0].u.expr; +; + break;} +case 3: +#line 387 "cppBison.yxx" +{ + current_type = yyvsp[0].u.type; +; + break;} +case 9: +#line 405 "cppBison.yxx" +{ + delete yyvsp[-1].u.expr; +; + break;} +case 10: +#line 417 "cppBison.yxx" +{ push_storage_class((current_storage_class & ~CPPInstance::SC_c_binding) | - ((yyvsp[-1].u.integer) & CPPInstance::SC_c_binding)); -} - break; - - case 12: -#line 420 "cppBison.yxx" - { + (yyvsp[-1].u.integer & CPPInstance::SC_c_binding)); +; + break;} +case 11: +#line 422 "cppBison.yxx" +{ pop_storage_class(); -} - break; - - case 20: -#line 434 "cppBison.yxx" - { +; + break;} +case 19: +#line 436 "cppBison.yxx" +{ if (publish_nest_level != 0) { yyerror("Unclosed __begin_publish", publish_loc); publish_nest_level = 0; @@ -2870,382 +2306,349 @@ yyreduce: } publish_previous = current_scope->get_current_vis(); - publish_loc = (yylsp[0]); + publish_loc = yylsp[0]; publish_nest_level++; current_scope->set_current_vis(V_published); -} - break; - - case 21: -#line 447 "cppBison.yxx" - { +; + break;} +case 20: +#line 449 "cppBison.yxx" +{ if (publish_nest_level != 1) { - yyerror("Unmatched __end_publish", (yylsp[0])); + yyerror("Unmatched __end_publish", yylsp[0]); } else { current_scope->set_current_vis(publish_previous); } publish_nest_level = 0; -} - break; - - case 22: -#line 456 "cppBison.yxx" - { +; + break;} +case 21: +#line 458 "cppBison.yxx" +{ current_scope->set_current_vis(V_published); -} - break; - - case 23: -#line 460 "cppBison.yxx" - { +; + break;} +case 22: +#line 462 "cppBison.yxx" +{ if (publish_nest_level > 0) { current_scope->set_current_vis(V_published); } else { current_scope->set_current_vis(V_public); } -} - break; - - case 24: -#line 468 "cppBison.yxx" - { +; + break;} +case 23: +#line 470 "cppBison.yxx" +{ current_scope->set_current_vis(V_protected); -} - break; - - case 25: -#line 472 "cppBison.yxx" - { +; + break;} +case 24: +#line 474 "cppBison.yxx" +{ current_scope->set_current_vis(V_private); -} - break; - - case 26: -#line 479 "cppBison.yxx" - { +; + break;} +case 25: +#line 478 "cppBison.yxx" +{ + CPPMakeSeq *make_seq = new CPPMakeSeq(yyvsp[-6].u.identifier->get_simple_name(), yyvsp[-4].u.identifier->get_simple_name(), yyvsp[-2].u.identifier->get_simple_name(), yylsp[-8].file); + current_scope->add_declaration(make_seq, global_scope, current_lexer, yylsp[-8]); +; + break;} +case 26: +#line 486 "cppBison.yxx" +{ CPPScope *new_scope = new CPPScope(current_scope, CPPNameComponent("temp"), V_public); push_scope(new_scope); -} - break; - - case 27: -#line 485 "cppBison.yxx" - { +; + break;} +case 27: +#line 492 "cppBison.yxx" +{ delete current_scope; pop_scope(); -} - break; - - case 28: -#line 494 "cppBison.yxx" - { - (yyval.u.integer) = 0; -} - break; - - case 29: -#line 498 "cppBison.yxx" - { - (yyval.u.integer) = (yyvsp[-1].u.integer) | (int)CPPInstance::SC_extern; -} - break; - - case 30: -#line 502 "cppBison.yxx" - { - (yyval.u.integer) = (yyvsp[-2].u.integer) | (int)CPPInstance::SC_extern; - if ((yyvsp[0].str) == "C") { - (yyval.u.integer) |= (int)CPPInstance::SC_c_binding; - } else if ((yyvsp[0].str) == "C++") { - (yyval.u.integer) &= ~(int)CPPInstance::SC_c_binding; +; + break;} +case 28: +#line 501 "cppBison.yxx" +{ + yyval.u.integer = 0; +; + break;} +case 29: +#line 505 "cppBison.yxx" +{ + yyval.u.integer = yyvsp[-1].u.integer | (int)CPPInstance::SC_extern; +; + break;} +case 30: +#line 509 "cppBison.yxx" +{ + yyval.u.integer = yyvsp[-2].u.integer | (int)CPPInstance::SC_extern; + if (yyvsp[0].str == "C") { + yyval.u.integer |= (int)CPPInstance::SC_c_binding; + } else if (yyvsp[0].str == "C++") { + yyval.u.integer &= ~(int)CPPInstance::SC_c_binding; } else { - yywarning("Ignoring unknown linkage type \"" + (yyvsp[0].str) + "\"", (yylsp[0])); + yywarning("Ignoring unknown linkage type \"" + yyvsp[0].str + "\"", yylsp[0]); } -} - break; - - case 31: -#line 513 "cppBison.yxx" - { - (yyval.u.integer) = (yyvsp[-1].u.integer) | (int)CPPInstance::SC_static; -} - break; - - case 32: -#line 517 "cppBison.yxx" - { - (yyval.u.integer) = (yyvsp[-1].u.integer) | (int)CPPInstance::SC_inline; -} - break; - - case 33: -#line 521 "cppBison.yxx" - { - (yyval.u.integer) = (yyvsp[-1].u.integer) | (int)CPPInstance::SC_virtual; -} - break; - - case 34: -#line 525 "cppBison.yxx" - { - (yyval.u.integer) = (yyvsp[-1].u.integer) | (int)CPPInstance::SC_explicit; -} - break; - - case 35: -#line 529 "cppBison.yxx" - { - (yyval.u.integer) = (yyvsp[-1].u.integer) | (int)CPPInstance::SC_volatile; -} - break; - - case 36: -#line 533 "cppBison.yxx" - { - (yyval.u.integer) = (yyvsp[-1].u.integer) | (int)CPPInstance::SC_mutable; -} - break; - - case 37: -#line 537 "cppBison.yxx" - { - (yyval.u.integer) = (yyvsp[-1].u.integer) | (int)CPPInstance::SC_register; -} - break; - - case 38: -#line 541 "cppBison.yxx" - { - (yyval.u.integer) = (yyvsp[-1].u.integer) | (int)CPPInstance::SC_blocking; -} - break; - - case 39: +; + break;} +case 31: +#line 520 "cppBison.yxx" +{ + yyval.u.integer = yyvsp[-1].u.integer | (int)CPPInstance::SC_static; +; + break;} +case 32: +#line 524 "cppBison.yxx" +{ + yyval.u.integer = yyvsp[-1].u.integer | (int)CPPInstance::SC_inline; +; + break;} +case 33: +#line 528 "cppBison.yxx" +{ + yyval.u.integer = yyvsp[-1].u.integer | (int)CPPInstance::SC_virtual; +; + break;} +case 34: +#line 532 "cppBison.yxx" +{ + yyval.u.integer = yyvsp[-1].u.integer | (int)CPPInstance::SC_explicit; +; + break;} +case 35: +#line 536 "cppBison.yxx" +{ + yyval.u.integer = yyvsp[-1].u.integer | (int)CPPInstance::SC_volatile; +; + break;} +case 36: +#line 540 "cppBison.yxx" +{ + yyval.u.integer = yyvsp[-1].u.integer | (int)CPPInstance::SC_mutable; +; + break;} +case 37: +#line 544 "cppBison.yxx" +{ + yyval.u.integer = yyvsp[-1].u.integer | (int)CPPInstance::SC_register; +; + break;} +case 38: #line 548 "cppBison.yxx" - { +{ + yyval.u.integer = yyvsp[-1].u.integer | (int)CPPInstance::SC_blocking; +; + break;} +case 39: +#line 555 "cppBison.yxx" +{ /* multiple_var_declaration adds itself to the scope. */ -} - break; - - case 40: -#line 552 "cppBison.yxx" - { +; + break;} +case 40: +#line 559 "cppBison.yxx" +{ // We don't really care about the storage class here. In fact, it's // not actually legal to define a class or struct using a particular // storage class, but we require it just to help yacc out in its // parsing. - current_scope->add_declaration((yyvsp[-1].u.decl), global_scope, current_lexer, (yylsp[-1])); -} - break; - - case 41: -#line 561 "cppBison.yxx" - { - if ((yyvsp[-1].u.instance) != (CPPInstance *)NULL) { - (yyvsp[-1].u.instance)->_storage_class |= (current_storage_class | (yyvsp[-2].u.integer)); - current_scope->add_declaration((yyvsp[-1].u.instance), global_scope, current_lexer, (yylsp[-1])); - (yyvsp[-1].u.instance)->set_initializer((yyvsp[0].u.expr)); + current_scope->add_declaration(yyvsp[-1].u.decl, global_scope, current_lexer, yylsp[-1]); +; + break;} +case 41: +#line 568 "cppBison.yxx" +{ + if (yyvsp[-1].u.instance != (CPPInstance *)NULL) { + yyvsp[-1].u.instance->_storage_class |= (current_storage_class | yyvsp[-2].u.integer); + current_scope->add_declaration(yyvsp[-1].u.instance, global_scope, current_lexer, yylsp[-1]); + yyvsp[-1].u.instance->set_initializer(yyvsp[0].u.expr); } -} - break; - - case 42: -#line 572 "cppBison.yxx" - { +; + break;} +case 42: +#line 579 "cppBison.yxx" +{ // We don't need to push/pop type, because we can't nest // multiple_var_declarations. - if ((yyvsp[0].u.decl)->as_type_declaration()) { - current_type = (yyvsp[0].u.decl)->as_type_declaration()->_type; + if (yyvsp[0].u.decl->as_type_declaration()) { + current_type = yyvsp[0].u.decl->as_type_declaration()->_type; } else { - current_type = (yyvsp[0].u.decl)->as_type(); + current_type = yyvsp[0].u.decl->as_type(); } - push_storage_class((yyvsp[-1].u.integer)); -} - break; - - case 43: -#line 583 "cppBison.yxx" - { + push_storage_class(yyvsp[-1].u.integer); +; + break;} +case 43: +#line 590 "cppBison.yxx" +{ pop_storage_class(); -} - break; - - case 44: -#line 587 "cppBison.yxx" - { - // We don't need to push/pop type, because we can't nest - // multiple_var_declarations. - current_type = (yyvsp[0].u.type); - push_storage_class((yyvsp[-2].u.integer)); -} - break; - - case 45: +; + break;} +case 44: #line 594 "cppBison.yxx" - { - pop_storage_class(); -} - break; - - case 46: -#line 605 "cppBison.yxx" - { - CPPInstance *inst = new CPPInstance(current_type, (yyvsp[-1].u.inst_ident), - current_storage_class, - (yylsp[-1]).file); - inst->set_initializer((yyvsp[0].u.expr)); - current_scope->add_declaration(inst, global_scope, current_lexer, (yylsp[-1])); -} - break; - - case 47: -#line 613 "cppBison.yxx" - { - CPPInstance *inst = new CPPInstance(current_type, (yyvsp[-3].u.inst_ident), - current_storage_class, - (yylsp[-3]).file); - inst->set_initializer((yyvsp[-2].u.expr)); - current_scope->add_declaration(inst, global_scope, current_lexer, (yylsp[-3])); -} - break; - - case 48: -#line 624 "cppBison.yxx" - { - (yyvsp[-1].u.inst_ident)->add_modifier(IIT_const); - CPPInstance *inst = new CPPInstance(current_type, (yyvsp[-1].u.inst_ident), - current_storage_class, - (yylsp[-1]).file); - inst->set_initializer((yyvsp[0].u.expr)); - current_scope->add_declaration(inst, global_scope, current_lexer, (yylsp[-1])); -} - break; - - case 49: -#line 633 "cppBison.yxx" - { - (yyvsp[-3].u.inst_ident)->add_modifier(IIT_const); - CPPInstance *inst = new CPPInstance(current_type, (yyvsp[-3].u.inst_ident), - current_storage_class, - (yylsp[-3]).file); - inst->set_initializer((yyvsp[-2].u.expr)); - current_scope->add_declaration(inst, global_scope, current_lexer, (yylsp[-3])); -} - break; - - case 50: -#line 646 "cppBison.yxx" - { +{ // We don't need to push/pop type, because we can't nest // multiple_var_declarations. - if ((yyvsp[0].u.decl)->as_type_declaration()) { - current_type = (yyvsp[0].u.decl)->as_type_declaration()->_type; + current_type = yyvsp[0].u.type; + push_storage_class(yyvsp[-2].u.integer); +; + break;} +case 45: +#line 601 "cppBison.yxx" +{ + pop_storage_class(); +; + break;} +case 46: +#line 612 "cppBison.yxx" +{ + CPPInstance *inst = new CPPInstance(current_type, yyvsp[-1].u.inst_ident, + current_storage_class, + yylsp[-1].file); + inst->set_initializer(yyvsp[0].u.expr); + current_scope->add_declaration(inst, global_scope, current_lexer, yylsp[-1]); +; + break;} +case 47: +#line 620 "cppBison.yxx" +{ + CPPInstance *inst = new CPPInstance(current_type, yyvsp[-3].u.inst_ident, + current_storage_class, + yylsp[-3].file); + inst->set_initializer(yyvsp[-2].u.expr); + current_scope->add_declaration(inst, global_scope, current_lexer, yylsp[-3]); +; + break;} +case 48: +#line 631 "cppBison.yxx" +{ + yyvsp[-1].u.inst_ident->add_modifier(IIT_const); + CPPInstance *inst = new CPPInstance(current_type, yyvsp[-1].u.inst_ident, + current_storage_class, + yylsp[-1].file); + inst->set_initializer(yyvsp[0].u.expr); + current_scope->add_declaration(inst, global_scope, current_lexer, yylsp[-1]); +; + break;} +case 49: +#line 640 "cppBison.yxx" +{ + yyvsp[-3].u.inst_ident->add_modifier(IIT_const); + CPPInstance *inst = new CPPInstance(current_type, yyvsp[-3].u.inst_ident, + current_storage_class, + yylsp[-3].file); + inst->set_initializer(yyvsp[-2].u.expr); + current_scope->add_declaration(inst, global_scope, current_lexer, yylsp[-3]); +; + break;} +case 50: +#line 653 "cppBison.yxx" +{ + // We don't need to push/pop type, because we can't nest + // multiple_var_declarations. + if (yyvsp[0].u.decl->as_type_declaration()) { + current_type = yyvsp[0].u.decl->as_type_declaration()->_type; } else { - current_type = (yyvsp[0].u.decl)->as_type(); + current_type = yyvsp[0].u.decl->as_type(); } - push_storage_class((yyvsp[-1].u.integer)); -} - break; - - case 51: -#line 657 "cppBison.yxx" - { + push_storage_class(yyvsp[-1].u.integer); +; + break;} +case 51: +#line 664 "cppBison.yxx" +{ pop_storage_class(); -} - break; - - case 52: -#line 661 "cppBison.yxx" - { +; + break;} +case 52: +#line 668 "cppBison.yxx" +{ // We don't need to push/pop type, because we can't nest // multiple_var_declarations. - current_type = (yyvsp[0].u.type); - push_storage_class((yyvsp[-2].u.integer)); -} - break; - - case 53: -#line 668 "cppBison.yxx" - { + current_type = yyvsp[0].u.type; + push_storage_class(yyvsp[-2].u.integer); +; + break;} +case 53: +#line 675 "cppBison.yxx" +{ pop_storage_class(); -} - break; - - case 54: -#line 672 "cppBison.yxx" - { - if ((yyvsp[-1].u.instance) != (CPPDeclaration *)NULL) { - CPPInstance *inst = (yyvsp[-1].u.instance)->as_instance(); +; + break;} +case 54: +#line 679 "cppBison.yxx" +{ + if (yyvsp[-1].u.instance != (CPPDeclaration *)NULL) { + CPPInstance *inst = yyvsp[-1].u.instance->as_instance(); if (inst != (CPPInstance *)NULL) { - inst->_storage_class |= (current_storage_class | (yyvsp[-2].u.integer)); - current_scope->add_declaration(inst, global_scope, current_lexer, (yylsp[-1])); - current_scope->add_declaration(new CPPTypedef(inst, current_scope == global_scope), global_scope, current_lexer, (yylsp[-1])); + inst->_storage_class |= (current_storage_class | yyvsp[-2].u.integer); + current_scope->add_declaration(inst, global_scope, current_lexer, yylsp[-1]); + current_scope->add_declaration(new CPPTypedef(inst, current_scope == global_scope), global_scope, current_lexer, yylsp[-1]); } } -} - break; - - case 55: -#line 686 "cppBison.yxx" - { - CPPInstance *inst = new CPPInstance(current_type, (yyvsp[-1].u.inst_ident), +; + break;} +case 55: +#line 693 "cppBison.yxx" +{ + CPPInstance *inst = new CPPInstance(current_type, yyvsp[-1].u.inst_ident, current_storage_class, - (yylsp[-1]).file); - inst->set_initializer((yyvsp[0].u.expr)); - current_scope->add_declaration(new CPPTypedef(inst, current_scope == global_scope), global_scope, current_lexer, (yylsp[-1])); -} - break; - - case 56: -#line 694 "cppBison.yxx" - { - CPPInstance *inst = new CPPInstance(current_type, (yyvsp[-3].u.inst_ident), + yylsp[-1].file); + inst->set_initializer(yyvsp[0].u.expr); + current_scope->add_declaration(new CPPTypedef(inst, current_scope == global_scope), global_scope, current_lexer, yylsp[-1]); +; + break;} +case 56: +#line 701 "cppBison.yxx" +{ + CPPInstance *inst = new CPPInstance(current_type, yyvsp[-3].u.inst_ident, current_storage_class, - (yylsp[-3]).file); - inst->set_initializer((yyvsp[-2].u.expr)); - current_scope->add_declaration(new CPPTypedef(inst, current_scope == global_scope), global_scope, current_lexer, (yylsp[-3])); -} - break; - - case 57: -#line 705 "cppBison.yxx" - { - (yyvsp[-1].u.inst_ident)->add_modifier(IIT_const); - CPPInstance *inst = new CPPInstance(current_type, (yyvsp[-1].u.inst_ident), + yylsp[-3].file); + inst->set_initializer(yyvsp[-2].u.expr); + current_scope->add_declaration(new CPPTypedef(inst, current_scope == global_scope), global_scope, current_lexer, yylsp[-3]); +; + break;} +case 57: +#line 712 "cppBison.yxx" +{ + yyvsp[-1].u.inst_ident->add_modifier(IIT_const); + CPPInstance *inst = new CPPInstance(current_type, yyvsp[-1].u.inst_ident, current_storage_class, - (yylsp[-1]).file); - inst->set_initializer((yyvsp[0].u.expr)); - current_scope->add_declaration(new CPPTypedef(inst, current_scope == global_scope), global_scope, current_lexer, (yylsp[-1])); -} - break; - - case 58: -#line 714 "cppBison.yxx" - { - (yyvsp[-3].u.inst_ident)->add_modifier(IIT_const); - CPPInstance *inst = new CPPInstance(current_type, (yyvsp[-3].u.inst_ident), + yylsp[-1].file); + inst->set_initializer(yyvsp[0].u.expr); + current_scope->add_declaration(new CPPTypedef(inst, current_scope == global_scope), global_scope, current_lexer, yylsp[-1]); +; + break;} +case 58: +#line 721 "cppBison.yxx" +{ + yyvsp[-3].u.inst_ident->add_modifier(IIT_const); + CPPInstance *inst = new CPPInstance(current_type, yyvsp[-3].u.inst_ident, current_storage_class, - (yylsp[-3]).file); - inst->set_initializer((yyvsp[-2].u.expr)); - current_scope->add_declaration(new CPPTypedef(inst, current_scope == global_scope), global_scope, current_lexer, (yylsp[-3])); -} - break; - - case 59: -#line 728 "cppBison.yxx" - { - push_scope((yyvsp[-1].u.identifier)->get_scope(current_scope, global_scope)); -} - break; - - case 60: -#line 732 "cppBison.yxx" - { + yylsp[-3].file); + inst->set_initializer(yyvsp[-2].u.expr); + current_scope->add_declaration(new CPPTypedef(inst, current_scope == global_scope), global_scope, current_lexer, yylsp[-3]); +; + break;} +case 59: +#line 735 "cppBison.yxx" +{ + push_scope(yyvsp[-1].u.identifier->get_scope(current_scope, global_scope)); +; + break;} +case 60: +#line 739 "cppBison.yxx" +{ pop_scope(); CPPType *type; - if ((yyvsp[-5].u.identifier)->get_simple_name() == current_scope->get_simple_name()) { + if (yyvsp[-5].u.identifier->get_simple_name() == current_scope->get_simple_name()) { // This is a constructor, and has no return. type = new CPPSimpleType(CPPSimpleType::T_void); } else { @@ -3254,26 +2657,24 @@ yyreduce: type = new CPPSimpleType(CPPSimpleType::T_int); } - CPPInstanceIdentifier *ii = new CPPInstanceIdentifier((yyvsp[-5].u.identifier)); - ii->add_func_modifier((yyvsp[-2].u.param_list), (yyvsp[0].u.integer)); + CPPInstanceIdentifier *ii = new CPPInstanceIdentifier(yyvsp[-5].u.identifier); + ii->add_func_modifier(yyvsp[-2].u.param_list, yyvsp[0].u.integer); - (yyval.u.instance) = new CPPInstance(type, ii, 0, (yylsp[-5]).file); -} - break; - - case 61: -#line 750 "cppBison.yxx" - { - push_scope((yyvsp[-1].u.identifier)->get_scope(current_scope, global_scope)); -} - break; - - case 62: -#line 754 "cppBison.yxx" - { + yyval.u.instance = new CPPInstance(type, ii, 0, yylsp[-5].file); +; + break;} +case 61: +#line 757 "cppBison.yxx" +{ + push_scope(yyvsp[-1].u.identifier->get_scope(current_scope, global_scope)); +; + break;} +case 62: +#line 761 "cppBison.yxx" +{ pop_scope(); CPPType *type; - if ((yyvsp[-5].u.identifier)->get_simple_name() == current_scope->get_simple_name()) { + if (yyvsp[-5].u.identifier->get_simple_name() == current_scope->get_simple_name()) { // This is a constructor, and has no return. type = new CPPSimpleType(CPPSimpleType::T_void); } else { @@ -3282,97 +2683,89 @@ yyreduce: type = new CPPSimpleType(CPPSimpleType::T_int); } - CPPInstanceIdentifier *ii = new CPPInstanceIdentifier((yyvsp[-5].u.identifier)); - ii->add_func_modifier((yyvsp[-2].u.param_list), (yyvsp[0].u.integer)); + CPPInstanceIdentifier *ii = new CPPInstanceIdentifier(yyvsp[-5].u.identifier); + ii->add_func_modifier(yyvsp[-2].u.param_list, yyvsp[0].u.integer); - (yyval.u.instance) = new CPPInstance(type, ii, 0, (yylsp[-5]).file); -} - break; - - case 63: -#line 774 "cppBison.yxx" - { - push_scope((yyvsp[-1].u.identifier)->get_scope(current_scope, global_scope)); -} - break; - - case 64: -#line 778 "cppBison.yxx" - { + yyval.u.instance = new CPPInstance(type, ii, 0, yylsp[-5].file); +; + break;} +case 63: +#line 781 "cppBison.yxx" +{ + push_scope(yyvsp[-1].u.identifier->get_scope(current_scope, global_scope)); +; + break;} +case 64: +#line 785 "cppBison.yxx" +{ pop_scope(); - if ((yyvsp[-5].u.identifier)->is_scoped()) { - yyerror("Invalid destructor name: ~" + (yyvsp[-5].u.identifier)->get_fully_scoped_name(), (yylsp[-5])); + if (yyvsp[-5].u.identifier->is_scoped()) { + yyerror("Invalid destructor name: ~" + yyvsp[-5].u.identifier->get_fully_scoped_name(), yylsp[-5]); } else { CPPIdentifier *ident = - new CPPIdentifier("~" + (yyvsp[-5].u.identifier)->get_simple_name(), (yylsp[-5]).file); - delete (yyvsp[-5].u.identifier); + new CPPIdentifier("~" + yyvsp[-5].u.identifier->get_simple_name(), yylsp[-5].file); + delete yyvsp[-5].u.identifier; CPPType *type; type = new CPPSimpleType(CPPSimpleType::T_void); CPPInstanceIdentifier *ii = new CPPInstanceIdentifier(ident); - ii->add_func_modifier((yyvsp[-2].u.param_list), (yyvsp[0].u.integer)); + ii->add_func_modifier(yyvsp[-2].u.param_list, yyvsp[0].u.integer); - (yyval.u.instance) = new CPPInstance(type, ii, 0, (yylsp[-5]).file); + yyval.u.instance = new CPPInstance(type, ii, 0, yylsp[-5].file); } -} - break; - - case 65: -#line 804 "cppBison.yxx" - { - push_scope((yyvsp[-2].u.inst_ident)->get_scope(current_scope, global_scope)); -} - break; - - case 66: -#line 808 "cppBison.yxx" - { +; + break;} +case 65: +#line 811 "cppBison.yxx" +{ + push_scope(yyvsp[-2].u.inst_ident->get_scope(current_scope, global_scope)); +; + break;} +case 66: +#line 815 "cppBison.yxx" +{ pop_scope(); - CPPType *type = (yyvsp[-9].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); + CPPType *type = yyvsp[-9].u.identifier->find_type(current_scope, global_scope, false, current_lexer); assert(type != NULL); - CPPInstanceIdentifier *ii = (yyvsp[-6].u.inst_ident); + CPPInstanceIdentifier *ii = yyvsp[-6].u.inst_ident; ii->add_modifier(IIT_pointer); - ii->add_func_modifier((yyvsp[-2].u.param_list), (yyvsp[0].u.integer)); - (yyval.u.instance) = new CPPInstance(type, ii, 0, (yylsp[-9]).file); -} - break; - - case 67: -#line 819 "cppBison.yxx" - { - push_scope((yyvsp[-2].u.inst_ident)->get_scope(current_scope, global_scope)); -} - break; - - case 68: -#line 823 "cppBison.yxx" - { + ii->add_func_modifier(yyvsp[-2].u.param_list, yyvsp[0].u.integer); + yyval.u.instance = new CPPInstance(type, ii, 0, yylsp[-9].file); +; + break;} +case 67: +#line 826 "cppBison.yxx" +{ + push_scope(yyvsp[-2].u.inst_ident->get_scope(current_scope, global_scope)); +; + break;} +case 68: +#line 830 "cppBison.yxx" +{ pop_scope(); - CPPType *type = (yyvsp[-10].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); + CPPType *type = yyvsp[-10].u.identifier->find_type(current_scope, global_scope, false, current_lexer); assert(type != NULL); - CPPInstanceIdentifier *ii = (yyvsp[-6].u.inst_ident); - ii->add_scoped_pointer_modifier((yyvsp[-8].u.identifier)); - ii->add_func_modifier((yyvsp[-2].u.param_list), (yyvsp[0].u.integer)); - (yyval.u.instance) = new CPPInstance(type, ii, 0, (yylsp[-10]).file); -} - break; - - case 69: -#line 836 "cppBison.yxx" - { - if ((yyvsp[-3].u.identifier) != NULL) { - push_scope((yyvsp[-3].u.identifier)->get_scope(current_scope, global_scope)); + CPPInstanceIdentifier *ii = yyvsp[-6].u.inst_ident; + ii->add_scoped_pointer_modifier(yyvsp[-8].u.identifier); + ii->add_func_modifier(yyvsp[-2].u.param_list, yyvsp[0].u.integer); + yyval.u.instance = new CPPInstance(type, ii, 0, yylsp[-10].file); +; + break;} +case 69: +#line 843 "cppBison.yxx" +{ + if (yyvsp[-3].u.identifier != NULL) { + push_scope(yyvsp[-3].u.identifier->get_scope(current_scope, global_scope)); } -} - break; - - case 70: -#line 842 "cppBison.yxx" - { - if ((yyvsp[-7].u.identifier) != NULL) { +; + break;} +case 70: +#line 849 "cppBison.yxx" +{ + if (yyvsp[-7].u.identifier != NULL) { pop_scope(); } @@ -3386,2921 +2779,2564 @@ yyreduce: // Only their return type will differentiate them. (Naturally, this // violates actual C++ rules, but we're not an actual C++ compiler // so we don't care. And this is the easiest way to do it.) - CPPIdentifier *ident = (yyvsp[-7].u.identifier); + CPPIdentifier *ident = yyvsp[-7].u.identifier; if (ident == NULL) { - ident = new CPPIdentifier("operator typecast", (yylsp[-7]).file); + ident = new CPPIdentifier("operator typecast", yylsp[-7].file); } else { ident->add_name("operator typecast"); } - (yyval.u.instance) = CPPInstance::make_typecast_function - (new CPPInstance((yyvsp[-6].u.type), (yyvsp[-5].u.inst_ident), 0, (yylsp[-5]).file), ident, (yyvsp[-2].u.param_list), (yyvsp[0].u.integer)); -} - break; - - case 71: -#line 867 "cppBison.yxx" - { - if ((yyvsp[-4].u.identifier) != NULL) { - push_scope((yyvsp[-4].u.identifier)->get_scope(current_scope, global_scope)); + yyval.u.instance = CPPInstance::make_typecast_function + (new CPPInstance(yyvsp[-6].u.type, yyvsp[-5].u.inst_ident, 0, yylsp[-5].file), ident, yyvsp[-2].u.param_list, yyvsp[0].u.integer); +; + break;} +case 71: +#line 874 "cppBison.yxx" +{ + if (yyvsp[-4].u.identifier != NULL) { + push_scope(yyvsp[-4].u.identifier->get_scope(current_scope, global_scope)); } -} - break; - - case 72: -#line 873 "cppBison.yxx" - { - if ((yyvsp[-8].u.identifier) != NULL) { +; + break;} +case 72: +#line 880 "cppBison.yxx" +{ + if (yyvsp[-8].u.identifier != NULL) { pop_scope(); } - CPPIdentifier *ident = (yyvsp[-8].u.identifier); + CPPIdentifier *ident = yyvsp[-8].u.identifier; if (ident == NULL) { - ident = new CPPIdentifier("operator typecast", (yylsp[-8]).file); + ident = new CPPIdentifier("operator typecast", yylsp[-8].file); } else { ident->add_name("operator typecast"); } - (yyvsp[-5].u.inst_ident)->add_modifier(IIT_const); - (yyval.u.instance) = CPPInstance::make_typecast_function - (new CPPInstance((yyvsp[-6].u.type), (yyvsp[-5].u.inst_ident), 0, (yylsp[-5]).file), ident, (yyvsp[-2].u.param_list), (yyvsp[0].u.integer)); -} - break; - - case 73: -#line 893 "cppBison.yxx" - { + yyvsp[-5].u.inst_ident->add_modifier(IIT_const); + yyval.u.instance = CPPInstance::make_typecast_function + (new CPPInstance(yyvsp[-6].u.type, yyvsp[-5].u.inst_ident, 0, yylsp[-5].file), ident, yyvsp[-2].u.param_list, yyvsp[0].u.integer); +; + break;} +case 73: +#line 900 "cppBison.yxx" +{ CPPDeclaration *decl = - (yyvsp[0].u.identifier)->find_symbol(current_scope, global_scope, current_lexer); + yyvsp[0].u.identifier->find_symbol(current_scope, global_scope, current_lexer); if (decl != (CPPDeclaration *)NULL) { - (yyval.u.instance) = decl->as_instance(); + yyval.u.instance = decl->as_instance(); } else { - (yyval.u.instance) = (CPPInstance *)NULL; + yyval.u.instance = (CPPInstance *)NULL; } -} - break; - - case 74: -#line 906 "cppBison.yxx" - { - (yyval.u.integer) = 0; -} - break; - - case 75: -#line 910 "cppBison.yxx" - { - (yyval.u.integer) = (int)CPPFunctionType::F_const_method; -} - break; - - case 76: -#line 914 "cppBison.yxx" - { - (yyval.u.integer) = (yyvsp[-3].u.integer); -} - break; - - case 77: -#line 918 "cppBison.yxx" - { - (yyval.u.integer) = (yyvsp[-4].u.integer); -} - break; - - case 78: +; + break;} +case 74: +#line 913 "cppBison.yxx" +{ + yyval.u.integer = 0; +; + break;} +case 75: +#line 917 "cppBison.yxx" +{ + yyval.u.integer = (int)CPPFunctionType::F_const_method; +; + break;} +case 76: +#line 921 "cppBison.yxx" +{ + yyval.u.integer = yyvsp[-3].u.integer; +; + break;} +case 77: #line 925 "cppBison.yxx" - { - (yyval.str) = "!"; -} - break; - - case 79: -#line 929 "cppBison.yxx" - { - (yyval.str) = "~"; -} - break; - - case 80: -#line 933 "cppBison.yxx" - { - (yyval.str) = "*"; -} - break; - - case 81: -#line 937 "cppBison.yxx" - { - (yyval.str) = "/"; -} - break; - - case 82: -#line 941 "cppBison.yxx" - { - (yyval.str) = "%"; -} - break; - - case 83: -#line 945 "cppBison.yxx" - { - (yyval.str) = "+"; -} - break; - - case 84: -#line 949 "cppBison.yxx" - { - (yyval.str) = "-"; -} - break; - - case 85: -#line 953 "cppBison.yxx" - { - (yyval.str) = "|"; -} - break; - - case 86: -#line 957 "cppBison.yxx" - { - (yyval.str) = "&"; -} - break; - - case 87: -#line 961 "cppBison.yxx" - { - (yyval.str) = "^"; -} - break; - - case 88: -#line 965 "cppBison.yxx" - { - (yyval.str) = "||"; -} - break; - - case 89: -#line 969 "cppBison.yxx" - { - (yyval.str) = "&&"; -} - break; - - case 90: -#line 973 "cppBison.yxx" - { - (yyval.str) = "=="; -} - break; - - case 91: -#line 977 "cppBison.yxx" - { - (yyval.str) = "!="; -} - break; - - case 92: -#line 981 "cppBison.yxx" - { - (yyval.str) = "<="; -} - break; - - case 93: -#line 985 "cppBison.yxx" - { - (yyval.str) = ">="; -} - break; - - case 94: -#line 989 "cppBison.yxx" - { - (yyval.str) = "<"; -} - break; - - case 95: -#line 993 "cppBison.yxx" - { - (yyval.str) = ">"; -} - break; - - case 96: -#line 997 "cppBison.yxx" - { - (yyval.str) = "<<"; -} - break; - - case 97: -#line 1001 "cppBison.yxx" - { - (yyval.str) = ">>"; -} - break; - - case 98: -#line 1005 "cppBison.yxx" - { - (yyval.str) = "="; -} - break; - - case 99: -#line 1009 "cppBison.yxx" - { - (yyval.str) = ","; -} - break; - - case 100: -#line 1013 "cppBison.yxx" - { - (yyval.str) = "++"; -} - break; - - case 101: -#line 1017 "cppBison.yxx" - { - (yyval.str) = "--"; -} - break; - - case 102: -#line 1021 "cppBison.yxx" - { - (yyval.str) = "*="; -} - break; - - case 103: -#line 1025 "cppBison.yxx" - { - (yyval.str) = "/="; -} - break; - - case 104: -#line 1029 "cppBison.yxx" - { - (yyval.str) = "%="; -} - break; - - case 105: -#line 1033 "cppBison.yxx" - { - (yyval.str) = "+="; -} - break; - - case 106: -#line 1037 "cppBison.yxx" - { - (yyval.str) = "-="; -} - break; - - case 107: -#line 1041 "cppBison.yxx" - { - (yyval.str) = "|="; -} - break; - - case 108: -#line 1045 "cppBison.yxx" - { - (yyval.str) = "&="; -} - break; - - case 109: -#line 1049 "cppBison.yxx" - { - (yyval.str) = "^="; -} - break; - - case 110: -#line 1053 "cppBison.yxx" - { - (yyval.str) = "<<="; -} - break; - - case 111: -#line 1057 "cppBison.yxx" - { - (yyval.str) = ">>="; -} - break; - - case 112: -#line 1061 "cppBison.yxx" - { - (yyval.str) = "->"; -} - break; - - case 113: -#line 1065 "cppBison.yxx" - { - (yyval.str) = "[]"; -} - break; - - case 114: -#line 1069 "cppBison.yxx" - { - (yyval.str) = "()"; -} - break; - - case 115: -#line 1073 "cppBison.yxx" - { - (yyval.str) = "new"; -} - break; - - case 116: -#line 1077 "cppBison.yxx" - { - (yyval.str) = "delete"; -} - break; - - case 119: -#line 1089 "cppBison.yxx" - { +{ + yyval.u.integer = yyvsp[-4].u.integer; +; + break;} +case 78: +#line 932 "cppBison.yxx" +{ + yyval.str = "!"; +; + break;} +case 79: +#line 936 "cppBison.yxx" +{ + yyval.str = "~"; +; + break;} +case 80: +#line 940 "cppBison.yxx" +{ + yyval.str = "*"; +; + break;} +case 81: +#line 944 "cppBison.yxx" +{ + yyval.str = "/"; +; + break;} +case 82: +#line 948 "cppBison.yxx" +{ + yyval.str = "%"; +; + break;} +case 83: +#line 952 "cppBison.yxx" +{ + yyval.str = "+"; +; + break;} +case 84: +#line 956 "cppBison.yxx" +{ + yyval.str = "-"; +; + break;} +case 85: +#line 960 "cppBison.yxx" +{ + yyval.str = "|"; +; + break;} +case 86: +#line 964 "cppBison.yxx" +{ + yyval.str = "&"; +; + break;} +case 87: +#line 968 "cppBison.yxx" +{ + yyval.str = "^"; +; + break;} +case 88: +#line 972 "cppBison.yxx" +{ + yyval.str = "||"; +; + break;} +case 89: +#line 976 "cppBison.yxx" +{ + yyval.str = "&&"; +; + break;} +case 90: +#line 980 "cppBison.yxx" +{ + yyval.str = "=="; +; + break;} +case 91: +#line 984 "cppBison.yxx" +{ + yyval.str = "!="; +; + break;} +case 92: +#line 988 "cppBison.yxx" +{ + yyval.str = "<="; +; + break;} +case 93: +#line 992 "cppBison.yxx" +{ + yyval.str = ">="; +; + break;} +case 94: +#line 996 "cppBison.yxx" +{ + yyval.str = "<"; +; + break;} +case 95: +#line 1000 "cppBison.yxx" +{ + yyval.str = ">"; +; + break;} +case 96: +#line 1004 "cppBison.yxx" +{ + yyval.str = "<<"; +; + break;} +case 97: +#line 1008 "cppBison.yxx" +{ + yyval.str = ">>"; +; + break;} +case 98: +#line 1012 "cppBison.yxx" +{ + yyval.str = "="; +; + break;} +case 99: +#line 1016 "cppBison.yxx" +{ + yyval.str = ","; +; + break;} +case 100: +#line 1020 "cppBison.yxx" +{ + yyval.str = "++"; +; + break;} +case 101: +#line 1024 "cppBison.yxx" +{ + yyval.str = "--"; +; + break;} +case 102: +#line 1028 "cppBison.yxx" +{ + yyval.str = "*="; +; + break;} +case 103: +#line 1032 "cppBison.yxx" +{ + yyval.str = "/="; +; + break;} +case 104: +#line 1036 "cppBison.yxx" +{ + yyval.str = "%="; +; + break;} +case 105: +#line 1040 "cppBison.yxx" +{ + yyval.str = "+="; +; + break;} +case 106: +#line 1044 "cppBison.yxx" +{ + yyval.str = "-="; +; + break;} +case 107: +#line 1048 "cppBison.yxx" +{ + yyval.str = "|="; +; + break;} +case 108: +#line 1052 "cppBison.yxx" +{ + yyval.str = "&="; +; + break;} +case 109: +#line 1056 "cppBison.yxx" +{ + yyval.str = "^="; +; + break;} +case 110: +#line 1060 "cppBison.yxx" +{ + yyval.str = "<<="; +; + break;} +case 111: +#line 1064 "cppBison.yxx" +{ + yyval.str = ">>="; +; + break;} +case 112: +#line 1068 "cppBison.yxx" +{ + yyval.str = "->"; +; + break;} +case 113: +#line 1072 "cppBison.yxx" +{ + yyval.str = "[]"; +; + break;} +case 114: +#line 1076 "cppBison.yxx" +{ + yyval.str = "()"; +; + break;} +case 115: +#line 1080 "cppBison.yxx" +{ + yyval.str = "new"; +; + break;} +case 116: +#line 1084 "cppBison.yxx" +{ + yyval.str = "delete"; +; + break;} +case 119: +#line 1096 "cppBison.yxx" +{ push_scope(new CPPTemplateScope(current_scope)); -} - break; - - case 120: -#line 1093 "cppBison.yxx" - { +; + break;} +case 120: +#line 1100 "cppBison.yxx" +{ pop_scope(); -} - break; - - case 123: -#line 1105 "cppBison.yxx" - { +; + break;} +case 123: +#line 1112 "cppBison.yxx" +{ CPPTemplateScope *ts = current_scope->as_template_scope(); assert(ts != NULL); - ts->add_template_parameter((yyvsp[0].u.decl)); -} - break; - - case 124: -#line 1111 "cppBison.yxx" - { + ts->add_template_parameter(yyvsp[0].u.decl); +; + break;} +case 124: +#line 1118 "cppBison.yxx" +{ CPPTemplateScope *ts = current_scope->as_template_scope(); assert(ts != NULL); - ts->add_template_parameter((yyvsp[0].u.decl)); -} - break; - - case 125: -#line 1120 "cppBison.yxx" - { - (yyval.u.decl) = CPPType::new_type(new CPPClassTemplateParameter((yyvsp[0].u.identifier))); -} - break; - - case 126: -#line 1124 "cppBison.yxx" - { - (yyval.u.decl) = CPPType::new_type(new CPPClassTemplateParameter((yyvsp[-2].u.identifier), (yyvsp[0].u.type))); -} - break; - - case 127: -#line 1128 "cppBison.yxx" - { - CPPInstance *inst = new CPPInstance((yyvsp[-2].u.type), (yyvsp[-1].u.inst_ident), 0, (yylsp[-1]).file); - inst->set_initializer((yyvsp[0].u.expr)); - (yyval.u.decl) = inst; -} - break; - - case 128: -#line 1134 "cppBison.yxx" - { - (yyvsp[-1].u.inst_ident)->add_modifier(IIT_const); - CPPInstance *inst = new CPPInstance((yyvsp[-2].u.type), (yyvsp[-1].u.inst_ident), 0, (yylsp[-1]).file); - inst->set_initializer((yyvsp[0].u.expr)); - (yyval.u.decl) = inst; -} - break; - - case 129: -#line 1144 "cppBison.yxx" - { - (yyval.u.type) = CPPType::new_type((yyvsp[0].u.simple_type)); -} - break; - - case 130: -#line 1148 "cppBison.yxx" - { - yywarning("Not a type: " + (yyvsp[0].u.identifier)->get_fully_scoped_name(), (yylsp[0])); - (yyval.u.type) = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_unknown)); -} - break; - - case 131: -#line 1153 "cppBison.yxx" - { - (yyval.u.type) = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); - assert((yyval.u.type) != NULL); -} - break; - - case 132: -#line 1158 "cppBison.yxx" - { - (yyval.u.type) = CPPType::new_type(new CPPTBDType((yyvsp[0].u.identifier))); -} - break; - - case 133: -#line 1166 "cppBison.yxx" - { - (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[0].u.identifier)); -} - break; - - case 134: -#line 1170 "cppBison.yxx" - { + ts->add_template_parameter(yyvsp[0].u.decl); +; + break;} +case 125: +#line 1127 "cppBison.yxx" +{ + yyval.u.decl = CPPType::new_type(new CPPClassTemplateParameter(yyvsp[0].u.identifier)); +; + break;} +case 126: +#line 1131 "cppBison.yxx" +{ + yyval.u.decl = CPPType::new_type(new CPPClassTemplateParameter(yyvsp[-2].u.identifier, yyvsp[0].u.type)); +; + break;} +case 127: +#line 1135 "cppBison.yxx" +{ + CPPInstance *inst = new CPPInstance(yyvsp[-2].u.type, yyvsp[-1].u.inst_ident, 0, yylsp[-1].file); + inst->set_initializer(yyvsp[0].u.expr); + yyval.u.decl = inst; +; + break;} +case 128: +#line 1141 "cppBison.yxx" +{ + yyvsp[-1].u.inst_ident->add_modifier(IIT_const); + CPPInstance *inst = new CPPInstance(yyvsp[-2].u.type, yyvsp[-1].u.inst_ident, 0, yylsp[-1].file); + inst->set_initializer(yyvsp[0].u.expr); + yyval.u.decl = inst; +; + break;} +case 129: +#line 1151 "cppBison.yxx" +{ + yyval.u.type = CPPType::new_type(yyvsp[0].u.simple_type); +; + break;} +case 130: +#line 1155 "cppBison.yxx" +{ + yywarning("Not a type: " + yyvsp[0].u.identifier->get_fully_scoped_name(), yylsp[0]); + yyval.u.type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_unknown)); +; + break;} +case 131: +#line 1160 "cppBison.yxx" +{ + yyval.u.type = yyvsp[0].u.identifier->find_type(current_scope, global_scope, false, current_lexer); + assert(yyval.u.type != NULL); +; + break;} +case 132: +#line 1165 "cppBison.yxx" +{ + yyval.u.type = CPPType::new_type(new CPPTBDType(yyvsp[0].u.identifier)); +; + break;} +case 133: +#line 1173 "cppBison.yxx" +{ + yyval.u.inst_ident = new CPPInstanceIdentifier(yyvsp[0].u.identifier); +; + break;} +case 134: +#line 1177 "cppBison.yxx" +{ // For an operator function. We implement this simply by building a // ficticious name for the function; in other respects it's just // like a regular function. - CPPIdentifier *ident = (yyvsp[-1].u.identifier); + CPPIdentifier *ident = yyvsp[-1].u.identifier; if (ident == NULL) { - ident = new CPPIdentifier("operator "+(yyvsp[0].str), (yylsp[0]).file); + ident = new CPPIdentifier("operator "+yyvsp[0].str, yylsp[0].file); } else { - ident->_names.push_back("operator "+(yyvsp[0].str)); + ident->_names.push_back("operator "+yyvsp[0].str); } - (yyval.u.inst_ident) = new CPPInstanceIdentifier(ident); -} - break; - - case 135: -#line 1184 "cppBison.yxx" - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_const); -} - break; - - case 136: -#line 1189 "cppBison.yxx" - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_pointer); -} - break; - - case 137: -#line 1194 "cppBison.yxx" - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_reference); -} - break; - - case 138: -#line 1199 "cppBison.yxx" - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_scoped_pointer_modifier((yyvsp[-2].u.identifier)); -} - break; - - case 139: -#line 1204 "cppBison.yxx" - { - (yyval.u.inst_ident) = (yyvsp[-3].u.inst_ident); - (yyval.u.inst_ident)->add_array_modifier((yyvsp[-1].u.expr)); -} - break; - - case 140: -#line 1209 "cppBison.yxx" - { + yyval.u.inst_ident = new CPPInstanceIdentifier(ident); +; + break;} +case 135: +#line 1191 "cppBison.yxx" +{ + yyval.u.inst_ident = yyvsp[0].u.inst_ident; + yyval.u.inst_ident->add_modifier(IIT_const); +; + break;} +case 136: +#line 1196 "cppBison.yxx" +{ + yyval.u.inst_ident = yyvsp[0].u.inst_ident; + yyval.u.inst_ident->add_modifier(IIT_pointer); +; + break;} +case 137: +#line 1201 "cppBison.yxx" +{ + yyval.u.inst_ident = yyvsp[0].u.inst_ident; + yyval.u.inst_ident->add_modifier(IIT_reference); +; + break;} +case 138: +#line 1206 "cppBison.yxx" +{ + yyval.u.inst_ident = yyvsp[0].u.inst_ident; + yyval.u.inst_ident->add_scoped_pointer_modifier(yyvsp[-2].u.identifier); +; + break;} +case 139: +#line 1211 "cppBison.yxx" +{ + yyval.u.inst_ident = yyvsp[-3].u.inst_ident; + yyval.u.inst_ident->add_array_modifier(yyvsp[-1].u.expr); +; + break;} +case 140: +#line 1216 "cppBison.yxx" +{ // bitfield definition. We ignore the bitfield for now. - (yyval.u.inst_ident) = (yyvsp[-2].u.inst_ident); -} - break; - - case 141: -#line 1214 "cppBison.yxx" - { - (yyval.u.inst_ident) = (yyvsp[-1].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_paren); -} - break; - - case 142: -#line 1219 "cppBison.yxx" - { - push_scope((yyvsp[-1].u.inst_ident)->get_scope(current_scope, global_scope)); -} - break; - - case 143: -#line 1223 "cppBison.yxx" - { + yyval.u.inst_ident = yyvsp[-2].u.inst_ident; +; + break;} +case 141: +#line 1221 "cppBison.yxx" +{ + yyval.u.inst_ident = yyvsp[-1].u.inst_ident; + yyval.u.inst_ident->add_modifier(IIT_paren); +; + break;} +case 142: +#line 1226 "cppBison.yxx" +{ + push_scope(yyvsp[-1].u.inst_ident->get_scope(current_scope, global_scope)); +; + break;} +case 143: +#line 1230 "cppBison.yxx" +{ pop_scope(); - (yyval.u.inst_ident) = (yyvsp[-5].u.inst_ident); - if ((yyvsp[-2].u.param_list)->is_parameter_expr() && (yyvsp[0].u.integer) == 0) { + yyval.u.inst_ident = yyvsp[-5].u.inst_ident; + if (yyvsp[-2].u.param_list->is_parameter_expr() && yyvsp[0].u.integer == 0) { // Oops, this must have been an instance declaration with a // parameter list, not a function prototype. - (yyval.u.inst_ident)->add_initializer_modifier((yyvsp[-2].u.param_list)); + yyval.u.inst_ident->add_initializer_modifier(yyvsp[-2].u.param_list); } else { // This was (probably) a function prototype. - (yyval.u.inst_ident)->add_func_modifier((yyvsp[-2].u.param_list), (yyvsp[0].u.integer)); + yyval.u.inst_ident->add_func_modifier(yyvsp[-2].u.param_list, yyvsp[0].u.integer); } -} - break; - - case 144: -#line 1241 "cppBison.yxx" - { - (yyval.u.param_list) = new CPPParameterList; -} - break; - - case 145: -#line 1245 "cppBison.yxx" - { - (yyval.u.param_list) = new CPPParameterList; - (yyval.u.param_list)->_includes_ellipsis = true; -} - break; - - case 146: -#line 1250 "cppBison.yxx" - { - (yyval.u.param_list) = (yyvsp[0].u.param_list); -} - break; - - case 147: -#line 1254 "cppBison.yxx" - { - (yyval.u.param_list) = (yyvsp[-2].u.param_list); - (yyval.u.param_list)->_includes_ellipsis = true; -} - break; - - case 148: -#line 1259 "cppBison.yxx" - { - (yyval.u.param_list) = (yyvsp[-1].u.param_list); - (yyval.u.param_list)->_includes_ellipsis = true; -} - break; - - case 149: -#line 1267 "cppBison.yxx" - { - (yyval.u.param_list) = new CPPParameterList; - (yyval.u.param_list)->_parameters.push_back((yyvsp[0].u.instance)); -} - break; - - case 150: -#line 1272 "cppBison.yxx" - { - (yyval.u.param_list) = (yyvsp[-2].u.param_list); - (yyval.u.param_list)->_parameters.push_back((yyvsp[0].u.instance)); -} - break; - - case 151: -#line 1280 "cppBison.yxx" - { - (yyval.u.expr) = (CPPExpression *)NULL; -} - break; - - case 152: -#line 1284 "cppBison.yxx" - { - (yyval.u.expr) = (yyvsp[0].u.expr); -} - break; - - case 153: +; + break;} +case 144: +#line 1248 "cppBison.yxx" +{ + yyval.u.param_list = new CPPParameterList; +; + break;} +case 145: +#line 1252 "cppBison.yxx" +{ + yyval.u.param_list = new CPPParameterList; + yyval.u.param_list->_includes_ellipsis = true; +; + break;} +case 146: +#line 1257 "cppBison.yxx" +{ + yyval.u.param_list = yyvsp[0].u.param_list; +; + break;} +case 147: +#line 1261 "cppBison.yxx" +{ + yyval.u.param_list = yyvsp[-2].u.param_list; + yyval.u.param_list->_includes_ellipsis = true; +; + break;} +case 148: +#line 1266 "cppBison.yxx" +{ + yyval.u.param_list = yyvsp[-1].u.param_list; + yyval.u.param_list->_includes_ellipsis = true; +; + break;} +case 149: +#line 1274 "cppBison.yxx" +{ + yyval.u.param_list = new CPPParameterList; + yyval.u.param_list->_parameters.push_back(yyvsp[0].u.instance); +; + break;} +case 150: +#line 1279 "cppBison.yxx" +{ + yyval.u.param_list = yyvsp[-2].u.param_list; + yyval.u.param_list->_parameters.push_back(yyvsp[0].u.instance); +; + break;} +case 151: +#line 1287 "cppBison.yxx" +{ + yyval.u.expr = (CPPExpression *)NULL; +; + break;} +case 152: #line 1291 "cppBison.yxx" - { - (yyval.u.expr) = (CPPExpression *)NULL; -} - break; - - case 154: -#line 1295 "cppBison.yxx" - { - (yyval.u.expr) = (yyvsp[0].u.expr); -} - break; - - case 155: +{ + yyval.u.expr = yyvsp[0].u.expr; +; + break;} +case 153: +#line 1298 "cppBison.yxx" +{ + yyval.u.expr = (CPPExpression *)NULL; +; + break;} +case 154: #line 1302 "cppBison.yxx" - { - (yyval.u.expr) = (CPPExpression *)NULL; -} - break; - - case 156: -#line 1306 "cppBison.yxx" - { - (yyval.u.expr) = (CPPExpression *)NULL; -} - break; - - case 157: -#line 1310 "cppBison.yxx" - { - (yyval.u.expr) = (CPPExpression *)NULL; -} - break; - - case 158: -#line 1314 "cppBison.yxx" - { - (yyval.u.expr) = (yyvsp[-1].u.expr); -} - break; - - case 159: -#line 1318 "cppBison.yxx" - { - (yyval.u.expr) = (CPPExpression *)NULL; -} - break; - - case 163: -#line 1331 "cppBison.yxx" - { -} - break; - - case 167: -#line 1340 "cppBison.yxx" - { - (yyval.u.instance) = new CPPInstance((yyvsp[-2].u.type), (yyvsp[-1].u.inst_ident), 0, (yylsp[-1]).file); - (yyval.u.instance)->set_initializer((yyvsp[0].u.expr)); -} - break; - - case 168: -#line 1345 "cppBison.yxx" - { - yywarning("Not a type: " + (yyvsp[-2].u.identifier)->get_fully_scoped_name(), (yylsp[-2])); +{ + yyval.u.expr = yyvsp[0].u.expr; +; + break;} +case 155: +#line 1309 "cppBison.yxx" +{ + yyval.u.expr = (CPPExpression *)NULL; +; + break;} +case 156: +#line 1313 "cppBison.yxx" +{ + yyval.u.expr = (CPPExpression *)NULL; +; + break;} +case 157: +#line 1317 "cppBison.yxx" +{ + yyval.u.expr = (CPPExpression *)NULL; +; + break;} +case 158: +#line 1321 "cppBison.yxx" +{ + yyval.u.expr = yyvsp[-1].u.expr; +; + break;} +case 159: +#line 1325 "cppBison.yxx" +{ + yyval.u.expr = (CPPExpression *)NULL; +; + break;} +case 163: +#line 1338 "cppBison.yxx" +{ +; + break;} +case 167: +#line 1347 "cppBison.yxx" +{ + yyval.u.instance = new CPPInstance(yyvsp[-2].u.type, yyvsp[-1].u.inst_ident, 0, yylsp[-1].file); + yyval.u.instance->set_initializer(yyvsp[0].u.expr); +; + break;} +case 168: +#line 1352 "cppBison.yxx" +{ + yywarning("Not a type: " + yyvsp[-2].u.identifier->get_fully_scoped_name(), yylsp[-2]); CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_unknown)); - (yyval.u.instance) = new CPPInstance(type, (yyvsp[-1].u.inst_ident), 0, (yylsp[-1]).file); - (yyval.u.instance)->set_initializer((yyvsp[0].u.expr)); -} - break; - - case 169: -#line 1353 "cppBison.yxx" - { - (yyvsp[-1].u.inst_ident)->add_modifier(IIT_const); - (yyval.u.instance) = new CPPInstance((yyvsp[-2].u.type), (yyvsp[-1].u.inst_ident), 0, (yylsp[-1]).file); - (yyval.u.instance)->set_initializer((yyvsp[0].u.expr)); -} - break; - - case 170: -#line 1359 "cppBison.yxx" - { + yyval.u.instance = new CPPInstance(type, yyvsp[-1].u.inst_ident, 0, yylsp[-1].file); + yyval.u.instance->set_initializer(yyvsp[0].u.expr); +; + break;} +case 169: +#line 1360 "cppBison.yxx" +{ + yyvsp[-1].u.inst_ident->add_modifier(IIT_const); + yyval.u.instance = new CPPInstance(yyvsp[-2].u.type, yyvsp[-1].u.inst_ident, 0, yylsp[-1].file); + yyval.u.instance->set_initializer(yyvsp[0].u.expr); +; + break;} +case 170: +#line 1366 "cppBison.yxx" +{ CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_parameter)); - (yyval.u.instance) = new CPPInstance(type, "expr"); - (yyval.u.instance)->set_initializer((yyvsp[0].u.expr)); -} - break; - - case 171: -#line 1369 "cppBison.yxx" - { - (yyval.u.inst_ident) = new CPPInstanceIdentifier((CPPIdentifier *)NULL); -} - break; - - case 172: -#line 1373 "cppBison.yxx" - { - (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[0].u.identifier)); -} - break; - - case 173: -#line 1377 "cppBison.yxx" - { - (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[0].u.identifier)); -} - break; - - case 174: -#line 1381 "cppBison.yxx" - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_const); -} - break; - - case 175: -#line 1386 "cppBison.yxx" - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_pointer); -} - break; - - case 176: -#line 1391 "cppBison.yxx" - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_reference); -} - break; - - case 177: -#line 1396 "cppBison.yxx" - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_scoped_pointer_modifier((yyvsp[-2].u.identifier)); -} - break; - - case 178: -#line 1401 "cppBison.yxx" - { - (yyval.u.inst_ident) = (yyvsp[-3].u.inst_ident); - (yyval.u.inst_ident)->add_array_modifier((yyvsp[-1].u.expr)); -} - break; - - case 179: -#line 1409 "cppBison.yxx" - { - (yyval.u.inst_ident) = new CPPInstanceIdentifier((CPPIdentifier *)NULL); -} - break; - - case 180: -#line 1413 "cppBison.yxx" - { - (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[0].u.identifier)); -} - break; - - case 181: -#line 1417 "cppBison.yxx" - { - (yyval.u.inst_ident) = new CPPInstanceIdentifier((yyvsp[0].u.identifier)); -} - break; - - case 182: -#line 1421 "cppBison.yxx" - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_const); -} - break; - - case 183: -#line 1426 "cppBison.yxx" - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_pointer); -} - break; - - case 184: -#line 1431 "cppBison.yxx" - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_reference); -} - break; - - case 185: -#line 1436 "cppBison.yxx" - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_scoped_pointer_modifier((yyvsp[-2].u.identifier)); -} - break; - - case 186: -#line 1441 "cppBison.yxx" - { - (yyval.u.inst_ident) = (yyvsp[-3].u.inst_ident); - (yyval.u.inst_ident)->add_array_modifier((yyvsp[-1].u.expr)); -} - break; - - case 187: -#line 1446 "cppBison.yxx" - { - (yyval.u.inst_ident) = (yyvsp[-5].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_paren); - (yyval.u.inst_ident)->add_func_modifier((yyvsp[-2].u.param_list), (yyvsp[0].u.integer)); -} - break; - - case 188: -#line 1452 "cppBison.yxx" - { - (yyval.u.inst_ident) = (yyvsp[-1].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_paren); -} - break; - - case 189: -#line 1460 "cppBison.yxx" - { - (yyval.u.inst_ident) = new CPPInstanceIdentifier((CPPIdentifier *)NULL); -} - break; - - case 190: -#line 1464 "cppBison.yxx" - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_const); -} - break; - - case 191: -#line 1469 "cppBison.yxx" - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_pointer); -} - break; - - case 192: -#line 1474 "cppBison.yxx" - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_reference); -} - break; - - case 193: -#line 1479 "cppBison.yxx" - { - (yyval.u.inst_ident) = (yyvsp[0].u.inst_ident); - (yyval.u.inst_ident)->add_scoped_pointer_modifier((yyvsp[-2].u.identifier)); -} - break; - - case 194: -#line 1484 "cppBison.yxx" - { - (yyval.u.inst_ident) = (yyvsp[-3].u.inst_ident); - (yyval.u.inst_ident)->add_array_modifier((yyvsp[-1].u.expr)); -} - break; - - case 195: -#line 1489 "cppBison.yxx" - { - (yyval.u.inst_ident) = (yyvsp[-5].u.inst_ident); - (yyval.u.inst_ident)->add_modifier(IIT_paren); - (yyval.u.inst_ident)->add_func_modifier((yyvsp[-2].u.param_list), (yyvsp[0].u.integer)); -} - break; - - case 196: -#line 1498 "cppBison.yxx" - { - (yyval.u.type) = CPPType::new_type((yyvsp[0].u.simple_type)); -} - break; - - case 197: -#line 1502 "cppBison.yxx" - { - (yyval.u.type) = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); - assert((yyval.u.type) != NULL); -} - break; - - case 198: -#line 1507 "cppBison.yxx" - { - (yyval.u.type) = CPPType::new_type(new CPPTBDType((yyvsp[0].u.identifier))); -} - break; - - case 199: -#line 1511 "cppBison.yxx" - { - (yyval.u.type) = CPPType::new_type((yyvsp[0].u.struct_type)); -} - break; - - case 200: -#line 1515 "cppBison.yxx" - { - (yyval.u.type) = CPPType::new_type((yyvsp[0].u.struct_type)); -} - break; - - case 201: -#line 1519 "cppBison.yxx" - { - (yyval.u.type) = CPPType::new_type((yyvsp[0].u.enum_type)); -} - break; - - case 202: -#line 1523 "cppBison.yxx" - { - (yyval.u.type) = CPPType::new_type((yyvsp[0].u.enum_type)); -} - break; - - case 203: -#line 1527 "cppBison.yxx" - { - CPPType *type = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); + yyval.u.instance = new CPPInstance(type, "expr"); + yyval.u.instance->set_initializer(yyvsp[0].u.expr); +; + break;} +case 171: +#line 1376 "cppBison.yxx" +{ + yyval.u.inst_ident = new CPPInstanceIdentifier((CPPIdentifier *)NULL); +; + break;} +case 172: +#line 1380 "cppBison.yxx" +{ + yyval.u.inst_ident = new CPPInstanceIdentifier(yyvsp[0].u.identifier); +; + break;} +case 173: +#line 1384 "cppBison.yxx" +{ + yyval.u.inst_ident = new CPPInstanceIdentifier(yyvsp[0].u.identifier); +; + break;} +case 174: +#line 1388 "cppBison.yxx" +{ + yyval.u.inst_ident = yyvsp[0].u.inst_ident; + yyval.u.inst_ident->add_modifier(IIT_const); +; + break;} +case 175: +#line 1393 "cppBison.yxx" +{ + yyval.u.inst_ident = yyvsp[0].u.inst_ident; + yyval.u.inst_ident->add_modifier(IIT_pointer); +; + break;} +case 176: +#line 1398 "cppBison.yxx" +{ + yyval.u.inst_ident = yyvsp[0].u.inst_ident; + yyval.u.inst_ident->add_modifier(IIT_reference); +; + break;} +case 177: +#line 1403 "cppBison.yxx" +{ + yyval.u.inst_ident = yyvsp[0].u.inst_ident; + yyval.u.inst_ident->add_scoped_pointer_modifier(yyvsp[-2].u.identifier); +; + break;} +case 178: +#line 1408 "cppBison.yxx" +{ + yyval.u.inst_ident = yyvsp[-3].u.inst_ident; + yyval.u.inst_ident->add_array_modifier(yyvsp[-1].u.expr); +; + break;} +case 179: +#line 1416 "cppBison.yxx" +{ + yyval.u.inst_ident = new CPPInstanceIdentifier((CPPIdentifier *)NULL); +; + break;} +case 180: +#line 1420 "cppBison.yxx" +{ + yyval.u.inst_ident = new CPPInstanceIdentifier(yyvsp[0].u.identifier); +; + break;} +case 181: +#line 1424 "cppBison.yxx" +{ + yyval.u.inst_ident = new CPPInstanceIdentifier(yyvsp[0].u.identifier); +; + break;} +case 182: +#line 1428 "cppBison.yxx" +{ + yyval.u.inst_ident = yyvsp[0].u.inst_ident; + yyval.u.inst_ident->add_modifier(IIT_const); +; + break;} +case 183: +#line 1433 "cppBison.yxx" +{ + yyval.u.inst_ident = yyvsp[0].u.inst_ident; + yyval.u.inst_ident->add_modifier(IIT_pointer); +; + break;} +case 184: +#line 1438 "cppBison.yxx" +{ + yyval.u.inst_ident = yyvsp[0].u.inst_ident; + yyval.u.inst_ident->add_modifier(IIT_reference); +; + break;} +case 185: +#line 1443 "cppBison.yxx" +{ + yyval.u.inst_ident = yyvsp[0].u.inst_ident; + yyval.u.inst_ident->add_scoped_pointer_modifier(yyvsp[-2].u.identifier); +; + break;} +case 186: +#line 1448 "cppBison.yxx" +{ + yyval.u.inst_ident = yyvsp[-3].u.inst_ident; + yyval.u.inst_ident->add_array_modifier(yyvsp[-1].u.expr); +; + break;} +case 187: +#line 1453 "cppBison.yxx" +{ + yyval.u.inst_ident = yyvsp[-5].u.inst_ident; + yyval.u.inst_ident->add_modifier(IIT_paren); + yyval.u.inst_ident->add_func_modifier(yyvsp[-2].u.param_list, yyvsp[0].u.integer); +; + break;} +case 188: +#line 1459 "cppBison.yxx" +{ + yyval.u.inst_ident = yyvsp[-1].u.inst_ident; + yyval.u.inst_ident->add_modifier(IIT_paren); +; + break;} +case 189: +#line 1467 "cppBison.yxx" +{ + yyval.u.inst_ident = new CPPInstanceIdentifier((CPPIdentifier *)NULL); +; + break;} +case 190: +#line 1471 "cppBison.yxx" +{ + yyval.u.inst_ident = yyvsp[0].u.inst_ident; + yyval.u.inst_ident->add_modifier(IIT_const); +; + break;} +case 191: +#line 1476 "cppBison.yxx" +{ + yyval.u.inst_ident = yyvsp[0].u.inst_ident; + yyval.u.inst_ident->add_modifier(IIT_pointer); +; + break;} +case 192: +#line 1481 "cppBison.yxx" +{ + yyval.u.inst_ident = yyvsp[0].u.inst_ident; + yyval.u.inst_ident->add_modifier(IIT_reference); +; + break;} +case 193: +#line 1486 "cppBison.yxx" +{ + yyval.u.inst_ident = yyvsp[0].u.inst_ident; + yyval.u.inst_ident->add_scoped_pointer_modifier(yyvsp[-2].u.identifier); +; + break;} +case 194: +#line 1491 "cppBison.yxx" +{ + yyval.u.inst_ident = yyvsp[-3].u.inst_ident; + yyval.u.inst_ident->add_array_modifier(yyvsp[-1].u.expr); +; + break;} +case 195: +#line 1496 "cppBison.yxx" +{ + yyval.u.inst_ident = yyvsp[-5].u.inst_ident; + yyval.u.inst_ident->add_modifier(IIT_paren); + yyval.u.inst_ident->add_func_modifier(yyvsp[-2].u.param_list, yyvsp[0].u.integer); +; + break;} +case 196: +#line 1505 "cppBison.yxx" +{ + yyval.u.type = CPPType::new_type(yyvsp[0].u.simple_type); +; + break;} +case 197: +#line 1509 "cppBison.yxx" +{ + yyval.u.type = yyvsp[0].u.identifier->find_type(current_scope, global_scope, false, current_lexer); + assert(yyval.u.type != NULL); +; + break;} +case 198: +#line 1514 "cppBison.yxx" +{ + yyval.u.type = CPPType::new_type(new CPPTBDType(yyvsp[0].u.identifier)); +; + break;} +case 199: +#line 1518 "cppBison.yxx" +{ + yyval.u.type = CPPType::new_type(yyvsp[0].u.struct_type); +; + break;} +case 200: +#line 1522 "cppBison.yxx" +{ + yyval.u.type = CPPType::new_type(yyvsp[0].u.struct_type); +; + break;} +case 201: +#line 1526 "cppBison.yxx" +{ + yyval.u.type = CPPType::new_type(yyvsp[0].u.enum_type); +; + break;} +case 202: +#line 1530 "cppBison.yxx" +{ + yyval.u.type = CPPType::new_type(yyvsp[0].u.enum_type); +; + break;} +case 203: +#line 1534 "cppBison.yxx" +{ + CPPType *type = yyvsp[0].u.identifier->find_type(current_scope, global_scope, false, current_lexer); if (type != NULL) { - (yyval.u.type) = type; + yyval.u.type = type; } else { CPPExtensionType *et = - CPPType::new_type(new CPPExtensionType((yyvsp[-1].u.extension_enum), (yyvsp[0].u.identifier), current_scope, (yylsp[-1]).file)) + CPPType::new_type(new CPPExtensionType(yyvsp[-1].u.extension_enum, yyvsp[0].u.identifier, current_scope, yylsp[-1].file)) ->as_extension_type(); - CPPScope *scope = (yyvsp[0].u.identifier)->get_scope(current_scope, global_scope); + CPPScope *scope = yyvsp[0].u.identifier->get_scope(current_scope, global_scope); if (scope != NULL) { scope->define_extension_type(et); } - (yyval.u.type) = et; + yyval.u.type = et; } -} - break; - - case 204: -#line 1543 "cppBison.yxx" - { - CPPType *type = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); +; + break;} +case 204: +#line 1550 "cppBison.yxx" +{ + CPPType *type = yyvsp[0].u.identifier->find_type(current_scope, global_scope, false, current_lexer); if (type != NULL) { - (yyval.u.type) = type; + yyval.u.type = type; } else { CPPExtensionType *et = - CPPType::new_type(new CPPExtensionType((yyvsp[-1].u.extension_enum), (yyvsp[0].u.identifier), current_scope, (yylsp[-1]).file)) + CPPType::new_type(new CPPExtensionType(yyvsp[-1].u.extension_enum, yyvsp[0].u.identifier, current_scope, yylsp[-1].file)) ->as_extension_type(); - CPPScope *scope = (yyvsp[0].u.identifier)->get_scope(current_scope, global_scope); + CPPScope *scope = yyvsp[0].u.identifier->get_scope(current_scope, global_scope); if (scope != NULL) { scope->define_extension_type(et); } - (yyval.u.type) = et; + yyval.u.type = et; } -} - break; - - case 205: -#line 1562 "cppBison.yxx" - { - (yyval.u.decl) = CPPType::new_type((yyvsp[0].u.simple_type)); -} - break; - - case 206: -#line 1566 "cppBison.yxx" - { - (yyval.u.decl) = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); - assert((yyval.u.decl) != NULL); -} - break; - - case 207: -#line 1571 "cppBison.yxx" - { - (yyval.u.decl) = CPPType::new_type(new CPPTBDType((yyvsp[0].u.identifier))); -} - break; - - case 208: -#line 1575 "cppBison.yxx" - { - (yyval.u.decl) = CPPType::new_type((yyvsp[0].u.struct_type)); -} - break; - - case 209: -#line 1579 "cppBison.yxx" - { - (yyval.u.decl) = new CPPTypeDeclaration(CPPType::new_type((yyvsp[0].u.struct_type))); -} - break; - - case 210: -#line 1583 "cppBison.yxx" - { - (yyval.u.decl) = CPPType::new_type((yyvsp[0].u.enum_type)); -} - break; - - case 211: -#line 1587 "cppBison.yxx" - { - (yyval.u.decl) = new CPPTypeDeclaration(CPPType::new_type((yyvsp[0].u.enum_type))); -} - break; - - case 212: -#line 1591 "cppBison.yxx" - { - CPPType *type = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); +; + break;} +case 205: +#line 1569 "cppBison.yxx" +{ + yyval.u.decl = CPPType::new_type(yyvsp[0].u.simple_type); +; + break;} +case 206: +#line 1573 "cppBison.yxx" +{ + yyval.u.decl = yyvsp[0].u.identifier->find_type(current_scope, global_scope, false, current_lexer); + assert(yyval.u.decl != NULL); +; + break;} +case 207: +#line 1578 "cppBison.yxx" +{ + yyval.u.decl = CPPType::new_type(new CPPTBDType(yyvsp[0].u.identifier)); +; + break;} +case 208: +#line 1582 "cppBison.yxx" +{ + yyval.u.decl = CPPType::new_type(yyvsp[0].u.struct_type); +; + break;} +case 209: +#line 1586 "cppBison.yxx" +{ + yyval.u.decl = new CPPTypeDeclaration(CPPType::new_type(yyvsp[0].u.struct_type)); +; + break;} +case 210: +#line 1590 "cppBison.yxx" +{ + yyval.u.decl = CPPType::new_type(yyvsp[0].u.enum_type); +; + break;} +case 211: +#line 1594 "cppBison.yxx" +{ + yyval.u.decl = new CPPTypeDeclaration(CPPType::new_type(yyvsp[0].u.enum_type)); +; + break;} +case 212: +#line 1598 "cppBison.yxx" +{ + CPPType *type = yyvsp[0].u.identifier->find_type(current_scope, global_scope, false, current_lexer); if (type != NULL) { - (yyval.u.decl) = type; + yyval.u.decl = type; } else { CPPExtensionType *et = - CPPType::new_type(new CPPExtensionType((yyvsp[-1].u.extension_enum), (yyvsp[0].u.identifier), current_scope, (yylsp[-1]).file)) + CPPType::new_type(new CPPExtensionType(yyvsp[-1].u.extension_enum, yyvsp[0].u.identifier, current_scope, yylsp[-1].file)) ->as_extension_type(); - CPPScope *scope = (yyvsp[0].u.identifier)->get_scope(current_scope, global_scope); + CPPScope *scope = yyvsp[0].u.identifier->get_scope(current_scope, global_scope); if (scope != NULL) { scope->define_extension_type(et); } - (yyval.u.decl) = et; + yyval.u.decl = et; } -} - break; - - case 213: -#line 1607 "cppBison.yxx" - { - CPPType *type = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); +; + break;} +case 213: +#line 1614 "cppBison.yxx" +{ + CPPType *type = yyvsp[0].u.identifier->find_type(current_scope, global_scope, false, current_lexer); if (type != NULL) { - (yyval.u.decl) = type; + yyval.u.decl = type; } else { CPPExtensionType *et = - CPPType::new_type(new CPPExtensionType((yyvsp[-1].u.extension_enum), (yyvsp[0].u.identifier), current_scope, (yylsp[-1]).file)) + CPPType::new_type(new CPPExtensionType(yyvsp[-1].u.extension_enum, yyvsp[0].u.identifier, current_scope, yylsp[-1].file)) ->as_extension_type(); - CPPScope *scope = (yyvsp[0].u.identifier)->get_scope(current_scope, global_scope); + CPPScope *scope = yyvsp[0].u.identifier->get_scope(current_scope, global_scope); if (scope != NULL) { scope->define_extension_type(et); } - (yyval.u.decl) = et; + yyval.u.decl = et; } -} - break; - - case 214: -#line 1626 "cppBison.yxx" - { - (yyval.u.type) = CPPType::new_type((yyvsp[0].u.simple_type)); -} - break; - - case 215: -#line 1630 "cppBison.yxx" - { - (yyval.u.type) = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); - assert((yyval.u.type) != NULL); -} - break; - - case 216: -#line 1635 "cppBison.yxx" - { - (yyval.u.type) = CPPType::new_type(new CPPTBDType((yyvsp[0].u.identifier))); -} - break; - - case 217: -#line 1639 "cppBison.yxx" - { - CPPType *type = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); +; + break;} +case 214: +#line 1633 "cppBison.yxx" +{ + yyval.u.type = CPPType::new_type(yyvsp[0].u.simple_type); +; + break;} +case 215: +#line 1637 "cppBison.yxx" +{ + yyval.u.type = yyvsp[0].u.identifier->find_type(current_scope, global_scope, false, current_lexer); + assert(yyval.u.type != NULL); +; + break;} +case 216: +#line 1642 "cppBison.yxx" +{ + yyval.u.type = CPPType::new_type(new CPPTBDType(yyvsp[0].u.identifier)); +; + break;} +case 217: +#line 1646 "cppBison.yxx" +{ + CPPType *type = yyvsp[0].u.identifier->find_type(current_scope, global_scope, false, current_lexer); if (type != NULL) { - (yyval.u.type) = type; + yyval.u.type = type; } else { CPPExtensionType *et = - CPPType::new_type(new CPPExtensionType((yyvsp[-1].u.extension_enum), (yyvsp[0].u.identifier), current_scope, (yylsp[-1]).file)) + CPPType::new_type(new CPPExtensionType(yyvsp[-1].u.extension_enum, yyvsp[0].u.identifier, current_scope, yylsp[-1].file)) ->as_extension_type(); - CPPScope *scope = (yyvsp[0].u.identifier)->get_scope(current_scope, global_scope); + CPPScope *scope = yyvsp[0].u.identifier->get_scope(current_scope, global_scope); if (scope != NULL) { scope->define_extension_type(et); } - (yyval.u.type) = et; + yyval.u.type = et; } -} - break; - - case 218: -#line 1655 "cppBison.yxx" - { - CPPType *type = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); +; + break;} +case 218: +#line 1662 "cppBison.yxx" +{ + CPPType *type = yyvsp[0].u.identifier->find_type(current_scope, global_scope, false, current_lexer); if (type != NULL) { - (yyval.u.type) = type; + yyval.u.type = type; } else { CPPExtensionType *et = - CPPType::new_type(new CPPExtensionType((yyvsp[-1].u.extension_enum), (yyvsp[0].u.identifier), current_scope, (yylsp[-1]).file)) + CPPType::new_type(new CPPExtensionType(yyvsp[-1].u.extension_enum, yyvsp[0].u.identifier, current_scope, yylsp[-1].file)) ->as_extension_type(); - CPPScope *scope = (yyvsp[0].u.identifier)->get_scope(current_scope, global_scope); + CPPScope *scope = yyvsp[0].u.identifier->get_scope(current_scope, global_scope); if (scope != NULL) { scope->define_extension_type(et); } - (yyval.u.type) = et; + yyval.u.type = et; } -} - break; - - case 219: -#line 1674 "cppBison.yxx" - { - CPPInstance *inst = new CPPInstance((yyvsp[-1].u.type), (yyvsp[0].u.inst_ident), 0, (yylsp[-1]).file); - (yyval.u.type) = inst->_type; +; + break;} +case 219: +#line 1681 "cppBison.yxx" +{ + CPPInstance *inst = new CPPInstance(yyvsp[-1].u.type, yyvsp[0].u.inst_ident, 0, yylsp[-1].file); + yyval.u.type = inst->_type; delete inst; -} - break; - - case 220: -#line 1680 "cppBison.yxx" - { - (yyvsp[0].u.inst_ident)->add_modifier(IIT_const); - CPPInstance *inst = new CPPInstance((yyvsp[-1].u.type), (yyvsp[0].u.inst_ident), 0, (yylsp[-2]).file); - (yyval.u.type) = inst->_type; +; + break;} +case 220: +#line 1687 "cppBison.yxx" +{ + yyvsp[0].u.inst_ident->add_modifier(IIT_const); + CPPInstance *inst = new CPPInstance(yyvsp[-1].u.type, yyvsp[0].u.inst_ident, 0, yylsp[-2].file); + yyval.u.type = inst->_type; delete inst; -} - break; - - case 221: -#line 1690 "cppBison.yxx" - { +; + break;} +case 221: +#line 1697 "cppBison.yxx" +{ CPPVisibility starting_vis = - ((yyvsp[-1].u.extension_enum) == CPPExtensionType::T_class) ? V_private : V_public; + (yyvsp[-1].u.extension_enum == CPPExtensionType::T_class) ? V_private : V_public; CPPScope *new_scope = new CPPScope(current_scope, CPPNameComponent("anon"), starting_vis); - CPPStructType *st = new CPPStructType((yyvsp[-1].u.extension_enum), NULL, current_scope, - new_scope, (yylsp[-1]).file); + CPPStructType *st = new CPPStructType(yyvsp[-1].u.extension_enum, NULL, current_scope, + new_scope, yylsp[-1].file); new_scope->set_struct_type(st); push_scope(new_scope); push_struct(st); -} - break; - - case 222: -#line 1704 "cppBison.yxx" - { - (yyval.u.struct_type) = current_struct; +; + break;} +case 222: +#line 1711 "cppBison.yxx" +{ + yyval.u.struct_type = current_struct; current_struct->_incomplete = false; pop_struct(); pop_scope(); -} - break; - - case 223: -#line 1714 "cppBison.yxx" - { +; + break;} +case 223: +#line 1721 "cppBison.yxx" +{ CPPVisibility starting_vis = - ((yyvsp[-1].u.extension_enum) == CPPExtensionType::T_class) ? V_private : V_public; + (yyvsp[-1].u.extension_enum == CPPExtensionType::T_class) ? V_private : V_public; - CPPScope *scope = (yyvsp[0].u.identifier)->get_scope(current_scope, global_scope, current_lexer); + CPPScope *scope = yyvsp[0].u.identifier->get_scope(current_scope, global_scope, current_lexer); if (scope == NULL) { scope = current_scope; } - CPPScope *new_scope = new CPPScope(scope, (yyvsp[0].u.identifier)->_names.back(), + CPPScope *new_scope = new CPPScope(scope, yyvsp[0].u.identifier->_names.back(), starting_vis); - CPPStructType *st = new CPPStructType((yyvsp[-1].u.extension_enum), (yyvsp[0].u.identifier), current_scope, - new_scope, (yylsp[-1]).file); + CPPStructType *st = new CPPStructType(yyvsp[-1].u.extension_enum, yyvsp[0].u.identifier, current_scope, + new_scope, yylsp[-1].file); new_scope->set_struct_type(st); current_scope->define_extension_type(st); push_scope(new_scope); push_struct(st); -} - break; - - case 224: -#line 1734 "cppBison.yxx" - { - (yyval.u.struct_type) = current_struct; +; + break;} +case 224: +#line 1741 "cppBison.yxx" +{ + yyval.u.struct_type = current_struct; current_struct->_incomplete = false; pop_struct(); pop_scope(); -} - break; - - case 229: -#line 1754 "cppBison.yxx" - { - current_struct->append_derivation((yyvsp[0].u.type), V_public, false); -} - break; - - case 230: -#line 1758 "cppBison.yxx" - { - current_struct->append_derivation((yyvsp[0].u.type), V_protected, false); -} - break; - - case 231: -#line 1762 "cppBison.yxx" - { - current_struct->append_derivation((yyvsp[0].u.type), V_private, false); -} - break; - - case 232: -#line 1766 "cppBison.yxx" - { - current_struct->append_derivation((yyvsp[0].u.type), V_public, true); -} - break; - - case 233: -#line 1770 "cppBison.yxx" - { - current_struct->append_derivation((yyvsp[0].u.type), V_protected, true); -} - break; - - case 234: -#line 1774 "cppBison.yxx" - { - current_struct->append_derivation((yyvsp[0].u.type), V_private, true); -} - break; - - case 235: -#line 1778 "cppBison.yxx" - { - current_struct->append_derivation((yyvsp[0].u.type), V_public, true); -} - break; - - case 236: -#line 1782 "cppBison.yxx" - { - current_struct->append_derivation((yyvsp[0].u.type), V_protected, true); -} - break; - - case 237: -#line 1786 "cppBison.yxx" - { - current_struct->append_derivation((yyvsp[0].u.type), V_private, true); -} - break; - - case 238: +; + break;} +case 229: +#line 1761 "cppBison.yxx" +{ + current_struct->append_derivation(yyvsp[0].u.type, V_public, false); +; + break;} +case 230: +#line 1765 "cppBison.yxx" +{ + current_struct->append_derivation(yyvsp[0].u.type, V_protected, false); +; + break;} +case 231: +#line 1769 "cppBison.yxx" +{ + current_struct->append_derivation(yyvsp[0].u.type, V_private, false); +; + break;} +case 232: +#line 1773 "cppBison.yxx" +{ + current_struct->append_derivation(yyvsp[0].u.type, V_public, true); +; + break;} +case 233: +#line 1777 "cppBison.yxx" +{ + current_struct->append_derivation(yyvsp[0].u.type, V_protected, true); +; + break;} +case 234: +#line 1781 "cppBison.yxx" +{ + current_struct->append_derivation(yyvsp[0].u.type, V_private, true); +; + break;} +case 235: +#line 1785 "cppBison.yxx" +{ + current_struct->append_derivation(yyvsp[0].u.type, V_public, true); +; + break;} +case 236: +#line 1789 "cppBison.yxx" +{ + current_struct->append_derivation(yyvsp[0].u.type, V_protected, true); +; + break;} +case 237: #line 1793 "cppBison.yxx" - { - current_enum = new CPPEnumType(NULL, current_scope, (yylsp[-1]).file); -} - break; - - case 239: -#line 1797 "cppBison.yxx" - { - (yyval.u.enum_type) = current_enum; +{ + current_struct->append_derivation(yyvsp[0].u.type, V_private, true); +; + break;} +case 238: +#line 1800 "cppBison.yxx" +{ + current_enum = new CPPEnumType(NULL, current_scope, yylsp[-1].file); +; + break;} +case 239: +#line 1804 "cppBison.yxx" +{ + yyval.u.enum_type = current_enum; current_enum = NULL; -} - break; - - case 240: -#line 1805 "cppBison.yxx" - { - current_enum = new CPPEnumType((yyvsp[-1].u.identifier), current_scope, (yylsp[-2]).file); -} - break; - - case 241: -#line 1809 "cppBison.yxx" - { - (yyval.u.enum_type) = current_enum; +; + break;} +case 240: +#line 1812 "cppBison.yxx" +{ + current_enum = new CPPEnumType(yyvsp[-1].u.identifier, current_scope, yylsp[-2].file); +; + break;} +case 241: +#line 1816 "cppBison.yxx" +{ + yyval.u.enum_type = current_enum; current_enum = NULL; -} - break; - - case 245: -#line 1823 "cppBison.yxx" - { +; + break;} +case 245: +#line 1830 "cppBison.yxx" +{ assert(current_enum != NULL); - current_enum->add_element((yyvsp[0].u.identifier)->get_simple_name(), current_scope); -} - break; - - case 246: -#line 1828 "cppBison.yxx" - { + current_enum->add_element(yyvsp[0].u.identifier->get_simple_name(), current_scope); +; + break;} +case 246: +#line 1835 "cppBison.yxx" +{ assert(current_enum != NULL); - current_enum->add_element((yyvsp[-2].u.identifier)->get_simple_name(), current_scope, (yyvsp[0].u.expr)); -} - break; - - case 247: -#line 1833 "cppBison.yxx" - { + current_enum->add_element(yyvsp[-2].u.identifier->get_simple_name(), current_scope, yyvsp[0].u.expr); +; + break;} +case 247: +#line 1840 "cppBison.yxx" +{ assert(current_enum != NULL); - current_enum->add_element((yyvsp[0].u.identifier)->get_simple_name(), current_scope); -} - break; - - case 248: -#line 1838 "cppBison.yxx" - { + current_enum->add_element(yyvsp[0].u.identifier->get_simple_name(), current_scope); +; + break;} +case 248: +#line 1845 "cppBison.yxx" +{ assert(current_enum != NULL); - current_enum->add_element((yyvsp[-2].u.identifier)->get_simple_name(), current_scope, (yyvsp[0].u.expr)); -} - break; - - case 249: -#line 1846 "cppBison.yxx" - { - (yyval.u.extension_enum) = CPPExtensionType::T_enum; -} - break; - - case 250: + current_enum->add_element(yyvsp[-2].u.identifier->get_simple_name(), current_scope, yyvsp[0].u.expr); +; + break;} +case 249: #line 1853 "cppBison.yxx" - { - (yyval.u.extension_enum) = CPPExtensionType::T_class; -} - break; - - case 251: -#line 1857 "cppBison.yxx" - { - (yyval.u.extension_enum) = CPPExtensionType::T_struct; -} - break; - - case 252: -#line 1861 "cppBison.yxx" - { - (yyval.u.extension_enum) = CPPExtensionType::T_union; -} - break; - - case 253: +{ + yyval.u.extension_enum = CPPExtensionType::T_enum; +; + break;} +case 250: +#line 1860 "cppBison.yxx" +{ + yyval.u.extension_enum = CPPExtensionType::T_class; +; + break;} +case 251: +#line 1864 "cppBison.yxx" +{ + yyval.u.extension_enum = CPPExtensionType::T_struct; +; + break;} +case 252: #line 1868 "cppBison.yxx" - { - CPPScope *scope = (yyvsp[-1].u.identifier)->find_scope(current_scope, global_scope, current_lexer); +{ + yyval.u.extension_enum = CPPExtensionType::T_union; +; + break;} +case 253: +#line 1875 "cppBison.yxx" +{ + CPPScope *scope = yyvsp[-1].u.identifier->find_scope(current_scope, global_scope, current_lexer); if (scope == NULL) { // This must be a new namespace declaration. CPPScope *parent_scope = - (yyvsp[-1].u.identifier)->get_scope(current_scope, global_scope, current_lexer); + yyvsp[-1].u.identifier->get_scope(current_scope, global_scope, current_lexer); if (parent_scope == NULL) { parent_scope = current_scope; } - scope = new CPPScope(parent_scope, (yyvsp[-1].u.identifier)->_names.back(), V_public); + scope = new CPPScope(parent_scope, yyvsp[-1].u.identifier->_names.back(), V_public); } - CPPNamespace *nspace = new CPPNamespace((yyvsp[-1].u.identifier), scope, (yylsp[-2]).file); - current_scope->add_declaration(nspace, global_scope, current_lexer, (yylsp[-2])); + CPPNamespace *nspace = new CPPNamespace(yyvsp[-1].u.identifier, scope, yylsp[-2].file); + current_scope->add_declaration(nspace, global_scope, current_lexer, yylsp[-2]); current_scope->define_namespace(nspace); push_scope(scope); -} - break; - - case 254: -#line 1886 "cppBison.yxx" - { +; + break;} +case 254: +#line 1893 "cppBison.yxx" +{ pop_scope(); -} - break; - - case 256: -#line 1894 "cppBison.yxx" - { - CPPUsing *using_decl = new CPPUsing((yyvsp[0].u.identifier), false, (yylsp[-1]).file); - current_scope->add_declaration(using_decl, global_scope, current_lexer, (yylsp[-1])); +; + break;} +case 256: +#line 1901 "cppBison.yxx" +{ + CPPUsing *using_decl = new CPPUsing(yyvsp[0].u.identifier, false, yylsp[-1].file); + current_scope->add_declaration(using_decl, global_scope, current_lexer, yylsp[-1]); current_scope->add_using(using_decl, global_scope, current_lexer); -} - break; - - case 257: -#line 1900 "cppBison.yxx" - { - CPPUsing *using_decl = new CPPUsing((yyvsp[0].u.identifier), true, (yylsp[-2]).file); - current_scope->add_declaration(using_decl, global_scope, current_lexer, (yylsp[-2])); +; + break;} +case 257: +#line 1907 "cppBison.yxx" +{ + CPPUsing *using_decl = new CPPUsing(yyvsp[0].u.identifier, true, yylsp[-2].file); + current_scope->add_declaration(using_decl, global_scope, current_lexer, yylsp[-2]); current_scope->add_using(using_decl, global_scope, current_lexer); -} - break; - - case 261: -#line 1915 "cppBison.yxx" - { - (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_bool); -} - break; - - case 262: -#line 1919 "cppBison.yxx" - { - (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_char); -} - break; - - case 263: -#line 1923 "cppBison.yxx" - { - (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_wchar_t); -} - break; - - case 264: -#line 1927 "cppBison.yxx" - { - (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_int, +; + break;} +case 261: +#line 1922 "cppBison.yxx" +{ + yyval.u.simple_type = new CPPSimpleType(CPPSimpleType::T_bool); +; + break;} +case 262: +#line 1926 "cppBison.yxx" +{ + yyval.u.simple_type = new CPPSimpleType(CPPSimpleType::T_char); +; + break;} +case 263: +#line 1930 "cppBison.yxx" +{ + yyval.u.simple_type = new CPPSimpleType(CPPSimpleType::T_wchar_t); +; + break;} +case 264: +#line 1934 "cppBison.yxx" +{ + yyval.u.simple_type = new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_short); -} - break; - - case 265: -#line 1932 "cppBison.yxx" - { - (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_int, +; + break;} +case 265: +#line 1939 "cppBison.yxx" +{ + yyval.u.simple_type = new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_long); -} - break; - - case 266: -#line 1937 "cppBison.yxx" - { - (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_int, +; + break;} +case 266: +#line 1944 "cppBison.yxx" +{ + yyval.u.simple_type = new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_longlong); -} - break; - - case 267: -#line 1942 "cppBison.yxx" - { - (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_int, +; + break;} +case 267: +#line 1949 "cppBison.yxx" +{ + yyval.u.simple_type = new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_unsigned); -} - break; - - case 268: -#line 1947 "cppBison.yxx" - { - (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_int, +; + break;} +case 268: +#line 1954 "cppBison.yxx" +{ + yyval.u.simple_type = new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_signed); -} - break; - - case 269: -#line 1952 "cppBison.yxx" - { - (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_int); -} - break; - - case 270: -#line 1956 "cppBison.yxx" - { - (yyval.u.simple_type) = (yyvsp[0].u.simple_type); - (yyval.u.simple_type)->_flags |= CPPSimpleType::F_short; -} - break; - - case 271: -#line 1961 "cppBison.yxx" - { - (yyval.u.simple_type) = (yyvsp[0].u.simple_type); - if ((yyval.u.simple_type)->_flags & CPPSimpleType::F_long) { - (yyval.u.simple_type)->_flags |= CPPSimpleType::F_longlong; +; + break;} +case 269: +#line 1959 "cppBison.yxx" +{ + yyval.u.simple_type = new CPPSimpleType(CPPSimpleType::T_int); +; + break;} +case 270: +#line 1963 "cppBison.yxx" +{ + yyval.u.simple_type = yyvsp[0].u.simple_type; + yyval.u.simple_type->_flags |= CPPSimpleType::F_short; +; + break;} +case 271: +#line 1968 "cppBison.yxx" +{ + yyval.u.simple_type = yyvsp[0].u.simple_type; + if (yyval.u.simple_type->_flags & CPPSimpleType::F_long) { + yyval.u.simple_type->_flags |= CPPSimpleType::F_longlong; } else { - (yyval.u.simple_type)->_flags |= CPPSimpleType::F_long; + yyval.u.simple_type->_flags |= CPPSimpleType::F_long; } -} - break; - - case 272: -#line 1970 "cppBison.yxx" - { - (yyval.u.simple_type) = (yyvsp[0].u.simple_type); - (yyval.u.simple_type)->_flags |= CPPSimpleType::F_unsigned; -} - break; - - case 273: -#line 1975 "cppBison.yxx" - { - (yyval.u.simple_type) = (yyvsp[0].u.simple_type); - (yyval.u.simple_type)->_flags |= CPPSimpleType::F_signed; -} - break; - - case 274: -#line 1983 "cppBison.yxx" - { - (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_float); -} - break; - - case 275: -#line 1987 "cppBison.yxx" - { - (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_float, +; + break;} +case 272: +#line 1977 "cppBison.yxx" +{ + yyval.u.simple_type = yyvsp[0].u.simple_type; + yyval.u.simple_type->_flags |= CPPSimpleType::F_unsigned; +; + break;} +case 273: +#line 1982 "cppBison.yxx" +{ + yyval.u.simple_type = yyvsp[0].u.simple_type; + yyval.u.simple_type->_flags |= CPPSimpleType::F_signed; +; + break;} +case 274: +#line 1990 "cppBison.yxx" +{ + yyval.u.simple_type = new CPPSimpleType(CPPSimpleType::T_float); +; + break;} +case 275: +#line 1994 "cppBison.yxx" +{ + yyval.u.simple_type = new CPPSimpleType(CPPSimpleType::T_float, CPPSimpleType::F_long); -} - break; - - case 276: -#line 1992 "cppBison.yxx" - { - (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_double); -} - break; - - case 277: -#line 1996 "cppBison.yxx" - { - (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_float, +; + break;} +case 276: +#line 1999 "cppBison.yxx" +{ + yyval.u.simple_type = new CPPSimpleType(CPPSimpleType::T_double); +; + break;} +case 277: +#line 2003 "cppBison.yxx" +{ + yyval.u.simple_type = new CPPSimpleType(CPPSimpleType::T_float, CPPSimpleType::F_longlong); -} - break; - - case 278: -#line 2001 "cppBison.yxx" - { - (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_double, +; + break;} +case 278: +#line 2008 "cppBison.yxx" +{ + yyval.u.simple_type = new CPPSimpleType(CPPSimpleType::T_double, CPPSimpleType::F_long); -} - break; - - case 279: -#line 2009 "cppBison.yxx" - { - (yyval.u.simple_type) = new CPPSimpleType(CPPSimpleType::T_void); -} - break; - - case 280: -#line 2018 "cppBison.yxx" - { +; + break;} +case 279: +#line 2016 "cppBison.yxx" +{ + yyval.u.simple_type = new CPPSimpleType(CPPSimpleType::T_void); +; + break;} +case 280: +#line 2025 "cppBison.yxx" +{ current_lexer->_resolve_identifiers = false; -} - break; - - case 281: -#line 2022 "cppBison.yxx" - { +; + break;} +case 281: +#line 2029 "cppBison.yxx" +{ current_lexer->_resolve_identifiers = true; -} - break; - - case 284: -#line 2034 "cppBison.yxx" - { -} - break; - - case 285: -#line 2037 "cppBison.yxx" - { -} - break; - - case 286: -#line 2040 "cppBison.yxx" - { -} - break; - - case 287: -#line 2043 "cppBison.yxx" - { -} - break; - - case 288: -#line 2046 "cppBison.yxx" - { -} - break; - - case 289: -#line 2049 "cppBison.yxx" - { -} - break; - - case 290: -#line 2052 "cppBison.yxx" - { -} - break; - - case 291: -#line 2055 "cppBison.yxx" - { -} - break; - - case 365: -#line 2075 "cppBison.yxx" - { -} - break; - - case 389: -#line 2084 "cppBison.yxx" - { - (yyval.u.expr) = (CPPExpression *)NULL; -} - break; - - case 390: -#line 2088 "cppBison.yxx" - { - (yyval.u.expr) = (yyvsp[0].u.expr); -} - break; - - case 391: +; + break;} +case 284: +#line 2041 "cppBison.yxx" +{ +; + break;} +case 285: +#line 2044 "cppBison.yxx" +{ +; + break;} +case 286: +#line 2047 "cppBison.yxx" +{ +; + break;} +case 287: +#line 2050 "cppBison.yxx" +{ +; + break;} +case 288: +#line 2053 "cppBison.yxx" +{ +; + break;} +case 289: +#line 2056 "cppBison.yxx" +{ +; + break;} +case 290: +#line 2059 "cppBison.yxx" +{ +; + break;} +case 291: +#line 2062 "cppBison.yxx" +{ +; + break;} +case 365: +#line 2082 "cppBison.yxx" +{ +; + break;} +case 389: +#line 2091 "cppBison.yxx" +{ + yyval.u.expr = (CPPExpression *)NULL; +; + break;} +case 390: #line 2095 "cppBison.yxx" - { - (yyval.u.expr) = (CPPExpression *)NULL; -} - break; - - case 392: -#line 2099 "cppBison.yxx" - { - (yyval.u.expr) = (yyvsp[0].u.expr); -} - break; - - case 393: +{ + yyval.u.expr = yyvsp[0].u.expr; +; + break;} +case 391: +#line 2102 "cppBison.yxx" +{ + yyval.u.expr = (CPPExpression *)NULL; +; + break;} +case 392: #line 2106 "cppBison.yxx" - { - (yyval.u.expr) = (yyvsp[0].u.expr); -} - break; - - case 394: -#line 2110 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(',', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 395: +{ + yyval.u.expr = yyvsp[0].u.expr; +; + break;} +case 393: +#line 2113 "cppBison.yxx" +{ + yyval.u.expr = yyvsp[0].u.expr; +; + break;} +case 394: #line 2117 "cppBison.yxx" - { - (yyval.u.expr) = (yyvsp[0].u.expr); -} - break; - - case 396: -#line 2121 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-2].u.type), (yyvsp[0].u.expr))); -} - break; - - case 397: -#line 2125 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr))); -} - break; - - case 398: -#line 2129 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr))); -} - break; - - case 399: -#line 2133 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(CPPExpression::sizeof_func((yyvsp[-1].u.type))); -} - break; - - case 400: -#line 2137 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(UNARY_NOT, (yyvsp[0].u.expr)); -} - break; - - case 401: -#line 2141 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(UNARY_NEGATE, (yyvsp[0].u.expr)); -} - break; - - case 402: -#line 2145 "cppBison.yxx" - { - if ((yyvsp[0].u.expr)->_type == CPPExpression::T_integer) { - (yyval.u.expr) = (yyvsp[0].u.expr); - (yyval.u.expr)->_u._integer = -(yyval.u.expr)->_u._integer; - } else if ((yyvsp[0].u.expr)->_type == CPPExpression::T_real) { - (yyval.u.expr) = (yyvsp[0].u.expr); - (yyval.u.expr)->_u._real = -(yyval.u.expr)->_u._real; +{ + yyval.u.expr = new CPPExpression(',', yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 395: +#line 2124 "cppBison.yxx" +{ + yyval.u.expr = yyvsp[0].u.expr; +; + break;} +case 396: +#line 2128 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(CPPExpression::typecast_op(yyvsp[-2].u.type, yyvsp[0].u.expr)); +; + break;} +case 397: +#line 2132 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(CPPExpression::typecast_op(yyvsp[-4].u.type, yyvsp[-1].u.expr)); +; + break;} +case 398: +#line 2136 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(CPPExpression::typecast_op(yyvsp[-4].u.type, yyvsp[-1].u.expr)); +; + break;} +case 399: +#line 2140 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(CPPExpression::sizeof_func(yyvsp[-1].u.type)); +; + break;} +case 400: +#line 2144 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(UNARY_NOT, yyvsp[0].u.expr); +; + break;} +case 401: +#line 2148 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(UNARY_NEGATE, yyvsp[0].u.expr); +; + break;} +case 402: +#line 2152 "cppBison.yxx" +{ + if (yyvsp[0].u.expr->_type == CPPExpression::T_integer) { + yyval.u.expr = yyvsp[0].u.expr; + yyval.u.expr->_u._integer = -yyval.u.expr->_u._integer; + } else if (yyvsp[0].u.expr->_type == CPPExpression::T_real) { + yyval.u.expr = yyvsp[0].u.expr; + yyval.u.expr->_u._real = -yyval.u.expr->_u._real; } else { - (yyval.u.expr) = new CPPExpression(UNARY_MINUS, (yyvsp[0].u.expr)); + yyval.u.expr = new CPPExpression(UNARY_MINUS, yyvsp[0].u.expr); } -} - break; - - case 403: -#line 2157 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(UNARY_STAR, (yyvsp[0].u.expr)); -} - break; - - case 404: -#line 2161 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(UNARY_REF, (yyvsp[0].u.expr)); -} - break; - - case 405: -#line 2165 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('*', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 406: -#line 2169 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('/', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 407: -#line 2173 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('%', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 408: -#line 2177 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('+', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 409: -#line 2181 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('-', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 410: -#line 2185 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('|', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 411: -#line 2189 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('&', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 412: -#line 2193 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(OROR, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 413: -#line 2197 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(ANDAND, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 414: -#line 2201 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(EQCOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 415: -#line 2205 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(NECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 416: -#line 2209 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(LECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 417: -#line 2213 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(GECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 418: -#line 2217 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(LSHIFT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 419: -#line 2221 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(RSHIFT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 420: -#line 2225 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('?', (yyvsp[-4].u.expr), (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 421: -#line 2229 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('[', (yyvsp[-3].u.expr), (yyvsp[-1].u.expr)); -} - break; - - case 422: -#line 2233 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('f', (yyvsp[-3].u.expr), (yyvsp[-1].u.expr)); -} - break; - - case 423: -#line 2237 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('f', (yyvsp[-2].u.expr)); -} - break; - - case 424: -#line 2241 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('.', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 425: -#line 2245 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(POINTSAT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 426: -#line 2249 "cppBison.yxx" - { - (yyval.u.expr) = (yyvsp[-1].u.expr); -} - break; - - case 427: -#line 2257 "cppBison.yxx" - { - (yyval.u.expr) = (yyvsp[0].u.expr); -} - break; - - case 428: -#line 2261 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-2].u.type), (yyvsp[0].u.expr))); -} - break; - - case 429: -#line 2265 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr))); -} - break; - - case 430: -#line 2269 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr))); -} - break; - - case 431: -#line 2273 "cppBison.yxx" - { - // A constructor call. - CPPType *type = (yyvsp[-3].u.identifier)->find_type(current_scope, global_scope, false, current_lexer); - assert(type != NULL); - (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); -} - break; - - case 432: +; + break;} +case 403: +#line 2164 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(UNARY_STAR, yyvsp[0].u.expr); +; + break;} +case 404: +#line 2168 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(UNARY_REF, yyvsp[0].u.expr); +; + break;} +case 405: +#line 2172 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('*', yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 406: +#line 2176 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('/', yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 407: +#line 2180 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('%', yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 408: +#line 2184 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('+', yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 409: +#line 2188 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('-', yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 410: +#line 2192 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('|', yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 411: +#line 2196 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('&', yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 412: +#line 2200 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(OROR, yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 413: +#line 2204 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(ANDAND, yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 414: +#line 2208 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(EQCOMPARE, yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 415: +#line 2212 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(NECOMPARE, yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 416: +#line 2216 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(LECOMPARE, yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 417: +#line 2220 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(GECOMPARE, yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 418: +#line 2224 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(LSHIFT, yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 419: +#line 2228 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(RSHIFT, yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 420: +#line 2232 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('?', yyvsp[-4].u.expr, yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 421: +#line 2236 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('[', yyvsp[-3].u.expr, yyvsp[-1].u.expr); +; + break;} +case 422: +#line 2240 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('f', yyvsp[-3].u.expr, yyvsp[-1].u.expr); +; + break;} +case 423: +#line 2244 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('f', yyvsp[-2].u.expr); +; + break;} +case 424: +#line 2248 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('.', yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 425: +#line 2252 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(POINTSAT, yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 426: +#line 2256 "cppBison.yxx" +{ + yyval.u.expr = yyvsp[-1].u.expr; +; + break;} +case 427: +#line 2264 "cppBison.yxx" +{ + yyval.u.expr = yyvsp[0].u.expr; +; + break;} +case 428: +#line 2268 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(CPPExpression::typecast_op(yyvsp[-2].u.type, yyvsp[0].u.expr)); +; + break;} +case 429: +#line 2272 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(CPPExpression::typecast_op(yyvsp[-4].u.type, yyvsp[-1].u.expr)); +; + break;} +case 430: +#line 2276 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(CPPExpression::typecast_op(yyvsp[-4].u.type, yyvsp[-1].u.expr)); +; + break;} +case 431: #line 2280 "cppBison.yxx" - { +{ + // A constructor call. + CPPType *type = yyvsp[-3].u.identifier->find_type(current_scope, global_scope, false, current_lexer); + assert(type != NULL); + yyval.u.expr = new CPPExpression(CPPExpression::construct_op(type, yyvsp[-1].u.expr)); +; + break;} +case 432: +#line 2287 "cppBison.yxx" +{ CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_int)); - (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); -} - break; - - case 433: -#line 2286 "cppBison.yxx" - { + yyval.u.expr = new CPPExpression(CPPExpression::construct_op(type, yyvsp[-1].u.expr)); +; + break;} +case 433: +#line 2293 "cppBison.yxx" +{ CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_char)); - (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); -} - break; - - case 434: -#line 2292 "cppBison.yxx" - { + yyval.u.expr = new CPPExpression(CPPExpression::construct_op(type, yyvsp[-1].u.expr)); +; + break;} +case 434: +#line 2299 "cppBison.yxx" +{ CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_wchar_t)); - (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); -} - break; - - case 435: -#line 2298 "cppBison.yxx" - { + yyval.u.expr = new CPPExpression(CPPExpression::construct_op(type, yyvsp[-1].u.expr)); +; + break;} +case 435: +#line 2305 "cppBison.yxx" +{ CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_bool)); - (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); -} - break; - - case 436: -#line 2304 "cppBison.yxx" - { + yyval.u.expr = new CPPExpression(CPPExpression::construct_op(type, yyvsp[-1].u.expr)); +; + break;} +case 436: +#line 2311 "cppBison.yxx" +{ CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_short)); - (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); -} - break; - - case 437: -#line 2311 "cppBison.yxx" - { + yyval.u.expr = new CPPExpression(CPPExpression::construct_op(type, yyvsp[-1].u.expr)); +; + break;} +case 437: +#line 2318 "cppBison.yxx" +{ CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_long)); - (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); -} - break; - - case 438: -#line 2318 "cppBison.yxx" - { + yyval.u.expr = new CPPExpression(CPPExpression::construct_op(type, yyvsp[-1].u.expr)); +; + break;} +case 438: +#line 2325 "cppBison.yxx" +{ CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_unsigned)); - (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); -} - break; - - case 439: -#line 2325 "cppBison.yxx" - { + yyval.u.expr = new CPPExpression(CPPExpression::construct_op(type, yyvsp[-1].u.expr)); +; + break;} +case 439: +#line 2332 "cppBison.yxx" +{ CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_int, CPPSimpleType::F_signed)); - (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); -} - break; - - case 440: -#line 2332 "cppBison.yxx" - { + yyval.u.expr = new CPPExpression(CPPExpression::construct_op(type, yyvsp[-1].u.expr)); +; + break;} +case 440: +#line 2339 "cppBison.yxx" +{ CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_float)); - (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); -} - break; - - case 441: -#line 2338 "cppBison.yxx" - { + yyval.u.expr = new CPPExpression(CPPExpression::construct_op(type, yyvsp[-1].u.expr)); +; + break;} +case 441: +#line 2345 "cppBison.yxx" +{ CPPType *type = CPPType::new_type(new CPPSimpleType(CPPSimpleType::T_double)); - (yyval.u.expr) = new CPPExpression(CPPExpression::construct_op(type, (yyvsp[-1].u.expr))); -} - break; - - case 442: -#line 2344 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(CPPExpression::sizeof_func((yyvsp[-1].u.type))); -} - break; - - case 443: -#line 2348 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(CPPExpression::new_op((yyvsp[0].u.type))); -} - break; - - case 444: -#line 2352 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(CPPExpression::new_op((yyvsp[-3].u.type), (yyvsp[-1].u.expr))); -} - break; - - case 445: -#line 2356 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(UNARY_NOT, (yyvsp[0].u.expr)); -} - break; - - case 446: -#line 2360 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(UNARY_NEGATE, (yyvsp[0].u.expr)); -} - break; - - case 447: -#line 2364 "cppBison.yxx" - { - if ((yyvsp[0].u.expr)->_type == CPPExpression::T_integer) { - (yyval.u.expr) = (yyvsp[0].u.expr); - (yyval.u.expr)->_u._integer = -(yyval.u.expr)->_u._integer; - } else if ((yyvsp[0].u.expr)->_type == CPPExpression::T_real) { - (yyval.u.expr) = (yyvsp[0].u.expr); - (yyval.u.expr)->_u._real = -(yyval.u.expr)->_u._real; + yyval.u.expr = new CPPExpression(CPPExpression::construct_op(type, yyvsp[-1].u.expr)); +; + break;} +case 442: +#line 2351 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(CPPExpression::sizeof_func(yyvsp[-1].u.type)); +; + break;} +case 443: +#line 2355 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(CPPExpression::new_op(yyvsp[0].u.type)); +; + break;} +case 444: +#line 2359 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(CPPExpression::new_op(yyvsp[-3].u.type, yyvsp[-1].u.expr)); +; + break;} +case 445: +#line 2363 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(UNARY_NOT, yyvsp[0].u.expr); +; + break;} +case 446: +#line 2367 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(UNARY_NEGATE, yyvsp[0].u.expr); +; + break;} +case 447: +#line 2371 "cppBison.yxx" +{ + if (yyvsp[0].u.expr->_type == CPPExpression::T_integer) { + yyval.u.expr = yyvsp[0].u.expr; + yyval.u.expr->_u._integer = -yyval.u.expr->_u._integer; + } else if (yyvsp[0].u.expr->_type == CPPExpression::T_real) { + yyval.u.expr = yyvsp[0].u.expr; + yyval.u.expr->_u._real = -yyval.u.expr->_u._real; } else { - (yyval.u.expr) = new CPPExpression(UNARY_MINUS, (yyvsp[0].u.expr)); + yyval.u.expr = new CPPExpression(UNARY_MINUS, yyvsp[0].u.expr); } -} - break; - - case 448: -#line 2376 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(UNARY_STAR, (yyvsp[0].u.expr)); -} - break; - - case 449: -#line 2380 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(UNARY_REF, (yyvsp[0].u.expr)); -} - break; - - case 450: -#line 2384 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('*', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 451: -#line 2388 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('/', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 452: -#line 2392 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('%', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 453: -#line 2396 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('+', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 454: -#line 2400 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('-', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 455: -#line 2404 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('|', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 456: -#line 2408 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('&', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 457: -#line 2412 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(OROR, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 458: -#line 2416 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(ANDAND, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 459: -#line 2420 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(EQCOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 460: -#line 2424 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(NECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 461: -#line 2428 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(LECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 462: -#line 2432 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(GECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 463: -#line 2436 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('<', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 464: -#line 2440 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('>', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 465: -#line 2444 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(LSHIFT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 466: -#line 2448 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(RSHIFT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 467: -#line 2452 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('?', (yyvsp[-4].u.expr), (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 468: -#line 2456 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('[', (yyvsp[-3].u.expr), (yyvsp[-1].u.expr)); -} - break; - - case 469: -#line 2460 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('f', (yyvsp[-3].u.expr), (yyvsp[-1].u.expr)); -} - break; - - case 470: -#line 2464 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('f', (yyvsp[-2].u.expr)); -} - break; - - case 471: -#line 2468 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('.', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 472: -#line 2472 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(POINTSAT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 473: -#line 2476 "cppBison.yxx" - { - (yyval.u.expr) = (yyvsp[-1].u.expr); -} - break; - - case 474: +; + break;} +case 448: +#line 2383 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(UNARY_STAR, yyvsp[0].u.expr); +; + break;} +case 449: +#line 2387 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(UNARY_REF, yyvsp[0].u.expr); +; + break;} +case 450: +#line 2391 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('*', yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 451: +#line 2395 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('/', yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 452: +#line 2399 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('%', yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 453: +#line 2403 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('+', yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 454: +#line 2407 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('-', yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 455: +#line 2411 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('|', yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 456: +#line 2415 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('&', yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 457: +#line 2419 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(OROR, yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 458: +#line 2423 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(ANDAND, yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 459: +#line 2427 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(EQCOMPARE, yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 460: +#line 2431 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(NECOMPARE, yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 461: +#line 2435 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(LECOMPARE, yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 462: +#line 2439 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(GECOMPARE, yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 463: +#line 2443 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('<', yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 464: +#line 2447 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('>', yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 465: +#line 2451 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(LSHIFT, yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 466: +#line 2455 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(RSHIFT, yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 467: +#line 2459 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('?', yyvsp[-4].u.expr, yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 468: +#line 2463 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('[', yyvsp[-3].u.expr, yyvsp[-1].u.expr); +; + break;} +case 469: +#line 2467 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('f', yyvsp[-3].u.expr, yyvsp[-1].u.expr); +; + break;} +case 470: +#line 2471 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('f', yyvsp[-2].u.expr); +; + break;} +case 471: +#line 2475 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('.', yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 472: +#line 2479 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(POINTSAT, yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 473: #line 2483 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression((yyvsp[0].u.integer)); -} - break; - - case 475: -#line 2487 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(true); -} - break; - - case 476: -#line 2491 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(false); -} - break; - - case 477: -#line 2495 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression((yyvsp[0].u.integer)); -} - break; - - case 478: -#line 2499 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression((yyvsp[0].u.real)); -} - break; - - case 479: -#line 2503 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression((yyvsp[0].str)); -} - break; - - case 480: -#line 2507 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression((yyvsp[0].u.identifier), current_scope, global_scope, current_lexer); -} - break; - - case 481: -#line 2521 "cppBison.yxx" - { - (yyval.u.expr) = (yyvsp[0].u.expr); -} - break; - - case 482: -#line 2525 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-2].u.type), (yyvsp[0].u.expr))); -} - break; - - case 483: -#line 2529 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr))); -} - break; - - case 484: -#line 2533 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(CPPExpression::typecast_op((yyvsp[-4].u.type), (yyvsp[-1].u.expr))); -} - break; - - case 485: -#line 2537 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(CPPExpression::sizeof_func((yyvsp[-1].u.type))); -} - break; - - case 486: -#line 2541 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(CPPExpression::new_op((yyvsp[0].u.type))); -} - break; - - case 487: -#line 2545 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(CPPExpression::new_op((yyvsp[-3].u.type), (yyvsp[-1].u.expr))); -} - break; - - case 488: -#line 2549 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(UNARY_NOT, (yyvsp[0].u.expr)); -} - break; - - case 489: -#line 2553 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(UNARY_NEGATE, (yyvsp[0].u.expr)); -} - break; - - case 490: -#line 2557 "cppBison.yxx" - { - if ((yyvsp[0].u.expr)->_type == CPPExpression::T_integer) { - (yyval.u.expr) = (yyvsp[0].u.expr); - (yyval.u.expr)->_u._integer = -(yyval.u.expr)->_u._integer; - } else if ((yyvsp[0].u.expr)->_type == CPPExpression::T_real) { - (yyval.u.expr) = (yyvsp[0].u.expr); - (yyval.u.expr)->_u._real = -(yyval.u.expr)->_u._real; +{ + yyval.u.expr = yyvsp[-1].u.expr; +; + break;} +case 474: +#line 2490 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(yyvsp[0].u.integer); +; + break;} +case 475: +#line 2494 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(true); +; + break;} +case 476: +#line 2498 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(false); +; + break;} +case 477: +#line 2502 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(yyvsp[0].u.integer); +; + break;} +case 478: +#line 2506 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(yyvsp[0].u.real); +; + break;} +case 479: +#line 2510 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(yyvsp[0].str); +; + break;} +case 480: +#line 2514 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(yyvsp[0].u.identifier, current_scope, global_scope, current_lexer); +; + break;} +case 481: +#line 2528 "cppBison.yxx" +{ + yyval.u.expr = yyvsp[0].u.expr; +; + break;} +case 482: +#line 2532 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(CPPExpression::typecast_op(yyvsp[-2].u.type, yyvsp[0].u.expr)); +; + break;} +case 483: +#line 2536 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(CPPExpression::typecast_op(yyvsp[-4].u.type, yyvsp[-1].u.expr)); +; + break;} +case 484: +#line 2540 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(CPPExpression::typecast_op(yyvsp[-4].u.type, yyvsp[-1].u.expr)); +; + break;} +case 485: +#line 2544 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(CPPExpression::sizeof_func(yyvsp[-1].u.type)); +; + break;} +case 486: +#line 2548 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(CPPExpression::new_op(yyvsp[0].u.type)); +; + break;} +case 487: +#line 2552 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(CPPExpression::new_op(yyvsp[-3].u.type, yyvsp[-1].u.expr)); +; + break;} +case 488: +#line 2556 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(UNARY_NOT, yyvsp[0].u.expr); +; + break;} +case 489: +#line 2560 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(UNARY_NEGATE, yyvsp[0].u.expr); +; + break;} +case 490: +#line 2564 "cppBison.yxx" +{ + if (yyvsp[0].u.expr->_type == CPPExpression::T_integer) { + yyval.u.expr = yyvsp[0].u.expr; + yyval.u.expr->_u._integer = -yyval.u.expr->_u._integer; + } else if (yyvsp[0].u.expr->_type == CPPExpression::T_real) { + yyval.u.expr = yyvsp[0].u.expr; + yyval.u.expr->_u._real = -yyval.u.expr->_u._real; } else { - (yyval.u.expr) = new CPPExpression(UNARY_MINUS, (yyvsp[0].u.expr)); + yyval.u.expr = new CPPExpression(UNARY_MINUS, yyvsp[0].u.expr); } -} - break; - - case 491: -#line 2569 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(UNARY_REF, (yyvsp[0].u.expr)); -} - break; - - case 492: -#line 2573 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('*', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 493: -#line 2577 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('/', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 494: -#line 2581 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('%', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 495: -#line 2585 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('+', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 496: -#line 2589 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('-', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 497: -#line 2593 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('|', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 498: -#line 2597 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('&', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 499: -#line 2601 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(OROR, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 500: -#line 2605 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(ANDAND, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 501: -#line 2609 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(EQCOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 502: -#line 2613 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(NECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 503: -#line 2617 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(LECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 504: -#line 2621 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(GECOMPARE, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 505: -#line 2625 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('<', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 506: -#line 2629 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('>', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 507: -#line 2633 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(LSHIFT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 508: -#line 2637 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(RSHIFT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 509: -#line 2641 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('?', (yyvsp[-4].u.expr), (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 510: -#line 2645 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('[', (yyvsp[-3].u.expr), (yyvsp[-1].u.expr)); -} - break; - - case 511: -#line 2649 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('f', (yyvsp[-3].u.expr), (yyvsp[-1].u.expr)); -} - break; - - case 512: -#line 2653 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('f', (yyvsp[-2].u.expr)); -} - break; - - case 513: -#line 2657 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression('.', (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 514: -#line 2661 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(POINTSAT, (yyvsp[-2].u.expr), (yyvsp[0].u.expr)); -} - break; - - case 515: -#line 2665 "cppBison.yxx" - { - (yyval.u.expr) = (yyvsp[-1].u.expr); -} - break; - - case 516: +; + break;} +case 491: +#line 2576 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(UNARY_REF, yyvsp[0].u.expr); +; + break;} +case 492: +#line 2580 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('*', yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 493: +#line 2584 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('/', yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 494: +#line 2588 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('%', yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 495: +#line 2592 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('+', yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 496: +#line 2596 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('-', yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 497: +#line 2600 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('|', yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 498: +#line 2604 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('&', yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 499: +#line 2608 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(OROR, yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 500: +#line 2612 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(ANDAND, yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 501: +#line 2616 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(EQCOMPARE, yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 502: +#line 2620 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(NECOMPARE, yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 503: +#line 2624 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(LECOMPARE, yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 504: +#line 2628 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(GECOMPARE, yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 505: +#line 2632 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('<', yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 506: +#line 2636 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('>', yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 507: +#line 2640 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(LSHIFT, yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 508: +#line 2644 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(RSHIFT, yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 509: +#line 2648 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('?', yyvsp[-4].u.expr, yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 510: +#line 2652 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('[', yyvsp[-3].u.expr, yyvsp[-1].u.expr); +; + break;} +case 511: +#line 2656 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('f', yyvsp[-3].u.expr, yyvsp[-1].u.expr); +; + break;} +case 512: +#line 2660 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('f', yyvsp[-2].u.expr); +; + break;} +case 513: +#line 2664 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression('.', yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 514: +#line 2668 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(POINTSAT, yyvsp[-2].u.expr, yyvsp[0].u.expr); +; + break;} +case 515: #line 2672 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression((yyvsp[0].u.integer)); -} - break; - - case 517: -#line 2676 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(true); -} - break; - - case 518: -#line 2680 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression(false); -} - break; - - case 519: -#line 2684 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression((yyvsp[0].u.integer)); -} - break; - - case 520: -#line 2688 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression((yyvsp[0].u.real)); -} - break; - - case 521: -#line 2692 "cppBison.yxx" - { - (yyval.u.expr) = new CPPExpression((yyvsp[0].str)); -} - break; - - case 522: +{ + yyval.u.expr = yyvsp[-1].u.expr; +; + break;} +case 516: +#line 2679 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(yyvsp[0].u.integer); +; + break;} +case 517: +#line 2683 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(true); +; + break;} +case 518: +#line 2687 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(false); +; + break;} +case 519: +#line 2691 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(yyvsp[0].u.integer); +; + break;} +case 520: +#line 2695 "cppBison.yxx" +{ + yyval.u.expr = new CPPExpression(yyvsp[0].u.real); +; + break;} +case 521: #line 2699 "cppBison.yxx" - { - CPPType *type = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, true); +{ + yyval.u.expr = new CPPExpression(yyvsp[0].str); +; + break;} +case 522: +#line 2706 "cppBison.yxx" +{ + CPPType *type = yyvsp[0].u.identifier->find_type(current_scope, global_scope, true); if (type == NULL) { - type = CPPType::new_type(new CPPTBDType((yyvsp[0].u.identifier))); + type = CPPType::new_type(new CPPTBDType(yyvsp[0].u.identifier)); } - (yyval.u.type) = type; -} - break; - - case 523: -#line 2707 "cppBison.yxx" - { - CPPType *type = (yyvsp[0].u.identifier)->find_type(current_scope, global_scope, true, current_lexer); + yyval.u.type = type; +; + break;} +case 523: +#line 2714 "cppBison.yxx" +{ + CPPType *type = yyvsp[0].u.identifier->find_type(current_scope, global_scope, true, current_lexer); if (type == NULL) { - type = CPPType::new_type(new CPPTBDType((yyvsp[0].u.identifier))); + type = CPPType::new_type(new CPPTBDType(yyvsp[0].u.identifier)); } - (yyval.u.type) = type; -} - break; - - case 524: -#line 2715 "cppBison.yxx" - { - (yyval.u.type) = CPPType::new_type(new CPPTBDType((yyvsp[0].u.identifier))); -} - break; - - case 525: -#line 2738 "cppBison.yxx" - { - (yyval.u.identifier) = (yyvsp[0].u.identifier); -} - break; - - case 526: -#line 2742 "cppBison.yxx" - { - (yyval.u.identifier) = (yyvsp[0].u.identifier); -} - break; - - case 527: + yyval.u.type = type; +; + break;} +case 524: +#line 2722 "cppBison.yxx" +{ + yyval.u.type = CPPType::new_type(new CPPTBDType(yyvsp[0].u.identifier)); +; + break;} +case 525: +#line 2745 "cppBison.yxx" +{ + yyval.u.identifier = yyvsp[0].u.identifier; +; + break;} +case 526: #line 2749 "cppBison.yxx" - { - (yyval.str) = (yyvsp[0].str); +{ + yyval.u.identifier = yyvsp[0].u.identifier; +; + break;} +case 527: +#line 2756 "cppBison.yxx" +{ + yyval.str = yyvsp[0].str; +; + break;} +case 528: +#line 2760 "cppBison.yxx" +{ + yyval.str = yyvsp[-1].str + yyvsp[0].str; +; + break;} } - break; - - case 528: -#line 2753 "cppBison.yxx" - { - (yyval.str) = (yyvsp[-1].str) + (yyvsp[0].str); -} - break; - - - } - -/* Line 1037 of yacc.c. */ -#line 6072 "y.tab.c" + /* the action file gets copied in in place of this dollarsign */ +#line 543 "/usr/share/bison.simple" yyvsp -= yylen; yyssp -= yylen; +#ifdef YYLSP_NEEDED yylsp -= yylen; +#endif - YY_STACK_PRINT (yyss, yyssp); +#if YYDEBUG != 0 + if (yydebug) + { + short *ssp1 = yyss - 1; + fprintf (stderr, "state stack now"); + while (ssp1 != yyssp) + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } +#endif *++yyvsp = yyval; - *++yylsp = yyloc; - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ +#ifdef YYLSP_NEEDED + yylsp++; + if (yylen == 0) + { + yylsp->first_line = yylloc.first_line; + yylsp->first_column = yylloc.first_column; + yylsp->last_line = (yylsp-1)->last_line; + yylsp->last_column = (yylsp-1)->last_column; + yylsp->text = 0; + } + else + { + yylsp->last_line = (yylsp+yylen-1)->last_line; + yylsp->last_column = (yylsp+yylen-1)->last_column; + } +#endif + + /* Now "shift" the result of the reduction. + Determine what state that goes to, + based on the state we popped back to + and the rule number reduced by. */ yyn = yyr1[yyn]; - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yypgoto[yyn - YYNTBASE] + *yyssp; + if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) yystate = yytable[yystate]; else - yystate = yydefgoto[yyn - YYNTOKENS]; + yystate = yydefgoto[yyn - YYNTBASE]; goto yynewstate; +yyerrlab: /* here on detecting error */ -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) + if (! yyerrstatus) + /* If not already recovering from an error, report this error. */ { ++yynerrs; -#if YYERROR_VERBOSE + +#ifdef YYERROR_VERBOSE yyn = yypact[yystate]; - if (YYPACT_NINF < yyn && yyn < YYLAST) + if (yyn > YYFLAG && yyn < YYLAST) { - YYSIZE_T yysize = 0; - int yytype = YYTRANSLATE (yychar); - const char* yyprefix; - char *yymsg; - int yyx; + int size = 0; + char *msg; + int x, count; - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 0; - - yyprefix = ", expecting "; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - yysize += yystrlen (yyprefix) + yystrlen (yytname [yyx]); - yycount += 1; - if (yycount == 5) - { - yysize = 0; - break; - } - } - yysize += (sizeof ("syntax error, unexpected ") - + yystrlen (yytname[yytype])); - yymsg = (char *) YYSTACK_ALLOC (yysize); - if (yymsg != 0) + count = 0; + /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + size += strlen(yytname[x]) + 15, count++; + msg = (char *) malloc(size + 15); + if (msg != 0) { - char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); - yyp = yystpcpy (yyp, yytname[yytype]); + strcpy(msg, "parse error"); - if (yycount < 5) + if (count < 5) { - yyprefix = ", expecting "; - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + count = 0; + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) { - yyp = yystpcpy (yyp, yyprefix); - yyp = yystpcpy (yyp, yytname[yyx]); - yyprefix = " or "; + strcat(msg, count == 0 ? ", expecting `" : " or `"); + strcat(msg, yytname[x]); + strcat(msg, "'"); + count++; } } - yyerror (yymsg); - YYSTACK_FREE (yymsg); + yyerror(msg); + free(msg); } else - yyerror ("syntax error; also virtual memory exhausted"); + yyerror ("parse error; also virtual memory exceeded"); } else #endif /* YYERROR_VERBOSE */ - yyerror ("syntax error"); + yyerror("parse error"); } - yyerror_range[0] = yylloc; + goto yyerrlab1; +yyerrlab1: /* here on error raised explicitly by an action */ if (yyerrstatus == 3) { - /* If just tried and failed to reuse look-ahead token after an - error, discard it. */ + /* if just tried and failed to reuse lookahead token after an error, discard it. */ - if (yychar <= YYEOF) - { - /* If at end of input, pop the error token, - then the rest of the stack, then return failure. */ - if (yychar == YYEOF) - for (;;) - { - yyerror_range[0] = *yylsp; - YYPOPSTACK; - if (yyssp == yyss) - YYABORT; - yydestruct ("Error: popping", - yystos[*yyssp], yyvsp, yylsp); - } - } - else - { - yydestruct ("Error: discarding", yytoken, &yylval, &yylloc); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse look-ahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - -#ifdef __GNUC__ - /* Pacify GCC when the user code never invokes YYERROR and the label - yyerrorlab therefore never appears in user code. */ - if (0) - goto yyerrorlab; -#endif - - yyerror_range[0] = yylsp[1-yylen]; - yylsp -= yylen; - yyvsp -= yylen; - yyssp -= yylen; - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) + /* return failure if at end of input */ + if (yychar == YYEOF) YYABORT; - yyerror_range[0] = *yylsp; - yydestruct ("Error: popping", yystos[yystate], yyvsp, yylsp); - YYPOPSTACK; - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); +#endif + + yychar = YYEMPTY; } + /* Else will try to reuse lookahead token + after shifting the error token. */ + + yyerrstatus = 3; /* Each real token shifted decrements this */ + + goto yyerrhandle; + +yyerrdefault: /* current state does not do anything special for the error token. */ + +#if 0 + /* This is wrong; only states that explicitly want error tokens + should shift them. */ + yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ + if (yyn) goto yydefault; +#endif + +yyerrpop: /* pop the current state because it cannot handle the error token */ + + if (yyssp == yyss) YYABORT; + yyvsp--; + yystate = *--yyssp; +#ifdef YYLSP_NEEDED + yylsp--; +#endif + +#if YYDEBUG != 0 + if (yydebug) + { + short *ssp1 = yyss - 1; + fprintf (stderr, "Error: state stack now"); + while (ssp1 != yyssp) + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } +#endif + +yyerrhandle: + + yyn = yypact[yystate]; + if (yyn == YYFLAG) + goto yyerrdefault; + + yyn += YYTERROR; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) + goto yyerrdefault; + + yyn = yytable[yyn]; + if (yyn < 0) + { + if (yyn == YYFLAG) + goto yyerrpop; + yyn = -yyn; + goto yyreduce; + } + else if (yyn == 0) + goto yyerrpop; + if (yyn == YYFINAL) YYACCEPT; +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting error token, "); +#endif + *++yyvsp = yylval; - - yyerror_range[1] = yylloc; - /* Using YYLLOC is tempting, but would change the location of - the look-ahead. YYLOC is available though. */ - YYLLOC_DEFAULT (yyloc, yyerror_range - 1, 2); - *++yylsp = yyloc; - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); +#ifdef YYLSP_NEEDED + *++yylsp = yylloc; +#endif yystate = yyn; goto yynewstate; - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yydestruct ("Error: discarding lookahead", - yytoken, &yylval, &yylloc); - yychar = YYEMPTY; - yyresult = 1; - goto yyreturn; - -#ifndef yyoverflow -/*----------------------------------------------. -| yyoverflowlab -- parser overflow comes here. | -`----------------------------------------------*/ -yyoverflowlab: - yyerror ("parser stack overflow"); - yyresult = 2; - /* Fall through. */ + yyacceptlab: + /* YYACCEPT comes here. */ + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); #endif + } + return 0; -yyreturn: -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); + yyabortlab: + /* YYABORT comes here. */ + if (yyfree_stacks) + { + free (yyss); + free (yyvs); +#ifdef YYLSP_NEEDED + free (yyls); #endif - return yyresult; + } + return 1; } - - - +#line 2767 "cppBison.yxx" diff --git a/dtool/src/cppparser/cppBison.h.prebuilt b/dtool/src/cppparser/cppBison.h.prebuilt index 4aa744d717..b14d651819 100644 --- a/dtool/src/cppparser/cppBison.h.prebuilt +++ b/dtool/src/cppparser/cppBison.h.prebuilt @@ -1,260 +1,118 @@ -/* A Bison parser, made by GNU Bison 2.0. */ -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. +#ifndef YYLTYPE +typedef + struct yyltype + { + int timestamp; + int first_line; + int first_column; + int last_line; + int last_column; + char *text; + } + 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., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, 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_BLOCKING = 300, - KW_BOOL = 301, - KW_CATCH = 302, - KW_CHAR = 303, - KW_WCHAR_T = 304, - KW_CLASS = 305, - KW_CONST = 306, - KW_DELETE = 307, - KW_DOUBLE = 308, - KW_DYNAMIC_CAST = 309, - KW_ELSE = 310, - KW_END_PUBLISH = 311, - KW_ENUM = 312, - KW_EXTERN = 313, - KW_EXPLICIT = 314, - KW_PUBLISHED = 315, - KW_FALSE = 316, - KW_FLOAT = 317, - KW_FRIEND = 318, - KW_FOR = 319, - KW_GOTO = 320, - KW_IF = 321, - KW_INLINE = 322, - KW_INT = 323, - KW_LONG = 324, - KW_LONGLONG = 325, - KW_MUTABLE = 326, - KW_NAMESPACE = 327, - KW_NEW = 328, - KW_OPERATOR = 329, - KW_PRIVATE = 330, - KW_PROTECTED = 331, - KW_PUBLIC = 332, - KW_REGISTER = 333, - KW_RETURN = 334, - KW_SHORT = 335, - KW_SIGNED = 336, - KW_SIZEOF = 337, - KW_STATIC = 338, - KW_STATIC_CAST = 339, - KW_STRUCT = 340, - KW_TEMPLATE = 341, - KW_THROW = 342, - KW_TRUE = 343, - KW_TRY = 344, - KW_TYPEDEF = 345, - KW_TYPENAME = 346, - KW_UNION = 347, - KW_UNSIGNED = 348, - KW_USING = 349, - KW_VIRTUAL = 350, - KW_VOID = 351, - KW_VOLATILE = 352, - KW_WHILE = 353, - START_CPP = 354, - START_CONST_EXPR = 355, - START_TYPE = 356 - }; -#endif -#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_BLOCKING 300 -#define KW_BOOL 301 -#define KW_CATCH 302 -#define KW_CHAR 303 -#define KW_WCHAR_T 304 -#define KW_CLASS 305 -#define KW_CONST 306 -#define KW_DELETE 307 -#define KW_DOUBLE 308 -#define KW_DYNAMIC_CAST 309 -#define KW_ELSE 310 -#define KW_END_PUBLISH 311 -#define KW_ENUM 312 -#define KW_EXTERN 313 -#define KW_EXPLICIT 314 -#define KW_PUBLISHED 315 -#define KW_FALSE 316 -#define KW_FLOAT 317 -#define KW_FRIEND 318 -#define KW_FOR 319 -#define KW_GOTO 320 -#define KW_IF 321 -#define KW_INLINE 322 -#define KW_INT 323 -#define KW_LONG 324 -#define KW_LONGLONG 325 -#define KW_MUTABLE 326 -#define KW_NAMESPACE 327 -#define KW_NEW 328 -#define KW_OPERATOR 329 -#define KW_PRIVATE 330 -#define KW_PROTECTED 331 -#define KW_PUBLIC 332 -#define KW_REGISTER 333 -#define KW_RETURN 334 -#define KW_SHORT 335 -#define KW_SIGNED 336 -#define KW_SIZEOF 337 -#define KW_STATIC 338 -#define KW_STATIC_CAST 339 -#define KW_STRUCT 340 -#define KW_TEMPLATE 341 -#define KW_THROW 342 -#define KW_TRUE 343 -#define KW_TRY 344 -#define KW_TYPEDEF 345 -#define KW_TYPENAME 346 -#define KW_UNION 347 -#define KW_UNSIGNED 348 -#define KW_USING 349 -#define KW_VIRTUAL 350 -#define KW_VOID 351 -#define KW_VOLATILE 352 -#define KW_WHILE 353 -#define START_CPP 354 -#define START_CONST_EXPR 355 -#define START_TYPE 356 - - - - -#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 +#define YYLTYPE yyltype #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 /* obsolescent; will be withdrawn */ -# define YYLTYPE_IS_DECLARED 1 -# define YYLTYPE_IS_TRIVIAL 1 -#endif - - - +#define REAL 257 +#define INTEGER 258 +#define CHAR_TOK 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_BLOCKING 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_MAKE_SEQ 325 +#define KW_MUTABLE 326 +#define KW_NAMESPACE 327 +#define KW_NEW 328 +#define KW_OPERATOR 329 +#define KW_PRIVATE 330 +#define KW_PROTECTED 331 +#define KW_PUBLIC 332 +#define KW_REGISTER 333 +#define KW_RETURN 334 +#define KW_SHORT 335 +#define KW_SIGNED 336 +#define KW_SIZEOF 337 +#define KW_STATIC 338 +#define KW_STATIC_CAST 339 +#define KW_STRUCT 340 +#define KW_TEMPLATE 341 +#define KW_THROW 342 +#define KW_TRUE 343 +#define KW_TRY 344 +#define KW_TYPEDEF 345 +#define KW_TYPENAME 346 +#define KW_UNION 347 +#define KW_UNSIGNED 348 +#define KW_USING 349 +#define KW_VIRTUAL 350 +#define KW_VOID 351 +#define KW_VOLATILE 352 +#define KW_WHILE 353 +#define START_CPP 354 +#define START_CONST_EXPR 355 +#define START_TYPE 356 diff --git a/dtool/src/cppparser/cppBison.yxx b/dtool/src/cppparser/cppBison.yxx index 4e211fbaa2..cb5bca3524 100644 --- a/dtool/src/cppparser/cppBison.yxx +++ b/dtool/src/cppparser/cppBison.yxx @@ -14,6 +14,7 @@ #include "cppEnumType.h" #include "cppFunctionType.h" #include "cppTBDType.h" +#include "cppMakeSeq.h" #include "cppParameterList.h" #include "cppInstance.h" #include "cppClassTemplateParameter.h" @@ -262,6 +263,7 @@ pop_struct() { %token KW_INT %token KW_LONG %token KW_LONGLONG +%token KW_MAKE_SEQ %token KW_MUTABLE %token KW_NAMESPACE %token KW_NEW @@ -471,6 +473,11 @@ declaration: | KW_PRIVATE ':' { current_scope->set_current_vis(V_private); +} + | KW_MAKE_SEQ '(' name ',' name ',' name ')' ';' +{ + CPPMakeSeq *make_seq = new CPPMakeSeq($3->get_simple_name(), $5->get_simple_name(), $7->get_simple_name(), @1.file); + current_scope->add_declaration(make_seq, global_scope, current_lexer, @1); } ; diff --git a/dtool/src/cppparser/cppDeclaration.cxx b/dtool/src/cppparser/cppDeclaration.cxx index 1c94ccaf18..fcc60903ca 100644 --- a/dtool/src/cppparser/cppDeclaration.cxx +++ b/dtool/src/cppparser/cppDeclaration.cxx @@ -356,6 +356,16 @@ as_type_proxy() { return (CPPTypeProxy *)NULL; } +//////////////////////////////////////////////////////////////////// +// Function: CPPDeclaration::as_make_seq +// Access: Public, Virtual +// Description: +//////////////////////////////////////////////////////////////////// +CPPMakeSeq *CPPDeclaration:: +as_make_seq() { + return (CPPMakeSeq *)NULL; +} + //////////////////////////////////////////////////////////////////// // Function: CPPDeclaration::is_equal diff --git a/dtool/src/cppparser/cppDeclaration.h b/dtool/src/cppparser/cppDeclaration.h index 1deb9278fb..f4f6474013 100644 --- a/dtool/src/cppparser/cppDeclaration.h +++ b/dtool/src/cppparser/cppDeclaration.h @@ -47,6 +47,7 @@ class CPPExtensionType; class CPPStructType; class CPPEnumType; class CPPTypeProxy; +class CPPMakeSeq; class CPPClassTemplateParameter; class CPPTBDType; class CPPScope; @@ -68,6 +69,7 @@ public: ST_type, ST_namespace, ST_using, + ST_make_seq, // Subtypes of CPPType ST_simple, @@ -134,6 +136,7 @@ public: virtual CPPEnumType *as_enum_type(); virtual CPPTBDType *as_tbd_type(); virtual CPPTypeProxy *as_type_proxy(); + virtual CPPMakeSeq *as_make_seq(); CPPVisibility _vis; CPPTemplateScope *_template_scope; diff --git a/dtool/src/cppparser/cppExpression.cxx b/dtool/src/cppparser/cppExpression.cxx index c06927681d..7dd2f18833 100644 --- a/dtool/src/cppparser/cppExpression.cxx +++ b/dtool/src/cppparser/cppExpression.cxx @@ -30,7 +30,7 @@ #include //////////////////////////////////////////////////////////////////// -// Function: CPPExpresion::Result::Constructor +// Function: CPPExpression::Result::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// @@ -40,7 +40,7 @@ Result() { } //////////////////////////////////////////////////////////////////// -// Function: CPPExpresion::Result::Constructor +// Function: CPPExpression::Result::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// @@ -51,7 +51,7 @@ Result(int value) { } //////////////////////////////////////////////////////////////////// -// Function: CPPExpresion::Result::Constructor +// Function: CPPExpression::Result::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// @@ -62,7 +62,7 @@ Result(double value) { } //////////////////////////////////////////////////////////////////// -// Function: CPPExpresion::Result::Constructor +// Function: CPPExpression::Result::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// @@ -74,7 +74,7 @@ Result(void *value) { //////////////////////////////////////////////////////////////////// -// Function: CPPExpresion::Result::as_integer +// Function: CPPExpression::Result::as_integer // Access: Public // Description: //////////////////////////////////////////////////////////////////// @@ -99,7 +99,7 @@ as_integer() const { } //////////////////////////////////////////////////////////////////// -// Function: CPPExpresion::Result::as_real +// Function: CPPExpression::Result::as_real // Access: Public // Description: //////////////////////////////////////////////////////////////////// @@ -124,7 +124,7 @@ as_real() const { } //////////////////////////////////////////////////////////////////// -// Function: CPPExpresion::Result::as_pointer +// Function: CPPExpression::Result::as_pointer // Access: Public // Description: //////////////////////////////////////////////////////////////////// @@ -148,7 +148,7 @@ as_pointer() const { } //////////////////////////////////////////////////////////////////// -// Function: CPPExpresion::Result::output +// Function: CPPExpression::Result::output // Access: Public // Description: //////////////////////////////////////////////////////////////////// @@ -177,7 +177,7 @@ output(ostream &out) const { } //////////////////////////////////////////////////////////////////// -// Function: CPPExpresion::Constructor +// Function: CPPExpression::Constructor // Access: Public // Description: //////////////////////////////////////////////////////////////////// diff --git a/dtool/src/cppparser/cppMakeSeq.cxx b/dtool/src/cppparser/cppMakeSeq.cxx new file mode 100644 index 0000000000..db3207c58a --- /dev/null +++ b/dtool/src/cppparser/cppMakeSeq.cxx @@ -0,0 +1,61 @@ +// Filename: cppMakeSeq.cxx +// Created by: drose (06Nov08) +// +//////////////////////////////////////////////////////////////////// +// +// PANDA 3D SOFTWARE +// Copyright (c) Carnegie Mellon University. All rights reserved. +// +// All use of this software is subject to the terms of the revised BSD +// license. You should have received a copy of this license along +// with this source code in a file named "LICENSE." +// +//////////////////////////////////////////////////////////////////// + +#include "cppMakeSeq.h" + +//////////////////////////////////////////////////////////////////// +// Function: CPPMakeSeq::Constructor +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +CPPMakeSeq:: +CPPMakeSeq(const string &seq_name, const string &num_name, + const string &element_name, const CPPFile &file) : + CPPDeclaration(file), + _seq_name(seq_name), + _num_name(num_name), + _element_name(element_name) +{ +} + +//////////////////////////////////////////////////////////////////// +// Function: CPPMakeSeq::output +// Access: Public, Virtual +// Description: +//////////////////////////////////////////////////////////////////// +void CPPMakeSeq:: +output(ostream &out, int indent_level, CPPScope *scope, bool complete) const { + out << "__make_seq(" << _seq_name << ", " << _num_name << ", " + << _element_name << ");"; +} + +//////////////////////////////////////////////////////////////////// +// Function: CPPMakeSeq::get_subtype +// Access: Public, Virtual +// Description: +//////////////////////////////////////////////////////////////////// +CPPDeclaration::SubType CPPMakeSeq:: +get_subtype() const { + return ST_make_seq; +} + +//////////////////////////////////////////////////////////////////// +// Function: CPPMakeSeq::as_make_seq +// Access: Public, Virtual +// Description: +//////////////////////////////////////////////////////////////////// +CPPMakeSeq *CPPMakeSeq:: +as_make_seq() { + return this; +} diff --git a/dtool/src/cppparser/cppMakeSeq.h b/dtool/src/cppparser/cppMakeSeq.h new file mode 100644 index 0000000000..0016617c69 --- /dev/null +++ b/dtool/src/cppparser/cppMakeSeq.h @@ -0,0 +1,48 @@ +// Filename: cppMakeSeq.h +// Created by: drose (06Nov08) +// +//////////////////////////////////////////////////////////////////// +// +// PANDA 3D SOFTWARE +// Copyright (c) Carnegie Mellon University. All rights reserved. +// +// All use of this software is subject to the terms of the revised BSD +// license. You should have received a copy of this license along +// with this source code in a file named "LICENSE." +// +//////////////////////////////////////////////////////////////////// + +#ifndef CPPMAKESEQ_H +#define CPPMAKESEQ_H + +#include "dtoolbase.h" + +#include "cppDeclaration.h" + +/////////////////////////////////////////////////////////////////// +// Class : CPPMakeSeq +// Description : This is a MAKE_SEQ() declaration appearing within a +// class body. It means to generate a sequence method +// within Python, replacing (for instance) +// get_num_nodes()/get_node(n) with a synthetic +// get_nodes() method. +//////////////////////////////////////////////////////////////////// +class CPPMakeSeq : public CPPDeclaration { +public: + CPPMakeSeq(const string &seq_name, const string &num_name, + const string &element_name, const CPPFile &file); + + virtual void output(ostream &out, int indent_level, CPPScope *scope, + bool complete) const; + + virtual SubType get_subtype() const; + virtual CPPMakeSeq *as_make_seq(); + + string _seq_name; + string _num_name; + string _element_name; +}; + +#endif + + diff --git a/dtool/src/cppparser/cppParser_composite1.cxx b/dtool/src/cppparser/cppParser_composite1.cxx index 99ec39a2b0..f14b966480 100644 --- a/dtool/src/cppparser/cppParser_composite1.cxx +++ b/dtool/src/cppparser/cppParser_composite1.cxx @@ -4,6 +4,7 @@ #include "cppCommentBlock.cxx" #include "cppConstType.cxx" #include "cppDeclaration.cxx" +#include "cppMakeSeq.cxx" #include "cppParameterList.cxx" #include "cppParser.cxx" #include "cppPointerType.cxx" diff --git a/dtool/src/cppparser/cppPreprocessor.cxx b/dtool/src/cppparser/cppPreprocessor.cxx index e2e475a26a..cd47e27fe2 100644 --- a/dtool/src/cppparser/cppPreprocessor.cxx +++ b/dtool/src/cppparser/cppPreprocessor.cxx @@ -1976,6 +1976,7 @@ check_keyword(const string &name) { if (name == "inline") return KW_INLINE; if (name == "int") return KW_INT; if (name == "long") return KW_LONG; + if (name == "__make_seq") return KW_MAKE_SEQ; if (name == "mutable") return KW_MUTABLE; if (name == "namespace") return KW_NAMESPACE; if (name == "new") return KW_NEW; diff --git a/dtool/src/dtoolbase/dtoolbase.h b/dtool/src/dtoolbase/dtoolbase.h index d44d8b7a3d..a415c257fa 100644 --- a/dtool/src/dtoolbase/dtoolbase.h +++ b/dtool/src/dtoolbase/dtoolbase.h @@ -291,11 +291,13 @@ #define BEGIN_PUBLISH __begin_publish #define END_PUBLISH __end_publish #define BLOCKING __blocking +#define MAKE_SEQ(seq_name, num_name, element_name) __make_seq(seq_name, num_name, element_name) #undef USE_STL_ALLOCATOR // Don't try to parse these template classes in interrogate. #else #define BEGIN_PUBLISH #define END_PUBLISH #define BLOCKING +#define MAKE_SEQ(seq_name, num_name, element_name) #endif #ifdef __cplusplus diff --git a/dtool/src/interrogate/functionRemap.cxx b/dtool/src/interrogate/functionRemap.cxx index 87a6a45ff9..8b10053544 100644 --- a/dtool/src/interrogate/functionRemap.cxx +++ b/dtool/src/interrogate/functionRemap.cxx @@ -48,6 +48,7 @@ FunctionRemap(const InterrogateType &itype, const InterrogateFunction &ifunc, _first_true_parameter = 0; _num_default_parameters = num_default_parameters; _type = T_normal; + _flags = 0; _wrapper_index = 0; _return_value_needs_management = false; @@ -446,6 +447,8 @@ setup_properties(const InterrogateFunction &ifunc, InterfaceMaker *interface_mak _blocking = true; } + string fname = _cppfunc->get_simple_name(); + if (_cpptype != (CPPType *)NULL && ((_cppfunc->_storage_class & CPPInstance::SC_static) == 0) && _type != T_constructor) { @@ -469,7 +472,6 @@ setup_properties(const InterrogateFunction &ifunc, InterfaceMaker *interface_mak // Also check the name of the function. If it's one of the // assignment-style operators, flag it as such. - string fname = _cppfunc->get_simple_name(); if (fname == "operator =" || fname == "operator *=" || fname == "operator /=" || @@ -592,5 +594,39 @@ setup_properties(const InterrogateFunction &ifunc, InterfaceMaker *interface_mak _return_value_destructor = builder.get_destructor_for(return_meat_type); } + // Check for a special meaning by name and signature. + if (_type == T_normal) { + int first_param = 0; + if (_has_this) { + first_param = 1; + } + + if (fname == "operator []" || fname == "__getitem__") { + _flags |= F_getitem; + if (_has_this && _parameters.size() == 2) { + if (TypeManager::is_integer(_parameters[1]._remap->get_new_type())) { + // It receives a single int parameter. + _flags |= F_getitem_int; + } + } + + } else if (fname == "__setitem__") { + _flags |= F_setitem; + if (_has_this && _parameters.size() > 2) { + if (TypeManager::is_integer(_parameters[1]._remap->get_new_type())) { + // Its first parameter is an int parameter, presumably an index. + _flags |= F_setitem_int; + } + } + + } else if (fname == "size" || fname == "__len__") { + if (_parameters.size() == first_param && + TypeManager::is_integer(_return_type->get_new_type())) { + // It receives no parameters, and returns an integer. + _flags |= F_size; + } + } + } + return true; } diff --git a/dtool/src/interrogate/functionRemap.h b/dtool/src/interrogate/functionRemap.h index 0013e431dd..44e08f96c1 100644 --- a/dtool/src/interrogate/functionRemap.h +++ b/dtool/src/interrogate/functionRemap.h @@ -75,7 +75,15 @@ public: T_assignment_method, T_typecast, T_getter, - T_setter + T_setter, + }; + + enum Flags { + F_getitem = 0x0001, + F_getitem_int = 0x0002, + F_size = 0x0004, + F_setitem = 0x0008, + F_setitem_int = 0x0010, }; typedef vector Parameters; @@ -90,6 +98,7 @@ public: int _first_true_parameter; int _num_default_parameters; Type _type; + int _flags; string _expression; string _function_signature; string _hash; diff --git a/dtool/src/interrogate/interfaceMaker.cxx b/dtool/src/interrogate/interfaceMaker.cxx index 92cbcf1b1c..69918d64b0 100644 --- a/dtool/src/interrogate/interfaceMaker.cxx +++ b/dtool/src/interrogate/interfaceMaker.cxx @@ -35,6 +35,8 @@ #include "interrogateElement.h" #include "cppFunctionType.h" #include "cppParameterList.h" +#include "cppMakeSeq.h" +#include "cppStructType.h" #include "pnotify.h" InterrogateType dummy_type; @@ -54,6 +56,7 @@ Function(const string &name, _ifunc(ifunc) { _has_this = false; + _flags = 0; } //////////////////////////////////////////////////////////////////// @@ -68,6 +71,20 @@ InterfaceMaker::Function:: delete (*ri); } } + +//////////////////////////////////////////////////////////////////// +// Function: InterfaceMaker::MakeSeq::Constructor +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +InterfaceMaker::MakeSeq:: +MakeSeq(const string &name, CPPMakeSeq *cpp_make_seq) : + _name(name), + _seq_name(cpp_make_seq->_seq_name), + _num_name(cpp_make_seq->_num_name), + _element_name(cpp_make_seq->_element_name) +{ +} //////////////////////////////////////////////////////////////////// // Function: InterfaceMaker::Object::Constructor @@ -76,7 +93,8 @@ InterfaceMaker::Function:: //////////////////////////////////////////////////////////////////// InterfaceMaker::Object:: Object(const InterrogateType &itype) : - _itype(itype) + _itype(itype), + _protocol_types(0) { } @@ -89,6 +107,58 @@ InterfaceMaker::Object:: ~Object() { } +//////////////////////////////////////////////////////////////////// +// Function: InterfaceMaker::Object::check_protocols +// Access: Public +// Description: To be called after all of the methods have been +// added, this checks which protocols this object +// appears to support (based on the methods it +// provides). +//////////////////////////////////////////////////////////////////// +void InterfaceMaker::Object:: +check_protocols() { + InterrogateDatabase *idb = InterrogateDatabase::get_ptr(); + + int flags = 0; + + Functions::const_iterator fi; + for (fi = _methods.begin(); fi != _methods.end(); ++fi) { + Function *func = (*fi); + flags |= func->_flags; + } + + if ((flags & (FunctionRemap::F_getitem_int | FunctionRemap::F_size)) == + (FunctionRemap::F_getitem_int | FunctionRemap::F_size)) { + // If we have both a getitem that receives an int, and a size, + // then we implement the sequence protocol: you can iterate + // through the elements of this object. + _protocol_types |= PT_sequence; + + } else if (flags & FunctionRemap::F_getitem) { + // If we have any getitem, then we implement the mapping protocol. + _protocol_types |= PT_mapping; + } + + // Now are there any make_seq requests within this class? + CPPStructType *stype = _itype._cpptype->as_struct_type(); + if (stype != (CPPStructType *)NULL) { + CPPScope *scope = stype->get_scope(); + if (scope != (CPPScope *)NULL) { + CPPScope::Declarations::iterator di; + for (di = scope->_declarations.begin(); di != scope->_declarations.end(); ++di) { + CPPMakeSeq *cpp_make_seq = (*di)->as_make_seq(); + if (cpp_make_seq != (CPPMakeSeq *)NULL) { + string class_name = _itype.get_scoped_name(); + string clean_name = InterrogateBuilder::clean_identifier(class_name); + string wrapper_name = "MakeSeq_" + clean_name + "_" + cpp_make_seq->_seq_name; + MakeSeq *make_seq = new MakeSeq(wrapper_name, cpp_make_seq); + _make_seqs.push_back(make_seq); + } + } + } + } +} + //////////////////////////////////////////////////////////////////// // Function: InterfaceMaker::Constructor // Access: Public @@ -548,6 +618,8 @@ record_function(const InterrogateType &itype, FunctionIndex func_index) { if (remap->_has_this) { func->_has_this = true; } + + func->_flags |= remap->_flags; // Make a wrapper for the function. FunctionWrapperIndex wrapper_index = @@ -655,6 +727,8 @@ record_object(TypeIndex type_index) { } } + object->check_protocols(); + int num_nested = itype.number_of_nested_types(); for (int ni = 0; ni < num_nested; ni++) { diff --git a/dtool/src/interrogate/interfaceMaker.h b/dtool/src/interrogate/interfaceMaker.h index 5cddd79591..680d6f97c6 100644 --- a/dtool/src/interrogate/interfaceMaker.h +++ b/dtool/src/interrogate/interfaceMaker.h @@ -58,7 +58,7 @@ public: virtual void write_module(ostream &out, ostream *out_h,InterrogateModuleDef *def); - virtual ParameterRemap * remap_parameter(CPPType *struct_type, CPPType *param_type); + virtual ParameterRemap *remap_parameter(CPPType *struct_type, CPPType *param_type); virtual bool synthesize_this_parameter(); virtual bool separate_overloading(); @@ -81,20 +81,39 @@ public: typedef vector Remaps; Remaps _remaps; bool _has_this; + int _flags; }; typedef vector Functions; Functions _functions; + class MakeSeq { + public: + MakeSeq(const string &name, CPPMakeSeq *cpp_make_seq); + + string _name; + string _seq_name; + string _num_name; + string _element_name; + }; + typedef vector MakeSeqs; + class Object { public: Object(const InterrogateType &itype); ~Object(); - void add_method(Function *method); + void check_protocols(); const InterrogateType &_itype; Functions _constructors; Functions _methods; + MakeSeqs _make_seqs; + + enum ProtocolTypes { + PT_sequence = 0x0001, + PT_mapping = 0x0002, + }; + int _protocol_types; }; typedef map Objects; Objects _objects; diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.cxx b/dtool/src/interrogate/interfaceMakerPythonNative.cxx index a523e8d7b3..8897e16629 100755 --- a/dtool/src/interrogate/interfaceMakerPythonNative.cxx +++ b/dtool/src/interrogate/interfaceMakerPythonNative.cxx @@ -98,9 +98,6 @@ RenameSet methodRenameDictionary[] = { { "operator ->" , "dereference", 0 }, { "operator <<=" , "__ilshift__", 1 }, { "operator >>=" , "__irshift__", 1 }, - { "__getitem__" , "__getitem__", 0 }, - { "__getattr__" , "__getattr__", 0 }, - { "__setattr__" , "__setattr__", 0 }, { "print" , "Cprint", 0 }, { "CInterval.set_t" , "_priv__cSetT", 0 }, { NULL, NULL, -1 } @@ -272,13 +269,7 @@ std::string nonClassNameFromCppName(const std::string &cppName_in) } /////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////// -std::string methodNameFromCppName(InterfaceMaker::Function *func, const std::string &className) -{ - std::string cppName = func->_ifunc.get_name(); - if (func->_ifunc.is_unary_op()) { - cppName += "unary"; - } - +std::string methodNameFromCppName(const std::string &cppName, const std::string &className) { std::string methodName; std::string badChars(" "); int nextCap = 0; @@ -325,6 +316,16 @@ std::string methodNameFromCppName(InterfaceMaker::Function *func, const std::st methodName = checkKeyword(methodName); return methodName; } + +std::string methodNameFromCppName(InterfaceMaker::Function *func, const std::string &className) +{ + std::string cppName = func->_ifunc.get_name(); + if (func->_ifunc.is_unary_op()) { + cppName += "unary"; + } + return methodNameFromCppName(cppName, className); +} + /////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////// @@ -360,215 +361,206 @@ bool isInplaceFunction(InterfaceMaker::Function *func) return false; } + //////////////////////////////////////////////////////////////////// -/// Function : GetSlotedFunctinDef +// Function: InterfaceMakerPythonNative::get_slotted_function_def +// Access: Private, Static +// Description: Determines whether this method should be mapped to +// one of Python's special slotted functions, those +// hard-coded functions that are assigned to particular +// function pointers within the object structure, for +// special functions like __getitem__ and __len__. // -// This function is used to define special behavior for class functions.. -// main use is to encode the slot pointer logic and function call -// conventions for the slaot interface.. +// Returns true if it has such a mapping, false if it is +// just a normal method. If it returns true, the +// SlottedFunctionDef structure is filled in with the +// important details. //////////////////////////////////////////////////////////////////// -bool GetSlotedFunctinDef(const std::string &thimputstring, std::string &answer_location, int &wraper_type) -{ - wraper_type = -1; +bool InterfaceMakerPythonNative:: +get_slotted_function_def(Object *obj, Function *func, SlottedFunctionDef &def) { + def._answer_location = string(); + def._wrapper_type = WT_none; - if(thimputstring.size() > 4 && thimputstring[0] == '_' && thimputstring[1] == '_') - { - if(thimputstring == "__add__") - { - answer_location = "tp_as_number->nb_add"; - wraper_type = 6; - return true; - } + string method_name = func->_ifunc.get_name(); + bool is_unary_op = func->_ifunc.is_unary_op(); - if(thimputstring == "__sub__") - { - answer_location = "tp_as_number->nb_subtract"; - wraper_type = 6; - return true; - } + if (method_name == "operator +") { + def._answer_location = "tp_as_number->nb_add"; + def._wrapper_type = WT_numeric_operator; + return true; + } - if(thimputstring == "__neg__") - { - answer_location = "tp_as_number->nb_negative"; - wraper_type = 2; - return true; - } + if (method_name == "operator -" && is_unary_op) { + def._answer_location = "tp_as_number->nb_negative"; + def._wrapper_type = WT_no_params; + return true; + } - if(thimputstring == "__mul__") - { - answer_location = "tp_as_number->nb_multiply"; - wraper_type = 6; - return true; - } + if (method_name == "operator -") { + def._answer_location = "tp_as_number->nb_subtract"; + def._wrapper_type = WT_numeric_operator; + return true; + } - if(thimputstring == "__div__") - { - answer_location = "tp_as_number->nb_divide"; - wraper_type = 6; - return true; - } + if (method_name == "operator *") { + def._answer_location = "tp_as_number->nb_multiply"; + def._wrapper_type = WT_numeric_operator; + return true; + } - if(thimputstring == "__mod__") - { - answer_location = "tp_as_number->nb_remainder"; - wraper_type = 6; - return true; - } + if (method_name == "operator /") { + def._answer_location = "tp_as_number->nb_divide"; + def._wrapper_type = WT_numeric_operator; + return true; + } - if(thimputstring == "__lshift__") - { - answer_location = "tp_as_number->nb_lshift"; - wraper_type = 6; - return true; - } + if (method_name == "operator %") { + def._answer_location = "tp_as_number->nb_remainder"; + def._wrapper_type = WT_numeric_operator; + return true; + } - if(thimputstring == "__rshift__") - { - answer_location = "tp_as_number->nb_rshift"; - wraper_type = 6; - return true; - } + if (method_name == "operator <<") { + def._answer_location = "tp_as_number->nb_lshift"; + def._wrapper_type = WT_numeric_operator; + return true; + } + if (method_name == "operator >>") { + def._answer_location = "tp_as_number->nb_rshift"; + def._wrapper_type = WT_numeric_operator; + return true; + } - if(thimputstring == "__xor__") - { - answer_location = "tp_as_number->nb_xor"; - wraper_type = 6; - return true; - } + if (method_name == "operator ^") { + def._answer_location = "tp_as_number->nb_xor"; + def._wrapper_type = WT_numeric_operator; + return true; + } - if(thimputstring == "__invert__") - { - answer_location = "tp_as_number->nb_invert"; - wraper_type = 2; - return true; - } + if (method_name == "operator ~" && is_unary_op) { + def._answer_location = "tp_as_number->nb_invert"; + def._wrapper_type = WT_no_params; + return true; + } + if (method_name == "operator &") { + def._answer_location = "tp_as_number->nb_and"; + def._wrapper_type = WT_numeric_operator; + return true; + } - if(thimputstring == "__and__") - { - answer_location = "tp_as_number->nb_and"; - wraper_type = 6; - return true; - } + if (method_name == "operator |") { + def._answer_location = "tp_as_number->nb_or"; + def._wrapper_type = WT_numeric_operator; + return true; + } - if(thimputstring == "__or__") - { - answer_location = "tp_as_number->nb_or"; - wraper_type = 6; - return true; - } + if (method_name == "operator +=") { + def._answer_location = "tp_as_number->nb_inplace_add"; + def._wrapper_type = WT_one_param; + return true; + } + if (method_name == "operator -=") { + def._answer_location = "tp_as_number->nb_inplace_subtract"; + def._wrapper_type = WT_one_param; + return true; + } - if(thimputstring == "__iadd__") - { - answer_location = "tp_as_number->nb_inplace_add"; - wraper_type = 3; - return true; - } + if (method_name == "operator *=") { + def._answer_location = "tp_as_number->nb_inplace_multiply"; + def._wrapper_type = WT_one_param; + return true; + } - if(thimputstring == "__isub__") - { - answer_location = "tp_as_number->nb_inplace_subtract"; - wraper_type = 3; - return true; - } + if (method_name == "operator /=") { + def._answer_location = "tp_as_number->nb_inplace_divide"; + def._wrapper_type = WT_one_param; + return true; + } - if(thimputstring == "__imul__") - { - answer_location = "tp_as_number->nb_inplace_multiply"; - wraper_type = 3; - return true; - } + if (method_name == "operator %=") { + def._answer_location = ".tp_as_number->nb_inplace_remainder"; + def._wrapper_type = WT_one_param; + return true; + } - if(thimputstring == "__idiv__") - { - answer_location = "tp_as_number->nb_inplace_divide"; - wraper_type = 3; - return true; - } + if (method_name == "operator <<=") { + def._answer_location = "tp_as_number->nb_inplace_lshift"; + def._wrapper_type = WT_one_param; + return true; + } - if(thimputstring == "__imod__") - { - answer_location = ".tp_as_number->nb_inplace_remainder"; - wraper_type = 3; - return true; - } + if (method_name == "operator >>=") { + def._answer_location = "tp_as_number->nb_inplace_rshift"; + def._wrapper_type = WT_one_param; + return true; + } + if (method_name == "operator &=") { + def._answer_location = "tp_as_number->nb_inplace_and"; + def._wrapper_type = WT_one_param; + return true; + } - if(thimputstring == "__ilshift__") - { - answer_location = "tp_as_number->nb_inplace_lshift"; - wraper_type = 3; - return true; - } + if (method_name == "operator ^=") { + def._answer_location = "tp_as_number->nb_inplace_xor"; + def._wrapper_type = WT_one_param; + return true; + } - if(thimputstring == "__irshift__") - { - answer_location = "tp_as_number->nb_inplace_rshift"; - wraper_type = 3; - return true; - } - - if(thimputstring == "__iand__") - { - answer_location = "tp_as_number->nb_inplace_and"; - wraper_type = 3; - return true; - } - - if(thimputstring == "__ixor__") - { - answer_location = "tp_as_number->nb_inplace_xor"; - wraper_type = 3; - return true; - } - - if(thimputstring == "__int__") - { - answer_location = "tp_as_number->nb_int"; - wraper_type = 2; - return true; - } - -// if(thimputstring == "__coerce__") -// { -// answer_location = "tp_as_number->nb_coerce"; -// return true; -// } - - // mapping methods - if(thimputstring == "__getitem__") - { - answer_location = "tp_as_mapping->mp_subscript"; - wraper_type = 3; - return true; - } - - //Direct methods - if(thimputstring == "__call__") - { - answer_location = "tp_call"; - //wraper_type = 1; - return true; - } - - if(thimputstring == "__getattr__") - { - answer_location = "tp_getattro"; - wraper_type = 5; - return true; - } - - if(thimputstring == "__setattr__") - { - answer_location = "tp_setattro"; - wraper_type = 4; - return true; - } + if (obj->_protocol_types & Object::PT_sequence) { + if (func->_flags & FunctionRemap::F_getitem_int) { + def._answer_location = "tp_as_sequence->sq_item"; + def._wrapper_type = WT_sequence_getitem; + return true; } - return false; -}; + if (func->_flags & FunctionRemap::F_setitem_int) { + def._answer_location = "tp_as_sequence->sq_ass_item"; + def._wrapper_type = WT_sequence_setitem; + return true; + } + if (func->_flags & FunctionRemap::F_size) { + def._answer_location = "tp_as_sequence->sq_length"; + def._wrapper_type = WT_sequence_size; + return true; + } + } + + if (obj->_protocol_types & Object::PT_mapping) { + if (func->_flags & FunctionRemap::F_getitem) { + def._answer_location = "tp_as_mapping->mp_subscript"; + def._wrapper_type = WT_one_param; + return true; + } + if (func->_flags & FunctionRemap::F_setitem) { + def._answer_location = "tp_as_mapping->mp_ass_subscript"; + def._wrapper_type = WT_mapping_setitem; + return true; + } + } + + if (method_name == "operator ()") { + def._answer_location = "tp_call"; + def._wrapper_type = WT_none; + return true; + } + + if (method_name == "__getattr__") { + def._answer_location = "tp_getattro"; + def._wrapper_type = WT_getattr; + return true; + } + + if (method_name == "__setattr__") { + def._answer_location = "tp_setattro"; + def._wrapper_type = WT_setattr; + return true; + } + + return false; +} /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// @@ -772,7 +764,7 @@ void InterfaceMakerPythonNative::write_prototypes_class(ostream &out_code,ostrea { Function *func = (*fi); std::string fname = "int Dtool_Init_"+ClassName+"(PyObject *self, PyObject *args, PyObject *kwds)"; - write_prototype_for_name(out_code, func,fname); + write_prototype_for_name(out_code, obj, func,fname); } */ @@ -799,7 +791,7 @@ void InterfaceMakerPythonNative::write_functions(ostream &out) { Function *func = (*fi); if(!func->_itype.is_global() && isFunctionLegal(func)) - write_function_for_top(out, func,""); + write_function_for_top(out, NULL, func,""); } Objects::iterator oi; @@ -850,19 +842,18 @@ void InterfaceMakerPythonNative::write_ClasseDetails(ostream &out, Object * obj) Function *func = (*fi); if( (func)) { - string answer_location; - int wrapper_type; - GetSlotedFunctinDef( methodNameFromCppName(func, export_class_name), answer_location, wrapper_type); + SlottedFunctionDef def; + get_slotted_function_def(obj, func, def); ostringstream GetThis; GetThis << " "<_make_seqs.begin(); msi != obj->_make_seqs.end(); ++msi) { + write_make_seq(out, obj, ClassName, *msi); + } + + CPPType *cpptype = TypeManager::resolve_type(obj->_itype._cpptype); std::map< string ,CastDetails > details; std::map< string ,CastDetails >::iterator di; - builder.get_type(TypeManager::unwrap(TypeManager::resolve_type(obj->_itype._cpptype)),false); - GetValideChildClasses(details,obj->_itype._cpptype->as_struct_type()); + builder.get_type(TypeManager::unwrap(cpptype),false); + GetValideChildClasses(details, cpptype->as_struct_type()); for(di = details.begin(); di != details.end(); di++) { //InterrogateType ptype =idb->get_type(di->first); @@ -1185,47 +1182,47 @@ write_module_class(ostream &out, Object *obj) { std::map static_functions; std::map normal_Operator_functions; - std::map > wraped_Operator_functions; + std::map wraped_Operator_functions; // function Table int x; - for (x = 0, fi = obj->_methods.begin(); fi != obj->_methods.end(); ++fi,x++) - { - Function *func = (*fi); - std::string temp0; - int temp1; - if(!GetSlotedFunctinDef( methodNameFromCppName(func,export_calss_name),temp0,temp1)) - { - - out << " { \"" << methodNameFromCppName(func,export_calss_name) << "\",(PyCFunction ) &" - << func->_name << ", METH_VARARGS| METH_KEYWORDS ," << func->_name << "_comment},\n"; - if(!isFunctionWithThis(func)) - static_functions[x] = func; + for (x = 0, fi = obj->_methods.begin(); fi != obj->_methods.end(); ++fi,x++) { + Function *func = (*fi); + SlottedFunctionDef slotted_def; + if (!get_slotted_function_def(obj, func, slotted_def)) { + out << " { \"" << methodNameFromCppName(func,export_calss_name) << "\",(PyCFunction ) &" + << func->_name << ", METH_VARARGS| METH_KEYWORDS ," << func->_name << "_comment},\n"; + if(!isFunctionWithThis(func)) { + static_functions[x] = func; + } + + } else { + if (slotted_def._wrapper_type != WT_none) { + wraped_Operator_functions[func] = slotted_def; + + out << " { \"" << methodNameFromCppName(func,export_calss_name) << "\",(PyCFunction ) &" + << func->_name << ", METH_VARARGS| METH_KEYWORDS ," << func->_name << "_comment},\n"; + if (!isFunctionWithThis(func)) { + static_functions[x] = func; } - else - { - if(temp1 > 0) - { - wraped_Operator_functions[func] = std::pair< std::string, int>(temp0,temp1); - - out << " { \"" << methodNameFromCppName(func,export_calss_name) << "\",(PyCFunction ) &" - << func->_name << ", METH_VARARGS| METH_KEYWORDS ," << func->_name << "_comment},\n"; - if(!isFunctionWithThis(func)) - static_functions[x] = func; - - } - else - { - normal_Operator_functions[func] = temp0; - - out << " { \"" << methodNameFromCppName(func,export_calss_name) << "\",(PyCFunction ) &" - << func->_name << ", METH_VARARGS| METH_KEYWORDS ," << func->_name << "_comment},\n"; - if(!isFunctionWithThis(func)) - static_functions[x] = func; - } + + } else { + normal_Operator_functions[func] = slotted_def._answer_location; + + out << " { \"" << methodNameFromCppName(func,export_calss_name) << "\",(PyCFunction ) &" + << func->_name << ", METH_VARARGS| METH_KEYWORDS ," << func->_name << "_comment},\n"; + if (!isFunctionWithThis(func)) { + static_functions[x] = func; } + } } + } - + MakeSeqs::iterator msi; + for (msi = obj->_make_seqs.begin(); msi != obj->_make_seqs.end(); ++msi) { + out << " { \"" + << methodNameFromCppName((*msi)->_seq_name, export_calss_name) + << "\",(PyCFunction) &" << (*msi)->_name << ", METH_NOARGS, NULL},\n"; + } out << " { NULL, NULL }\n" << "};\n\n"; @@ -1270,95 +1267,186 @@ write_module_class(ostream &out, Object *obj) { { - std::map >::iterator rfi; // wraped_Operator_functions; - for(rfi = wraped_Operator_functions.begin(); rfi != wraped_Operator_functions.end(); rfi++) - { - if(rfi->second.second == 1) - { - Function *func = rfi->first; - out << "//////////////////\n"; - out << "// Required TO Convert the calling Conventions.. \n"; - out << "// " <second.first <<" = "<< methodNameFromCppName(func,export_calss_name) <<"\n"; - out << "//////////////////\n"; - out << "static PyObject * " << func->_name << methodNameFromCppName(func,export_calss_name) << "( PyObject * self, PyObject * args, PyObject *dict)\n"; - out << "{\n"; - out << " return "<< func->_name <<"(self,args);\n"; - out << "}\n\n"; - } - else if(rfi->second.second == 2) - { - Function *func = rfi->first; - out << "//////////////////\n"; - out << "// Required TO Convert the calling Conventions.. \n"; - out << "// " <second.first <<" = "<< methodNameFromCppName(func,export_calss_name) <<"\n"; - out << "//////////////////\n"; - out << "static PyObject * " << func->_name << methodNameFromCppName(func,export_calss_name) << "( PyObject * self)\n"; - out << "{\n"; - out << " return "<< func->_name <<"(self,Py_None,Py_None);\n"; - out << "}\n\n"; - } + std::map::iterator rfi; // wraped_Operator_functions; + for(rfi = wraped_Operator_functions.begin(); rfi != wraped_Operator_functions.end(); rfi++) { + switch (rfi->second._wrapper_type) { + case WT_no_params: + // PyObject *func(PyObject *self) + { + Function *func = rfi->first; + out << "//////////////////\n"; + out << "// A wrapper function to satisfy Python's internal calling conventions. \n"; + out << "// " <second._answer_location <<" = "<< methodNameFromCppName(func,export_calss_name) <<"\n"; + out << "//////////////////\n"; + out << "static PyObject * " << func->_name << methodNameFromCppName(func,export_calss_name) << "( PyObject * self)\n"; + out << "{\n"; + out << " PyObject *args = Py_BuildValue(\"()\");\n"; + out << " PyObject *result = " << func->_name <<"(self, args, NULL);\n"; + out << " Py_DECREF(args);\n"; + out << " return result;\n"; + out << "}\n\n"; + } + break; + + case WT_one_param: + case WT_numeric_operator: + // PyObject *func(PyObject *self, PyObject *one) + { + Function *func = rfi->first; + out << "//////////////////\n"; + out << "// A wrapper function to satisfy Python's internal calling conventions. \n"; + out << "// " <second._answer_location <<" = "<< methodNameFromCppName(func,export_calss_name) <<"\n"; + out << "//////////////////\n"; + out << "static PyObject *" << func->_name << methodNameFromCppName(func,export_calss_name) << "(PyObject *self, PyObject *one)\n"; + out << "{\n"; + out << " PyObject *args = Py_BuildValue(\"(O)\", one);\n"; + out << " PyObject *result = " << func->_name <<"(self, args, NULL);\n"; + out << " Py_DECREF(args);\n"; + out << " return result;\n"; + out << "}\n\n"; + } + break; - if(rfi->second.second == 3 || rfi->second.second == 6) - { - Function *func = rfi->first; - out << "//////////////////\n"; - out << "// Required TO Convert the calling Conventions.. \n"; - out << "// " <second.first <<" = "<< methodNameFromCppName(func,export_calss_name) <<"\n"; - out << "//////////////////\n"; - out << "static PyObject * " << func->_name << methodNameFromCppName(func,export_calss_name) << "( PyObject * self, PyObject * args)\n"; - out << "{\n"; - out << " return "<< func->_name <<"(self,args,Py_None);\n"; - out << "}\n\n"; - } + case WT_setattr: + // int func(PyObject *self, PyObject *one, PyObject *two = NULL) + { + Function *func = rfi->first; + out << "//////////////////\n"; + out << "// A wrapper function to satisfy Python's internal calling conventions. \n"; + out << "// " <second._answer_location <<" = "<< methodNameFromCppName(func,export_calss_name) <<"\n"; + out << "//////////////////\n"; + out << "static int " << func->_name << methodNameFromCppName(func,export_calss_name) << "( PyObject * self, PyObject * one, PyObject * two)\n"; + out << "{\n"; + out << " PyObject *args;\n"; + out << " if (two == NULL) {\n"; + out << " args = Py_BuildValue(\"(O)\", one);\n"; + out << " } else {\n"; + out << " args = Py_BuildValue(\"(OO)\", one, two);\n"; + out << " }\n"; + out << " PyObject *py_result = " << func->_name <<"(self, args, NULL);\n"; + out << " Py_DECREF(args);\n"; + out << " if (py_result == NULL) return -1;\n"; + out << " int result = PyInt_AsLong(py_result);\n"; + out << " Py_DECREF(py_result);\n"; + out << " return result;\n"; + out << "}\n\n"; + } + break; - if(rfi->second.second == 4) - { - // __setattr__. int func(PyObject *self, PyObject *one, PyObject *two = NULL) - Function *func = rfi->first; - out << "//////////////////\n"; - out << "// Required TO Convert the calling Conventions.. \n"; - out << "// " <second.first <<" = "<< methodNameFromCppName(func,export_calss_name) <<"\n"; - out << "//////////////////\n"; - out << "static int " << func->_name << methodNameFromCppName(func,export_calss_name) << "( PyObject * self, PyObject * one, PyObject * two)\n"; - out << "{\n"; - out << " PyObject *args;\n"; - out << " if (two == NULL) {\n"; - out << " args = PyTuple_Pack(1, one);\n"; - out << " } else {\n"; - out << " args = PyTuple_Pack(2, one, two);\n"; - out << " }\n"; - out << " PyObject *py_result = " << func->_name <<"(self, args, NULL);\n"; - out << " Py_DECREF(args);\n"; - out << " if (py_result == NULL) return -1;\n"; - out << " int result = PyInt_AsLong(py_result);\n"; - out << " Py_DECREF(py_result);\n"; - out << " return result;\n"; - out << "}\n\n"; - } + case WT_getattr: + // PyObject *func(PyObject *self, PyObject *one) + // Specifically to implement __getattr__. + // With special handling to pass up to + // PyObject_GenericGetAttr() if it returns NULL. + { + Function *func = rfi->first; + out << "//////////////////\n"; + out << "// A wrapper function to satisfy Python's internal calling conventions. \n"; + out << "// " <second._answer_location <<" = "<< methodNameFromCppName(func,export_calss_name) <<"\n"; + out << "//////////////////\n"; + out << "static PyObject * " << func->_name << methodNameFromCppName(func,export_calss_name) << "( PyObject * self, PyObject * one)\n"; + out << "{\n"; + out << " PyObject *args = Py_BuildValue(\"(O)\", one);\n"; + out << " PyObject *result = " << func->_name <<"(self, args, NULL);\n"; + out << " Py_DECREF(args);\n"; + out << " if (result == NULL) {\n"; + out << " PyErr_Clear();\n"; + out << " return PyObject_GenericGetAttr(self, one);\n"; + out << " }\n"; + out << " return result;\n"; + out << "}\n\n"; + } + break; - if(rfi->second.second == 5) - { - // Specifically to implement __getattr__. - // PyObject *func(PyObject *self, PyObject *one) - // With special handling to pass up to - // PyObject_GenericGetAttr() if it returns NULL. - Function *func = rfi->first; - out << "//////////////////\n"; - out << "// Required TO Convert the calling Conventions.. \n"; - out << "// " <second.first <<" = "<< methodNameFromCppName(func,export_calss_name) <<"\n"; - out << "//////////////////\n"; - out << "static PyObject * " << func->_name << methodNameFromCppName(func,export_calss_name) << "( PyObject * self, PyObject * one)\n"; - out << "{\n"; - out << " PyObject *result = " << func->_name <<"(self, one, NULL);\n"; - out << " if (result == NULL) {\n"; - out << " PyErr_Clear();\n"; - out << " return PyObject_GenericGetAttr(self, one);\n"; - out << " }\n"; - out << " return result;\n"; - out << "}\n\n"; - } + case WT_sequence_getitem: + // PyObject *func(PyObject *self, Py_ssize_t index) + { + Function *func = rfi->first; + out << "//////////////////\n"; + out << "// A wrapper function to satisfy Python's internal calling conventions. \n"; + out << "// " <second._answer_location <<" = "<< methodNameFromCppName(func,export_calss_name) <<"\n"; + out << "//////////////////\n"; + out << "static PyObject * " << func->_name << methodNameFromCppName(func,export_calss_name) << "( PyObject * self, Py_ssize_t index)\n"; + out << "{\n"; + out << " PyObject *args = Py_BuildValue(\"(i)\", index);\n"; + out << " PyObject *result = " << func->_name <<"(self, args, NULL);\n"; + out << " Py_DECREF(args);\n"; + out << " return result;\n"; + out << "}\n\n"; + } + break; + case WT_sequence_setitem: + // Py_ssize_t func(PyObject *self, Py_ssize_t index, PyObject *value) + { + Function *func = rfi->first; + out << "//////////////////\n"; + out << "// A wrapper function to satisfy Python's internal calling conventions. \n"; + out << "// " <second._answer_location <<" = "<< methodNameFromCppName(func,export_calss_name) <<"\n"; + out << "//////////////////\n"; + out << "static Py_ssize_t " << func->_name << methodNameFromCppName(func,export_calss_name) << "( PyObject * self, Py_ssize_t index, PyObject *value)\n"; + out << "{\n"; + out << " PyObject *args = Py_BuildValue(\"(iO)\", index, value);\n"; + out << " PyObject *result = " << func->_name <<"(self, args, NULL);\n"; + out << " Py_DECREF(args);\n"; + out << " if (result == NULL) {\n"; + out << " return -1;\n"; + out << " }\n"; + out << " Py_DECREF(result);\n"; + out << " return 0;\n"; + out << "}\n\n"; + } + break; + + case WT_sequence_size: + // Py_ssize_t func(PyObject *self) + { + Function *func = rfi->first; + out << "//////////////////\n"; + out << "// A wrapper function to satisfy Python's internal calling conventions. \n"; + out << "// " <second._answer_location <<" = "<< methodNameFromCppName(func,export_calss_name) <<"\n"; + out << "//////////////////\n"; + out << "static Py_ssize_t " << func->_name << methodNameFromCppName(func,export_calss_name) << "(PyObject *self)\n"; + out << "{\n"; + out << " PyObject *args = Py_BuildValue(\"()\");\n"; + out << " PyObject *result = "<< func->_name <<"(self, args, NULL);\n"; + out << " Py_DECREF(args);\n"; + out << " if (result == NULL) {\n"; + out << " return -1;\n"; + out << " }\n"; + out << " Py_ssize_t num = PyInt_AsSsize_t(result);\n"; + out << " Py_DECREF(result);\n"; + out << " return num;\n"; + out << "}\n\n"; + } + break; + + case WT_mapping_setitem: + // int func(PyObject *self, PyObject *one, PyObject *two) + { + Function *func = rfi->first; + out << "//////////////////\n"; + out << "// A wrapper function to satisfy Python's internal calling conventions. \n"; + out << "// " <second._answer_location <<" = "<< methodNameFromCppName(func,export_calss_name) <<"\n"; + out << "//////////////////\n"; + out << "static int " << func->_name << methodNameFromCppName(func,export_calss_name) << "( PyObject * self, PyObject * one, PyObject * two)\n"; + out << "{\n"; + out << " PyObject *args = Py_BuildValue(\"(OO)\", one, two);\n"; + out << " PyObject *result = " << func->_name <<"(self, args, NULL);\n"; + out << " Py_DECREF(args);\n"; + out << " if (result == NULL) {\n"; + out << " return -1;\n"; + out << " }\n"; + out << " Py_DECREF(result);\n"; + out << " return 0;\n"; + out << "}\n\n"; + } + break; + + case WT_none: + break; } + } if(HasAGetKeyFunction(obj->_itype)) { @@ -1519,12 +1607,12 @@ write_module_class(ostream &out, Object *obj) { // wraped functions... { - std::map >::iterator rfi; // wraped_Operator_functions; + std::map::iterator rfi; // wraped_Operator_functions; for(rfi = wraped_Operator_functions.begin(); rfi != wraped_Operator_functions.end(); rfi++) { Function *func = rfi->first; - out << " // " << rfi->second.first <<" = "<< methodNameFromCppName(func,export_calss_name) <<"\n"; - out << " Dtool_" << ClassName <<".As_PyTypeObject()." << rfi->second.first <<" = &" << func->_name << methodNameFromCppName(func,export_calss_name)<<";\n"; + out << " // " << rfi->second._answer_location <<" = "<< methodNameFromCppName(func,export_calss_name) <<"\n"; + out << " Dtool_" << ClassName <<".As_PyTypeObject()." << rfi->second._answer_location <<" = &" << func->_name << methodNameFromCppName(func,export_calss_name)<<";\n"; } } @@ -1712,19 +1800,20 @@ void InterfaceMakerPythonNative::write_prototype_for_name(ostream &out, Interfac // Description: Writes the definition for a function that will call // the indicated C++ function or method. //////////////////////////////////////////////////////////////////// -void InterfaceMakerPythonNative::write_function_for_top(ostream &out, InterfaceMaker::Function *func, const std::string &PreProcess) +void InterfaceMakerPythonNative::write_function_for_top(ostream &out, InterfaceMaker::Object *obj, InterfaceMaker::Function *func, const std::string &PreProcess) { std::string fname = "static PyObject *"+func->_name+"(PyObject *self, PyObject *args,PyObject *kwds)"; - write_function_for_name(out,func,fname,PreProcess,""); + write_function_for_name(out,obj,func,fname,PreProcess,""); } + //////////////////////////////////////////////////////////////////// /// Function : write_function_for_name // // Wrap a complete name override function for Py..... //////////////////////////////////////////////////////////////////// void InterfaceMakerPythonNative:: -write_function_for_name(ostream &out1, InterfaceMaker::Function *func, +write_function_for_name(ostream &out1, InterfaceMaker::Object *obj, InterfaceMaker::Function *func, const std::string &function_name, const std::string &PreProcess, const std::string &ClassName) { @@ -1794,7 +1883,7 @@ write_function_for_name(ostream &out1, InterfaceMaker::Function *func, indent(out,4) << "case(" << mii->first << "):\n"; indent(out,8) << "{\n"; - write_function_forset(out,func,mii->second,expected_params,8,forward_decl,ClassName + function_name, is_inplace); + write_function_forset(out,obj,func,mii->second,expected_params,8,forward_decl,ClassName + function_name, is_inplace); if ((*mii->second.begin())->_type == FunctionRemap::T_constructor) { constructor = true; } @@ -1860,7 +1949,7 @@ write_function_for_name(ostream &out1, InterfaceMaker::Function *func, } else { string expected_params = ""; for (mii = MapSets.begin(); mii != MapSets.end(); mii ++) { - write_function_forset(out,func,mii->second,expected_params,4,forward_decl,ClassName + function_name,is_inplace); + write_function_forset(out,obj,func,mii->second,expected_params,4,forward_decl,ClassName + function_name,is_inplace); if((*mii->second.begin())->_type == FunctionRemap::T_constructor) { constructor = true; } @@ -2000,84 +2089,157 @@ std::vector< FunctionRemap * > SortFunctionSet(std::set< FunctionRemap *> &rema // // A set is defined as all remaps that have the same number of paramaters.. /////////////////////////////////////////////////////////// -void InterfaceMakerPythonNative::write_function_forset(ostream &out, InterfaceMaker::Function *func, - std::set< FunctionRemap *> &remapsin, string &expected_params, int indent_level,ostream &forward_decl, const std::string &functionname, bool is_inplace) -{ +void InterfaceMakerPythonNative:: +write_function_forset(ostream &out, InterfaceMaker::Object *obj, + InterfaceMaker::Function *func, + std::set< FunctionRemap *> &remapsin, + string &expected_params, int indent_level, + ostream &forward_decl, const std::string &functionname, + bool is_inplace) { + // Do we accept any parameters that are class objects? If so, we + // might need to check for parameter coercion. + bool coercion_possible = false; + std::set::const_iterator sii; + for (sii = remapsin.begin(); sii != remapsin.end() && !coercion_possible; ++sii) { + FunctionRemap *remap = (*sii); + if (isRemapLegal(*remap)) { + int pn = 0; + if (remap->_has_this) { + // Skip the "this" parameter. It's never coerceable. + ++pn; + } + while (pn < (int)remap->_parameters.size()) { + CPPType *type = remap->_parameters[pn]._remap->get_new_type(); - if(remapsin.size() > 1) - { -// printf("---------------------------- Start Sort ----- %s , %s\n",func->_name.c_str(),functionname.c_str()); - std::vector remaps = SortFunctionSet(remapsin); - - std::vector::iterator sii; - for(sii = remaps.begin(); sii != remaps.end(); sii ++) - { - FunctionRemap *remap = (*sii); - if(isRemapLegal(*remap)) - { - if (remap->_has_this && !remap->_const_method) { - // If it's a non-const method, we only allow a - // non-const this. - indent(out,indent_level) - << "if (!((Dtool_PyInstDef *)self)->_is_const) {\n"; - } else { - indent(out, indent_level) - << "{\n"; - } - - indent(out,indent_level) << " // -2 " ; - remap->write_orig_prototype(out, 0); out << "\n" ; - - write_function_instance(out, func, remap,expected_params,indent_level+4,false,forward_decl, func->_name, is_inplace); - - indent(out,indent_level+4)<< "PyErr_Clear(); \n"; - indent(out,indent_level)<< "}\n\n"; - } + if (TypeManager::is_char_pointer(type)) { + } else if (TypeManager::is_pointer_to_PyObject(type)) { + } else if (TypeManager::is_pointer(type)) { + // This is a pointer to an object, so we + // might be able to coerce a parameter to it. + coercion_possible = true; + break; } + ++pn; + } } - else - { - std::set::iterator sii; - for(sii = remapsin.begin(); sii != remapsin.end(); sii ++) - { - FunctionRemap *remap = (*sii); - if(isRemapLegal(*remap)) { - if (remap->_has_this && !remap->_const_method) { - // If it's a non-const method, we only allow a - // non-const this. - indent(out, indent_level) - << "if (!((Dtool_PyInstDef *)self)->_is_const) {\n"; - } else { - indent(out, indent_level) - << "{\n"; - } + } - indent(out,indent_level + 2) - << "// 1-" ;remap->write_orig_prototype(out, 0); out << "\n" ; - write_function_instance(out, func, remap,expected_params,indent_level+4,true,forward_decl, func->_name, is_inplace); + if (coercion_possible) { + // These objects keep track of whether we have attempted automatic + // parameter coercion. + indent(out, indent_level) + << "{\n"; + indent_level += 2; + indent(out,indent_level) + << "PyObject *coerced = NULL;\n"; + indent(out,indent_level) + << "PyObject **coerced_ptr = NULL;\n"; + indent(out,indent_level) + << "while (true) {\n"; + indent_level += 2; + } + + if (remapsin.size() > 1) { + // There are multiple different overloads for this number of + // parameters. Sort them all into order from most-specific to + // least-specific, then try them one at a time. + std::vector remaps = SortFunctionSet(remapsin); - if (remap->_has_this && !remap->_const_method) { - indent(out, indent_level) - << "} else {\n"; - indent(out, indent_level + 2) - << "PyErr_SetString(PyExc_TypeError,\n"; - string class_name = remap->_cpptype->get_simple_name(); - indent(out, indent_level + 2) - << " \"Cannot call " - << classNameFromCppName(class_name) - << "." << methodNameFromCppName(func, class_name) - << "() on a const object.\");\n"; - indent(out, indent_level + 2) - << "return (PyObject *) NULL;\n"; - indent(out,indent_level) - << "}\n\n"; - } else { - indent(out,indent_level) - << "}\n\n"; - } - } + std::vector::iterator sii; + for (sii = remaps.begin(); sii != remaps.end(); sii ++) { + FunctionRemap *remap = (*sii); + if(isRemapLegal(*remap)) { + if (remap->_has_this && !remap->_const_method) { + // If it's a non-const method, we only allow a + // non-const this. + indent(out,indent_level) + << "if (!((Dtool_PyInstDef *)self)->_is_const) {\n"; + } else { + indent(out, indent_level) + << "{\n"; } + + indent(out,indent_level) << " // -2 " ; + remap->write_orig_prototype(out, 0); out << "\n" ; + + write_function_instance(out, obj, func, remap,expected_params,indent_level+4,false,forward_decl, func->_name, is_inplace, coercion_possible); + + indent(out,indent_level+4)<< "PyErr_Clear(); \n"; + indent(out,indent_level)<< "}\n\n"; + } } + } else { + // There is only one possible overload with this number of + // parameters. Just call it. + std::set::iterator sii; + for(sii = remapsin.begin(); sii != remapsin.end(); sii ++) { + FunctionRemap *remap = (*sii); + if (isRemapLegal(*remap)) { + if (remap->_has_this && !remap->_const_method) { + // If it's a non-const method, we only allow a + // non-const this. + indent(out, indent_level) + << "if (!((Dtool_PyInstDef *)self)->_is_const) {\n"; + } else { + indent(out, indent_level) + << "{\n"; + } + + indent(out,indent_level + 2) + << "// 1-" ; + remap->write_orig_prototype(out, 0); + out << "\n" ; + write_function_instance(out, obj, func, remap,expected_params,indent_level+4,true,forward_decl, func->_name, is_inplace, coercion_possible); + + if (remap->_has_this && !remap->_const_method) { + indent(out, indent_level) + << "} else {\n"; + indent(out, indent_level + 2) + << "PyErr_SetString(PyExc_TypeError,\n"; + string class_name = remap->_cpptype->get_simple_name(); + indent(out, indent_level + 2) + << " \"Cannot call " + << classNameFromCppName(class_name) + << "." << methodNameFromCppName(func, class_name) + << "() on a const object.\");\n"; + indent(out, indent_level + 2) + << "return (PyObject *) NULL;\n"; + indent(out,indent_level) + << "}\n\n"; + } else { + indent(out,indent_level) + << "}\n\n"; + } + } + } + } + + // Now we've tried all of the possible overloads, and had no luck. + + if (coercion_possible) { + // Try again, this time with coercion enabled. + indent(out,indent_level) + << "if (coerced_ptr != NULL) {\n"; + indent(out,indent_level + 2) + << "break;\n"; + indent(out,indent_level) + << "}\n"; + + indent(out,indent_level) + << "PyErr_Clear();\n"; + indent(out,indent_level) + << "coerced_ptr = &coerced;\n"; + + indent_level -= 2; + indent(out,indent_level) + << "}\n"; + + indent(out,indent_level) + << "Py_XDECREF(coerced);\n"; + indent_level -= 2; + indent(out,indent_level) + << "}\n"; + } } @@ -2087,9 +2249,14 @@ void InterfaceMakerPythonNative::write_function_forset(ostream &out, InterfaceMa // Description: Writes out the particular function that handles a // single instance of an overloaded function. //////////////////////////////////////////////////////////////////// -void InterfaceMakerPythonNative::write_function_instance(ostream &out, InterfaceMaker::Function *func1, - FunctionRemap *remap, string &expected_params, int indent_level, bool errors_fatal, ostream &ForwardDeclrs, const std::string &functionnamestr, bool is_inplace) -{ +void InterfaceMakerPythonNative:: +write_function_instance(ostream &out, InterfaceMaker::Object *obj, + InterfaceMaker::Function *func1, + FunctionRemap *remap, string &expected_params, + int indent_level, bool errors_fatal, + ostream &ForwardDeclrs, + const std::string &functionnamestr, bool is_inplace, + bool coercion_possible) { string format_specifiers; std::string keyword_list; string parameter_list; @@ -2253,6 +2420,15 @@ void InterfaceMakerPythonNative::write_function_instance(ostream &out, Interface InterrogateDatabase *idb = InterrogateDatabase::get_ptr(); const InterrogateType &p_itype = idb->get_type(p_type_index); + bool is_copy_constructor = false; + if (is_constructor && remap->_parameters.size() == 1 && pn == 0) { + if (&p_itype == &obj->_itype) { + // If this is the only one parameter, and it's the same as + // the "this" type, this is a copy constructor. + is_copy_constructor = true; + } + } + //make_safe_name(itype.get_scoped_name()) extra_convert += p_itype.get_scoped_name()+" *" + param_name + "_this = ("+p_itype.get_scoped_name()+" *)"; // need to a forward scope for this class.. @@ -2273,7 +2449,15 @@ void InterfaceMakerPythonNative::write_function_instance(ostream &out, Interface << ", &Dtool_" << make_safe_name(p_itype.get_scoped_name()) << ", " << pn << ", \"" << method_prefix << methodNameFromCppName(func1, class_name) - << "\", " << const_ok << ");\n"; + << "\", " << const_ok; + if (coercion_possible && !is_copy_constructor) { + // We never attempt to coerce a copy constructor parameter. + // That would lead to infinite recursion. + str << ", coerced_ptr"; + } else { + str << ", NULL"; + } + str << ");\n"; extra_convert += str.str(); extra_param_check += "|| (" + param_name + "_this == NULL)"; @@ -2295,6 +2479,10 @@ void InterfaceMakerPythonNative::write_function_instance(ostream &out, Interface if (remap->_has_this && pn == 0) { container = "local_this"; + if (remap->_const_method) { + string class_name = remap->_cpptype->get_local_name(&parser); + container = "(const " + class_name + "*)local_this"; + } } else { out << ";\n"; } @@ -2352,6 +2540,28 @@ void InterfaceMakerPythonNative::write_function_instance(ostream &out, Interface <<"{\n"; extra_indent_level+=4; } + + if ((remap->_flags & (FunctionRemap::F_getitem_int | FunctionRemap::F_setitem_int)) && + (obj != (Object *)NULL && (obj->_protocol_types & Object::PT_sequence))) { + // This is a getitem or setitem of a sequence type. This means we + // *need* to raise IndexError if we're out of bounds. We have to + // assume the bounds are 0 .. this->size() (this is the same + // assumption that Python makes). + string pexpr_string = pexprs[1]; + indent(out, extra_indent_level) + << "if ((" << pexpr_string << ") < 0 || (" << pexpr_string << ") >= (" + << container << ")->size()) {\n"; + if (coercion_possible) { + indent(out, extra_indent_level + 2) + << "Py_XDECREF(coerced);\n"; + } + indent(out, extra_indent_level + 2) + << "PyErr_SetString(PyExc_IndexError, \"Out of bounds.\");\n"; + indent(out, extra_indent_level + 2) + << "return NULL;\n"; + indent(out, extra_indent_level) + << "}\n"; + } if (!remap->_void_return && remap->_return_type->new_type_is_atomic_string()) { @@ -2409,6 +2619,10 @@ void InterfaceMakerPythonNative::write_function_instance(ostream &out, Interface } string return_expr = remap->call_function(out, extra_indent_level, true, container, pexprs); + if (coercion_possible) { + indent(out, extra_indent_level) + << "Py_XDECREF(coerced);\n"; + } if (return_expr.empty()) { if (track_interpreter) { indent(out,extra_indent_level) << "in_interpreter = 1;\n"; @@ -2498,7 +2712,7 @@ void InterfaceMakerPythonNative::pack_return_value(ostream &out, int indent_leve } else if(TypeManager::is_unsigned_integer(type)){ indent(out, indent_level) - << "return PyLong_FromUnsignedLong(" << return_expr << ");\n"; + << "return PyLongOrInt_FromUnsignedLong(" << return_expr << ");\n"; }else if (TypeManager::is_integer(type)) { indent(out, indent_level) @@ -2642,6 +2856,27 @@ void InterfaceMakerPythonNative::pack_return_value(ostream &out, int indent_leve } } +//////////////////////////////////////////////////////////////////// +// Function: InterfaceMakerPythonName::write_make_seq +// Access: Public +// Description: Generates the synthetic method described by the +// MAKE_SEQ() macro. +//////////////////////////////////////////////////////////////////// +void InterfaceMakerPythonNative:: +write_make_seq(ostream &out, Object *obj, const std::string &ClassName, + MakeSeq *make_seq) { + out << "/******************************************************************\n" << " * Python make_seq wrapper\n"; + out << " *******************************************************************/\n"; + + out << "static PyObject *" << make_seq->_name + "(PyObject *self, PyObject *) {\n"; + string num_name = methodNameFromCppName(make_seq->_num_name, ClassName); + string element_name = methodNameFromCppName(make_seq->_element_name, ClassName); + + out << " return make_list_for_item(self, \"" << num_name + << "\", \"" << element_name << "\");\n"; + out << "}\n"; +} + //////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////// // Function: InterfaceMakerPythonNative::record_object @@ -2751,6 +2986,8 @@ InterfaceMaker::Object *InterfaceMakerPythonNative::record_object(TypeIndex type } } + object->check_protocols(); + int num_nested = itype.number_of_nested_types(); for (int ni = 0; ni < num_nested; ni++) { diff --git a/dtool/src/interrogate/interfaceMakerPythonNative.h b/dtool/src/interrogate/interfaceMakerPythonNative.h index 4e679cb622..21f0d04b36 100755 --- a/dtool/src/interrogate/interfaceMakerPythonNative.h +++ b/dtool/src/interrogate/interfaceMakerPythonNative.h @@ -30,89 +30,114 @@ class FunctionRemap; class InterfaceMakerPythonNative : public InterfaceMakerPython { public: - InterfaceMakerPythonNative(InterrogateModuleDef *def); - virtual ~InterfaceMakerPythonNative(); - - - virtual void write_prototypes(ostream &out,ostream *out_h); - void write_prototypes_class(ostream &out,ostream *out_h, Object * obj) ; - void write_prototypes_class_external(ostream &out, Object * obj); - - virtual void write_functions(ostream &out); - - virtual void write_module(ostream &out,ostream *out_h, InterrogateModuleDef *def); - virtual void write_module_support(ostream &out, ostream *out_h,InterrogateModuleDef *moduledefdef); - - void write_module_class(ostream &out, Object *cls); - virtual void write_sub_module(ostream &out, Object *obj); - - virtual bool synthesize_this_parameter(); - - virtual Object *record_object(TypeIndex type_index); - + InterfaceMakerPythonNative(InterrogateModuleDef *def); + virtual ~InterfaceMakerPythonNative(); + + + virtual void write_prototypes(ostream &out,ostream *out_h); + void write_prototypes_class(ostream &out,ostream *out_h, Object * obj) ; + void write_prototypes_class_external(ostream &out, Object * obj); + + virtual void write_functions(ostream &out); + + virtual void write_module(ostream &out,ostream *out_h, InterrogateModuleDef *def); + virtual void write_module_support(ostream &out, ostream *out_h,InterrogateModuleDef *moduledefdef); + + void write_module_class(ostream &out, Object *cls); + virtual void write_sub_module(ostream &out, Object *obj); + + virtual bool synthesize_this_parameter(); + + virtual Object *record_object(TypeIndex type_index); + protected: - virtual string get_wrapper_prefix(); - virtual string get_unique_prefix(); - virtual void record_function_wrapper(InterrogateFunction &ifunc, - FunctionWrapperIndex wrapper_index); - - virtual void generate_wrappers(); - + virtual string get_wrapper_prefix(); + virtual string get_unique_prefix(); + virtual void record_function_wrapper(InterrogateFunction &ifunc, + FunctionWrapperIndex wrapper_index); + + virtual void generate_wrappers(); + private: - void write_prototype_for_name(ostream &out, Function *func, const std::string &name); - void write_prototype_for(ostream &out, Function *func); - void write_function_for_name(ostream &out, Function *func, const std::string &name, const std::string &PreProcess, const std::string &ClassName); - void write_function_for_top(ostream &out, Function *func, const std::string &PreProcess); - void write_function_instance(ostream &out, Function *func, - FunctionRemap *remap , string &expected_params, int indent_level, bool errors_fatal, ostream &forwarddecl, const std::string &functionnamestr, bool inplace ) ; + // This enum defines the various prototypes that must be generated + // for the specialty functions that Python requires, especially for + // the slotted functions. + enum WrapperType { + WT_none, + WT_no_params, + WT_one_param, + WT_numeric_operator, + WT_setattr, + WT_getattr, + WT_sequence_getitem, + WT_sequence_setitem, + WT_sequence_size, + WT_mapping_setitem, + }; - void write_function_forset(ostream &out, InterfaceMaker::Function *func, - std::set< FunctionRemap *> &remaps, string &expected_params, int indent_level , ostream &forwarddecl,const std::string &functionname, bool inplace) ; + class SlottedFunctionDef { + public: + string _answer_location; + WrapperType _wrapper_type; + }; - void pack_return_value(ostream &out, int indent_level, - FunctionRemap *remap, std::string return_expr , ostream &forwarddecl, bool in_place); - - void pack_return_value_tnit(ostream &out, int indent_level, - FunctionRemap *remap, string return_expr) ; - - void write_class_prototypes(ostream &out) ; - void write_ClasseDeclarations(ostream &out , ostream *out_h,Object * obj); - void write_ClasseDetails(ostream &out, Object * obj); - - void do_assert_init(ostream &out, int indent_level, bool constructor) const; + static bool get_slotted_function_def(Object *obj, Function *func, SlottedFunctionDef &def); + + void write_prototype_for_name(ostream &out, Function *func, const std::string &name); + void write_prototype_for(ostream &out, Function *func); + void write_function_for_name(ostream &out, Object *obj, Function *func, const std::string &name, const std::string &PreProcess, const std::string &ClassName); + void write_function_for_top(ostream &out, Object *obj, Function *func, const std::string &PreProcess); + void write_function_instance(ostream &out, Object *obj, Function *func, + FunctionRemap *remap, string &expected_params, + int indent_level, bool errors_fatal, + ostream &forwarddecl, const std::string &functionnamestr, + bool is_inplace, bool coercion_possible); + + void write_function_forset(ostream &out, Object *obj, Function *func, + std::set< FunctionRemap *> &remaps, string &expected_params, int indent_level , ostream &forwarddecl,const std::string &functionname, bool inplace) ; + + void pack_return_value(ostream &out, int indent_level, + FunctionRemap *remap, std::string return_expr , ostream &forwarddecl, bool in_place); + + void write_make_seq(ostream &out, Object *obj, const std::string &ClassName, + MakeSeq *make_seq); + + void write_class_prototypes(ostream &out) ; + void write_ClasseDeclarations(ostream &out , ostream *out_h,Object * obj); + void write_ClasseDetails(ostream &out, Object * obj); + + void do_assert_init(ostream &out, int indent_level, bool constructor) const; public: - bool isRemapLegal( FunctionRemap &remap); - bool isFunctionLegal( Function *func); - bool isCppTypeLegal(CPPType *ctype); - bool isExportThisRun(CPPType *ctype); - bool isExportThisRun(Function *func); - bool isFunctionWithThis( Function *func); - bool IsRunTimeTyped(const InterrogateType &itype); - - // comunicates the cast capabilites among methods.. - struct CastDetails - { - CPPStructType *_structType; - std::string _to_class_name; - std::string _up_cast_string; - bool _can_downcast; - bool _is_legal_py_class; - }; - - void GetValideChildClasses( std::map< std::string ,CastDetails > &answer, CPPStructType * inclass, const std::string &up_cast_seed = "", bool downcastposible = true); - bool DoesInheritFromIsClass( const CPPStructType * inclass, const std::string &name); - bool IsPandaTypedObject(CPPStructType * inclass) { return DoesInheritFromIsClass(inclass,"TypedObject"); }; - void WriteReturnInstance(ostream &out, int indent_level, std::string &return_expr, std::string &ows_memory_flag,const std::string &class_name, CPPType *ctype, bool inplace, const std::string &const_flag); - bool HasAGetKeyFunction(const InterrogateType &itype_class); - bool HasAGetClassTypeFunction(const InterrogateType &itype_class); - int NeedsAStrFunction(const InterrogateType &itype_class); - int NeedsAReprFunction(const InterrogateType &itype_class); - - void output_quoted(ostream &out, int indent_level, const std::string &str); - - // stash the forwad declarations for this compile pass.. - std::set< std::string > _external_imports; - + bool isRemapLegal( FunctionRemap &remap); + bool isFunctionLegal( Function *func); + bool isCppTypeLegal(CPPType *ctype); + bool isExportThisRun(CPPType *ctype); + bool isExportThisRun(Function *func); + bool isFunctionWithThis( Function *func); + bool IsRunTimeTyped(const InterrogateType &itype); + + // comunicates the cast capabilites among methods.. + struct CastDetails { + CPPStructType *_structType; + std::string _to_class_name; + std::string _up_cast_string; + bool _can_downcast; + bool _is_legal_py_class; + }; + + void GetValideChildClasses( std::map< std::string ,CastDetails > &answer, CPPStructType * inclass, const std::string &up_cast_seed = "", bool downcastposible = true); + bool DoesInheritFromIsClass( const CPPStructType * inclass, const std::string &name); + bool IsPandaTypedObject(CPPStructType * inclass) { return DoesInheritFromIsClass(inclass,"TypedObject"); }; + void WriteReturnInstance(ostream &out, int indent_level, std::string &return_expr, std::string &ows_memory_flag,const std::string &class_name, CPPType *ctype, bool inplace, const std::string &const_flag); + bool HasAGetKeyFunction(const InterrogateType &itype_class); + bool HasAGetClassTypeFunction(const InterrogateType &itype_class); + int NeedsAStrFunction(const InterrogateType &itype_class); + int NeedsAReprFunction(const InterrogateType &itype_class); + + void output_quoted(ostream &out, int indent_level, const std::string &str); + + // stash the forwad declarations for this compile pass.. + std::set< std::string > _external_imports; }; #endif diff --git a/dtool/src/interrogate/typeManager.cxx b/dtool/src/interrogate/typeManager.cxx index f45c3f177f..0f4d1f6130 100644 --- a/dtool/src/interrogate/typeManager.cxx +++ b/dtool/src/interrogate/typeManager.cxx @@ -375,6 +375,24 @@ is_const_ref_to_simple(CPPType *type) { } } +//////////////////////////////////////////////////////////////////// +// Function: TypeManager::is_ref_to_simple +// Access: Public, Static +// Description: Returns true if the indicated type is a non-const +// reference to something that a scripting language can +// handle directly as a concrete. +//////////////////////////////////////////////////////////////////// +bool TypeManager:: +is_ref_to_simple(CPPType *type) { + switch (type->get_subtype()) { + case CPPDeclaration::ST_reference: + return is_simple(type->as_reference_type()->_pointing_at); + + default: + return false; + } +} + //////////////////////////////////////////////////////////////////// // Function: TypeManager::is_pointable // Access: Public, Static diff --git a/dtool/src/interrogate/typeManager.h b/dtool/src/interrogate/typeManager.h index 33979120a8..9ec4c3f174 100644 --- a/dtool/src/interrogate/typeManager.h +++ b/dtool/src/interrogate/typeManager.h @@ -60,6 +60,7 @@ public: static bool is_simple(CPPType *type); static bool is_const_simple(CPPType *type); static bool is_const_ref_to_simple(CPPType *type); + static bool is_ref_to_simple(CPPType *type); static bool is_pointable(CPPType *type); static bool is_char(CPPType *type); static bool is_char_pointer(CPPType *type); diff --git a/dtool/src/interrogatedb/py_panda.cxx b/dtool/src/interrogatedb/py_panda.cxx index 340fffe0ee..0d491ab895 100644 --- a/dtool/src/interrogatedb/py_panda.cxx +++ b/dtool/src/interrogatedb/py_panda.cxx @@ -56,9 +56,91 @@ void DTOOL_Call_ExtractThisPointerForType(PyObject *self, Dtool_PyTypedObject * answer = NULL; }; +//////////////////////////////////////////////////////////////////// +// Function: attempt_coercion +// Description: A helper function for DTOOL_Call_GetPointerThisClass, +// below. This attempts to coerce the given object to +// the indicated Panda object, by creating a temporary +// instance of the required Panda object. If +// successful, returns the "this" pointer of the +// temporary object; otherwise, returns NULL. +//////////////////////////////////////////////////////////////////// +static void * +attempt_coercion(PyObject *self, Dtool_PyTypedObject *classdef, + PyObject **coerced) { + // The supplied parameter is not the required type. + if (coerced != NULL) { + // Attempt coercion: try to create a temporary instance of the + // required class using the supplied parameter. + PyObject *obj = PyObject_Call((PyObject *)classdef, self, NULL); + if (obj != NULL) { + // Well, whaddaya know? The supplied parameter(s) suited + // the object's constructor. Now we have a temporary object + // that we can pass to the function. + Dtool_PyTypedObject *my_type = ((Dtool_PyInstDef *)obj)->_My_Type; + void *result = my_type->_Dtool_UpcastInterface(obj, classdef); + if (result != NULL) { + // Successfully coerced. Store the newly-allocated + // pointer, so the caller can release the coerced object + // at his leisure. We store it in a list, so that other + // parameters can accumulate there too. + if ((*coerced) == NULL) { + (*coerced) = PyList_New(0); + } + PyList_Append(*coerced, obj); + return result; + } + // Some problem getting the C++ pointer from our created + // temporary object. Weird. + Py_DECREF(obj); + } + } + return NULL; +} + +//////////////////////////////////////////////////////////////////// +// Function: DTOOL_Call_GetPointerThisClass +// Description: Extracts the C++ pointer for an object, given its +// Python wrapper object, for passing as the parameter +// to a C++ function. +// +// self is the Python wrapper object in question. +// +// classdef is the Python class wrapper for the C++ +// class in which the this pointer should be returned. +// (This may require an upcast operation, if self is not +// already an instance of classdef.) +// +// param and function_name are used for error reporting +// only, and describe the particular function and +// parameter index for this parameter. +// +// const_ok is true if the function is declared const +// and can therefore be called with either a const or +// non-const "this" pointer, or false if the function is +// declared non-const, and can therefore be called with +// only a non-const "this" pointer. +// +// If coerced is non-NULL, parameter coercion will be +// attempted. This means the supplied parameter may not +// exactly match the required type, but will satisfy the +// require type's constructor; and we will create +// temporary object(s) of the required type instead. In +// this case, coerced is a pointer to a PyList that will +// be filled with these temporary objects. If coerced +// is a pointer to a NULL PyObject, a new PyList will be +// created on the first successful coercion. If coerced +// itself is NULL, parameter coercion will not be +// attempted. +// +// The return value is the C++ pointer that was +// extracted, or NULL if there was a problem (in which +// case the Python exception state will have been set). +//////////////////////////////////////////////////////////////////// void * DTOOL_Call_GetPointerThisClass(PyObject *self, Dtool_PyTypedObject *classdef, - int param, const string &function_name, bool const_ok) { + int param, const string &function_name, bool const_ok, + PyObject **coerced) { if (self != NULL) { if (DtoolCanThisBeAPandaInstance(self)) { Dtool_PyTypedObject *my_type = ((Dtool_PyInstDef *)self)->_My_Type; @@ -99,6 +181,14 @@ DTOOL_Call_GetPointerThisClass(PyObject *self, Dtool_PyTypedObject *classdef, } } else { + // The parameter was not a Panda type. Can we coerce it to the + // appropriate type, by creating a temporary object? + void *result = attempt_coercion(self, classdef, coerced); + if (result != NULL) { + return result; + } + + // Coercion failed. ostringstream str; str << function_name << "() argument " << param << " must be "; @@ -561,4 +651,42 @@ int DTOOL_PyObject_Compare(PyObject *v1, PyObject *v2) return 0; } + +PyObject *make_list_for_item(PyObject *self, const char *num_name, + const char *element_name) { + PyObject *num_result = PyObject_CallMethod(self, (char *)num_name, "()"); + if (num_result == NULL) { + return NULL; + } + Py_ssize_t num_elements = PyInt_AsSsize_t(num_result); + Py_DECREF(num_result); + + PyObject *list = PyList_New(num_elements); + for (int i = 0; i < num_elements; ++i) { + PyObject *element = PyObject_CallMethod(self, (char *)element_name, "(i)", i); + if (element == NULL) { + Py_DECREF(list); + return NULL; + } + PyList_SetItem(list, i, element); + } + return list; +} + +//////////////////////////////////////////////////////////////////// +// Function: PyLongOrInt_FromUnsignedLong +// Description: Similar to PyLong_FromUnsignedLong(), but returns +// either a regular integer or a long integer, according +// to whether the indicated value will fit. +//////////////////////////////////////////////////////////////////// +EXPCL_DTOOLCONFIG PyObject * +PyLongOrInt_FromUnsignedLong(unsigned long value) { + if ((long)value < 0) { + return PyLong_FromUnsignedLong(value); + } else { + return PyInt_FromLong((long)value); + } +} + + #endif // HAVE_PYTHON diff --git a/dtool/src/interrogatedb/py_panda.h b/dtool/src/interrogatedb/py_panda.h index 66cf88b388..1a5e472660 100755 --- a/dtool/src/interrogatedb/py_panda.h +++ b/dtool/src/interrogatedb/py_panda.h @@ -55,6 +55,15 @@ #undef HAVE_LONG_LONG #endif +#if PY_VERSION_HEX < 0x02050000 + +// Prior to Python 2.5, we didn't have Py_ssize_t. +typedef int Py_ssize_t; +#define PyInt_FromSsize_t PyInt_FromLong +#define PyInt_AsSsize_t PyInt_AsLong + +#endif // PY_VERSION_HEX + using namespace std; #define PY_PANDA_SMALLER_FOOTPRINT 1 @@ -189,6 +198,16 @@ static PyNumberMethods Dtool_PyNumberMethods_##CLASS_NAME ={\ 0,/*binaryfunc nb_inplace_floor_divide*/\ 0,/*binaryfunc nb_inplace_true_divide*/\ };\ +static PySequenceMethods Dtool_PySequenceMethods_##CLASS_NAME ={\ + 0,/*lenfunc sq_length */\ + 0,/*binaryfunc sq_concat */\ + 0,/*ssizeargfunc sq_repeat */\ + 0,/*ssizeargfunc sq_item */\ + 0,/*ssizeargfunc sq_ass_item */\ + 0,/*objobjproc sq_contains */\ + 0,/*binaryfunc sq_inplace_concat */\ + 0,/*ssizeargfunc sq_inplace_repeat */\ +};\ static PyMappingMethods Dtool_PyMappingMethods_##CLASS_NAME ={\ 0,/*inquiry mp_length */\ 0,/*binaryfunc mp_subscript */\ @@ -207,8 +226,8 @@ EXPORT_THIS Dtool_PyTypedObject Dtool_##CLASS_NAME = {\ 0, /*tp_setattr*/\ 0, /*tp_compare*/\ 0, /*tp_repr*/\ - &Dtool_PyNumberMethods_##CLASS_NAME, /*tp_as_number*/\ - 0, /*tp_as_sequence*/\ + &Dtool_PyNumberMethods_##CLASS_NAME, /*tp_as_number*/\ + &Dtool_PySequenceMethods_##CLASS_NAME, /*tp_as_sequence*/\ &Dtool_PyMappingMethods_##CLASS_NAME, /*tp_as_mapping*/\ 0, /*tp_hash */\ 0, /* tp_call */\ @@ -326,7 +345,7 @@ EXPCL_DTOOLCONFIG bool DtoolCanThisBeAPandaInstance(PyObject *self); EXPCL_DTOOLCONFIG void DTOOL_Call_ExtractThisPointerForType(PyObject *self, Dtool_PyTypedObject * classdef, void ** answer); -EXPCL_DTOOLCONFIG void * DTOOL_Call_GetPointerThisClass(PyObject *self, Dtool_PyTypedObject *classdef, int param, const string &function_name, bool const_ok); +EXPCL_DTOOLCONFIG void * DTOOL_Call_GetPointerThisClass(PyObject *self, Dtool_PyTypedObject *classdef, int param, const string &function_name, bool const_ok, PyObject **coerced); EXPCL_DTOOLCONFIG void * DTOOL_Call_GetPointerThis(PyObject *self); @@ -495,6 +514,12 @@ EXPCL_DTOOLCONFIG int DTOOL_PyObject_Compare_old(PyObject *v1, PyObject *v2); EXPCL_DTOOLCONFIG int DTOOL_PyObject_Compare(PyObject *v1, PyObject *v2); +EXPCL_DTOOLCONFIG PyObject * +make_list_for_item(PyObject *self, const char *num_name, + const char *element_name); +EXPCL_DTOOLCONFIG PyObject * +PyLongOrInt_FromUnsignedLong(unsigned long value); + EXPCL_DTOOLCONFIG extern struct Dtool_PyTypedObject Dtool_DTOOL_SUPPER_BASE; #endif // HAVE_PYTHON diff --git a/dtool/src/pystub/pystub.cxx b/dtool/src/pystub/pystub.cxx index f3158139e6..8b38b39442 100644 --- a/dtool/src/pystub/pystub.cxx +++ b/dtool/src/pystub/pystub.cxx @@ -54,6 +54,7 @@ extern "C" { EXPCL_DTOOLCONFIG int PyList_Append(...); EXPCL_DTOOLCONFIG int PyList_AsTuple(...); EXPCL_DTOOLCONFIG int PyList_New(...); + EXPCL_DTOOLCONFIG int PyList_SetItem(...); EXPCL_DTOOLCONFIG int PyLong_AsLong(...); EXPCL_DTOOLCONFIG int PyLong_AsLongLong(...); EXPCL_DTOOLCONFIG int PyLong_AsUnsignedLong(...); @@ -68,6 +69,7 @@ extern "C" { EXPCL_DTOOLCONFIG int PyModule_AddObject(...); EXPCL_DTOOLCONFIG int PyNumber_Long(...); EXPCL_DTOOLCONFIG int PyObject_Call(...); + EXPCL_DTOOLCONFIG int PyObject_CallMethod(...); EXPCL_DTOOLCONFIG int PyObject_CallMethodObjArgs(...); EXPCL_DTOOLCONFIG int PyObject_CallObject(...); EXPCL_DTOOLCONFIG int PyObject_Cmp(...); @@ -120,8 +122,11 @@ extern "C" { EXPCL_DTOOLCONFIG int _Py_NegativeRefcount(...); EXPCL_DTOOLCONFIG int _Py_RefTotal(...); + EXPCL_DTOOLCONFIG int Py_IsInitialized(); + EXPCL_DTOOLCONFIG extern void *PyExc_AssertionError; EXPCL_DTOOLCONFIG extern void *PyExc_AttributeError; + EXPCL_DTOOLCONFIG extern void *PyExc_IndexError; EXPCL_DTOOLCONFIG extern void *PyExc_RuntimeError; EXPCL_DTOOLCONFIG extern void *PyExc_StopIteration; EXPCL_DTOOLCONFIG extern void *PyExc_TypeError; @@ -170,6 +175,7 @@ int PyInt_Type(...) { return 0; } int PyList_Append(...) { return 0; } int PyList_AsTuple(...) { return 0; } int PyList_New(...) { return 0; } +int PyList_SetItem(...) { return 0; } int PyLong_AsLong(...) { return 0; } int PyLong_AsLongLong(...) { return 0; } int PyLong_AsUnsignedLong(...) { return 0; } @@ -184,6 +190,7 @@ int PyModule_AddIntConstant(...) { return 0; }; int PyModule_AddObject(...) { return 0; }; int PyNumber_Long(...) { return 0; } int PyObject_Call(...) { return 0; } +int PyObject_CallMethod(...) { return 0; } int PyObject_CallMethodObjArgs(...) { return 0; } int PyObject_CallObject(...) { return 0; } int PyObject_Cmp(...) { return 0; } @@ -236,9 +243,15 @@ int _Py_Dealloc(...) { return 0; }; int _Py_NegativeRefcount(...) { return 0; }; int _Py_RefTotal(...) { return 0; }; +// We actually might call this one. +int Py_IsInitialized() { + return 0; +} + void *PyExc_AssertionError = (void *)NULL; void *PyExc_AttributeError = (void *)NULL; +void *PyExc_IndexError = (void *)NULL; void *PyExc_RuntimeError = (void *)NULL; void *PyExc_StopIteration = (void *)NULL; void *PyExc_TypeError = (void *)NULL; diff --git a/panda/src/chan/animControlCollection.h b/panda/src/chan/animControlCollection.h index a1a556d0d0..38be5b9407 100644 --- a/panda/src/chan/animControlCollection.h +++ b/panda/src/chan/animControlCollection.h @@ -46,6 +46,9 @@ PUBLISHED: int get_num_anims() const; AnimControl *get_anim(int n) const; string get_anim_name(int n) const; + MAKE_SEQ(get_anims, get_num_anims, get_anim); + MAKE_SEQ(get_anim_names, get_num_anims, get_anim_name); + void clear_anims(); // The following functions are convenience functions that vector diff --git a/panda/src/chan/animGroup.h b/panda/src/chan/animGroup.h index bba4b3c53a..e68ef2bde0 100644 --- a/panda/src/chan/animGroup.h +++ b/panda/src/chan/animGroup.h @@ -45,6 +45,8 @@ PUBLISHED: int get_num_children() const; AnimGroup *get_child(int n) const; + MAKE_SEQ(get_children, get_num_children, get_child); + AnimGroup *find_child(const string &name) const; public: diff --git a/panda/src/chan/partBundle.h b/panda/src/chan/partBundle.h index 7fa3458f68..4178505d1b 100644 --- a/panda/src/chan/partBundle.h +++ b/panda/src/chan/partBundle.h @@ -116,6 +116,7 @@ PUBLISHED: INLINE int get_num_nodes() const; INLINE PartBundleNode *get_node(int n) const; + MAKE_SEQ(get_nodes, get_num_nodes, get_node); void clear_control_effects(); INLINE void set_control_effect(AnimControl *control, float effect); diff --git a/panda/src/chan/partGroup.h b/panda/src/chan/partGroup.h index 96c54a5ddd..1f836010a9 100644 --- a/panda/src/chan/partGroup.h +++ b/panda/src/chan/partGroup.h @@ -72,6 +72,8 @@ PUBLISHED: int get_num_children() const; PartGroup *get_child(int n) const; + MAKE_SEQ(get_children, get_num_children, get_child); + PartGroup *find_child(const string &name) const; virtual bool apply_freeze(const TransformState *transform); diff --git a/panda/src/collide/collisionFloorMesh.I b/panda/src/collide/collisionFloorMesh.I index a946a59210..04599f8ff9 100755 --- a/panda/src/collide/collisionFloorMesh.I +++ b/panda/src/collide/collisionFloorMesh.I @@ -61,6 +61,11 @@ get_num_vertices() const { return _vertices.size(); } +INLINE const LPoint3f CollisionFloorMesh:: +get_vertex(unsigned int index) const { + return _vertices[index]; +} + INLINE const unsigned int CollisionFloorMesh:: get_num_triangles() const { return _triangles.size(); @@ -72,8 +77,3 @@ get_triangle(unsigned int index) const { return LPoint3d(tri.p1, tri.p2, tri.p3); } - -INLINE const LPoint3f CollisionFloorMesh:: -get_vertex(unsigned int index) const { - return _vertices[index]; -} diff --git a/panda/src/collide/collisionFloorMesh.h b/panda/src/collide/collisionFloorMesh.h index 312c45219d..df1c21f542 100755 --- a/panda/src/collide/collisionFloorMesh.h +++ b/panda/src/collide/collisionFloorMesh.h @@ -51,10 +51,12 @@ PUBLISHED: void add_triangle(unsigned int pointA, unsigned int pointB, unsigned int pointC); INLINE const unsigned int get_num_vertices() const; + INLINE const LPoint3f get_vertex(unsigned int index) const; + MAKE_SEQ(get_vertices, get_num_vertices, get_vertex); INLINE const unsigned int get_num_triangles() const; INLINE const LPoint3d get_triangle(unsigned int index) const; - INLINE const LPoint3f get_vertex(unsigned int index) const; - + MAKE_SEQ(get_triangles, get_num_triangles, get_triangle); + virtual LPoint3f get_collision_origin() const; public: diff --git a/panda/src/collide/collisionHandlerEvent.h b/panda/src/collide/collisionHandlerEvent.h index ec78d789a8..bc6db4169a 100644 --- a/panda/src/collide/collisionHandlerEvent.h +++ b/panda/src/collide/collisionHandlerEvent.h @@ -48,18 +48,21 @@ PUBLISHED: INLINE void set_in_pattern(const string &in_pattern); INLINE int get_num_in_patterns() const; INLINE string get_in_pattern(int n) const; + MAKE_SEQ(get_in_patterns, get_num_in_patterns, get_in_pattern); INLINE void clear_again_patterns(); INLINE void add_again_pattern(const string &again_pattern); INLINE void set_again_pattern(const string &again_pattern); INLINE int get_num_again_patterns() const; INLINE string get_again_pattern(int n) const; + MAKE_SEQ(get_again_patterns, get_num_again_patterns, get_again_pattern); INLINE void clear_out_patterns(); INLINE void add_out_pattern(const string &out_pattern); INLINE void set_out_pattern(const string &out_pattern); INLINE int get_num_out_patterns() const; INLINE string get_out_pattern(int n) const; + MAKE_SEQ(get_out_patterns, get_num_out_patterns, get_out_pattern); void clear(); void flush(); diff --git a/panda/src/collide/collisionHandlerQueue.h b/panda/src/collide/collisionHandlerQueue.h index 9f7d443ece..cd7160cbba 100644 --- a/panda/src/collide/collisionHandlerQueue.h +++ b/panda/src/collide/collisionHandlerQueue.h @@ -43,6 +43,7 @@ PUBLISHED: int get_num_entries() const; CollisionEntry *get_entry(int n) const; + MAKE_SEQ(get_entries, get_num_entries, get_entry); void output(ostream &out) const; void write(ostream &out, int indent_level = 0) const; diff --git a/panda/src/collide/collisionNode.h b/panda/src/collide/collisionNode.h index 23a8d82c33..d34d69657a 100644 --- a/panda/src/collide/collisionNode.h +++ b/panda/src/collide/collisionNode.h @@ -60,6 +60,7 @@ PUBLISHED: INLINE void clear_solids(); INLINE int get_num_solids() const; INLINE CPT(CollisionSolid) get_solid(int n) const; + MAKE_SEQ(get_solids, get_num_solids, get_solid); INLINE PT(CollisionSolid) modify_solid(int n); INLINE void set_solid(int n, CollisionSolid *solid); INLINE void remove_solid(int n); diff --git a/panda/src/collide/collisionPolygon.h b/panda/src/collide/collisionPolygon.h index 886b758e2e..78409d68e8 100644 --- a/panda/src/collide/collisionPolygon.h +++ b/panda/src/collide/collisionPolygon.h @@ -50,6 +50,7 @@ PUBLISHED: INLINE int get_num_points() const; INLINE LPoint3f get_point(int n) const; + MAKE_SEQ(get_points, get_num_points, get_point); INLINE static bool verify_points(const LPoint3f &a, const LPoint3f &b, const LPoint3f &c); diff --git a/panda/src/collide/collisionTraverser.h b/panda/src/collide/collisionTraverser.h index c0c117c86d..cc98ad43cd 100644 --- a/panda/src/collide/collisionTraverser.h +++ b/panda/src/collide/collisionTraverser.h @@ -59,6 +59,7 @@ PUBLISHED: bool has_collider(const NodePath &collider) const; int get_num_colliders() const; NodePath get_collider(int n) const; + MAKE_SEQ(get_colliders, get_num_colliders, get_collider); CollisionHandler *get_handler(const NodePath &collider) const; void clear_colliders(); diff --git a/panda/src/display/graphicsEngine.h b/panda/src/display/graphicsEngine.h index 1e77f055cf..d53539530f 100644 --- a/panda/src/display/graphicsEngine.h +++ b/panda/src/display/graphicsEngine.h @@ -93,6 +93,7 @@ PUBLISHED: bool is_empty() const; int get_num_windows() const; GraphicsOutput *get_window(int n) const; + MAKE_SEQ(get_windows, get_num_windows, get_window); BLOCKING void render_frame(); BLOCKING void open_windows(); diff --git a/panda/src/display/graphicsOutput.h b/panda/src/display/graphicsOutput.h index 5001eb135c..4559cf7be2 100644 --- a/panda/src/display/graphicsOutput.h +++ b/panda/src/display/graphicsOutput.h @@ -148,9 +148,11 @@ PUBLISHED: int get_num_display_regions() const; PT(DisplayRegion) get_display_region(int n) const; + MAKE_SEQ(get_display_regions, get_num_display_regions, get_display_region); int get_num_active_display_regions() const; PT(DisplayRegion) get_active_display_region(int n) const; + MAKE_SEQ(get_active_display_regions, get_num_active_display_regions, get_active_display_region); GraphicsOutput *make_texture_buffer( const string &name, int x_size, int y_size, diff --git a/panda/src/display/graphicsPipeSelection.h b/panda/src/display/graphicsPipeSelection.h index fae6c89d43..22db462022 100644 --- a/panda/src/display/graphicsPipeSelection.h +++ b/panda/src/display/graphicsPipeSelection.h @@ -41,6 +41,7 @@ protected: PUBLISHED: int get_num_pipe_types() const; TypeHandle get_pipe_type(int n) const; + MAKE_SEQ(get_pipe_types, get_num_pipe_types, get_pipe_type); void print_pipe_types() const; PT(GraphicsPipe) make_pipe(const string &type_name, diff --git a/panda/src/display/graphicsWindow.h b/panda/src/display/graphicsWindow.h index a880088170..ea158c8726 100644 --- a/panda/src/display/graphicsWindow.h +++ b/panda/src/display/graphicsWindow.h @@ -65,6 +65,7 @@ PUBLISHED: // Mouse and keyboard routines int get_num_input_devices() const; string get_input_device_name(int device) const; + MAKE_SEQ(get_input_device_names, get_num_input_devices, get_input_device_name); bool has_pointer(int device) const; bool has_keyboard(int device) const; diff --git a/panda/src/distort/nonlinearImager.h b/panda/src/distort/nonlinearImager.h index efe12f556d..8812bc0f2e 100644 --- a/panda/src/distort/nonlinearImager.h +++ b/panda/src/distort/nonlinearImager.h @@ -101,7 +101,10 @@ PUBLISHED: int get_num_screens() const; NodePath get_screen(int index) const; + MAKE_SEQ(get_screens, get_num_screens, get_screen); GraphicsOutput *get_buffer(int index) const; + MAKE_SEQ(get_buffers, get_num_screens, get_buffer); + void set_texture_size(int index, int width, int height); void set_source_camera(int index, const NodePath &source_camera); @@ -119,6 +122,7 @@ PUBLISHED: int get_num_viewers() const; DisplayRegion *get_viewer(int index) const; + MAKE_SEQ(get_viewers, get_num_viewers, get_viewer); NodePath get_dark_room() const; GraphicsEngine *get_graphics_engine() const; diff --git a/panda/src/downloader/httpChannel.I b/panda/src/downloader/httpChannel.I index b64d21cb76..b8ef6cdd3a 100644 --- a/panda/src/downloader/httpChannel.I +++ b/panda/src/downloader/httpChannel.I @@ -162,29 +162,29 @@ get_redirect() const { } //////////////////////////////////////////////////////////////////// -// Function: HTTPChannel::get_num_redirect_trail +// Function: HTTPChannel::get_num_redirect_steps // Access: Published // Description: If the document automatically followed one or more // redirects, this will return the number of redirects // that were automatically followed. Use -// get_redirect_trail() to retrieve each URL in +// get_redirect_step() to retrieve each URL in // sequence. //////////////////////////////////////////////////////////////////// INLINE int HTTPChannel:: -get_num_redirect_trail() const { +get_num_redirect_steps() const { return _redirect_trail.size(); } //////////////////////////////////////////////////////////////////// -// Function: HTTPChannel::get_redirect_trail +// Function: HTTPChannel::get_redirect_step // Access: Published -// Description: Use in conjunction with get_num_redirect_trail() to +// Description: Use in conjunction with get_num_redirect_steps() to // extract the chain of URL's that the channel was // automatically redirected through to arrive at the // final document. //////////////////////////////////////////////////////////////////// INLINE const URLSpec &HTTPChannel:: -get_redirect_trail(int n) const { +get_redirect_step(int n) const { nassertr(n >= 0 && n < (int)_redirect_trail.size(), _redirect_trail[0]); return _redirect_trail[n]; } diff --git a/panda/src/downloader/httpChannel.h b/panda/src/downloader/httpChannel.h index 68cf6eaa69..9964d0862b 100644 --- a/panda/src/downloader/httpChannel.h +++ b/panda/src/downloader/httpChannel.h @@ -111,8 +111,9 @@ PUBLISHED: INLINE const URLSpec &get_redirect() const; string get_header_value(const string &key) const; - INLINE int get_num_redirect_trail() const; - INLINE const URLSpec &get_redirect_trail(int n) const; + INLINE int get_num_redirect_steps() const; + INLINE const URLSpec &get_redirect_step(int n) const; + MAKE_SEQ(get_redirect_steps, get_num_redirect_steps, get_redirect_step); INLINE void set_persistent_connection(bool persistent_connection); INLINE bool get_persistent_connection() const; diff --git a/panda/src/egg/eggCompositePrimitive.h b/panda/src/egg/eggCompositePrimitive.h index 2ca56d16aa..389c2fbdcb 100644 --- a/panda/src/egg/eggCompositePrimitive.h +++ b/panda/src/egg/eggCompositePrimitive.h @@ -38,6 +38,7 @@ PUBLISHED: INLINE int get_num_components() const; INLINE const EggAttributes *get_component(int i) const; INLINE EggAttributes *get_component(int i); + MAKE_SEQ(get_components, get_num_components, get_component); INLINE void set_component(int i, const EggAttributes *attrib); INLINE bool triangulate_into(EggGroupNode *container) const; diff --git a/panda/src/egg/eggGroup.h b/panda/src/egg/eggGroup.h index f8276e7bc9..4147dcfcc7 100644 --- a/panda/src/egg/eggGroup.h +++ b/panda/src/egg/eggGroup.h @@ -195,6 +195,7 @@ PUBLISHED: INLINE void clear_object_types(); INLINE int get_num_object_types() const; INLINE string get_object_type(int index) const; + MAKE_SEQ(get_object_types, get_num_object_types, get_object_type); bool has_object_type(const string &object_type) const; bool remove_object_type(const string &object_type); @@ -288,6 +289,7 @@ PUBLISHED: void add_group_ref(EggGroup *group); int get_num_group_refs() const; EggGroup *get_group_ref(int n) const; + MAKE_SEQ(get_group_refs, get_num_group_refs, get_group_ref); void remove_group_ref(int n); void clear_group_refs(); diff --git a/panda/src/egg/eggNurbsCurve.h b/panda/src/egg/eggNurbsCurve.h index db238a42ca..a00a2a6e5e 100644 --- a/panda/src/egg/eggNurbsCurve.h +++ b/panda/src/egg/eggNurbsCurve.h @@ -48,6 +48,7 @@ PUBLISHED: bool is_closed() const; INLINE double get_knot(int k) const; + MAKE_SEQ(get_knots, get_num_knots, get_knot); virtual void write(ostream &out, int indent_level) const; diff --git a/panda/src/egg/eggNurbsSurface.h b/panda/src/egg/eggNurbsSurface.h index 09e6b53513..cc55d70730 100644 --- a/panda/src/egg/eggNurbsSurface.h +++ b/panda/src/egg/eggNurbsSurface.h @@ -70,7 +70,9 @@ PUBLISHED: bool is_closed_v() const; INLINE double get_u_knot(int k) const; + MAKE_SEQ(get_u_knots, get_num_u_knots, get_u_knot); INLINE double get_v_knot(int k) const; + MAKE_SEQ(get_v_knots, get_num_v_knots, get_v_knot); INLINE EggVertex *get_cv(int ui, int vi) const; virtual void write(ostream &out, int indent_level) const; diff --git a/panda/src/egg/eggPrimitive.h b/panda/src/egg/eggPrimitive.h index 1fab440e26..6e39efb4f5 100644 --- a/panda/src/egg/eggPrimitive.h +++ b/panda/src/egg/eggPrimitive.h @@ -98,6 +98,7 @@ PUBLISHED: INLINE void clear_texture(); INLINE int get_num_textures() const; INLINE EggTexture *get_texture(int n) const; + MAKE_SEQ(get_textures, get_num_textures, get_texture); INLINE void set_material(EggMaterial *material); INLINE void clear_material(); @@ -174,6 +175,7 @@ PUBLISHED: INLINE int get_num_vertices() const; INLINE void set_vertex(int index, EggVertex *vertex); INLINE EggVertex *get_vertex(int index) const; + MAKE_SEQ(get_vertices, get_num_vertices, get_vertex); INLINE EggVertexPool *get_pool() const; diff --git a/panda/src/egg/eggTextureCollection.h b/panda/src/egg/eggTextureCollection.h index 28cef4150a..f210b05ef0 100644 --- a/panda/src/egg/eggTextureCollection.h +++ b/panda/src/egg/eggTextureCollection.h @@ -63,6 +63,7 @@ PUBLISHED: bool is_empty() const; int get_num_textures() const; EggTexture *get_texture(int index) const; + MAKE_SEQ(get_textures, get_num_textures, get_texture); public: EggGroupNode::iterator insert_textures(EggGroupNode *node); diff --git a/panda/src/egg/eggVertexPool.h b/panda/src/egg/eggVertexPool.h index 71a861fd53..8bb424f33e 100644 --- a/panda/src/egg/eggVertexPool.h +++ b/panda/src/egg/eggVertexPool.h @@ -104,9 +104,10 @@ public: iterator begin() const; iterator end() const; bool empty() const; - size_type size() const; PUBLISHED: + size_type size() const; + // add_vertex() adds a freshly-allocated vertex. It is up to the // user to allocate the vertex. EggVertex *add_vertex(EggVertex *vertex, int index = -1); diff --git a/panda/src/event/asyncTaskCollection.cxx b/panda/src/event/asyncTaskCollection.cxx index 7f03158e71..c3daa797f5 100644 --- a/panda/src/event/asyncTaskCollection.cxx +++ b/panda/src/event/asyncTaskCollection.cxx @@ -270,6 +270,17 @@ operator [] (int index) const { return _tasks[index]; } +//////////////////////////////////////////////////////////////////// +// Function: AsyncTaskCollection::size +// Access: Published +// Description: Returns the number of tasks in the collection. This +// is the same thing as get_num_tasks(). +//////////////////////////////////////////////////////////////////// +int AsyncTaskCollection:: +size() const { + return _tasks.size(); +} + //////////////////////////////////////////////////////////////////// // Function: AsyncTaskCollection::output // Access: Published diff --git a/panda/src/event/asyncTaskCollection.h b/panda/src/event/asyncTaskCollection.h index fd9221d265..e3f99f67b6 100644 --- a/panda/src/event/asyncTaskCollection.h +++ b/panda/src/event/asyncTaskCollection.h @@ -46,8 +46,10 @@ PUBLISHED: int get_num_tasks() const; AsyncTask *get_task(int index) const; + MAKE_SEQ(get_tasks, get_num_tasks, get_task); void remove_task(int index); AsyncTask *operator [] (int index) const; + int size() const; void output(ostream &out) const; void write(ostream &out, int indent_level = 0) const; diff --git a/panda/src/event/asyncTaskManager.h b/panda/src/event/asyncTaskManager.h index 2f5cb7ed39..9581d511d5 100644 --- a/panda/src/event/asyncTaskManager.h +++ b/panda/src/event/asyncTaskManager.h @@ -66,6 +66,7 @@ PUBLISHED: int get_num_task_chains() const; AsyncTaskChain *get_task_chain(int n) const; + MAKE_SEQ(get_task_chains, get_num_task_chains, get_task_chain); AsyncTaskChain *make_task_chain(const string &name); AsyncTaskChain *find_task_chain(const string &name); BLOCKING bool remove_task_chain(const string &name); diff --git a/panda/src/event/event.h b/panda/src/event/event.h index e957716d89..5fb22e3343 100644 --- a/panda/src/event/event.h +++ b/panda/src/event/event.h @@ -49,6 +49,7 @@ PUBLISHED: int get_num_parameters() const; EventParameter get_parameter(int n) const; + MAKE_SEQ(get_parameters, get_num_parameters, get_parameter); bool has_receiver() const; EventReceiver *get_receiver() const; diff --git a/panda/src/express/memoryUsagePointers.h b/panda/src/express/memoryUsagePointers.h index 2d039fdf44..7192cea41f 100644 --- a/panda/src/express/memoryUsagePointers.h +++ b/panda/src/express/memoryUsagePointers.h @@ -59,7 +59,10 @@ PUBLISHED: int get_num_pointers() const; ReferenceCount *get_pointer(int n) const; + MAKE_SEQ(get_pointers, get_num_pointers, get_pointer); TypedObject *get_typed_pointer(int n) const; + MAKE_SEQ(get_typed_pointers, get_num_pointers, get_typed_pointer); + TypeHandle get_type(int n) const; string get_type_name(int n) const; double get_age(int n) const; diff --git a/panda/src/express/multifile.h b/panda/src/express/multifile.h index 16acae80b8..c4b5c6d17d 100644 --- a/panda/src/express/multifile.h +++ b/panda/src/express/multifile.h @@ -83,6 +83,7 @@ PUBLISHED: const string &subfile_name) const; void remove_subfile(int index); const string &get_subfile_name(int index) const; + MAKE_SEQ(get_subfile_names, get_num_subfiles, get_subfile_name); size_t get_subfile_length(int index) const; time_t get_subfile_timestamp(int index) const; bool is_subfile_compressed(int index) const; diff --git a/panda/src/express/pointerToArray.I b/panda/src/express/pointerToArray.I index 546673eeae..c0ea6c8ed4 100644 --- a/panda/src/express/pointerToArray.I +++ b/panda/src/express/pointerToArray.I @@ -458,6 +458,19 @@ set_element(size_type n, const Element &value) { (*this)[n] = value; } +//////////////////////////////////////////////////////////////////// +// Function: PointerToArray::__setitem__ +// Access: Published +// Description: Same as set_element(), this replaces the nth element +// of the array. +//////////////////////////////////////////////////////////////////// +template +INLINE void PointerToArray:: +__setitem__(size_type n, const Element &value) { + nassertv(n < ((To *)(this->_void_ptr))->size()); + (*this)[n] = value; +} + //////////////////////////////////////////////////////////////////// // Function: PointerToArray::get_data // Access: Published diff --git a/panda/src/express/pointerToArray.h b/panda/src/express/pointerToArray.h index f3253c1c53..5ec52884cf 100644 --- a/panda/src/express/pointerToArray.h +++ b/panda/src/express/pointerToArray.h @@ -109,8 +109,12 @@ PUBLISHED: INLINE static PointerToArray empty_array(size_type n, TypeHandle type_handle = get_type_handle(Element)); INLINE PointerToArray(const PointerToArray ©); INLINE size_type size() const; + INLINE void push_back(const Element &x); + INLINE void pop_back(); INLINE const Element &get_element(size_type n) const; INLINE void set_element(size_type n, const Element &value); + INLINE const Element &operator [](size_type n) const; + INLINE void __setitem__(size_type n, const Element &value); INLINE string get_data() const; INLINE void set_data(const string &data); INLINE string get_subdata(size_type n, size_type count) const; @@ -189,6 +193,7 @@ public: // Methods to help out Python and other high-level languages. INLINE const Element &get_element(size_type n) const; INLINE void set_element(size_type n, const Element &value); + INLINE void __setitem__(size_type n, const Element &value); INLINE string get_data() const; INLINE void set_data(const string &data); INLINE string get_subdata(size_type n, size_type count) const; diff --git a/panda/src/express/virtualFileList.I b/panda/src/express/virtualFileList.I index 813364d2e9..e14a06cd67 100644 --- a/panda/src/express/virtualFileList.I +++ b/panda/src/express/virtualFileList.I @@ -61,3 +61,24 @@ get_file(int n) const { nassertr(n >= 0 && n < (int)_files.size(), NULL); return _files[n]; } + +//////////////////////////////////////////////////////////////////// +// Function: VirtualFileList::operator [] +// Access: Published +// Description: Returns the nth file in the list. +//////////////////////////////////////////////////////////////////// +INLINE VirtualFile *VirtualFileList:: +operator [](int n) const { + nassertr(n >= 0 && n < (int)_files.size(), NULL); + return _files[n]; +} + +//////////////////////////////////////////////////////////////////// +// Function: VirtualFileList::size +// Access: Published +// Description: Returns the number of files in the list. +//////////////////////////////////////////////////////////////////// +INLINE int VirtualFileList:: +size() const { + return _files.size(); +} diff --git a/panda/src/express/virtualFileList.h b/panda/src/express/virtualFileList.h index 4e461b742b..37f7f9822f 100644 --- a/panda/src/express/virtualFileList.h +++ b/panda/src/express/virtualFileList.h @@ -23,7 +23,7 @@ //////////////////////////////////////////////////////////////////// // Class : VirtualFileList // Description : A list of VirtualFiles, as returned by -// VirtualDirectory::scan(). +// VirtualFile::scan_directory(). //////////////////////////////////////////////////////////////////// class EXPCL_PANDAEXPRESS VirtualFileList : public ReferenceCount { public: @@ -38,6 +38,10 @@ public: PUBLISHED: INLINE int get_num_files() const; INLINE VirtualFile *get_file(int n) const; + MAKE_SEQ(get_files, get_num_files, get_file); + + INLINE VirtualFile *operator [](int n) const; + INLINE int size() const; private: typedef pvector< PT(VirtualFile) > Files; diff --git a/panda/src/gobj/geom.h b/panda/src/gobj/geom.h index 6729755fa6..3b7ebe44d2 100644 --- a/panda/src/gobj/geom.h +++ b/panda/src/gobj/geom.h @@ -89,6 +89,7 @@ PUBLISHED: INLINE int get_num_primitives() const; INLINE CPT(GeomPrimitive) get_primitive(int i) const; + MAKE_SEQ(get_primitives, get_num_primitives, get_primitive); INLINE PT(GeomPrimitive) modify_primitive(int i); void set_primitive(int i, const GeomPrimitive *primitive); void add_primitive(const GeomPrimitive *primitive); diff --git a/panda/src/gobj/geomPrimitive.h b/panda/src/gobj/geomPrimitive.h index 09c9dda775..5a31058f30 100644 --- a/panda/src/gobj/geomPrimitive.h +++ b/panda/src/gobj/geomPrimitive.h @@ -98,6 +98,7 @@ PUBLISHED: INLINE int get_first_vertex() const; INLINE int get_num_vertices() const; INLINE int get_vertex(int i) const; + MAKE_SEQ(get_vertices, get_num_vertices, get_vertex); void add_vertex(int vertex); INLINE void add_vertices(int v1, int v2); INLINE void add_vertices(int v1, int v2, int v3); diff --git a/panda/src/gobj/geomVertexData.h b/panda/src/gobj/geomVertexData.h index 6a0441e0ab..388b6a5161 100644 --- a/panda/src/gobj/geomVertexData.h +++ b/panda/src/gobj/geomVertexData.h @@ -109,6 +109,7 @@ PUBLISHED: INLINE int get_num_arrays() const; INLINE CPT(GeomVertexArrayData) get_array(int i) const; + MAKE_SEQ(get_arrays, get_num_arrays, get_array); INLINE PT(GeomVertexArrayData) modify_array(int i); INLINE void set_array(int i, const GeomVertexArrayData *array); diff --git a/panda/src/gobj/geomVertexFormat.h b/panda/src/gobj/geomVertexFormat.h index 2e4796e65a..51a4a324aa 100644 --- a/panda/src/gobj/geomVertexFormat.h +++ b/panda/src/gobj/geomVertexFormat.h @@ -80,6 +80,7 @@ PUBLISHED: INLINE int get_num_arrays() const; INLINE const GeomVertexArrayFormat *get_array(int array) const; + MAKE_SEQ(get_arrays, get_num_arrays, get_array); GeomVertexArrayFormat *modify_array(int array); void set_array(int array, const GeomVertexArrayFormat *format); void remove_array(int array); @@ -100,17 +101,23 @@ PUBLISHED: INLINE int get_num_points() const; INLINE const InternalName *get_point(int n) const; + MAKE_SEQ(get_points, get_num_points, get_point); INLINE int get_num_vectors() const; INLINE const InternalName *get_vector(int n) const; + MAKE_SEQ(get_vectors, get_num_vectors, get_vector); INLINE int get_num_texcoords() const; INLINE const InternalName *get_texcoord(int n) const; + MAKE_SEQ(get_texcoords, get_num_texcoords, get_texcoord); INLINE int get_num_morphs() const; INLINE const InternalName *get_morph_slider(int n) const; INLINE const InternalName *get_morph_base(int n) const; INLINE const InternalName *get_morph_delta(int n) const; + MAKE_SEQ(get_morph_sliders, get_num_morphs, get_morph_slider); + MAKE_SEQ(get_morph_bases, get_num_morphs, get_morph_base); + MAKE_SEQ(get_morph_deltas, get_num_morphs, get_morph_delta); void output(ostream &out) const; void write(ostream &out, int indent_level = 0) const; diff --git a/panda/src/gobj/sliderTable.h b/panda/src/gobj/sliderTable.h index 0966c29dcd..7df0e28ed2 100644 --- a/panda/src/gobj/sliderTable.h +++ b/panda/src/gobj/sliderTable.h @@ -51,6 +51,7 @@ PUBLISHED: INLINE int get_num_sliders() const; INLINE const VertexSlider *get_slider(int n) const; + MAKE_SEQ(get_sliders, get_num_sliders, get_slider); INLINE const SparseArray &get_slider_rows(int n) const; INLINE const SparseArray &find_sliders(const InternalName *name) const; diff --git a/panda/src/gobj/transformBlend.h b/panda/src/gobj/transformBlend.h index b6f6b5b6d0..c1bfd046fc 100644 --- a/panda/src/gobj/transformBlend.h +++ b/panda/src/gobj/transformBlend.h @@ -63,6 +63,7 @@ PUBLISHED: INLINE int get_num_transforms() const; INLINE const VertexTransform *get_transform(int n) const; + MAKE_SEQ(get_transforms, get_num_transforms, get_transform); INLINE float get_weight(int n) const; INLINE void set_transform(int n, const VertexTransform *transform); INLINE void set_weight(int n, float weight); diff --git a/panda/src/gobj/transformBlendTable.h b/panda/src/gobj/transformBlendTable.h index 948e7daf35..d169ea19f5 100644 --- a/panda/src/gobj/transformBlendTable.h +++ b/panda/src/gobj/transformBlendTable.h @@ -59,6 +59,7 @@ PUBLISHED: INLINE int get_num_blends() const; INLINE const TransformBlend &get_blend(int n) const; + MAKE_SEQ(get_blends, get_num_blends, get_blend); INLINE UpdateSeq get_modified(Thread *current_thread) const; void set_blend(int n, const TransformBlend &blend); diff --git a/panda/src/gobj/transformTable.h b/panda/src/gobj/transformTable.h index 853db8663c..2563594a08 100644 --- a/panda/src/gobj/transformTable.h +++ b/panda/src/gobj/transformTable.h @@ -51,6 +51,7 @@ PUBLISHED: INLINE int get_num_transforms() const; INLINE const VertexTransform *get_transform(int n) const; + MAKE_SEQ(get_transforms, get_num_transforms, get_transform); INLINE UpdateSeq get_modified(Thread *current_thread) const; void set_transform(int n, const VertexTransform *transform); diff --git a/panda/src/grutil/lineSegs.h b/panda/src/grutil/lineSegs.h index 425ed41d04..28880a7aed 100644 --- a/panda/src/grutil/lineSegs.h +++ b/panda/src/grutil/lineSegs.h @@ -57,12 +57,13 @@ PUBLISHED: // Functions to move the line vertices after they have been created. INLINE int get_num_vertices() const; - Vertexf get_vertex(int n) const; + MAKE_SEQ(get_vertices, get_num_vertices, get_vertex); void set_vertex(int n, const Vertexf &vert); INLINE void set_vertex(int vertex, float x, float y, float z); Colorf get_vertex_color(int vertex) const; + MAKE_SEQ(get_vertex_colors, get_num_vertices, get_vertex_color); void set_vertex_color(int vertex, const Colorf &c); INLINE void set_vertex_color(int vertex, float r, float g, float b, float a = 1.0f); diff --git a/panda/src/linmath/lmatrix3_src.I b/panda/src/linmath/lmatrix3_src.I index ed09bc297e..ada082a6e5 100644 --- a/panda/src/linmath/lmatrix3_src.I +++ b/panda/src/linmath/lmatrix3_src.I @@ -12,6 +12,91 @@ // //////////////////////////////////////////////////////////////////// + +//////////////////////////////////////////////////////////////////// +// Function: LMatrix3::Row::Constructor +// Access: Private +// Description: Defines a row-level index accessor to the matrix. +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH FLOATNAME(LMatrix3)::Row:: +Row(FLOATTYPE *row) : _row(row) { +} + +//////////////////////////////////////////////////////////////////// +// Function: LMatrix3::Row::operator [] +// Access: Published +// Description: +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH FLOATTYPE FLOATNAME(LMatrix3)::Row:: +operator [](int i) const { + nassertr(i >= 0 && i < 3, 0.0); + return _row[i]; +} + +//////////////////////////////////////////////////////////////////// +// Function: LMatrix3::Row::operator [] +// Access: Published +// Description: +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH FLOATTYPE &FLOATNAME(LMatrix3)::Row:: +operator [](int i) { + nassertr(i >= 0 && i < 3, _row[0]); + return _row[i]; +} + +#ifdef HAVE_PYTHON +//////////////////////////////////////////////////////////////////// +// Function: LMatrix3::Row::__setitem__ +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH void FLOATNAME(LMatrix3)::Row:: +__setitem__(int i, FLOATTYPE v) { + nassertv(i >= 0 && i < 3); + _row[i] = v; +} +#endif // HAVE_PYTHON + +//////////////////////////////////////////////////////////////////// +// Function: LMatrix3::Row::size +// Access: Public, Static +// Description: Returns 3: the number of columns of a LMatrix3. +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH size_t FLOATNAME(LMatrix3)::Row:: +size() { + return 3; +} + +//////////////////////////////////////////////////////////////////// +// Function: LMatrix3::CRow::Constructor +// Access: Private +// Description: Defines a row-level constant accessor to the matrix. +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH FLOATNAME(LMatrix3)::CRow:: +CRow(const FLOATTYPE *row) : _row(row) { +} + +//////////////////////////////////////////////////////////////////// +// Function: LMatrix3::CRow::operator [] +// Access: Published +// Description: +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH FLOATTYPE FLOATNAME(LMatrix3)::CRow:: +operator [](int i) const { + nassertr(i >= 0 && i < 3, 0.0); + return _row[i]; +} + +//////////////////////////////////////////////////////////////////// +// Function: LMatrix3::CRow::size +// Access: Public, Static +// Description: Returns 3: the number of columns of a LMatrix3. +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH size_t FLOATNAME(LMatrix3)::CRow:: +size() { + return 3; +} + //////////////////////////////////////////////////////////////////// // Function: LMatrix3::ident_mat // Access: Public, Static @@ -235,6 +320,38 @@ operator () (int row, int col) const { return _m.data[row * 3 + col]; } +//////////////////////////////////////////////////////////////////// +// Function: LMatrix3::Indexing Operator +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH FLOATNAME(LMatrix3)::CRow FLOATNAME(LMatrix3):: +operator [](int i) const { + nassertr(i >= 0 && i < 3, CRow(&_m.data[0])); + return CRow(&_m.data[i * 3]); +} + +//////////////////////////////////////////////////////////////////// +// Function: LMatrix3::Indexing Operator +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH FLOATNAME(LMatrix3)::Row FLOATNAME(LMatrix3):: +operator [](int i) { + nassertr(i >= 0 && i < 3, Row(&_m.data[0])); + return Row(&_m.data[i * 3]); +} + +//////////////////////////////////////////////////////////////////// +// Function: LMatrix3::size +// Access: Public, Static +// Description: Returns 3: the number of rows of a LMatrix3. +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH size_t FLOATNAME(LMatrix3):: +size() { + return 3; +} + //////////////////////////////////////////////////////////////////// // Function: LMatrix3::is_nan // Access: Public diff --git a/panda/src/linmath/lmatrix3_src.h b/panda/src/linmath/lmatrix3_src.h index d359a2b098..e5911d3f0e 100644 --- a/panda/src/linmath/lmatrix3_src.h +++ b/panda/src/linmath/lmatrix3_src.h @@ -28,6 +28,32 @@ public: typedef const FLOATTYPE *const_iterator; PUBLISHED: + // These helper classes are used to support two-level operator []. + class Row { + private: + INLINE_LINMATH Row(FLOATTYPE *row); + PUBLISHED: + INLINE_LINMATH FLOATTYPE operator [](int i) const; + INLINE_LINMATH FLOATTYPE &operator [](int i); +#ifdef HAVE_PYTHON + INLINE_LINMATH void __setitem__(int i, FLOATTYPE v); +#endif + INLINE_LINMATH static size_t size(); + private: + FLOATTYPE *_row; + friend class FLOATNAME(LMatrix3); + }; + class CRow { + private: + INLINE_LINMATH CRow(const FLOATTYPE *row); + PUBLISHED: + INLINE_LINMATH FLOATTYPE operator [](int i) const; + INLINE_LINMATH static size_t size(); + private: + const FLOATTYPE *_row; + friend class FLOATNAME(LMatrix3); + }; + INLINE_LINMATH FLOATNAME(LMatrix3)(); INLINE_LINMATH FLOATNAME(LMatrix3)(const FLOATNAME(LMatrix3) &other); INLINE_LINMATH FLOATNAME(LMatrix3) &operator = ( @@ -53,9 +79,13 @@ PUBLISHED: INLINE_LINMATH FLOATNAME(LVecBase3) get_row(int row) const; INLINE_LINMATH FLOATNAME(LVecBase3) get_col(int col) const; + MAKE_SEQ(get_rows, size, get_row); + MAKE_SEQ(get_cols, size, get_col); INLINE_LINMATH FLOATNAME(LVecBase2) get_row2(int row) const; INLINE_LINMATH FLOATNAME(LVecBase2) get_col2(int col) const; + MAKE_SEQ(get_col2s, size, get_col2); + MAKE_SEQ(get_row2s, size, get_row2); // these versions inline better INLINE_LINMATH void get_row( @@ -64,6 +94,10 @@ PUBLISHED: INLINE_LINMATH FLOATTYPE &operator () (int row, int col); INLINE_LINMATH FLOATTYPE operator () (int row, int col) const; + INLINE_LINMATH CRow operator [](int i) const; + INLINE_LINMATH Row operator [](int i); + INLINE_LINMATH static size_t size(); + INLINE_LINMATH bool is_nan() const; INLINE_LINMATH FLOATTYPE get_cell(int row, int col) const; diff --git a/panda/src/linmath/lmatrix4_src.I b/panda/src/linmath/lmatrix4_src.I index a122bb2115..643e3840dc 100644 --- a/panda/src/linmath/lmatrix4_src.I +++ b/panda/src/linmath/lmatrix4_src.I @@ -12,6 +12,91 @@ // //////////////////////////////////////////////////////////////////// + +//////////////////////////////////////////////////////////////////// +// Function: LMatrix4::Row::Constructor +// Access: Private +// Description: Defines a row-level index accessor to the matrix. +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH FLOATNAME(LMatrix4)::Row:: +Row(FLOATTYPE *row) : _row(row) { +} + +//////////////////////////////////////////////////////////////////// +// Function: LMatrix4::Row::operator [] +// Access: Published +// Description: +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH FLOATTYPE FLOATNAME(LMatrix4)::Row:: +operator [](int i) const { + nassertr(i >= 0 && i < 4, 0.0); + return _row[i]; +} + +//////////////////////////////////////////////////////////////////// +// Function: LMatrix4::Row::operator [] +// Access: Published +// Description: +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH FLOATTYPE &FLOATNAME(LMatrix4)::Row:: +operator [](int i) { + nassertr(i >= 0 && i < 4, _row[0]); + return _row[i]; +} + +#ifdef HAVE_PYTHON +//////////////////////////////////////////////////////////////////// +// Function: LMatrix4::Row::__setitem__ +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH void FLOATNAME(LMatrix4)::Row:: +__setitem__(int i, FLOATTYPE v) { + nassertv(i >= 0 && i < 4); + _row[i] = v; +} +#endif // HAVE_PYTHON + +//////////////////////////////////////////////////////////////////// +// Function: LMatrix4::Row::size +// Access: Public, Static +// Description: Returns 4: the number of columns of a LMatrix4. +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH size_t FLOATNAME(LMatrix4)::Row:: +size() { + return 4; +} + +//////////////////////////////////////////////////////////////////// +// Function: LMatrix4::CRow::Constructor +// Access: Private +// Description: Defines a row-level constant accessor to the matrix. +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH FLOATNAME(LMatrix4)::CRow:: +CRow(const FLOATTYPE *row) : _row(row) { +} + +//////////////////////////////////////////////////////////////////// +// Function: LMatrix4::CRow::operator [] +// Access: Published +// Description: +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH FLOATTYPE FLOATNAME(LMatrix4)::CRow:: +operator [](int i) const { + nassertr(i >= 0 && i < 4, 0.0); + return _row[i]; +} + +//////////////////////////////////////////////////////////////////// +// Function: LMatrix4::CRow::size +// Access: Public, Static +// Description: Returns 4: the number of columns of a LMatrix4. +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH size_t FLOATNAME(LMatrix4)::CRow:: +size() { + return 4; +} + //////////////////////////////////////////////////////////////////// // Function: LMatrix4::ident_mat // Access: Public, Static @@ -413,6 +498,38 @@ operator () (int row, int col) const { return _m.data[row * 4 + col]; } +//////////////////////////////////////////////////////////////////// +// Function: LMatrix4::Indexing Operator +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH FLOATNAME(LMatrix4)::CRow FLOATNAME(LMatrix4):: +operator [](int i) const { + nassertr(i >= 0 && i < 4, CRow(&_m.data[0])); + return CRow(&_m.data[i * 4]); +} + +//////////////////////////////////////////////////////////////////// +// Function: LMatrix4::Indexing Operator +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH FLOATNAME(LMatrix4)::Row FLOATNAME(LMatrix4):: +operator [](int i) { + nassertr(i >= 0 && i < 4, Row(&_m.data[0])); + return Row(&_m.data[i * 4]); +} + +//////////////////////////////////////////////////////////////////// +// Function: LMatrix4::size +// Access: Public, Static +// Description: Returns 4: the number of rows of a LMatrix4. +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH size_t FLOATNAME(LMatrix4):: +size() { + return 4; +} + //////////////////////////////////////////////////////////////////// // Function: LMatrix4::is_nan // Access: Public diff --git a/panda/src/linmath/lmatrix4_src.h b/panda/src/linmath/lmatrix4_src.h index 2f50646166..68be7282b6 100644 --- a/panda/src/linmath/lmatrix4_src.h +++ b/panda/src/linmath/lmatrix4_src.h @@ -23,6 +23,32 @@ public: typedef const FLOATTYPE *const_iterator; PUBLISHED: + // These helper classes are used to support two-level operator []. + class Row { + private: + INLINE_LINMATH Row(FLOATTYPE *row); + PUBLISHED: + INLINE_LINMATH FLOATTYPE operator [](int i) const; + INLINE_LINMATH FLOATTYPE &operator [](int i); +#ifdef HAVE_PYTHON + INLINE_LINMATH void __setitem__(int i, FLOATTYPE v); +#endif + INLINE_LINMATH static size_t size(); + private: + FLOATTYPE *_row; + friend class FLOATNAME(LMatrix4); + }; + class CRow { + private: + INLINE_LINMATH CRow(const FLOATTYPE *row); + PUBLISHED: + INLINE_LINMATH FLOATTYPE operator [](int i) const; + INLINE_LINMATH static size_t size(); + private: + const FLOATTYPE *_row; + friend class FLOATNAME(LMatrix4); + }; + INLINE_LINMATH FLOATNAME(LMatrix4)(); INLINE_LINMATH FLOATNAME(LMatrix4)(const FLOATNAME(LMatrix4) &other); INLINE_LINMATH FLOATNAME(LMatrix4) &operator = (const FLOATNAME(LMatrix4) &other); @@ -57,8 +83,10 @@ PUBLISHED: INLINE_LINMATH FLOATNAME(LVecBase4) get_row(int row) const; INLINE_LINMATH FLOATNAME(LVecBase4) get_col(int col) const; - INLINE_LINMATH FLOATNAME(LVecBase3) get_row3(int row) const; + MAKE_SEQ(get_rows, size, get_row); + MAKE_SEQ(get_cols, size, get_col); + MAKE_SEQ(get_row3s, size, get_row3); // these versions inline better INLINE_LINMATH void get_row(FLOATNAME(LVecBase4) &result_vec, int row) const; @@ -69,6 +97,10 @@ PUBLISHED: INLINE_LINMATH FLOATTYPE &operator () (int row, int col); INLINE_LINMATH FLOATTYPE operator () (int row, int col) const; + INLINE_LINMATH CRow operator [](int i) const; + INLINE_LINMATH Row operator [](int i); + INLINE_LINMATH static size_t size(); + INLINE_LINMATH bool is_nan() const; INLINE_LINMATH FLOATTYPE get_cell(int row, int col) const; diff --git a/panda/src/linmath/lvecBase2_src.I b/panda/src/linmath/lvecBase2_src.I index ed7b9a7b7d..389c26a5ea 100644 --- a/panda/src/linmath/lvecBase2_src.I +++ b/panda/src/linmath/lvecBase2_src.I @@ -144,6 +144,29 @@ operator [](int i) { return _v.data[i]; } +#ifdef HAVE_PYTHON +//////////////////////////////////////////////////////////////////// +// Function: LVecBase2::__setitem__ +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH void FLOATNAME(LVecBase2):: +__setitem__(int i, FLOATTYPE v) { + nassertv(i >= 0 && i < 2); + _v.data[i] = v; +} +#endif // HAVE_PYTHON + +//////////////////////////////////////////////////////////////////// +// Function: LVecBase2::size +// Access: Public, Static +// Description: Returns 2: the number of components of a LVecBase2. +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH size_t FLOATNAME(LVecBase2):: +size() { + return 2; +} + //////////////////////////////////////////////////////////////////// // Function: LVecBase2::is_nan // Access: Public diff --git a/panda/src/linmath/lvecBase2_src.h b/panda/src/linmath/lvecBase2_src.h index d4522600ae..ff7fb015b3 100644 --- a/panda/src/linmath/lvecBase2_src.h +++ b/panda/src/linmath/lvecBase2_src.h @@ -41,6 +41,10 @@ PUBLISHED: INLINE_LINMATH FLOATTYPE operator [](int i) const; INLINE_LINMATH FLOATTYPE &operator [](int i); +#ifdef HAVE_PYTHON + INLINE_LINMATH void __setitem__(int i, FLOATTYPE v); +#endif + INLINE_LINMATH static size_t size(); INLINE_LINMATH bool is_nan() const; diff --git a/panda/src/linmath/lvecBase3_src.I b/panda/src/linmath/lvecBase3_src.I index 5be42c62f3..4095c096ff 100644 --- a/panda/src/linmath/lvecBase3_src.I +++ b/panda/src/linmath/lvecBase3_src.I @@ -156,6 +156,29 @@ operator [](int i) { return _v.data[i]; } +#ifdef HAVE_PYTHON +//////////////////////////////////////////////////////////////////// +// Function: LVecBase3::__setitem__ +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH void FLOATNAME(LVecBase3):: +__setitem__(int i, FLOATTYPE v) { + nassertv(i >= 0 && i < 3); + _v.data[i] = v; +} +#endif // HAVE_PYTHON + +//////////////////////////////////////////////////////////////////// +// Function: LVecBase3::size +// Access: Public, Static +// Description: Returns 3: the number of components of a LVecBase3. +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH size_t FLOATNAME(LVecBase3):: +size() { + return 3; +} + //////////////////////////////////////////////////////////////////// // Function: LVecBase3::is_nan // Access: Public diff --git a/panda/src/linmath/lvecBase3_src.h b/panda/src/linmath/lvecBase3_src.h index 242c3271fa..70dde11b01 100644 --- a/panda/src/linmath/lvecBase3_src.h +++ b/panda/src/linmath/lvecBase3_src.h @@ -39,6 +39,10 @@ PUBLISHED: INLINE_LINMATH FLOATTYPE operator [](int i) const; INLINE_LINMATH FLOATTYPE &operator [](int i); +#ifdef HAVE_PYTHON + INLINE_LINMATH void __setitem__(int i, FLOATTYPE v); +#endif + INLINE_LINMATH static size_t size(); INLINE_LINMATH bool is_nan() const; diff --git a/panda/src/linmath/lvecBase4_src.I b/panda/src/linmath/lvecBase4_src.I index 616fb94c55..47ade7a0c0 100644 --- a/panda/src/linmath/lvecBase4_src.I +++ b/panda/src/linmath/lvecBase4_src.I @@ -170,6 +170,29 @@ operator [](int i) { return _v.data[i]; } +#ifdef HAVE_PYTHON +//////////////////////////////////////////////////////////////////// +// Function: LVecBase4::__setitem__ +// Access: Public +// Description: +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH void FLOATNAME(LVecBase4):: +__setitem__(int i, FLOATTYPE v) { + nassertv(i >= 0 && i < 4); + _v.data[i] = v; +} +#endif // HAVE_PYTHON + +//////////////////////////////////////////////////////////////////// +// Function: LVecBase4::size +// Access: Public, Static +// Description: Returns 4: the number of components of a LVecBase4. +//////////////////////////////////////////////////////////////////// +INLINE_LINMATH size_t FLOATNAME(LVecBase4):: +size() { + return 4; +} + //////////////////////////////////////////////////////////////////// // Function: LVecBase4::is_nan // Access: Public diff --git a/panda/src/linmath/lvecBase4_src.h b/panda/src/linmath/lvecBase4_src.h index a3c7f88eba..981c59a078 100644 --- a/panda/src/linmath/lvecBase4_src.h +++ b/panda/src/linmath/lvecBase4_src.h @@ -40,6 +40,10 @@ PUBLISHED: INLINE_LINMATH FLOATTYPE operator [](int i) const; INLINE_LINMATH FLOATTYPE &operator [](int i); +#ifdef HAVE_PYTHON + INLINE_LINMATH void __setitem__(int i, FLOATTYPE v); +#endif + INLINE_LINMATH static size_t size(); INLINE_LINMATH bool is_nan() const; diff --git a/panda/src/mathutil/boundingBox.h b/panda/src/mathutil/boundingBox.h index 8c2c97078c..cd6754621e 100644 --- a/panda/src/mathutil/boundingBox.h +++ b/panda/src/mathutil/boundingBox.h @@ -49,8 +49,10 @@ public: PUBLISHED: INLINE_MATHUTIL int get_num_points() const; INLINE_MATHUTIL LPoint3f get_point(int n) const; + MAKE_SEQ(get_points, get_num_points, get_point); INLINE_MATHUTIL int get_num_planes() const; INLINE_MATHUTIL Planef get_plane(int n) const; + MAKE_SEQ(get_planes, get_num_planes, get_plane); public: // Inline accessors for speed. diff --git a/panda/src/mathutil/boundingHexahedron.h b/panda/src/mathutil/boundingHexahedron.h index 52978b8d84..458a4bbad9 100644 --- a/panda/src/mathutil/boundingHexahedron.h +++ b/panda/src/mathutil/boundingHexahedron.h @@ -61,8 +61,10 @@ public: PUBLISHED: INLINE_MATHUTIL int get_num_points() const; INLINE_MATHUTIL LPoint3f get_point(int n) const; + MAKE_SEQ(get_points, get_num_points, get_point); INLINE_MATHUTIL int get_num_planes() const; INLINE_MATHUTIL Planef get_plane(int n) const; + MAKE_SEQ(get_planes, get_num_planes, get_plane); public: virtual const BoundingHexahedron *as_bounding_hexahedron() const; diff --git a/panda/src/mathutil/triangulator.h b/panda/src/mathutil/triangulator.h index f55f453dd1..c5608afd7b 100644 --- a/panda/src/mathutil/triangulator.h +++ b/panda/src/mathutil/triangulator.h @@ -45,6 +45,7 @@ PUBLISHED: INLINE int get_num_vertices() const; INLINE const LPoint2d &get_vertex(int n) const; + MAKE_SEQ(get_vertices, get_num_vertices, get_vertex); void clear_polygon(); void add_polygon_vertex(int index); diff --git a/panda/src/movies/microphoneAudio.h b/panda/src/movies/microphoneAudio.h index 4c5e9a5640..6fbcb38699 100644 --- a/panda/src/movies/microphoneAudio.h +++ b/panda/src/movies/microphoneAudio.h @@ -31,6 +31,7 @@ class EXPCL_PANDA_MOVIES MicrophoneAudio : public MovieAudio { static int get_num_options(); static PT(MicrophoneAudio) get_option(int n); + MAKE_SEQ(get_options, get_num_options, get_option); INLINE int get_channels() const; INLINE int get_rate() const; diff --git a/panda/src/movies/webcamVideo.h b/panda/src/movies/webcamVideo.h index 2d75cd53ee..64571d6cf4 100644 --- a/panda/src/movies/webcamVideo.h +++ b/panda/src/movies/webcamVideo.h @@ -29,6 +29,7 @@ PUBLISHED: static int get_num_options(); static PT(WebcamVideo) get_option(int n); + MAKE_SEQ(get_options, get_num_options, get_option); INLINE int get_size_x() const; INLINE int get_size_y() const; diff --git a/panda/src/ode/odeAMotorJoint.h b/panda/src/ode/odeAMotorJoint.h index fb339c59d8..feac5c23e2 100644 --- a/panda/src/ode/odeAMotorJoint.h +++ b/panda/src/ode/odeAMotorJoint.h @@ -33,6 +33,7 @@ PUBLISHED: INLINE int get_num_axes() const; INLINE LVecBase3f get_axis(int anum) const; + MAKE_SEQ(get_axes, get_num_axes, get_axis); INLINE int get_axis_rel(int anum) const; INLINE dReal get_angle(int anum) const; INLINE dReal get_angle_rate(int anum) const; diff --git a/panda/src/ode/odeBody.h b/panda/src/ode/odeBody.h index de6ae764f9..43c00cba49 100755 --- a/panda/src/ode/odeBody.h +++ b/panda/src/ode/odeBody.h @@ -124,6 +124,7 @@ PUBLISHED: INLINE int get_num_joints() const; OdeJoint get_joint(int index) const; + MAKE_SEQ(get_joints, get_num_joints, get_joint); INLINE void enable(); INLINE void disable(); INLINE int is_enabled() const; diff --git a/panda/src/ode/odeJointCollection.cxx b/panda/src/ode/odeJointCollection.cxx index fb6cbb1196..ba38456323 100755 --- a/panda/src/ode/odeJointCollection.cxx +++ b/panda/src/ode/odeJointCollection.cxx @@ -150,3 +150,14 @@ OdeJoint OdeJointCollection:: operator [] (int index) const { return get_joint(index); } + +//////////////////////////////////////////////////////////////////// +// Function: OdeJointCollection::size +// Access: Published +// Description: Returns the number of joints in the collection. This +// is the same thing as get_num_joints(). +//////////////////////////////////////////////////////////////////// +int OdeJointCollection:: +size() const { + return _joints.size(); +} diff --git a/panda/src/ode/odeJointCollection.h b/panda/src/ode/odeJointCollection.h index 9658211961..e4f141b0b0 100755 --- a/panda/src/ode/odeJointCollection.h +++ b/panda/src/ode/odeJointCollection.h @@ -39,7 +39,9 @@ PUBLISHED: bool is_empty() const; int get_num_joints() const; OdeJoint get_joint(int index) const; + MAKE_SEQ(get_joints, get_num_joints, get_joint); OdeJoint operator [] (int index) const; + int size() const; private: typedef PTA(OdeJoint) Joints; diff --git a/panda/src/ode/odeLMotorJoint.h b/panda/src/ode/odeLMotorJoint.h index ffcedda723..0d0d538758 100755 --- a/panda/src/ode/odeLMotorJoint.h +++ b/panda/src/ode/odeLMotorJoint.h @@ -30,6 +30,7 @@ PUBLISHED: INLINE int get_num_axes() const; INLINE LVecBase3f get_axis(int anum) const; + MAKE_SEQ(get_axes, get_num_axes, get_axis); INLINE dReal get_param(int parameter) const; public: diff --git a/panda/src/parametrics/nurbsCurveEvaluator.h b/panda/src/parametrics/nurbsCurveEvaluator.h index 34e305b2bd..c15a7151dc 100644 --- a/panda/src/parametrics/nurbsCurveEvaluator.h +++ b/panda/src/parametrics/nurbsCurveEvaluator.h @@ -55,6 +55,7 @@ PUBLISHED: INLINE void set_vertex(int i, const LVecBase3f &vertex, float weight = 1.0); INLINE const LVecBase4f &get_vertex(int i) const; INLINE LVecBase4f get_vertex(int i, const NodePath &rel_to) const; + MAKE_SEQ(get_vertices, get_num_vertices, get_vertex); INLINE void set_vertex_space(int i, const NodePath &space); INLINE void set_vertex_space(int i, const string &space); @@ -68,6 +69,7 @@ PUBLISHED: INLINE int get_num_knots() const; void set_knot(int i, float knot); float get_knot(int i) const; + MAKE_SEQ(get_knots, get_num_knots, get_knot); void normalize_knots(); INLINE int get_num_segments() const; diff --git a/panda/src/parametrics/nurbsCurveResult.h b/panda/src/parametrics/nurbsCurveResult.h index 7d86c221c9..e55efff829 100644 --- a/panda/src/parametrics/nurbsCurveResult.h +++ b/panda/src/parametrics/nurbsCurveResult.h @@ -65,6 +65,8 @@ PUBLISHED: INLINE int get_num_samples() const; INLINE float get_sample_t(int n) const; INLINE const LPoint3f &get_sample_point(int n) const; + MAKE_SEQ(get_sample_ts, get_num_samples, get_sample_t); + MAKE_SEQ(get_sample_points, get_num_samples, get_sample_points); private: int find_segment(float t); diff --git a/panda/src/parametrics/nurbsSurfaceEvaluator.h b/panda/src/parametrics/nurbsSurfaceEvaluator.h index c6825600fb..fec94d9c4f 100644 --- a/panda/src/parametrics/nurbsSurfaceEvaluator.h +++ b/panda/src/parametrics/nurbsSurfaceEvaluator.h @@ -66,11 +66,13 @@ PUBLISHED: INLINE int get_num_u_knots() const; void set_u_knot(int i, float knot); float get_u_knot(int i) const; + MAKE_SEQ(get_u_knots, get_num_u_knots, get_u_knot); void normalize_u_knots(); INLINE int get_num_v_knots() const; void set_v_knot(int i, float knot); float get_v_knot(int i) const; + MAKE_SEQ(get_v_knots, get_num_v_knots, get_v_knot); void normalize_v_knots(); INLINE int get_num_u_segments() const; diff --git a/panda/src/particlesystem/spriteParticleRenderer.h b/panda/src/particlesystem/spriteParticleRenderer.h index e7d93cde3f..78a892434a 100644 --- a/panda/src/particlesystem/spriteParticleRenderer.h +++ b/panda/src/particlesystem/spriteParticleRenderer.h @@ -198,6 +198,7 @@ PUBLISHED: INLINE Texture *get_texture(const int anim, const int frame) const; INLINE int get_num_anims() const; INLINE SpriteAnim *get_anim(const int n) const; + MAKE_SEQ(get_anims, get_num_anims, get_anim); INLINE SpriteAnim *get_last_anim() const; INLINE ColorInterpolationManager* get_color_interpolation_manager() const; INLINE TexCoordf get_ll_uv() const; diff --git a/panda/src/pgraph/attribNodeRegistry.h b/panda/src/pgraph/attribNodeRegistry.h index 42b0f78678..84b5805887 100644 --- a/panda/src/pgraph/attribNodeRegistry.h +++ b/panda/src/pgraph/attribNodeRegistry.h @@ -46,6 +46,7 @@ PUBLISHED: int get_num_nodes() const; NodePath get_node(int n) const; + MAKE_SEQ(get_nodes, get_num_nodes, get_node); TypeHandle get_node_type(int n) const; string get_node_name(int n) const; diff --git a/panda/src/pgraph/camera.h b/panda/src/pgraph/camera.h index b1e82f4e69..0b4499c756 100644 --- a/panda/src/pgraph/camera.h +++ b/panda/src/pgraph/camera.h @@ -55,6 +55,7 @@ PUBLISHED: INLINE int get_num_display_regions() const; INLINE DisplayRegion *get_display_region(int n) const; + MAKE_SEQ(get_display_regions, get_num_display_regions, get_display_region); INLINE void set_camera_mask(DrawMask mask); INLINE DrawMask get_camera_mask() const; diff --git a/panda/src/pgraph/clipPlaneAttrib.h b/panda/src/pgraph/clipPlaneAttrib.h index a8ad0f4058..bbada85694 100644 --- a/panda/src/pgraph/clipPlaneAttrib.h +++ b/panda/src/pgraph/clipPlaneAttrib.h @@ -75,10 +75,12 @@ PUBLISHED: INLINE int get_num_on_planes() const; INLINE NodePath get_on_plane(int n) const; + MAKE_SEQ(get_on_planes, get_num_on_planes, get_on_plane); INLINE bool has_on_plane(const NodePath &plane) const; INLINE int get_num_off_planes() const; INLINE NodePath get_off_plane(int n) const; + MAKE_SEQ(get_off_planes, get_num_off_planes, get_off_plane); INLINE bool has_off_plane(const NodePath &plane) const; INLINE bool has_all_off() const; diff --git a/panda/src/pgraph/cullBinManager.h b/panda/src/pgraph/cullBinManager.h index ad1fb08e9e..75007b8025 100644 --- a/panda/src/pgraph/cullBinManager.h +++ b/panda/src/pgraph/cullBinManager.h @@ -45,6 +45,7 @@ PUBLISHED: INLINE int get_num_bins() const; INLINE int get_bin(int n) const; + MAKE_SEQ(get_bins, get_num_bins, get_bin); int find_bin(const string &name) const; INLINE string get_bin_name(int bin_index) const; diff --git a/panda/src/pgraph/geomNode.h b/panda/src/pgraph/geomNode.h index ffea47e5a0..a9620f9e68 100644 --- a/panda/src/pgraph/geomNode.h +++ b/panda/src/pgraph/geomNode.h @@ -69,8 +69,10 @@ PUBLISHED: INLINE int get_num_geoms() const; INLINE CPT(Geom) get_geom(int n) const; + MAKE_SEQ(get_geoms, get_num_geoms, get_geom); INLINE PT(Geom) modify_geom(int n); INLINE const RenderState *get_geom_state(int n) const; + MAKE_SEQ(get_geom_states, get_num_geoms, get_geom_state); INLINE void set_geom_state(int n, const RenderState *state); void add_geom(Geom *geom, const RenderState *state = RenderState::make_empty()); diff --git a/panda/src/pgraph/internalNameCollection.cxx b/panda/src/pgraph/internalNameCollection.cxx index e514fd8711..fd4bd74395 100644 --- a/panda/src/pgraph/internalNameCollection.cxx +++ b/panda/src/pgraph/internalNameCollection.cxx @@ -230,6 +230,17 @@ operator [] (int index) const { return _names[index]; } +//////////////////////////////////////////////////////////////////// +// Function: InternalNameCollection::size +// Access: Published +// Description: Returns the number of names in the collection. This +// is the same thing as get_num_names(). +//////////////////////////////////////////////////////////////////// +int InternalNameCollection:: +size() const { + return _names.size(); +} + //////////////////////////////////////////////////////////////////// // Function: InternalNameCollection::output // Access: Published diff --git a/panda/src/pgraph/internalNameCollection.h b/panda/src/pgraph/internalNameCollection.h index 401e155aa0..9e66b56b68 100644 --- a/panda/src/pgraph/internalNameCollection.h +++ b/panda/src/pgraph/internalNameCollection.h @@ -40,7 +40,9 @@ PUBLISHED: int get_num_names() const; InternalName *get_name(int index) const; + MAKE_SEQ(get_names, get_num_names, get_name); InternalName *operator [] (int index) const; + int size() const; void output(ostream &out) const; void write(ostream &out, int indent_level = 0) const; diff --git a/panda/src/pgraph/lightAttrib.h b/panda/src/pgraph/lightAttrib.h index e770627ae5..c6ad400c4c 100644 --- a/panda/src/pgraph/lightAttrib.h +++ b/panda/src/pgraph/lightAttrib.h @@ -73,10 +73,12 @@ PUBLISHED: INLINE int get_num_on_lights() const; INLINE NodePath get_on_light(int n) const; + MAKE_SEQ(get_on_lights, get_num_on_lights, get_on_light); INLINE bool has_on_light(const NodePath &light) const; INLINE int get_num_off_lights() const; INLINE NodePath get_off_light(int n) const; + MAKE_SEQ(get_off_lights, get_num_off_lights, get_off_light); INLINE bool has_off_light(const NodePath &light) const; INLINE bool has_all_off() const; diff --git a/panda/src/pgraph/loader.h b/panda/src/pgraph/loader.h index 288cd3f1c7..7cbe35c657 100644 --- a/panda/src/pgraph/loader.h +++ b/panda/src/pgraph/loader.h @@ -63,7 +63,9 @@ PUBLISHED: INLINE void clear(); INLINE int get_num_files() const; INLINE const Filename &get_file(int n) const; + MAKE_SEQ(get_files, get_num_files, get_file); INLINE LoaderFileType *get_file_type(int n) const; + MAKE_SEQ(get_file_types, get_num_files, get_file_type); public: INLINE void add_file(const Filename &file, LoaderFileType *type); diff --git a/panda/src/pgraph/loaderFileTypeRegistry.h b/panda/src/pgraph/loaderFileTypeRegistry.h index d58ca8790c..610435d26c 100644 --- a/panda/src/pgraph/loaderFileTypeRegistry.h +++ b/panda/src/pgraph/loaderFileTypeRegistry.h @@ -41,6 +41,7 @@ public: PUBLISHED: int get_num_types() const; LoaderFileType *get_type(int n) const; + MAKE_SEQ(get_types, get_num_types, get_type); LoaderFileType *get_type_from_extension(const string &extension); void write(ostream &out, int indent_level = 0) const; diff --git a/panda/src/pgraph/lodNode.h b/panda/src/pgraph/lodNode.h index c0a0498c95..16234fa367 100644 --- a/panda/src/pgraph/lodNode.h +++ b/panda/src/pgraph/lodNode.h @@ -59,7 +59,9 @@ PUBLISHED: INLINE int get_num_switches() const; INLINE float get_in(int index) const; + MAKE_SEQ(get_ins, get_num_switches, get_in); INLINE float get_out(int index) const; + MAKE_SEQ(get_outs, get_num_switches, get_out); INLINE int get_lowest_switch() const; INLINE int get_highest_switch() const; diff --git a/panda/src/pgraph/materialCollection.cxx b/panda/src/pgraph/materialCollection.cxx index 64a6d03bfa..c27f386f75 100644 --- a/panda/src/pgraph/materialCollection.cxx +++ b/panda/src/pgraph/materialCollection.cxx @@ -249,6 +249,17 @@ operator [] (int index) const { return _materials[index]; } +//////////////////////////////////////////////////////////////////// +// Function: MaterialCollection::size +// Access: Published +// Description: Returns the number of materials in the collection. This +// is the same thing as get_num_materials(). +//////////////////////////////////////////////////////////////////// +int MaterialCollection:: +size() const { + return _materials.size(); +} + //////////////////////////////////////////////////////////////////// // Function: MaterialCollection::output // Access: Published diff --git a/panda/src/pgraph/materialCollection.h b/panda/src/pgraph/materialCollection.h index 66714e3b17..a4f7ee6527 100644 --- a/panda/src/pgraph/materialCollection.h +++ b/panda/src/pgraph/materialCollection.h @@ -43,6 +43,7 @@ PUBLISHED: int get_num_materials() const; Material *get_material(int index) const; Material *operator [] (int index) const; + int size() const; void output(ostream &out) const; void write(ostream &out, int indent_level = 0) const; diff --git a/panda/src/pgraph/nodePath.h b/panda/src/pgraph/nodePath.h index 3057891284..17326e63ed 100644 --- a/panda/src/pgraph/nodePath.h +++ b/panda/src/pgraph/nodePath.h @@ -180,7 +180,9 @@ PUBLISHED: INLINE bool is_singleton(Thread *current_thread = Thread::get_current_thread()) const; int get_num_nodes(Thread *current_thread = Thread::get_current_thread()) const; PandaNode *get_node(int index, Thread *current_thread = Thread::get_current_thread()) const; + MAKE_SEQ(get_nodes, get_num_nodes, get_node); NodePath get_ancestor(int index, Thread *current_thread = Thread::get_current_thread()) const; + MAKE_SEQ(get_ancestors, get_num_nodes, get_ancestor); INLINE ErrorType get_error_type() const; diff --git a/panda/src/pgraph/nodePathCollection.cxx b/panda/src/pgraph/nodePathCollection.cxx index 601d76dc62..148dd0f77f 100644 --- a/panda/src/pgraph/nodePathCollection.cxx +++ b/panda/src/pgraph/nodePathCollection.cxx @@ -246,6 +246,17 @@ operator [] (int index) const { return _node_paths[index]; } +//////////////////////////////////////////////////////////////////// +// Function: NodePathCollection::size +// Access: Published +// Description: Returns the number of paths in the collection. This +// is the same thing as get_num_paths(). +//////////////////////////////////////////////////////////////////// +int NodePathCollection:: +size() const { + return _node_paths.size(); +} + //////////////////////////////////////////////////////////////////// // Function: NodePathCollection::ls // Access: Published diff --git a/panda/src/pgraph/nodePathCollection.h b/panda/src/pgraph/nodePathCollection.h index ad467c9f00..e9b4cf9952 100644 --- a/panda/src/pgraph/nodePathCollection.h +++ b/panda/src/pgraph/nodePathCollection.h @@ -44,7 +44,9 @@ PUBLISHED: bool is_empty() const; int get_num_paths() const; NodePath get_path(int index) const; + MAKE_SEQ(get_paths, get_num_paths, get_path); NodePath operator [] (int index) const; + int size() const; // Handy operations on many NodePaths at once. INLINE void ls() const; diff --git a/panda/src/pgraph/portalNode.h b/panda/src/pgraph/portalNode.h index a07d827eb8..07fa222e74 100755 --- a/panda/src/pgraph/portalNode.h +++ b/panda/src/pgraph/portalNode.h @@ -74,6 +74,7 @@ PUBLISHED: INLINE int get_num_vertices() const; INLINE const LPoint3f &get_vertex(int n) const; + MAKE_SEQ(get_vertices, get_num_vertices, get_vertex); INLINE void set_cell_in(const NodePath &cell); INLINE NodePath get_cell_in() const; diff --git a/panda/src/pgraph/scissorEffect.h b/panda/src/pgraph/scissorEffect.h index ac8c7a794b..6c157a4485 100644 --- a/panda/src/pgraph/scissorEffect.h +++ b/panda/src/pgraph/scissorEffect.h @@ -53,7 +53,9 @@ PUBLISHED: INLINE int get_num_points() const; INLINE const LPoint3f &get_point(int n) const; + MAKE_SEQ(get_points, get_num_points, get_point); INLINE NodePath get_node(int n) const; + MAKE_SEQ(get_nodes, get_num_points, get_node); INLINE bool get_clip() const; diff --git a/panda/src/pgraph/texMatrixAttrib.h b/panda/src/pgraph/texMatrixAttrib.h index 456bf777f4..e096de81cf 100644 --- a/panda/src/pgraph/texMatrixAttrib.h +++ b/panda/src/pgraph/texMatrixAttrib.h @@ -51,6 +51,7 @@ PUBLISHED: int get_num_stages() const; TextureStage *get_stage(int n) const; + MAKE_SEQ(get_stages, get_num_stages, get_stage); const LMatrix4f &get_mat() const; const LMatrix4f &get_mat(TextureStage *stage) const; diff --git a/panda/src/pgraph/textureAttrib.h b/panda/src/pgraph/textureAttrib.h index 68a048ec82..15ff22510a 100644 --- a/panda/src/pgraph/textureAttrib.h +++ b/panda/src/pgraph/textureAttrib.h @@ -53,8 +53,10 @@ PUBLISHED: INLINE int get_num_on_stages() const; INLINE TextureStage *get_on_stage(int n) const; + MAKE_SEQ(get_on_stages, get_num_on_stages, get_on_stage); INLINE int get_num_on_ff_stages() const; INLINE TextureStage *get_on_ff_stage(int n) const; + MAKE_SEQ(get_on_ff_stages, get_num_on_ff_stages, get_on_ff_stage); INLINE int get_ff_tc_index(int n) const; INLINE bool has_on_stage(TextureStage *stage) const; INLINE Texture *get_on_texture(TextureStage *stage) const; @@ -63,6 +65,7 @@ PUBLISHED: INLINE int get_num_off_stages() const; INLINE TextureStage *get_off_stage(int n) const; + MAKE_SEQ(get_off_stages, get_num_off_stages, get_off_stage); INLINE bool has_off_stage(TextureStage *stage) const; INLINE bool has_all_off() const; diff --git a/panda/src/pgraph/textureCollection.cxx b/panda/src/pgraph/textureCollection.cxx index 78f0ddd55f..d77f21c516 100644 --- a/panda/src/pgraph/textureCollection.cxx +++ b/panda/src/pgraph/textureCollection.cxx @@ -249,6 +249,17 @@ operator [] (int index) const { return _textures[index]; } +//////////////////////////////////////////////////////////////////// +// Function: TextureCollection::size +// Access: Published +// Description: Returns the number of textures in the collection. This +// is the same thing as get_num_textures(). +//////////////////////////////////////////////////////////////////// +int TextureCollection:: +size() const { + return _textures.size(); +} + //////////////////////////////////////////////////////////////////// // Function: TextureCollection::output // Access: Published diff --git a/panda/src/pgraph/textureCollection.h b/panda/src/pgraph/textureCollection.h index 8720e85054..dc9f9458b8 100644 --- a/panda/src/pgraph/textureCollection.h +++ b/panda/src/pgraph/textureCollection.h @@ -42,7 +42,9 @@ PUBLISHED: int get_num_textures() const; Texture *get_texture(int index) const; + MAKE_SEQ(get_textures, get_num_textures, get_texture); Texture *operator [] (int index) const; + int size() const; void output(ostream &out) const; void write(ostream &out, int indent_level = 0) const; diff --git a/panda/src/pgraph/textureStageCollection.cxx b/panda/src/pgraph/textureStageCollection.cxx index 096481ea99..b49f24ab65 100644 --- a/panda/src/pgraph/textureStageCollection.cxx +++ b/panda/src/pgraph/textureStageCollection.cxx @@ -251,6 +251,18 @@ operator [] (int index) const { return _texture_stages[index]; } +//////////////////////////////////////////////////////////////////// +// Function: TextureStageCollection::size +// Access: Published +// Description: Returns the number of texture stages in the +// collection. This is the same thing as +// get_num_texture_stages(). +//////////////////////////////////////////////////////////////////// +int TextureStageCollection:: +size() const { + return _texture_stages.size(); +} + //////////////////////////////////////////////////////////////////// // Function: TextureStageCollection::sort // Access: Published diff --git a/panda/src/pgraph/textureStageCollection.h b/panda/src/pgraph/textureStageCollection.h index 5c828bff2c..d8b7324c21 100644 --- a/panda/src/pgraph/textureStageCollection.h +++ b/panda/src/pgraph/textureStageCollection.h @@ -42,7 +42,9 @@ PUBLISHED: int get_num_texture_stages() const; TextureStage *get_texture_stage(int index) const; + MAKE_SEQ(get_texture_stages, get_num_texture_stages, get_texture_stage); TextureStage *operator [] (int index) const; + int size() const; void sort(); diff --git a/panda/src/pgui/pgItem.h b/panda/src/pgui/pgItem.h index 71d1f5e179..55bb2f01b0 100644 --- a/panda/src/pgui/pgItem.h +++ b/panda/src/pgui/pgItem.h @@ -132,6 +132,7 @@ PUBLISHED: void clear_state_def(int state); bool has_state_def(int state) const; NodePath &get_state_def(int state); + MAKE_SEQ(get_state_defs, get_num_state_defs, get_state_def); NodePath instance_to_state_def(int state, const NodePath &path); PGFrameStyle get_frame_style(int state); diff --git a/panda/src/physics/forceNode.h b/panda/src/physics/forceNode.h index 5b003a49f7..ee24f961c1 100644 --- a/panda/src/physics/forceNode.h +++ b/panda/src/physics/forceNode.h @@ -33,6 +33,7 @@ PUBLISHED: INLINE void clear(); INLINE BaseForce *get_force(int index) const; INLINE int get_num_forces() const; + MAKE_SEQ(get_forces, get_num_forces, get_force); INLINE void add_force(BaseForce *force); void add_forces_from(const ForceNode &other); diff --git a/panda/src/physics/physical.h b/panda/src/physics/physical.h index 0c87c1c1be..56458d8f82 100644 --- a/panda/src/physics/physical.h +++ b/panda/src/physics/physical.h @@ -66,8 +66,10 @@ PUBLISHED: INLINE int get_num_linear_forces() const; INLINE PT(LinearForce) get_linear_force(int index) const; + MAKE_SEQ(get_linear_forces, get_num_linear_forces, get_linear_force); INLINE int get_num_angular_forces() const; INLINE PT(AngularForce) get_angular_force(int index) const; + MAKE_SEQ(get_angular_forces, get_num_angular_forces, get_angular_force); INLINE void set_viscosity(float viscosity); INLINE float get_viscosity() const; diff --git a/panda/src/physics/physicalNode.h b/panda/src/physics/physicalNode.h index 360a627342..d7f997a2c2 100644 --- a/panda/src/physics/physicalNode.h +++ b/panda/src/physics/physicalNode.h @@ -34,6 +34,7 @@ PUBLISHED: INLINE void clear(); INLINE Physical *get_physical(int index) const; INLINE int get_num_physicals() const; + MAKE_SEQ(get_physicals, get_num_physicals, get_physical); INLINE void add_physical(Physical *physical); void add_physicals_from(const PhysicalNode &other); diff --git a/panda/src/physics/physicsObjectCollection.cxx b/panda/src/physics/physicsObjectCollection.cxx index 425cff99e6..1e1c7344bc 100755 --- a/panda/src/physics/physicsObjectCollection.cxx +++ b/panda/src/physics/physicsObjectCollection.cxx @@ -242,6 +242,18 @@ operator [] (int index) const { return _physics_objects[index]; } +//////////////////////////////////////////////////////////////////// +// Function: PhysicsObjectCollection::size +// Access: Published +// Description: Returns the number of physics objects in the +// collection. This is the same thing as +// get_num_physics_objects(). +//////////////////////////////////////////////////////////////////// +int PhysicsObjectCollection:: +size() const { + return _physics_objects.size(); +} + //////////////////////////////////////////////////////////////////// // Function: PhysicsObjectCollection::output // Access: Published diff --git a/panda/src/physics/physicsObjectCollection.h b/panda/src/physics/physicsObjectCollection.h index 2398c8b351..451e16ddc4 100755 --- a/panda/src/physics/physicsObjectCollection.h +++ b/panda/src/physics/physicsObjectCollection.h @@ -43,8 +43,9 @@ PUBLISHED: bool is_empty() const; int get_num_physics_objects() const; PT(PhysicsObject) get_physics_object(int index) const; + MAKE_SEQ(get_physics_objects, get_num_physics_objects, get_physics_object); PT(PhysicsObject) operator [] (int index) const; - + int size() const; void output(ostream &out) const; void write(ostream &out, int indent_level = 0) const; diff --git a/panda/src/pnmimage/pnmFileType.h b/panda/src/pnmimage/pnmFileType.h index f5e6ece49a..19f583b6b6 100644 --- a/panda/src/pnmimage/pnmFileType.h +++ b/panda/src/pnmimage/pnmFileType.h @@ -44,6 +44,7 @@ PUBLISHED: virtual int get_num_extensions() const; virtual string get_extension(int n) const; + MAKE_SEQ(get_extensions, get_num_extensions, get_extension); virtual string get_suggested_extension() const; public: diff --git a/panda/src/pnmimage/pnmFileTypeRegistry.h b/panda/src/pnmimage/pnmFileTypeRegistry.h index 1fc444f539..d2f3a1799b 100644 --- a/panda/src/pnmimage/pnmFileTypeRegistry.h +++ b/panda/src/pnmimage/pnmFileTypeRegistry.h @@ -40,6 +40,7 @@ public: PUBLISHED: int get_num_types() const; PNMFileType *get_type(int n) const; + MAKE_SEQ(get_types, get_num_types, get_type); PNMFileType *get_type_from_extension(const string &filename) const; PNMFileType *get_type_from_magic_number(const string &magic_number) const; diff --git a/panda/src/pstatclient/pStatClient.h b/panda/src/pstatclient/pStatClient.h index 650458f896..a44af5cb06 100644 --- a/panda/src/pstatclient/pStatClient.h +++ b/panda/src/pstatclient/pStatClient.h @@ -67,12 +67,14 @@ PUBLISHED: INLINE int get_num_collectors() const; PStatCollector get_collector(int index) const; + MAKE_SEQ(get_collectors, get_num_collectors, get_collector); INLINE PStatCollectorDef *get_collector_def(int index) const; string get_collector_name(int index) const; string get_collector_fullname(int index) const; INLINE int get_num_threads() const; PStatThread get_thread(int index) const; + MAKE_SEQ(get_threads, get_num_threads, get_thread); INLINE string get_thread_name(int index) const; INLINE string get_thread_sync_name(int index) const; INLINE Thread *get_thread_object(int index) const; diff --git a/panda/src/putil/modifierButtons.h b/panda/src/putil/modifierButtons.h index fab38b8555..3dc40c61ba 100644 --- a/panda/src/putil/modifierButtons.h +++ b/panda/src/putil/modifierButtons.h @@ -53,6 +53,7 @@ PUBLISHED: INLINE int get_num_buttons() const; INLINE ButtonHandle get_button(int index) const; + MAKE_SEQ(get_buttons, get_num_buttons, get_button); bool button_down(ButtonHandle button); bool button_up(ButtonHandle button); diff --git a/panda/src/text/dynamicTextFont.h b/panda/src/text/dynamicTextFont.h index c77a2be28a..af8f7db4b9 100644 --- a/panda/src/text/dynamicTextFont.h +++ b/panda/src/text/dynamicTextFont.h @@ -88,6 +88,7 @@ PUBLISHED: int get_num_pages() const; DynamicTextPage *get_page(int n) const; + MAKE_SEQ(get_pages, get_num_pages, get_page); int garbage_collect(); void clear(); diff --git a/panda/src/tform/buttonThrower.h b/panda/src/tform/buttonThrower.h index 7726324ba7..59b19b7bbf 100644 --- a/panda/src/tform/buttonThrower.h +++ b/panda/src/tform/buttonThrower.h @@ -66,6 +66,7 @@ PUBLISHED: void add_parameter(const EventParameter &obj); int get_num_parameters() const; EventParameter get_parameter(int n) const; + MAKE_SEQ(get_parameters, get_num_parameters, get_parameter); INLINE const ModifierButtons &get_modifier_buttons() const; INLINE void set_modifier_buttons(const ModifierButtons &mods); diff --git a/panda/src/tform/mouseWatcher.h b/panda/src/tform/mouseWatcher.h index 3088b17590..5ee21ece53 100644 --- a/panda/src/tform/mouseWatcher.h +++ b/panda/src/tform/mouseWatcher.h @@ -130,6 +130,7 @@ PUBLISHED: bool replace_group(MouseWatcherGroup *old_group, MouseWatcherGroup *new_group); int get_num_groups() const; MouseWatcherGroup *get_group(int n) const; + MAKE_SEQ(get_groups, get_num_groups, get_group); INLINE void set_inactivity_timeout(double timeout); INLINE bool has_inactivity_timeout() const; diff --git a/panda/src/tform/mouseWatcherGroup.h b/panda/src/tform/mouseWatcherGroup.h index b411f6a80d..df7abcc6c8 100644 --- a/panda/src/tform/mouseWatcherGroup.h +++ b/panda/src/tform/mouseWatcherGroup.h @@ -46,6 +46,7 @@ PUBLISHED: int get_num_regions() const; MouseWatcherRegion *get_region(int n) const; + MAKE_SEQ(get_regions, get_num_regions, get_region); void output(ostream &out) const; void write(ostream &out, int indent_level = 0) const;