diff options
Diffstat (limited to 'cpp')
36 files changed, 2308 insertions, 1352 deletions
diff --git a/cpp/allTests.py b/cpp/allTests.py index ab5f6b14254..7ce520ca015 100755 --- a/cpp/allTests.py +++ b/cpp/allTests.py @@ -71,6 +71,7 @@ tests = [ ("Ice/hash", ["once"]), ("Ice/admin", ["core"]), ("Ice/metrics", ["core", "nossl", "noipv6"]), + ("Ice/enums", ["once"]), ("IceSSL/configuration", ["once", "novalgrind"]), # valgrind doesn't work well with openssl ("IceBox/configuration", ["core", "noipv6", "novc6", "nomingw", "nomx"]), ("IceBox/admin", ["core", "noipv6", "novc6", "nomingw", "nomx"]), diff --git a/cpp/include/Ice/Stream.h b/cpp/include/Ice/Stream.h index 21b53d9cb24..0048eb6b538 100644 --- a/cpp/include/Ice/Stream.h +++ b/cpp/include/Ice/Stream.h @@ -125,17 +125,17 @@ public: } Int - readEnum(Int limit) + readEnum(Int maxValue) { if(getEncoding() == Encoding_1_0) { - if(limit <= 127) + if(maxValue < 127) { Byte value; read(value); return value; } - else if(limit <= 32767) + else if(maxValue < 32767) { Short value; read(value); @@ -249,15 +249,15 @@ public: } void - writeEnum(Int v, Int limit) + writeEnum(Int v, Int maxValue) { if(getEncoding() == Encoding_1_0) { - if(limit <= 127) + if(maxValue < 127) { write(static_cast<Byte>(v)); } - else if(limit <= 32767) + else if(maxValue < 32767) { write(static_cast<Short>(v)); } diff --git a/cpp/include/Ice/StreamHelpers.h b/cpp/include/Ice/StreamHelpers.h index 9e69a02964e..81d30f4d543 100644 --- a/cpp/include/Ice/StreamHelpers.h +++ b/cpp/include/Ice/StreamHelpers.h @@ -328,18 +328,18 @@ struct StreamHelper<T, StreamHelperCategoryEnum> template<class S> static inline void write(S* stream, const T& v) { - if(static_cast<Int>(v) < 0 || static_cast<Int>(v) >= StreamableTraits<T>::enumLimit) + if(static_cast<Int>(v) < StreamableTraits<T>::minValue || static_cast<Int>(v) > StreamableTraits<T>::maxValue) { IceInternal::Ex::throwMarshalException(__FILE__, __LINE__, "enumerator out of range"); } - stream->writeEnum(static_cast<Int>(v), StreamableTraits<T>::enumLimit); + stream->writeEnum(static_cast<Int>(v), StreamableTraits<T>::maxValue); } template<class S> static inline void read(S* stream, T& v) { - Int value = stream->readEnum(StreamableTraits<T>::enumLimit); - if(value < 0 || value >= StreamableTraits<T>::enumLimit) + Int value = stream->readEnum(StreamableTraits<T>::maxValue); + if(value < StreamableTraits<T>::minValue || value > StreamableTraits<T>::maxValue) { IceInternal::Ex::throwMarshalException(__FILE__, __LINE__, "enumerator out of range"); } diff --git a/cpp/include/Slice/Parser.h b/cpp/include/Slice/Parser.h index 40e30b27ce4..3c24cdcf520 100644 --- a/cpp/include/Slice/Parser.h +++ b/cpp/include/Slice/Parser.h @@ -432,6 +432,7 @@ public: const StringList&, bool, NodeType = Real); EnumPtr createEnum(const std::string&, bool, NodeType = Real); EnumeratorPtr createEnumerator(const std::string&); + EnumeratorPtr createEnumerator(const std::string&, int); ConstPtr createConst(const std::string, const TypePtr&, const StringList&, const SyntaxTreeBasePtr&, const std::string&, const std::string&, NodeType = Real); TypeList lookupType(const std::string&, bool = true); @@ -482,6 +483,7 @@ protected: bool checkInterfaceAndLocal(const std::string&, bool, bool, bool, bool, bool); bool checkGlobalMetaData(const StringList&, const StringList&); bool validateConstant(const std::string&, const TypePtr&, const SyntaxTreeBasePtr&, const std::string&, bool); + EnumeratorPtr validateEnumerator(const std::string&); ContainedList _contents; std::map<std::string, ContainedPtr, CICompare> _introducedMap; @@ -838,6 +840,9 @@ public: virtual void destroy(); EnumeratorList getEnumerators(); void setEnumerators(const EnumeratorList&); + bool explicitValue() const; + int minValue() const; + int maxValue() const; virtual ContainedType containedType() const; virtual bool uses(const ContainedPtr&) const; virtual bool usesClasses() const; @@ -853,6 +858,9 @@ protected: friend class Container; EnumeratorList _enumerators; + bool _explicitValue; + IceUtil::Int64 _minValue; + IceUtil::Int64 _maxValue; }; // ---------------------------------------------------------------------- @@ -868,13 +876,19 @@ public: virtual ContainedType containedType() const; virtual std::string kindOf() const; + bool explicitValue() const; + int value() const; + protected: Enumerator(const ContainerPtr&, const std::string&); + Enumerator(const ContainerPtr&, const std::string&, int); friend class Container; friend class Enum; EnumPtr _type; + bool _explicitValue; + int _value; }; // ---------------------------------------------------------------------- diff --git a/cpp/src/Ice/BasicStream.cpp b/cpp/src/Ice/BasicStream.cpp index 52bf8c72e54..cd32101f980 100755 --- a/cpp/src/Ice/BasicStream.cpp +++ b/cpp/src/Ice/BasicStream.cpp @@ -1511,17 +1511,17 @@ IceInternal::BasicStream::read(ObjectPrx& v) } Int -IceInternal::BasicStream::readEnum(Int limit) +IceInternal::BasicStream::readEnum(Int maxValue) { if(getReadEncoding() == Encoding_1_0) { - if(limit <= 127) + if(maxValue < 127) { Byte value; read(value); return value; } - else if(limit <= 32767) + else if(maxValue < 32767) { Short value; read(value); @@ -1541,15 +1541,15 @@ IceInternal::BasicStream::readEnum(Int limit) } void -IceInternal::BasicStream::writeEnum(Int v, Int limit) +IceInternal::BasicStream::writeEnum(Int v, Int maxValue) { if(getWriteEncoding() == Encoding_1_0) { - if(limit <= 127) + if(maxValue < 127) { write(static_cast<Byte>(v)); } - else if(limit <= 32767) + else if(maxValue < 32767) { write(static_cast<Short>(v)); } diff --git a/cpp/src/Ice/SlicedData.cpp b/cpp/src/Ice/SlicedData.cpp index 5332719eec9..50930e4ce27 100644 --- a/cpp/src/Ice/SlicedData.cpp +++ b/cpp/src/Ice/SlicedData.cpp @@ -1,6 +1,6 @@ // ********************************************************************** // -// Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved. +// Copyright (c) 2003-2012 ZeroC, Inc. All rights reserved. // // This copy of Ice is licensed to you under the terms described in the // ICE_LICENSE file included in this distribution. diff --git a/cpp/src/IceGrid/Parser.cpp b/cpp/src/IceGrid/Parser.cpp index da5d25cbf98..a2eac633f04 100644 --- a/cpp/src/IceGrid/Parser.cpp +++ b/cpp/src/IceGrid/Parser.cpp @@ -2172,7 +2172,7 @@ Parser::showFile(const string& reader, const list<string>& origArgs) void Parser::showBanner() { - cout << "Ice " << ICE_STRING_VERSION << " Copyright 2003-2011 ZeroC, Inc." << endl; + cout << "Ice " << ICE_STRING_VERSION << " Copyright 2003-2012 ZeroC, Inc." << endl; } void diff --git a/cpp/src/Slice/CsUtil.cpp b/cpp/src/Slice/CsUtil.cpp index 1ec3bff4a56..e3841b72e9e 100644 --- a/cpp/src/Slice/CsUtil.cpp +++ b/cpp/src/Slice/CsUtil.cpp @@ -651,24 +651,26 @@ Slice::CsGenerator::writeMarshalUnmarshalCode(Output &out, EnumPtr en = EnumPtr::dynamicCast(type); if(en) { - size_t sz = en->getEnumerators().size(); if(marshal) { if(streamingAPI) { - out << nl << "if((int)" << param << " < 0 || (int)" << param << " >= " << sz << ")"; + out << nl << "if((int)" << param << " < " << en->minValue() + << " || (int)" << param << " > " << en->maxValue() << ")"; out << sb; out << nl << "throw new Ice.MarshalException(\"enumerator out of range\");"; out << eb; } - out << nl << stream << ".writeEnum((int)" << param << ", " << sz << ");"; + out << nl << stream << ".writeEnum((int)" << param << ", " << en->maxValue() << ");"; } else { - out << nl << param << " = (" << fixId(en->scoped()) << ')' << stream << ".readEnum(" << sz << ");"; + out << nl << param << " = (" << fixId(en->scoped()) << ')' << stream << ".readEnum(" << en->maxValue() + << ");"; if(streamingAPI) { - out << nl << "if((int)" << param << " < 0 || (int)" << param << " >= " << sz << ")"; + out << nl << "if((int)" << param << " < " << en->minValue() << " || (int)" << param << " > " + << en->maxValue() << ")"; out << sb; out << nl << "throw new Ice.MarshalException(\"enumerator out of range\");"; out << eb; diff --git a/cpp/src/Slice/Grammar.cpp b/cpp/src/Slice/Grammar.cpp index 842a30745e7..f565fb444a9 100644 --- a/cpp/src/Slice/Grammar.cpp +++ b/cpp/src/Slice/Grammar.cpp @@ -1,9 +1,8 @@ -/* A Bison parser, made by GNU Bison 2.4.3. */ +/* A Bison parser, made by GNU Bison 2.5. */ -/* Skeleton implementation for Bison's Yacc-like parsers in C +/* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2011 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 @@ -45,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.4.3" +#define YYBISON_VERSION "2.5" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -74,8 +73,8 @@ /* Copy the first part of user declarations. */ -/* Line 189 of yacc.c */ -#line 1 "../Slice/Grammar.y" +/* Line 268 of yacc.c */ +#line 1 "Grammar.y" // ********************************************************************** @@ -121,8 +120,8 @@ slice_error(const char* s) -/* Line 189 of yacc.c */ -#line 126 "Grammar.tab.c" +/* Line 268 of yacc.c */ +#line 125 "Grammar.tab.c" /* Enabling traces. */ #ifndef YYDEBUG @@ -207,8 +206,8 @@ typedef int YYSTYPE; /* Copy the second part of user declarations. */ -/* Line 264 of yacc.c */ -#line 212 "Grammar.tab.c" +/* Line 343 of yacc.c */ +#line 211 "Grammar.tab.c" #ifdef short # undef short @@ -311,11 +310,11 @@ YYID (yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 # endif # endif # endif @@ -338,24 +337,24 @@ YYID (yyi) # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif -# if (defined __cplusplus && ! defined _STDLIB_H \ +# if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif @@ -384,23 +383,7 @@ union yyalloc ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + 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 \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif +# define YYCOPY_NEEDED 1 /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of @@ -420,19 +403,39 @@ union yyalloc #endif +#if defined YYCOPY_NEEDED && YYCOPY_NEEDED +/* 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 \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (To)[yyi] = (From)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif +#endif /* !YYCOPY_NEEDED */ + /* YYFINAL -- State number of the termination state. */ #define YYFINAL 13 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 878 +#define YYLAST 893 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 54 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 70 +#define YYNNTS 71 /* YYNRULES -- Number of rules. */ -#define YYNRULES 196 +#define YYNRULES 199 /* YYNRULES -- Number of states. */ -#define YYNSTATES 291 +#define YYNSTATES 295 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 @@ -493,76 +496,77 @@ static const yytype_uint16 yyprhs[] = 258, 259, 265, 267, 269, 272, 275, 278, 279, 287, 291, 293, 295, 298, 299, 304, 308, 311, 312, 314, 318, 320, 322, 324, 332, 340, 351, 362, 365, 368, - 369, 376, 382, 386, 388, 390, 392, 393, 395, 396, - 397, 401, 407, 412, 419, 423, 429, 432, 433, 435, - 438, 442, 444, 446, 448, 450, 452, 454, 456, 458, - 460, 463, 465, 467, 470, 473, 475, 479, 481, 483, - 484, 486, 488, 490, 492, 494, 496, 503, 509, 511, - 513, 515, 517, 519, 521, 523, 525, 527, 529, 531, - 533, 535, 537, 539, 541, 543, 545, 547, 549, 551, - 553, 555, 557, 559, 561, 563, 565 + 369, 376, 382, 386, 388, 390, 394, 396, 397, 399, + 401, 403, 404, 405, 409, 415, 420, 427, 431, 437, + 440, 441, 443, 446, 450, 452, 454, 456, 458, 460, + 462, 464, 466, 468, 471, 473, 475, 478, 481, 483, + 487, 489, 491, 492, 494, 496, 498, 500, 502, 504, + 511, 517, 519, 521, 523, 525, 527, 529, 531, 533, + 535, 537, 539, 541, 543, 545, 547, 549, 551, 553, + 555, 557, 559, 561, 563, 565, 567, 569, 571, 573 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int8 yyrhs[] = { - 55, 0, -1, 58, -1, 42, 119, 43, -1, 40, - 119, 41, -1, -1, -1, 56, 59, 58, -1, -1, + 55, 0, -1, 58, -1, 42, 120, 43, -1, 40, + 120, 41, -1, -1, -1, 56, 59, 58, -1, -1, 57, 62, 60, 45, 58, -1, -1, 1, 45, 61, 58, -1, 57, 62, -1, -1, 63, -1, 82, -1, 83, -1, 97, -1, 98, -1, 66, -1, 67, -1, 76, -1, 77, -1, 106, -1, 107, -1, 109, -1, - 122, -1, -1, 3, 33, 64, 46, 58, 47, -1, - 6, 33, -1, 6, 123, -1, 120, 65, -1, -1, - 120, 65, 69, 68, 46, 70, 47, -1, 12, 116, + 123, -1, -1, 3, 33, 64, 46, 58, 47, -1, + 6, 33, -1, 6, 124, -1, 121, 65, -1, -1, + 121, 65, 69, 68, 46, 70, 47, -1, 12, 117, -1, -1, 57, 74, 45, 70, -1, 1, 45, 70, - -1, 57, 74, -1, -1, 117, 33, -1, 39, 35, - 48, -1, 39, 116, 48, -1, 39, 48, -1, 31, + -1, 57, 74, -1, -1, 118, 33, -1, 39, 35, + 48, -1, 39, 117, 48, -1, 39, 48, -1, 31, -1, 72, 71, -1, 71, -1, 88, -1, 7, 33, - -1, 7, 123, -1, 120, 75, -1, -1, 120, 75, + -1, 7, 124, -1, 121, 75, -1, -1, 121, 75, 78, 46, 79, 47, -1, 57, 80, 45, 79, -1, 1, 45, 79, -1, 57, 80, -1, -1, 89, -1, - 4, 33, -1, 4, 123, -1, 120, 81, -1, -1, - 120, 81, 85, 86, 84, 46, 87, 47, -1, 12, - 116, -1, -1, 13, 100, -1, -1, 57, 95, 45, + 4, 33, -1, 4, 124, -1, 121, 81, -1, -1, + 121, 81, 85, 86, 84, 46, 87, 47, -1, 12, + 117, -1, -1, 13, 100, -1, -1, 57, 95, 45, 87, -1, 1, 45, 87, -1, 57, 95, -1, -1, - 73, -1, 73, 49, 121, -1, 117, 123, -1, 117, - -1, 71, -1, 71, 49, 121, -1, 72, 71, -1, - 72, 71, 49, 121, -1, 117, 123, -1, 117, -1, - 72, 117, -1, 117, -1, 15, -1, 90, 37, -1, + 73, -1, 73, 49, 122, -1, 118, 124, -1, 118, + -1, 71, -1, 71, 49, 122, -1, 72, 71, -1, + 72, 71, 49, 122, -1, 118, 124, -1, 118, -1, + 72, 118, -1, 118, -1, 15, -1, 90, 37, -1, 30, 90, 37, -1, 90, 38, -1, 30, 90, 38, - -1, -1, 91, 114, 48, 93, 115, -1, -1, 91, - 1, 48, 94, 115, -1, 88, -1, 92, -1, 5, - 33, -1, 5, 123, -1, 120, 96, -1, -1, 120, - 96, 101, 99, 46, 102, 47, -1, 116, 50, 100, - -1, 116, -1, 24, -1, 12, 100, -1, -1, 57, + -1, -1, 91, 115, 48, 93, 116, -1, -1, 91, + 1, 48, 94, 116, -1, 88, -1, 92, -1, 5, + 33, -1, 5, 124, -1, 121, 96, -1, -1, 121, + 96, 101, 99, 46, 102, 47, -1, 117, 50, 100, + -1, 117, -1, 24, -1, 12, 100, -1, -1, 57, 103, 45, 102, -1, 1, 45, 102, -1, 57, 103, -1, -1, 92, -1, 105, 50, 104, -1, 105, -1, - 116, -1, 123, -1, 120, 8, 51, 57, 117, 52, - 33, -1, 120, 8, 51, 57, 117, 52, 123, -1, - 120, 9, 51, 57, 117, 50, 57, 117, 52, 33, - -1, 120, 9, 51, 57, 117, 50, 57, 117, 52, - 123, -1, 10, 33, -1, 10, 123, -1, -1, 120, - 108, 110, 46, 111, 47, -1, 120, 10, 46, 111, + 117, -1, 124, -1, 121, 8, 51, 57, 118, 52, + 33, -1, 121, 8, 51, 57, 118, 52, 124, -1, + 121, 9, 51, 57, 118, 50, 57, 118, 52, 33, + -1, 121, 9, 51, 57, 118, 50, 57, 118, 52, + 124, -1, 10, 33, -1, 10, 124, -1, -1, 121, + 108, 110, 46, 111, 47, -1, 121, 10, 46, 111, 47, -1, 112, 50, 111, -1, 112, -1, 33, -1, - 123, -1, -1, 11, -1, -1, -1, 113, 57, 73, - -1, 114, 50, 113, 57, 73, -1, 113, 57, 117, - 123, -1, 114, 50, 113, 57, 117, 123, -1, 113, - 57, 117, -1, 114, 50, 113, 57, 117, -1, 14, - 104, -1, -1, 33, -1, 32, 33, -1, 116, 32, - 33, -1, 16, -1, 17, -1, 18, -1, 19, -1, - 20, -1, 21, -1, 22, -1, 23, -1, 24, -1, - 24, 53, -1, 25, -1, 116, -1, 116, 53, -1, - 34, 118, -1, 34, -1, 119, 50, 118, -1, 118, - -1, 26, -1, -1, 35, -1, 36, -1, 116, -1, - 34, -1, 28, -1, 29, -1, 27, 57, 117, 33, - 49, 121, -1, 27, 57, 117, 49, 121, -1, 3, - -1, 4, -1, 5, -1, 6, -1, 7, -1, 8, - -1, 9, -1, 10, -1, 11, -1, 12, -1, 13, - -1, 14, -1, 15, -1, 16, -1, 17, -1, 18, - -1, 19, -1, 20, -1, 21, -1, 22, -1, 23, - -1, 24, -1, 25, -1, 26, -1, 27, -1, 28, - -1, 29, -1, 30, -1, 31, -1 + 33, 49, 113, -1, 124, -1, -1, 35, -1, 117, + -1, 11, -1, -1, -1, 114, 57, 73, -1, 115, + 50, 114, 57, 73, -1, 114, 57, 118, 124, -1, + 115, 50, 114, 57, 118, 124, -1, 114, 57, 118, + -1, 115, 50, 114, 57, 118, -1, 14, 104, -1, + -1, 33, -1, 32, 33, -1, 117, 32, 33, -1, + 16, -1, 17, -1, 18, -1, 19, -1, 20, -1, + 21, -1, 22, -1, 23, -1, 24, -1, 24, 53, + -1, 25, -1, 117, -1, 117, 53, -1, 34, 119, + -1, 34, -1, 120, 50, 119, -1, 119, -1, 26, + -1, -1, 35, -1, 36, -1, 117, -1, 34, -1, + 28, -1, 29, -1, 27, 57, 118, 33, 49, 122, + -1, 27, 57, 118, 49, 122, -1, 3, -1, 4, + -1, 5, -1, 6, -1, 7, -1, 8, -1, 9, + -1, 10, -1, 11, -1, 12, -1, 13, -1, 14, + -1, 15, -1, 16, -1, 17, -1, 18, -1, 19, + -1, 20, -1, 21, -1, 22, -1, 23, -1, 24, + -1, 25, -1, 26, -1, 27, -1, 28, -1, 29, + -1, 30, -1, 31, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ @@ -580,14 +584,14 @@ static const yytype_uint16 yyrline[] = 1060, 1059, 1082, 1083, 1089, 1093, 1104, 1119, 1118, 1153, 1188, 1223, 1233, 1238, 1246, 1255, 1258, 1263, 1270, 1276, 1283, 1295, 1307, 1318, 1327, 1342, 1353, 1370, 1374, 1386, - 1385, 1409, 1424, 1430, 1438, 1450, 1458, 1467, 1474, 1485, - 1487, 1503, 1519, 1531, 1543, 1554, 1570, 1575, 1583, 1586, - 1592, 1605, 1609, 1613, 1617, 1621, 1625, 1629, 1633, 1637, - 1641, 1645, 1649, 1668, 1709, 1715, 1723, 1730, 1742, 1749, - 1759, 1772, 1785, 1831, 1842, 1853, 1869, 1878, 1892, 1895, - 1898, 1901, 1904, 1907, 1910, 1913, 1916, 1919, 1922, 1925, - 1928, 1931, 1934, 1937, 1940, 1943, 1946, 1949, 1952, 1955, - 1958, 1961, 1964, 1967, 1970, 1973, 1976 + 1385, 1409, 1424, 1430, 1438, 1450, 1473, 1481, 1490, 1494, + 1533, 1540, 1551, 1553, 1569, 1585, 1597, 1609, 1620, 1636, + 1641, 1649, 1652, 1658, 1671, 1675, 1679, 1683, 1687, 1691, + 1695, 1699, 1703, 1707, 1711, 1715, 1734, 1775, 1781, 1789, + 1796, 1808, 1815, 1825, 1838, 1851, 1897, 1908, 1919, 1935, + 1944, 1958, 1961, 1964, 1967, 1970, 1973, 1976, 1979, 1982, + 1985, 1988, 1991, 1994, 1997, 2000, 2003, 2006, 2009, 2012, + 2015, 2018, 2021, 2024, 2027, 2030, 2033, 2036, 2039, 2042 }; #endif @@ -620,9 +624,10 @@ static const char *const yytname[] = "interface_def", "@10", "interface_list", "interface_extends", "interface_exports", "interface_export", "exception_list", "exception", "sequence_def", "dictionary_def", "enum_id", "enum_def", "@11", - "enumerator_list", "enumerator", "out_qualifier", "parameters", "throws", - "scoped_name", "type", "string_literal", "string_list", - "local_qualifier", "const_initializer", "const_def", "keyword", 0 + "enumerator_list", "enumerator", "enumerator_initializer", + "out_qualifier", "parameters", "throws", "scoped_name", "type", + "string_literal", "string_list", "local_qualifier", "const_initializer", + "const_def", "keyword", 0 }; #endif @@ -655,14 +660,14 @@ static const yytype_uint8 yyr1[] = 94, 92, 95, 95, 96, 96, 97, 99, 98, 100, 100, 100, 101, 101, 102, 102, 102, 102, 103, 104, 104, 105, 105, 106, 106, 107, 107, 108, 108, 110, - 109, 109, 111, 111, 112, 112, 112, 113, 113, 114, - 114, 114, 114, 114, 114, 114, 115, 115, 116, 116, - 116, 117, 117, 117, 117, 117, 117, 117, 117, 117, - 117, 117, 117, 117, 118, 118, 119, 119, 120, 120, - 121, 121, 121, 121, 121, 121, 122, 122, 123, 123, - 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, - 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, - 123, 123, 123, 123, 123, 123, 123 + 109, 109, 111, 111, 112, 112, 112, 112, 113, 113, + 114, 114, 115, 115, 115, 115, 115, 115, 115, 116, + 116, 117, 117, 117, 118, 118, 118, 118, 118, 118, + 118, 118, 118, 118, 118, 118, 118, 119, 119, 120, + 120, 121, 121, 122, 122, 122, 122, 122, 122, 123, + 123, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124, + 124, 124, 124, 124, 124, 124, 124, 124, 124, 124 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -680,284 +685,287 @@ static const yytype_uint8 yyr2[] = 0, 5, 1, 1, 2, 2, 2, 0, 7, 3, 1, 1, 2, 0, 4, 3, 2, 0, 1, 3, 1, 1, 1, 7, 7, 10, 10, 2, 2, 0, - 6, 5, 3, 1, 1, 1, 0, 1, 0, 0, - 3, 5, 4, 6, 3, 5, 2, 0, 1, 2, - 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 1, 1, 2, 2, 1, 3, 1, 1, 0, - 1, 1, 1, 1, 1, 1, 6, 5, 1, 1, + 6, 5, 3, 1, 1, 3, 1, 0, 1, 1, + 1, 0, 0, 3, 5, 4, 6, 3, 5, 2, + 0, 1, 2, 3, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 2, 1, 1, 2, 2, 1, 3, + 1, 1, 0, 1, 1, 1, 1, 1, 1, 6, + 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, 1 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero +/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { - 0, 0, 0, 0, 0, 6, 159, 2, 10, 155, - 157, 0, 0, 1, 0, 0, 158, 5, 12, 14, + 0, 0, 0, 0, 0, 6, 162, 2, 10, 158, + 160, 0, 0, 1, 0, 0, 161, 5, 12, 14, 19, 20, 21, 22, 15, 16, 17, 18, 23, 24, - 25, 0, 26, 0, 154, 4, 0, 3, 7, 27, + 25, 0, 26, 0, 157, 4, 0, 3, 7, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, - 50, 60, 96, 119, 11, 156, 0, 141, 142, 143, - 144, 145, 146, 147, 148, 149, 151, 0, 138, 152, - 0, 0, 168, 169, 170, 171, 172, 173, 174, 175, - 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, - 196, 58, 59, 94, 95, 29, 30, 48, 49, 5, - 5, 117, 126, 118, 0, 32, 0, 0, 66, 0, - 97, 0, 0, 150, 139, 0, 153, 0, 0, 9, - 0, 0, 124, 0, 123, 125, 34, 0, 0, 63, - 0, 61, 101, 102, 100, 0, 126, 0, 140, 0, - 164, 165, 163, 160, 161, 162, 167, 0, 0, 121, - 126, 0, 0, 0, 0, 65, 0, 0, 0, 0, - 28, 166, 0, 5, 122, 0, 0, 0, 0, 44, - 0, 75, 0, 55, 57, 80, 52, 0, 99, 0, - 0, 0, 120, 113, 114, 0, 0, 46, 0, 71, - 38, 47, 74, 33, 54, 0, 43, 0, 0, 77, - 0, 0, 40, 79, 0, 0, 0, 0, 83, 0, - 0, 0, 0, 108, 106, 82, 98, 0, 37, 45, - 0, 0, 73, 41, 42, 76, 0, 53, 0, 0, - 92, 93, 69, 74, 62, 105, 0, 81, 84, 86, - 0, 127, 5, 0, 0, 0, 72, 36, 78, 68, - 81, 0, 85, 87, 90, 0, 88, 128, 104, 115, - 116, 67, 137, 130, 134, 137, 5, 0, 91, 132, - 89, 0, 136, 110, 111, 112, 131, 135, 0, 133, - 109 + 50, 60, 96, 119, 11, 159, 0, 144, 145, 146, + 147, 148, 149, 150, 151, 152, 154, 0, 141, 155, + 0, 0, 171, 172, 173, 174, 175, 176, 177, 178, + 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, + 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, + 199, 58, 59, 94, 95, 29, 30, 48, 49, 5, + 5, 117, 127, 118, 0, 32, 0, 0, 66, 0, + 97, 0, 0, 153, 142, 0, 156, 0, 0, 9, + 0, 0, 124, 0, 123, 126, 34, 0, 0, 63, + 0, 61, 101, 102, 100, 0, 127, 0, 143, 0, + 167, 168, 166, 163, 164, 165, 170, 0, 0, 0, + 121, 127, 0, 0, 0, 0, 65, 0, 0, 0, + 0, 28, 169, 0, 5, 128, 125, 129, 122, 0, + 0, 0, 0, 44, 0, 75, 0, 55, 57, 80, + 52, 0, 99, 0, 0, 0, 120, 113, 114, 0, + 0, 46, 0, 71, 38, 47, 74, 33, 54, 0, + 43, 0, 0, 77, 0, 0, 40, 79, 0, 0, + 0, 0, 83, 0, 0, 0, 0, 108, 106, 82, + 98, 0, 37, 45, 0, 0, 73, 41, 42, 76, + 0, 53, 0, 0, 92, 93, 69, 74, 62, 105, + 0, 81, 84, 86, 0, 130, 5, 0, 0, 0, + 72, 36, 78, 68, 81, 0, 85, 87, 90, 0, + 88, 131, 104, 115, 116, 67, 140, 133, 137, 140, + 5, 0, 91, 135, 89, 0, 139, 110, 111, 112, + 134, 138, 0, 136, 109 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 4, 5, 6, 7, 14, 41, 33, 18, 19, - 56, 49, 20, 21, 137, 115, 177, 197, 198, 199, - 200, 50, 22, 23, 116, 164, 183, 51, 24, 25, - 166, 118, 141, 216, 201, 184, 221, 222, 223, 275, - 272, 242, 52, 26, 27, 145, 143, 120, 191, 224, - 282, 283, 28, 29, 53, 30, 121, 133, 134, 252, - 253, 278, 69, 210, 10, 11, 31, 156, 32, 135 + 56, 49, 20, 21, 137, 115, 181, 201, 202, 203, + 204, 50, 22, 23, 116, 165, 187, 51, 24, 25, + 167, 118, 141, 220, 205, 188, 225, 226, 227, 279, + 276, 246, 52, 26, 27, 145, 143, 120, 195, 228, + 286, 287, 28, 29, 53, 30, 121, 133, 134, 176, + 256, 257, 282, 69, 214, 10, 11, 31, 156, 32, + 135 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -210 +#define YYPACT_NINF -218 static const yytype_int16 yypact[] = { - 503, 35, 18, 18, 86, -210, 33, -210, -210, 18, - -210, 40, 63, -210, 23, 55, -210, 67, 79, -210, - -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, - -210, 110, -210, 23, -210, -210, 18, -210, -210, -210, - 845, 80, 610, 641, 672, 703, 75, 77, 469, 7, - 83, 5, 9, -210, -210, -210, 84, -210, -210, -210, - -210, -210, -210, -210, -210, 78, -210, 99, -210, 16, - 29, 23, -210, -210, -210, -210, -210, -210, -210, -210, - -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, - -210, -210, -210, -210, -210, -210, -210, -210, -210, -210, - -210, -210, -210, -210, -210, -210, -210, -210, -210, 67, - 67, -210, 734, -210, 64, -210, 89, 64, 124, 52, - -210, 92, 424, -210, -210, 106, -210, 91, 66, -210, - 845, 845, -210, 94, 93, -210, 113, 96, 346, 113, - 52, -210, -210, -210, 22, 100, 734, 101, -210, 66, - -210, -210, -210, -210, -210, 113, -210, 98, 102, -210, - 734, 379, 108, 500, 107, -210, 109, 52, 280, 111, - -210, -210, 765, 67, -210, 112, 500, 115, 346, -210, - 8, 116, 845, 114, -210, 796, -210, 313, -210, 121, - 422, 120, -210, -210, -210, 845, 379, -210, 845, 122, - 127, -210, 796, -210, -210, 125, -210, 34, 66, 126, - 136, 346, -210, -210, 131, 422, 130, 280, -210, 209, - 845, 74, 244, -210, 133, -210, -210, 128, -210, -210, - 66, 379, -210, -210, -210, -210, 66, -210, 313, 845, - -210, -210, 137, 543, -210, -210, 85, -210, -210, -210, - 135, -210, 67, 60, 280, 827, -210, -210, -210, -210, - 136, 313, -210, -210, -210, 500, -210, 149, -210, -210, - -210, -210, 167, -210, 796, 167, 67, 579, -210, -210, - -210, 500, -210, 134, 113, -210, -210, 796, 579, -210, - -210 + 536, -11, -3, -3, 63, -218, 29, -218, -218, -3, + -218, 24, -14, -218, 299, 38, -218, 36, 51, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, 154, -218, 299, -218, -218, -3, -218, -218, -218, + 533, 60, 643, 674, 705, 736, 56, 57, 502, -9, + 34, 6, 4, -218, -218, -218, 76, -218, -218, -218, + -218, -218, -218, -218, -218, 70, -218, 73, -218, 7, + 26, 299, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -218, -218, -218, 36, + 36, -218, 767, -218, 53, -218, 78, 53, 112, 9, + -218, 83, 457, -218, -218, 97, -218, 82, 55, -218, + 533, 533, 84, 89, 90, -218, 107, 96, 379, 107, + 9, -218, -218, -218, 3, 98, 767, 94, -218, 55, + -218, -218, -218, -218, -218, 107, -218, 91, 99, 35, + -218, 767, 412, 101, 95, 100, -218, 102, 9, 312, + 103, -218, -218, 798, 36, -218, -218, 107, -218, 109, + 95, 108, 379, -218, -5, 117, 533, 111, -218, 829, + -218, 346, -218, 124, 455, 123, -218, -218, -218, 533, + 412, -218, 533, 122, 128, -218, 829, -218, -218, 127, + -218, 30, 55, 129, 143, 379, -218, -218, 132, 455, + 133, 312, -218, 213, 533, 61, 248, -218, 136, -218, + -218, 130, -218, -218, 55, 412, -218, -218, -218, -218, + 55, -218, 346, 533, -218, -218, 139, 576, -218, -218, + 64, -218, -218, -218, 137, -218, 36, 47, 312, 860, + -218, -218, -218, -218, 143, 346, -218, -218, -218, 95, + -218, 175, -218, -218, -218, -218, 173, -218, 829, 173, + 36, 612, -218, -218, -218, 95, -218, 138, 107, -218, + -218, 829, 612, -218, -218 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -210, -210, -210, -17, -13, -210, -210, -210, -210, -210, - -210, -210, -210, -210, -210, -210, -187, -160, -148, -190, - -210, -210, -210, -210, -210, -143, -210, -210, -210, -210, - -210, -210, -210, -204, -29, -210, -32, -210, -26, -210, - -210, -210, -210, -210, -210, -210, -128, -210, -209, -210, - -98, -210, -210, -210, -210, -210, -210, -73, -210, -76, - -210, -80, -103, -27, 38, 193, -210, -147, -210, -38 + -218, -218, -218, -17, -13, -218, -218, -218, -218, -218, + -218, -218, -218, -218, -218, -218, -189, -162, -150, -208, + -218, -218, -218, -218, -218, -161, -218, -218, -218, -218, + -218, -218, -218, -217, -30, -218, -32, -218, -26, -218, + -218, -218, -218, -218, -218, -218, -117, -218, -213, -218, + -98, -218, -218, -218, -218, -218, -218, -82, -218, -218, + -76, -218, -80, -102, -27, 13, 197, -218, -140, -218, + -38 }; /* 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 -130 + number is the opposite. If YYTABLE_NINF, syntax error. */ +#define YYTABLE_NINF -133 static const yytype_int16 yytable[] = { - 40, 38, 171, 181, 102, 104, 106, 108, 245, 228, - 113, 136, 165, 70, 139, 182, 144, 117, -64, 114, - 54, 119, 209, -13, 1, 155, -5, -5, -5, -5, - -5, -5, -5, -5, 259, 204, 15, 144, 229, 188, - 67, 68, 220, 205, 257, 268, 155, 34, 125, -5, - -5, -64, 9, -35, 125, -103, 206, 271, 129, 16, - 17, 235, 127, 2, 144, 3, 125, 239, 237, 126, - -13, 220, 167, 169, 55, 273, 142, 207, 128, 229, - 8, 35, 234, 256, 67, 68, 13, 174, 39, 258, - 36, 286, 130, 131, 150, 151, 67, 68, 67, 68, - 152, 153, 154, 157, 158, 155, 37, 2, 266, 147, - 267, 248, 249, 36, 42, 43, 44, 45, 46, 47, - 48, 163, 262, 263, -8, 71, 109, 155, 110, -51, - 122, 123, 124, 155, 194, 138, 185, 140, 146, 148, - 149, 159, 161, 160, 176, 125, 168, 213, 170, 202, - 172, 190, 173, 178, 186, 187, 195, 196, 192, 211, - 251, 163, 203, 225, 232, 208, 217, 226, 227, 212, - 215, 230, 231, 233, 284, 236, 238, 244, 254, 176, - 255, 277, 261, 264, 288, 284, 240, 246, 243, 241, - 290, 276, 225, 247, 163, 280, 12, 0, 0, 0, - 190, 0, 0, 0, 0, 232, 0, 0, 0, 0, - 0, 0, 260, 0, 176, 0, 0, 270, 0, 0, - 0, 215, 0, 0, 218, 57, 58, 59, 60, 61, - 62, 63, 64, 65, 66, 265, 279, 190, 274, 285, - 179, 67, 68, 0, 215, 250, 0, 0, 180, 289, - 285, 0, 0, 0, 287, 251, 0, 0, 0, 281, - -128, -128, -128, -128, -128, -128, -128, -128, -128, -128, - 0, 0, 0, 0, 0, -128, -128, -128, 0, 0, - 0, 189, 0, -128, -128, 0, 0, 0, 0, 0, - 0, 0, -129, 0, -129, -5, -5, -5, -5, -5, - -5, -5, -5, -5, -5, -5, 0, 0, 0, 0, - -5, -5, -5, -5, 214, 0, 0, 0, 0, -5, - 2, 0, 0, 0, 0, 0, 0, -107, -5, -5, - -5, -5, -5, -5, -5, -5, -5, -5, -5, 0, - 0, 0, 0, -5, -5, -5, -5, 162, 0, 0, - 0, 0, -5, 2, 0, 0, 0, 0, 0, 0, - -70, 0, -5, -5, -5, -5, -5, -5, -5, -5, - -5, -5, 0, 0, 0, 0, 0, -5, -5, -5, - 175, 0, 0, 0, 0, -5, 2, 0, 0, 0, - 0, 0, 0, -56, 0, -5, -5, -5, -5, -5, + 40, 38, 185, 114, 102, 104, 106, 108, 249, 172, + 113, 232, 136, 70, 186, 139, 119, 144, 117, -64, + 54, 208, 34, 166, 213, 263, 155, 67, 68, 37, + 209, 9, 15, 142, 8, 125, 36, -35, 144, 125, + 233, 67, 68, 210, 224, 272, 261, 155, 275, 55, + -103, 192, -64, 168, 241, 16, 17, 177, 129, 127, + 126, 277, 125, 13, 170, 35, 144, 67, 68, 243, + 175, 39, 239, 224, 36, 128, 2, 290, 238, 178, + -51, 233, 211, 150, 151, 67, 68, 67, 68, 152, + 153, 154, 130, 131, 260, 270, -8, 271, 252, 253, + 262, 266, 267, 157, 158, 71, 124, 109, 110, 147, + 155, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 164, 122, 123, 138, 140, 183, 67, 68, 146, + 148, 149, 155, 159, 184, 198, 160, 189, 155, 125, + 161, 171, 162, 173, 169, 180, 182, 190, 191, 174, + 196, 217, 194, 206, 200, 207, 215, 199, 42, 43, + 44, 45, 46, 47, 48, 164, 212, 229, 236, 221, + 230, 234, 231, 235, 219, 237, 216, 242, 240, 288, + 248, 258, 259, 180, 265, 268, 255, 281, 292, 244, + 288, 250, 247, 245, 294, 280, 229, 251, 164, 284, + 12, 0, 0, 0, 194, 0, 0, 0, 0, 236, + 0, 0, 0, 0, 0, 0, 264, 0, 180, 0, + 0, 274, 0, 0, 0, 219, 0, 0, 222, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 269, + 283, 194, 278, 289, 183, 67, 68, 0, 219, 254, + 0, 0, 184, 293, 289, 0, 0, 0, 291, 255, + 0, 0, 0, 285, -131, -131, -131, -131, -131, -131, + -131, -131, -131, -131, 0, 0, 0, 0, 0, -131, + -131, -131, 0, 0, 0, 0, 0, -131, -131, 0, + 0, 0, 0, 0, 0, 0, -132, 0, -132, -13, + 1, 0, -5, -5, -5, -5, -5, -5, -5, -5, + 0, 0, 0, 193, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, -5, -5, -5, -5, -5, + -5, -5, -5, -5, -5, -5, -5, -5, 0, 2, + 0, 3, -5, -5, -5, -5, -13, 218, 0, 0, + 0, -5, 2, 0, 0, 0, 0, 0, 0, -107, + 0, -5, -5, -5, -5, -5, -5, -5, -5, -5, + -5, -5, 0, 0, 0, 0, -5, -5, -5, -5, + 163, 0, 0, 0, 0, -5, 2, 0, 0, 0, + 0, 0, 0, -70, 0, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, 0, 0, 0, 0, 0, - -5, -5, -5, 0, 0, 0, 0, 0, -5, 2, - 0, 0, 0, 0, 0, 1, -39, -5, -5, -5, - -5, -5, -5, -5, -5, 0, 0, 218, 57, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 0, 0, - -5, -5, 219, 179, 67, 68, 0, 0, 0, 0, - 0, 180, 0, 0, 2, 0, 3, 0, 0, 0, - 0, -13, 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, 0, 111, -13, 1, 0, -5, -5, -5, -5, - -5, -5, -5, -5, 0, 112, 57, 58, 59, 60, - 61, 62, 63, 64, 65, 66, 0, 0, 0, -5, - -5, 179, 67, 68, 0, 0, 0, 0, 0, 180, - 0, 0, 0, 2, 0, 3, 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, 0, 212, 0, 0, 0, - -82, -82, 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, 67, 68, 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, 0, 101, 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, 0, 103, 72, 73, 74, 75, 76, + -5, -5, -5, 179, 0, 0, 0, 0, -5, 2, + 0, 0, 0, 0, 0, 0, -56, 0, -5, -5, + -5, -5, -5, -5, -5, -5, -5, -5, 0, 0, + 0, 0, 0, -5, -5, -5, 0, 0, 0, 0, + 0, -5, 2, 0, 0, 0, 0, 0, 1, -39, + -5, -5, -5, -5, -5, -5, -5, -5, 0, 0, + 222, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 0, 0, -5, -5, 223, 183, 67, 68, 0, + 0, 0, 0, 0, 184, 0, 0, 2, 0, 3, + 0, 0, 0, 0, -13, 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, 0, 105, 72, 73, 74, 75, + 97, 98, 99, 100, 0, 111, -13, 1, 0, -5, + -5, -5, -5, -5, -5, -5, -5, 0, 112, 57, + 58, 59, 60, 61, 62, 63, 64, 65, 66, 0, + 0, 0, -5, -5, 0, 67, 68, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 2, 0, 3, 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, 0, 216, + 0, 0, 0, -82, -82, 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, 67, 68, 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, 0, 107, 72, 73, 74, + 96, 97, 98, 99, 100, 0, 101, 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, 0, 132, 72, 73, + 95, 96, 97, 98, 99, 100, 0, 103, 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, 0, 193, 72, + 94, 95, 96, 97, 98, 99, 100, 0, 105, 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, 0, 212, + 93, 94, 95, 96, 97, 98, 99, 100, 0, 107, 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, 0, - 269, 57, 58, 59, 60, 61, 62, 63, 64, 65, - 66, 0, 0, 0, 0, 0, 0, 67, 68 + 132, 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, + 0, 197, 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, 0, 216, 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, 0, 273 }; +#define yypact_value_is_default(yystate) \ + ((yystate) == (-218)) + +#define yytable_value_is_error(yytable_value) \ + YYID (0) + static const yytype_int16 yycheck[] = { - 17, 14, 149, 163, 42, 43, 44, 45, 217, 196, - 48, 114, 140, 40, 117, 163, 119, 12, 13, 12, - 33, 12, 182, 0, 1, 128, 3, 4, 5, 6, - 7, 8, 9, 10, 238, 178, 3, 140, 198, 167, - 32, 33, 190, 35, 231, 254, 149, 9, 32, 26, - 27, 46, 34, 46, 32, 46, 48, 261, 71, 26, - 27, 208, 33, 40, 167, 42, 32, 215, 211, 53, - 47, 219, 50, 146, 36, 265, 24, 180, 49, 239, - 45, 41, 48, 230, 32, 33, 0, 160, 33, 236, - 50, 281, 109, 110, 28, 29, 32, 33, 32, 33, - 34, 35, 36, 130, 131, 208, 43, 40, 48, 122, - 50, 37, 38, 50, 4, 5, 6, 7, 8, 9, - 10, 138, 37, 38, 45, 45, 51, 230, 51, 46, - 46, 53, 33, 236, 172, 46, 163, 13, 46, 33, - 49, 47, 46, 50, 161, 32, 46, 185, 47, 176, - 52, 168, 50, 45, 47, 46, 173, 45, 47, 45, - 11, 178, 47, 190, 202, 49, 45, 47, 195, 33, - 187, 49, 45, 48, 277, 49, 45, 47, 45, 196, - 52, 14, 45, 48, 50, 288, 215, 219, 215, 215, - 288, 267, 219, 220, 211, 275, 3, -1, -1, -1, - 217, -1, -1, -1, -1, 243, -1, -1, -1, -1, - -1, -1, 239, -1, 231, -1, -1, 255, -1, -1, - -1, 238, -1, -1, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 252, 274, 254, 265, 277, - 31, 32, 33, -1, 261, 1, -1, -1, 39, 287, - 288, -1, -1, -1, 281, 11, -1, -1, -1, 276, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - -1, -1, -1, -1, -1, 31, 32, 33, -1, -1, - -1, 1, -1, 39, 40, -1, -1, -1, -1, -1, - -1, -1, 48, -1, 50, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, - 30, 31, 32, 33, 1, -1, -1, -1, -1, 39, - 40, -1, -1, -1, -1, -1, -1, 47, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, - -1, -1, -1, 30, 31, 32, 33, 1, -1, -1, - -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, - 47, -1, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, -1, -1, -1, -1, -1, 31, 32, 33, + 17, 14, 164, 12, 42, 43, 44, 45, 221, 149, + 48, 200, 114, 40, 164, 117, 12, 119, 12, 13, + 33, 182, 9, 140, 186, 242, 128, 32, 33, 43, + 35, 34, 3, 24, 45, 32, 50, 46, 140, 32, + 202, 32, 33, 48, 194, 258, 235, 149, 265, 36, + 46, 168, 46, 50, 215, 26, 27, 159, 71, 33, + 53, 269, 32, 0, 146, 41, 168, 32, 33, 219, + 35, 33, 212, 223, 50, 49, 40, 285, 48, 161, + 46, 243, 184, 28, 29, 32, 33, 32, 33, 34, + 35, 36, 109, 110, 234, 48, 45, 50, 37, 38, + 240, 37, 38, 130, 131, 45, 33, 51, 51, 122, + 212, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 138, 46, 53, 46, 13, 31, 32, 33, 46, + 33, 49, 234, 49, 39, 173, 47, 164, 240, 32, + 50, 47, 46, 52, 46, 162, 45, 47, 46, 50, + 47, 189, 169, 180, 45, 47, 45, 174, 4, 5, + 6, 7, 8, 9, 10, 182, 49, 194, 206, 45, + 47, 49, 199, 45, 191, 48, 33, 45, 49, 281, + 47, 45, 52, 200, 45, 48, 11, 14, 50, 219, + 292, 223, 219, 219, 292, 271, 223, 224, 215, 279, + 3, -1, -1, -1, 221, -1, -1, -1, -1, 247, + -1, -1, -1, -1, -1, -1, 243, -1, 235, -1, + -1, 259, -1, -1, -1, 242, -1, -1, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 256, + 278, 258, 269, 281, 31, 32, 33, -1, 265, 1, + -1, -1, 39, 291, 292, -1, -1, -1, 285, 11, + -1, -1, -1, 280, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, -1, -1, -1, -1, -1, 31, + 32, 33, -1, -1, -1, -1, -1, 39, 40, -1, + -1, -1, -1, -1, -1, -1, 48, -1, 50, 0, + 1, -1, 3, 4, 5, 6, 7, 8, 9, 10, + -1, -1, -1, 1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 26, 27, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, -1, 40, + -1, 42, 30, 31, 32, 33, 47, 1, -1, -1, + -1, 39, 40, -1, -1, -1, -1, -1, -1, 47, + -1, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, -1, -1, -1, -1, 30, 31, 32, 33, 1, -1, -1, -1, -1, 39, 40, -1, -1, -1, -1, -1, -1, 47, -1, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, - 31, 32, 33, -1, -1, -1, -1, -1, 39, 40, - -1, -1, -1, -1, -1, 1, 47, 3, 4, 5, - 6, 7, 8, 9, 10, -1, -1, 15, 16, 17, + 31, 32, 33, 1, -1, -1, -1, -1, 39, 40, + -1, -1, -1, -1, -1, -1, 47, -1, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, - 26, 27, 30, 31, 32, 33, -1, -1, -1, -1, - -1, 39, -1, -1, 40, -1, 42, -1, -1, -1, - -1, 47, 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, -1, 33, 0, 1, -1, 3, 4, 5, 6, - 7, 8, 9, 10, -1, 46, 16, 17, 18, 19, - 20, 21, 22, 23, 24, 25, -1, -1, -1, 26, - 27, 31, 32, 33, -1, -1, -1, -1, -1, 39, - -1, -1, -1, 40, -1, 42, 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, -1, 33, -1, -1, -1, - 37, 38, 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, 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, -1, 33, 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, -1, 33, 3, 4, 5, 6, 7, + -1, -1, -1, 31, 32, 33, -1, -1, -1, -1, + -1, 39, 40, -1, -1, -1, -1, -1, 1, 47, + 3, 4, 5, 6, 7, 8, 9, 10, -1, -1, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, -1, -1, 26, 27, 30, 31, 32, 33, -1, + -1, -1, -1, -1, 39, -1, -1, 40, -1, 42, + -1, -1, -1, -1, 47, 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, -1, 33, 3, 4, 5, 6, + 28, 29, 30, 31, -1, 33, 0, 1, -1, 3, + 4, 5, 6, 7, 8, 9, 10, -1, 46, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, + -1, -1, 26, 27, -1, 32, 33, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 40, -1, 42, 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, -1, 33, + -1, -1, -1, 37, 38, 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, 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, -1, 33, 3, 4, 5, @@ -973,8 +981,16 @@ static const yytype_int16 yycheck[] = 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, -1, - 33, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, -1, -1, -1, -1, -1, -1, 32, 33 + 33, 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, + -1, 33, 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, -1, 33, 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, -1, 33 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -982,35 +998,35 @@ static const yytype_int16 yycheck[] = static const yytype_uint8 yystos[] = { 0, 1, 40, 42, 55, 56, 57, 58, 45, 34, - 118, 119, 119, 0, 59, 3, 26, 27, 62, 63, + 119, 120, 120, 0, 59, 3, 26, 27, 62, 63, 66, 67, 76, 77, 82, 83, 97, 98, 106, 107, - 109, 120, 122, 61, 118, 41, 50, 43, 58, 33, + 109, 121, 123, 61, 119, 41, 50, 43, 58, 33, 57, 60, 4, 5, 6, 7, 8, 9, 10, 65, - 75, 81, 96, 108, 58, 118, 64, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 32, 33, 116, - 117, 45, 3, 4, 5, 6, 7, 8, 9, 10, + 75, 81, 96, 108, 58, 119, 64, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 32, 33, 117, + 118, 45, 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, 33, 123, 33, 123, 33, 123, 33, 123, 51, - 51, 33, 46, 123, 12, 69, 78, 12, 85, 12, + 31, 33, 124, 33, 124, 33, 124, 33, 124, 51, + 51, 33, 46, 124, 12, 69, 78, 12, 85, 12, 101, 110, 46, 53, 33, 32, 53, 33, 49, 58, - 57, 57, 33, 111, 112, 123, 116, 68, 46, 116, - 13, 86, 24, 100, 116, 99, 46, 58, 33, 49, - 28, 29, 34, 35, 36, 116, 121, 117, 117, 47, - 50, 46, 1, 57, 79, 100, 84, 50, 46, 111, - 47, 121, 52, 50, 111, 1, 57, 70, 45, 31, - 39, 71, 72, 80, 89, 117, 47, 46, 100, 1, - 57, 102, 47, 33, 123, 57, 45, 71, 72, 73, - 74, 88, 117, 47, 79, 35, 48, 116, 49, 71, - 117, 45, 33, 123, 1, 57, 87, 45, 15, 30, - 72, 90, 91, 92, 103, 117, 47, 117, 70, 71, - 49, 45, 123, 48, 48, 121, 49, 79, 45, 72, - 88, 92, 95, 117, 47, 102, 90, 117, 37, 38, - 1, 11, 113, 114, 45, 52, 121, 70, 121, 87, - 117, 45, 37, 38, 48, 57, 48, 50, 102, 33, - 123, 87, 94, 73, 117, 93, 113, 14, 115, 123, - 115, 57, 104, 105, 116, 123, 73, 117, 50, 123, - 104 + 57, 57, 33, 111, 112, 124, 117, 68, 46, 117, + 13, 86, 24, 100, 117, 99, 46, 58, 33, 49, + 28, 29, 34, 35, 36, 117, 122, 118, 118, 49, + 47, 50, 46, 1, 57, 79, 100, 84, 50, 46, + 111, 47, 122, 52, 50, 35, 113, 117, 111, 1, + 57, 70, 45, 31, 39, 71, 72, 80, 89, 118, + 47, 46, 100, 1, 57, 102, 47, 33, 124, 57, + 45, 71, 72, 73, 74, 88, 118, 47, 79, 35, + 48, 117, 49, 71, 118, 45, 33, 124, 1, 57, + 87, 45, 15, 30, 72, 90, 91, 92, 103, 118, + 47, 118, 70, 71, 49, 45, 124, 48, 48, 122, + 49, 79, 45, 72, 88, 92, 95, 118, 47, 102, + 90, 118, 37, 38, 1, 11, 114, 115, 45, 52, + 122, 70, 122, 87, 118, 45, 37, 38, 48, 57, + 48, 50, 102, 33, 124, 87, 94, 73, 118, 93, + 114, 14, 116, 124, 116, 57, 104, 105, 117, 124, + 73, 118, 50, 124, 104 }; #define yyerrok (yyerrstatus = 0) @@ -1046,7 +1062,6 @@ do \ { \ yychar = (Token); \ yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ YYPOPSTACK (1); \ goto yybackup; \ } \ @@ -1088,19 +1103,10 @@ while (YYID (0)) #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. */ +/* This macro is provided for backward compatibility. */ #ifndef YY_LOCATION_PRINT -# if defined YYLTYPE_IS_TRIVIAL && 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 +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) #endif @@ -1292,7 +1298,6 @@ int yydebug; # define YYMAXDEPTH 10000 #endif - #if YYERROR_VERBOSE @@ -1395,115 +1400,142 @@ yytnamerr (char *yyres, const char *yystr) } # endif -/* Copy into YYRESULT an error message about the unexpected token - YYCHAR while in state YYSTATE. Return the number of bytes copied, - including the terminating null byte. If YYRESULT is null, do not - copy anything; just return the number of bytes that would be - copied. As a special case, return 0 if an ordinary "syntax error" - message will do. Return YYSIZE_MAXIMUM if overflow occurs during - size calculation. */ -static YYSIZE_T -yysyntax_error (char *yyresult, int yystate, int yychar) -{ - int yyn = yypact[yystate]; +/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message + about the unexpected token YYTOKEN for the state stack whose top is + YYSSP. - if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else - { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -# if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -# endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* 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 + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } + Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is + not large enough to hold the message. In that case, also set + *YYMSG_ALLOC to the required number of bytes. Return 2 if the + required number of bytes is too large to store. */ +static int +yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, + yytype_int16 *yyssp, int yytoken) +{ + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytoken]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + /* Internationalized format string. */ + const char *yyformat = 0; + /* Arguments of yyformat. */ + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + /* Number of reported tokens (one for the "unexpected", one per + "expected"). */ + int yycount = 0; + + /* There are many possibilities here to consider: + - Assume YYFAIL is not used. It's too flawed to consider. See + <http://lists.gnu.org/archive/html/bison-patches/2009-12/msg00024.html> + for details. YYERROR is fine as it does not invoke this + function. + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yychar) is if + this state is a consistent state with a default action. Thus, + detecting the absence of a lookahead is sufficient to determine + that there is no unexpected or expected token to report. In that + case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is a + consistent state with a default action. There might have been a + previous inconsistent state, consistent state with a non-default + action, or user semantic action that manipulated yychar. + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state merging + (from LALR or IELR) and default reductions corrupt the expected + token list. However, the list is correct for canonical LR with + one exception: it will still contain any token that will not be + accepted due to an error action in a later state. + */ + if (yytoken != YYEMPTY) + { + int yyn = yypact[*yyssp]; + yyarg[yycount++] = yytname[yytoken]; + if (!yypact_value_is_default (yyn)) + { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yyx; + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR + && !yytable_value_is_error (yytable[yyx + yyn])) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + if (! (yysize <= yysize1 + && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + } + } - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; + switch (yycount) + { +# define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +# undef YYCASE_ + } - if (yysize_overflow) - return YYSIZE_MAXIMUM; + yysize1 = yysize + yystrlen (yyformat); + if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; - if (yyresult) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yyresult; - int yyi = 0; - while ((*yyp = *yyf) != '\0') - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - } - return yysize; + if (*yymsg_alloc < yysize) + { + *yymsg_alloc = 2 * yysize; + if (! (yysize <= *yymsg_alloc + && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) + *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; + return 1; } + + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + { + char *yyp = *yymsg; + int yyi = 0; + while ((*yyp = *yyformat) != '\0') + if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyformat += 2; + } + else + { + yyp++; + yyformat++; + } + } + return 0; } #endif /* YYERROR_VERBOSE */ - /*-----------------------------------------------. | Release the memory associated to this symbol. | @@ -1536,6 +1568,7 @@ yydestruct (yymsg, yytype, yyvaluep) } } + /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus @@ -1552,12 +1585,9 @@ int yyparse (); #endif /* ! YYPARSE_PARAM */ - - - -/*-------------------------. -| yyparse or yypush_parse. | -`-------------------------*/ +/*----------. +| yyparse. | +`----------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ @@ -1744,7 +1774,7 @@ yybackup: /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) + if (yypact_value_is_default (yyn)) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ @@ -1775,8 +1805,8 @@ yybackup: yyn = yytable[yyn]; if (yyn <= 0) { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; + if (yytable_value_is_error (yyn)) + goto yyerrlab; yyn = -yyn; goto yyreduce; } @@ -1831,56 +1861,56 @@ yyreduce: { case 2: -/* Line 1464 of yacc.c */ -#line 108 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 108 "Grammar.y" { -;} +} break; case 3: -/* Line 1464 of yacc.c */ -#line 116 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 116 "Grammar.y" { (yyval) = (yyvsp[(2) - (3)]); -;} +} break; case 4: -/* Line 1464 of yacc.c */ -#line 125 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 125 "Grammar.y" { (yyval) = (yyvsp[(2) - (3)]); -;} +} break; case 5: -/* Line 1464 of yacc.c */ -#line 129 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 129 "Grammar.y" { (yyval) = new StringListTok; -;} +} break; case 6: -/* Line 1464 of yacc.c */ -#line 138 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 138 "Grammar.y" { StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(1) - (1)])); if(!metaData->v.empty()) { unit->addGlobalMetaData(metaData->v); } -;} +} break; case 8: -/* Line 1464 of yacc.c */ -#line 147 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 147 "Grammar.y" { StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(1) - (2)])); ContainedPtr contained = ContainedPtr::dynamicCast((yyvsp[(2) - (2)])); @@ -1888,156 +1918,156 @@ yyreduce: { contained->setMetaData(metaData->v); } -;} +} break; case 10: -/* Line 1464 of yacc.c */ -#line 157 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 157 "Grammar.y" { yyerrok; -;} +} break; case 12: -/* Line 1464 of yacc.c */ -#line 162 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 162 "Grammar.y" { unit->error("`;' missing after definition"); -;} +} break; case 13: -/* Line 1464 of yacc.c */ -#line 166 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 166 "Grammar.y" { -;} +} break; case 14: -/* Line 1464 of yacc.c */ -#line 174 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 174 "Grammar.y" { assert((yyvsp[(1) - (1)]) == 0 || ModulePtr::dynamicCast((yyvsp[(1) - (1)]))); -;} +} break; case 15: -/* Line 1464 of yacc.c */ -#line 178 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 178 "Grammar.y" { assert((yyvsp[(1) - (1)]) == 0 || ClassDeclPtr::dynamicCast((yyvsp[(1) - (1)]))); -;} +} break; case 16: -/* Line 1464 of yacc.c */ -#line 182 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 182 "Grammar.y" { assert((yyvsp[(1) - (1)]) == 0 || ClassDefPtr::dynamicCast((yyvsp[(1) - (1)]))); -;} +} break; case 17: -/* Line 1464 of yacc.c */ -#line 186 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 186 "Grammar.y" { assert((yyvsp[(1) - (1)]) == 0 || ClassDeclPtr::dynamicCast((yyvsp[(1) - (1)]))); -;} +} break; case 18: -/* Line 1464 of yacc.c */ -#line 190 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 190 "Grammar.y" { assert((yyvsp[(1) - (1)]) == 0 || ClassDefPtr::dynamicCast((yyvsp[(1) - (1)]))); -;} +} break; case 19: -/* Line 1464 of yacc.c */ -#line 194 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 194 "Grammar.y" { assert((yyvsp[(1) - (1)]) == 0); -;} +} break; case 20: -/* Line 1464 of yacc.c */ -#line 198 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 198 "Grammar.y" { assert((yyvsp[(1) - (1)]) == 0 || ExceptionPtr::dynamicCast((yyvsp[(1) - (1)]))); -;} +} break; case 21: -/* Line 1464 of yacc.c */ -#line 202 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 202 "Grammar.y" { assert((yyvsp[(1) - (1)]) == 0); -;} +} break; case 22: -/* Line 1464 of yacc.c */ -#line 206 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 206 "Grammar.y" { assert((yyvsp[(1) - (1)]) == 0 || StructPtr::dynamicCast((yyvsp[(1) - (1)]))); -;} +} break; case 23: -/* Line 1464 of yacc.c */ -#line 210 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 210 "Grammar.y" { assert((yyvsp[(1) - (1)]) == 0 || SequencePtr::dynamicCast((yyvsp[(1) - (1)]))); -;} +} break; case 24: -/* Line 1464 of yacc.c */ -#line 214 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 214 "Grammar.y" { assert((yyvsp[(1) - (1)]) == 0 || DictionaryPtr::dynamicCast((yyvsp[(1) - (1)]))); -;} +} break; case 25: -/* Line 1464 of yacc.c */ -#line 218 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 218 "Grammar.y" { assert((yyvsp[(1) - (1)]) == 0 || EnumPtr::dynamicCast((yyvsp[(1) - (1)]))); -;} +} break; case 26: -/* Line 1464 of yacc.c */ -#line 222 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 222 "Grammar.y" { assert((yyvsp[(1) - (1)]) == 0 || ConstPtr::dynamicCast((yyvsp[(1) - (1)]))); -;} +} break; case 27: -/* Line 1464 of yacc.c */ -#line 231 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 231 "Grammar.y" { unit->setSeenDefinition(); StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); @@ -2053,13 +2083,13 @@ yyreduce: { (yyval) = 0; } -;} +} break; case 28: -/* Line 1464 of yacc.c */ -#line 248 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 248 "Grammar.y" { if((yyvsp[(3) - (6)])) { @@ -2070,43 +2100,43 @@ yyreduce: { (yyval) = 0; } -;} +} break; case 29: -/* Line 1464 of yacc.c */ -#line 265 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 265 "Grammar.y" { (yyval) = (yyvsp[(2) - (2)]); -;} +} break; case 30: -/* Line 1464 of yacc.c */ -#line 269 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 269 "Grammar.y" { StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); unit->error("keyword `" + ident->v + "' cannot be used as exception name"); (yyval) = (yyvsp[(2) - (2)]); // Dummy -;} +} break; case 31: -/* Line 1464 of yacc.c */ -#line 280 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 280 "Grammar.y" { unit->error("exceptions cannot be forward declared"); (yyval) = 0; -;} +} break; case 32: -/* Line 1464 of yacc.c */ -#line 290 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 290 "Grammar.y" { BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (3)])); StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (3)])); @@ -2119,48 +2149,48 @@ yyreduce: unit->pushContainer(ex); } (yyval) = ex; -;} +} break; case 33: -/* Line 1464 of yacc.c */ -#line 304 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 304 "Grammar.y" { if((yyvsp[(4) - (7)])) { unit->popContainer(); } (yyval) = (yyvsp[(4) - (7)]); -;} +} break; case 34: -/* Line 1464 of yacc.c */ -#line 317 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 317 "Grammar.y" { StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); ContainerPtr cont = unit->currentContainer(); ContainedPtr contained = cont->lookupException(scoped->v); cont->checkIntroduced(scoped->v); (yyval) = contained; -;} +} break; case 35: -/* Line 1464 of yacc.c */ -#line 325 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 325 "Grammar.y" { (yyval) = 0; -;} +} break; case 36: -/* Line 1464 of yacc.c */ -#line 334 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 334 "Grammar.y" { StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(1) - (4)])); ContainedPtr contained = ContainedPtr::dynamicCast((yyvsp[(2) - (4)])); @@ -2168,51 +2198,51 @@ yyreduce: { contained->setMetaData(metaData->v); } -;} +} break; case 37: -/* Line 1464 of yacc.c */ -#line 343 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 343 "Grammar.y" { -;} +} break; case 38: -/* Line 1464 of yacc.c */ -#line 346 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 346 "Grammar.y" { unit->error("`;' missing after definition"); -;} +} break; case 39: -/* Line 1464 of yacc.c */ -#line 350 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 350 "Grammar.y" { -;} +} break; case 40: -/* Line 1464 of yacc.c */ -#line 358 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 358 "Grammar.y" { TypePtr type = TypePtr::dynamicCast((yyvsp[(1) - (2)])); StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); TypeStringTokPtr typestring = new TypeStringTok; typestring->v = make_pair(type, ident->v); (yyval) = typestring; -;} +} break; case 41: -/* Line 1464 of yacc.c */ -#line 371 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 371 "Grammar.y" { IntegerTokPtr i = IntegerTokPtr::dynamicCast((yyvsp[(2) - (3)])); @@ -2231,13 +2261,13 @@ yyreduce: m->v.optional = tag >= 0; m->v.tag = tag; (yyval) = m; -;} +} break; case 42: -/* Line 1464 of yacc.c */ -#line 391 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 391 "Grammar.y" { StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(2) - (3)])); @@ -2306,52 +2336,52 @@ yyreduce: m->v.optional = tag >= 0; m->v.tag = tag; (yyval) = m; -;} +} break; case 43: -/* Line 1464 of yacc.c */ -#line 461 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 461 "Grammar.y" { unit->error("missing tag for optional"); OptionalDefTokPtr m = new OptionalDefTok; // Dummy m->v.optional = false; m->v.tag = -1; (yyval) = m; -;} +} break; case 44: -/* Line 1464 of yacc.c */ -#line 469 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 469 "Grammar.y" { unit->error("missing tag for optional"); OptionalDefTokPtr m = new OptionalDefTok; // Dummy m->v.optional = false; m->v.tag = -1; (yyval) = m; -;} +} break; case 45: -/* Line 1464 of yacc.c */ -#line 482 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 482 "Grammar.y" { OptionalDefTokPtr m = OptionalDefTokPtr::dynamicCast((yyvsp[(1) - (2)])); TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast((yyvsp[(2) - (2)])); m->v.type = ts->v.first; m->v.name = ts->v.second; (yyval) = m; -;} +} break; case 46: -/* Line 1464 of yacc.c */ -#line 490 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 490 "Grammar.y" { TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast((yyvsp[(1) - (1)])); OptionalDefTokPtr m = new OptionalDefTok; @@ -2360,43 +2390,43 @@ yyreduce: m->v.optional = false; m->v.tag = -1; (yyval) = m; -;} +} break; case 48: -/* Line 1464 of yacc.c */ -#line 511 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 511 "Grammar.y" { (yyval) = (yyvsp[(2) - (2)]); -;} +} break; case 49: -/* Line 1464 of yacc.c */ -#line 515 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 515 "Grammar.y" { StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); unit->error("keyword `" + ident->v + "' cannot be used as struct name"); (yyval) = (yyvsp[(2) - (2)]); // Dummy -;} +} break; case 50: -/* Line 1464 of yacc.c */ -#line 526 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 526 "Grammar.y" { unit->error("structs cannot be forward declared"); (yyval) = 0; // Dummy -;} +} break; case 51: -/* Line 1464 of yacc.c */ -#line 536 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 536 "Grammar.y" { BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (2)])); StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); @@ -2408,13 +2438,13 @@ yyreduce: unit->pushContainer(st); } (yyval) = st; -;} +} break; case 52: -/* Line 1464 of yacc.c */ -#line 549 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 549 "Grammar.y" { if((yyvsp[(3) - (6)])) { @@ -2431,13 +2461,13 @@ yyreduce: { unit->error("struct `" + st->name() + "' must have at least one member"); // $$ is a dummy } -;} +} break; case 53: -/* Line 1464 of yacc.c */ -#line 572 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 572 "Grammar.y" { StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(1) - (4)])); ContainedPtr contained = ContainedPtr::dynamicCast((yyvsp[(2) - (4)])); @@ -2445,71 +2475,71 @@ yyreduce: { contained->setMetaData(metaData->v); } -;} +} break; case 54: -/* Line 1464 of yacc.c */ -#line 581 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 581 "Grammar.y" { -;} +} break; case 55: -/* Line 1464 of yacc.c */ -#line 584 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 584 "Grammar.y" { unit->error("`;' missing after definition"); -;} +} break; case 56: -/* Line 1464 of yacc.c */ -#line 588 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 588 "Grammar.y" { -;} +} break; case 58: -/* Line 1464 of yacc.c */ -#line 602 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 602 "Grammar.y" { (yyval) = (yyvsp[(2) - (2)]); -;} +} break; case 59: -/* Line 1464 of yacc.c */ -#line 606 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 606 "Grammar.y" { StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); unit->error("keyword `" + ident->v + "' cannot be used as class name"); (yyval) = (yyvsp[(2) - (2)]); // Dummy -;} +} break; case 60: -/* Line 1464 of yacc.c */ -#line 617 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 617 "Grammar.y" { BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (2)])); StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); ContainerPtr cont = unit->currentContainer(); ClassDeclPtr cl = cont->createClassDecl(ident->v, false, local->v); (yyval) = cl; -;} +} break; case 61: -/* Line 1464 of yacc.c */ -#line 630 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 630 "Grammar.y" { BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (4)])); StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (4)])); @@ -2531,13 +2561,13 @@ yyreduce: { (yyval) = 0; } -;} +} break; case 62: -/* Line 1464 of yacc.c */ -#line 653 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 653 "Grammar.y" { if((yyvsp[(5) - (8)])) { @@ -2548,13 +2578,13 @@ yyreduce: { (yyval) = 0; } -;} +} break; case 63: -/* Line 1464 of yacc.c */ -#line 670 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 670 "Grammar.y" { StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); ContainerPtr cont = unit->currentContainer(); @@ -2587,40 +2617,40 @@ yyreduce: } } } -;} +} break; case 64: -/* Line 1464 of yacc.c */ -#line 704 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 704 "Grammar.y" { (yyval) = 0; -;} +} break; case 65: -/* Line 1464 of yacc.c */ -#line 713 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 713 "Grammar.y" { (yyval) = (yyvsp[(2) - (2)]); -;} +} break; case 66: -/* Line 1464 of yacc.c */ -#line 717 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 717 "Grammar.y" { (yyval) = new ClassListTok; -;} +} break; case 67: -/* Line 1464 of yacc.c */ -#line 726 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 726 "Grammar.y" { StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(1) - (4)])); ContainedPtr contained = ContainedPtr::dynamicCast((yyvsp[(2) - (4)])); @@ -2628,38 +2658,38 @@ yyreduce: { contained->setMetaData(metaData->v); } -;} +} break; case 68: -/* Line 1464 of yacc.c */ -#line 735 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 735 "Grammar.y" { -;} +} break; case 69: -/* Line 1464 of yacc.c */ -#line 738 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 738 "Grammar.y" { unit->error("`;' missing after definition"); -;} +} break; case 70: -/* Line 1464 of yacc.c */ -#line 742 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 742 "Grammar.y" { -;} +} break; case 71: -/* Line 1464 of yacc.c */ -#line 750 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 750 "Grammar.y" { OptionalDefTokPtr def = OptionalDefTokPtr::dynamicCast((yyvsp[(1) - (1)])); ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); @@ -2680,13 +2710,13 @@ yyreduce: } unit->currentContainer()->checkIntroduced(def->v.name, dm); (yyval) = dm; -;} +} break; case 72: -/* Line 1464 of yacc.c */ -#line 772 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 772 "Grammar.y" { OptionalDefTokPtr def = OptionalDefTokPtr::dynamicCast((yyvsp[(1) - (3)])); ConstDefTokPtr value = ConstDefTokPtr::dynamicCast((yyvsp[(3) - (3)])); @@ -2712,13 +2742,13 @@ yyreduce: } unit->currentContainer()->checkIntroduced(def->v.name, dm); (yyval) = dm; -;} +} break; case 73: -/* Line 1464 of yacc.c */ -#line 799 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 799 "Grammar.y" { TypePtr type = TypePtr::dynamicCast((yyvsp[(1) - (2)])); string name = StringTokPtr::dynamicCast((yyvsp[(2) - (2)]))->v; @@ -2739,13 +2769,13 @@ yyreduce: } assert((yyval)); unit->error("keyword `" + name + "' cannot be used as data member name"); -;} +} break; case 74: -/* Line 1464 of yacc.c */ -#line 821 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 821 "Grammar.y" { TypePtr type = TypePtr::dynamicCast((yyvsp[(1) - (1)])); ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); @@ -2765,13 +2795,13 @@ yyreduce: } assert((yyval)); unit->error("missing data member name"); -;} +} break; case 75: -/* Line 1464 of yacc.c */ -#line 847 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 847 "Grammar.y" { TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast((yyvsp[(1) - (1)])); StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); @@ -2779,13 +2809,13 @@ yyreduce: DataMemberPtr dm = st->createDataMember(ts->v.second, ts->v.first, false, -1, 0, "", ""); unit->currentContainer()->checkIntroduced(ts->v.second, dm); (yyval) = dm; -;} +} break; case 76: -/* Line 1464 of yacc.c */ -#line 856 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 856 "Grammar.y" { TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast((yyvsp[(1) - (3)])); ConstDefTokPtr value = ConstDefTokPtr::dynamicCast((yyvsp[(3) - (3)])); @@ -2795,13 +2825,13 @@ yyreduce: value->v.valueAsString, value->v.valueAsLiteral); unit->currentContainer()->checkIntroduced(ts->v.second, dm); (yyval) = dm; -;} +} break; case 77: -/* Line 1464 of yacc.c */ -#line 867 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 867 "Grammar.y" { TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast((yyvsp[(2) - (2)])); StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); @@ -2809,13 +2839,13 @@ yyreduce: (yyval) = st->createDataMember(ts->v.second, ts->v.first, false, 0, 0, "", ""); // Dummy assert((yyval)); unit->error("optional data members not supported in struct"); -;} +} break; case 78: -/* Line 1464 of yacc.c */ -#line 876 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 876 "Grammar.y" { TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast((yyvsp[(2) - (4)])); StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); @@ -2823,13 +2853,13 @@ yyreduce: (yyval) = st->createDataMember(ts->v.second, ts->v.first, false, 0, 0, "", ""); // Dummy assert((yyval)); unit->error("optional data members not supported in struct"); -;} +} break; case 79: -/* Line 1464 of yacc.c */ -#line 885 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 885 "Grammar.y" { TypePtr type = TypePtr::dynamicCast((yyvsp[(1) - (2)])); string name = StringTokPtr::dynamicCast((yyvsp[(2) - (2)]))->v; @@ -2838,13 +2868,13 @@ yyreduce: (yyval) = st->createDataMember(name, type, false, 0, 0, "", ""); // Dummy assert((yyval)); unit->error("keyword `" + name + "' cannot be used as data member name"); -;} +} break; case 80: -/* Line 1464 of yacc.c */ -#line 895 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 895 "Grammar.y" { TypePtr type = TypePtr::dynamicCast((yyvsp[(1) - (1)])); StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); @@ -2852,49 +2882,49 @@ yyreduce: (yyval) = st->createDataMember(IceUtil::generateUUID(), type, false, 0, 0, "", ""); // Dummy assert((yyval)); unit->error("missing data member name"); -;} +} break; case 81: -/* Line 1464 of yacc.c */ -#line 909 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 909 "Grammar.y" { OptionalDefTokPtr m = OptionalDefTokPtr::dynamicCast((yyvsp[(1) - (2)])); m->v.type = TypePtr::dynamicCast((yyvsp[(2) - (2)])); (yyval) = m; -;} +} break; case 82: -/* Line 1464 of yacc.c */ -#line 915 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 915 "Grammar.y" { OptionalDefTokPtr m = new OptionalDefTok(); m->v.type = TypePtr::dynamicCast((yyvsp[(1) - (1)])); m->v.optional = false; m->v.tag = -1; (yyval) = m; -;} +} break; case 83: -/* Line 1464 of yacc.c */ -#line 923 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 923 "Grammar.y" { OptionalDefTokPtr m = new OptionalDefTok; m->v.optional = false; m->v.tag = -1; (yyval) = m; -;} +} break; case 84: -/* Line 1464 of yacc.c */ -#line 935 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 935 "Grammar.y" { OptionalDefTokPtr returnType = OptionalDefTokPtr::dynamicCast((yyvsp[(1) - (2)])); string name = StringTokPtr::dynamicCast((yyvsp[(2) - (2)]))->v; @@ -2917,13 +2947,13 @@ yyreduce: { (yyval) = 0; } -;} +} break; case 85: -/* Line 1464 of yacc.c */ -#line 959 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 959 "Grammar.y" { OptionalDefTokPtr returnType = OptionalDefTokPtr::dynamicCast((yyvsp[(2) - (3)])); string name = StringTokPtr::dynamicCast((yyvsp[(3) - (3)]))->v; @@ -2947,13 +2977,13 @@ yyreduce: { (yyval) = 0; } -;} +} break; case 86: -/* Line 1464 of yacc.c */ -#line 984 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 984 "Grammar.y" { OptionalDefTokPtr returnType = OptionalDefTokPtr::dynamicCast((yyvsp[(1) - (2)])); string name = StringTokPtr::dynamicCast((yyvsp[(2) - (2)]))->v; @@ -2976,13 +3006,13 @@ yyreduce: { (yyval) = 0; } -;} +} break; case 87: -/* Line 1464 of yacc.c */ -#line 1008 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1008 "Grammar.y" { OptionalDefTokPtr returnType = OptionalDefTokPtr::dynamicCast((yyvsp[(2) - (3)])); string name = StringTokPtr::dynamicCast((yyvsp[(3) - (3)]))->v; @@ -3006,13 +3036,13 @@ yyreduce: { (yyval) = 0; } -;} +} break; case 88: -/* Line 1464 of yacc.c */ -#line 1038 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1038 "Grammar.y" { if((yyvsp[(1) - (3)])) { @@ -3023,13 +3053,13 @@ yyreduce: { (yyval) = 0; } -;} +} break; case 89: -/* Line 1464 of yacc.c */ -#line 1050 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1050 "Grammar.y" { OperationPtr op = OperationPtr::dynamicCast((yyvsp[(4) - (5)])); ExceptionListTokPtr el = ExceptionListTokPtr::dynamicCast((yyvsp[(5) - (5)])); @@ -3038,26 +3068,26 @@ yyreduce: { op->setExceptionList(el->v); } -;} +} break; case 90: -/* Line 1464 of yacc.c */ -#line 1060 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1060 "Grammar.y" { if((yyvsp[(1) - (3)])) { unit->popContainer(); } yyerrok; -;} +} break; case 91: -/* Line 1464 of yacc.c */ -#line 1068 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1068 "Grammar.y" { OperationPtr op = OperationPtr::dynamicCast((yyvsp[(4) - (5)])); ExceptionListTokPtr el = ExceptionListTokPtr::dynamicCast((yyvsp[(5) - (5)])); @@ -3066,33 +3096,33 @@ yyreduce: { op->setExceptionList(el->v); // Dummy } -;} +} break; case 94: -/* Line 1464 of yacc.c */ -#line 1090 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1090 "Grammar.y" { (yyval) = (yyvsp[(2) - (2)]); -;} +} break; case 95: -/* Line 1464 of yacc.c */ -#line 1094 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1094 "Grammar.y" { StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); unit->error("keyword `" + ident->v + "' cannot be used as interface name"); (yyval) = (yyvsp[(2) - (2)]); // Dummy -;} +} break; case 96: -/* Line 1464 of yacc.c */ -#line 1105 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1105 "Grammar.y" { BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (2)])); StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); @@ -3100,13 +3130,13 @@ yyreduce: ClassDeclPtr cl = cont->createClassDecl(ident->v, true, local->v); cont->checkIntroduced(ident->v, cl); (yyval) = cl; -;} +} break; case 97: -/* Line 1464 of yacc.c */ -#line 1119 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1119 "Grammar.y" { BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (3)])); StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (3)])); @@ -3123,13 +3153,13 @@ yyreduce: { (yyval) = 0; } -;} +} break; case 98: -/* Line 1464 of yacc.c */ -#line 1137 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1137 "Grammar.y" { if((yyvsp[(4) - (7)])) { @@ -3140,13 +3170,13 @@ yyreduce: { (yyval) = 0; } -;} +} break; case 99: -/* Line 1464 of yacc.c */ -#line 1154 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1154 "Grammar.y" { ClassListTokPtr intfs = ClassListTokPtr::dynamicCast((yyvsp[(3) - (3)])); StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(1) - (3)])); @@ -3180,13 +3210,13 @@ yyreduce: } } (yyval) = intfs; -;} +} break; case 100: -/* Line 1464 of yacc.c */ -#line 1189 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1189 "Grammar.y" { ClassListTokPtr intfs = new ClassListTok; StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); @@ -3220,41 +3250,41 @@ yyreduce: } } (yyval) = intfs; -;} +} break; case 101: -/* Line 1464 of yacc.c */ -#line 1224 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1224 "Grammar.y" { unit->error("illegal inheritance from type Object"); (yyval) = new ClassListTok; // Dummy -;} +} break; case 102: -/* Line 1464 of yacc.c */ -#line 1234 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1234 "Grammar.y" { (yyval) = (yyvsp[(2) - (2)]); -;} +} break; case 103: -/* Line 1464 of yacc.c */ -#line 1238 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1238 "Grammar.y" { (yyval) = new ClassListTok; -;} +} break; case 104: -/* Line 1464 of yacc.c */ -#line 1247 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1247 "Grammar.y" { StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(1) - (4)])); ContainedPtr contained = ContainedPtr::dynamicCast((yyvsp[(2) - (4)])); @@ -3262,62 +3292,62 @@ yyreduce: { contained->setMetaData(metaData->v); } -;} +} break; case 105: -/* Line 1464 of yacc.c */ -#line 1256 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1256 "Grammar.y" { -;} +} break; case 106: -/* Line 1464 of yacc.c */ -#line 1259 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1259 "Grammar.y" { unit->error("`;' missing after definition"); -;} +} break; case 107: -/* Line 1464 of yacc.c */ -#line 1263 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1263 "Grammar.y" { -;} +} break; case 109: -/* Line 1464 of yacc.c */ -#line 1277 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1277 "Grammar.y" { ExceptionPtr exception = ExceptionPtr::dynamicCast((yyvsp[(1) - (3)])); ExceptionListTokPtr exceptionList = ExceptionListTokPtr::dynamicCast((yyvsp[(3) - (3)])); exceptionList->v.push_front(exception); (yyval) = exceptionList; -;} +} break; case 110: -/* Line 1464 of yacc.c */ -#line 1284 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1284 "Grammar.y" { ExceptionPtr exception = ExceptionPtr::dynamicCast((yyvsp[(1) - (1)])); ExceptionListTokPtr exceptionList = new ExceptionListTok; exceptionList->v.push_front(exception); (yyval) = exceptionList; -;} +} break; case 111: -/* Line 1464 of yacc.c */ -#line 1296 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1296 "Grammar.y" { StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); ContainerPtr cont = unit->currentContainer(); @@ -3328,24 +3358,24 @@ yyreduce: } cont->checkIntroduced(scoped->v, exception); (yyval) = exception; -;} +} break; case 112: -/* Line 1464 of yacc.c */ -#line 1308 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1308 "Grammar.y" { StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); unit->error("keyword `" + ident->v + "' cannot be used as exception name"); (yyval) = unit->currentContainer()->createException(IceUtil::generateUUID(), 0, false, Dummy); // Dummy -;} +} break; case 113: -/* Line 1464 of yacc.c */ -#line 1319 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1319 "Grammar.y" { BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (7)])); StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(7) - (7)])); @@ -3353,13 +3383,13 @@ yyreduce: TypePtr type = TypePtr::dynamicCast((yyvsp[(5) - (7)])); ContainerPtr cont = unit->currentContainer(); (yyval) = cont->createSequence(ident->v, type, metaData->v, local->v); -;} +} break; case 114: -/* Line 1464 of yacc.c */ -#line 1328 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1328 "Grammar.y" { BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (7)])); StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(7) - (7)])); @@ -3368,13 +3398,13 @@ yyreduce: ContainerPtr cont = unit->currentContainer(); (yyval) = cont->createSequence(ident->v, type, metaData->v, local->v); // Dummy unit->error("keyword `" + ident->v + "' cannot be used as sequence name"); -;} +} break; case 115: -/* Line 1464 of yacc.c */ -#line 1343 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1343 "Grammar.y" { BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (10)])); StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(10) - (10)])); @@ -3384,13 +3414,13 @@ yyreduce: TypePtr valueType = TypePtr::dynamicCast((yyvsp[(8) - (10)])); ContainerPtr cont = unit->currentContainer(); (yyval) = cont->createDictionary(ident->v, keyType, keyMetaData->v, valueType, valueMetaData->v, local->v); -;} +} break; case 116: -/* Line 1464 of yacc.c */ -#line 1354 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1354 "Grammar.y" { BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (10)])); StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(10) - (10)])); @@ -3401,33 +3431,33 @@ yyreduce: ContainerPtr cont = unit->currentContainer(); (yyval) = cont->createDictionary(ident->v, keyType, keyMetaData->v, valueType, valueMetaData->v, local->v); // Dummy unit->error("keyword `" + ident->v + "' cannot be used as dictionary name"); -;} +} break; case 117: -/* Line 1464 of yacc.c */ -#line 1371 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1371 "Grammar.y" { (yyval) = (yyvsp[(2) - (2)]); -;} +} break; case 118: -/* Line 1464 of yacc.c */ -#line 1375 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1375 "Grammar.y" { StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); unit->error("keyword `" + ident->v + "' cannot be used as enumeration name"); (yyval) = (yyvsp[(2) - (2)]); // Dummy -;} +} break; case 119: -/* Line 1464 of yacc.c */ -#line 1386 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1386 "Grammar.y" { BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (2)])); StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); @@ -3435,13 +3465,13 @@ yyreduce: EnumPtr en = cont->createEnum(ident->v, local->v); cont->checkIntroduced(ident->v, en); (yyval) = en; -;} +} break; case 120: -/* Line 1464 of yacc.c */ -#line 1395 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1395 "Grammar.y" { EnumPtr en = EnumPtr::dynamicCast((yyvsp[(3) - (6)])); if(en) @@ -3454,13 +3484,13 @@ yyreduce: en->setEnumerators(enumerators->v); // Dummy } (yyval) = (yyvsp[(3) - (6)]); -;} +} break; case 121: -/* Line 1464 of yacc.c */ -#line 1410 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1410 "Grammar.y" { unit->error("missing enumeration name"); BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (5)])); @@ -3469,32 +3499,32 @@ yyreduce: EnumeratorListTokPtr enumerators = EnumeratorListTokPtr::dynamicCast((yyvsp[(4) - (5)])); en->setEnumerators(enumerators->v); // Dummy (yyval) = en; -;} +} break; case 122: -/* Line 1464 of yacc.c */ -#line 1425 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1425 "Grammar.y" { EnumeratorListTokPtr ens = EnumeratorListTokPtr::dynamicCast((yyvsp[(1) - (3)])); ens->v.splice(ens->v.end(), EnumeratorListTokPtr::dynamicCast((yyvsp[(3) - (3)]))->v); (yyval) = ens; -;} +} break; case 123: -/* Line 1464 of yacc.c */ -#line 1431 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1431 "Grammar.y" { -;} +} break; case 124: -/* Line 1464 of yacc.c */ -#line 1439 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1439 "Grammar.y" { StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); EnumeratorListTokPtr ens = new EnumeratorListTok; @@ -3505,65 +3535,141 @@ yyreduce: ens->v.push_front(en); } (yyval) = ens; -;} +} break; case 125: -/* Line 1464 of yacc.c */ -#line 1451 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1451 "Grammar.y" + { + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(1) - (3)])); + EnumeratorListTokPtr ens = new EnumeratorListTok; + ContainerPtr cont = unit->currentContainer(); + IntegerTokPtr intVal = IntegerTokPtr::dynamicCast((yyvsp[(3) - (3)])); + if(intVal) + { + if(intVal->v < 0 || intVal->v > Int32Max) + { + unit->error("value for enumerator `" + ident->v + "' is out of range"); + } + else + { + EnumeratorPtr en = cont->createEnumerator(ident->v, static_cast<int>(intVal->v)); + if(en) + { + ens->v.push_front(en); + } + } + } + (yyval) = ens; +} + break; + + case 126: + +/* Line 1806 of yacc.c */ +#line 1474 "Grammar.y" { StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); unit->error("keyword `" + ident->v + "' cannot be used as enumerator"); EnumeratorListTokPtr ens = new EnumeratorListTok; // Dummy (yyval) = ens; -;} +} break; - case 126: + case 127: -/* Line 1464 of yacc.c */ -#line 1458 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1481 "Grammar.y" { EnumeratorListTokPtr ens = new EnumeratorListTok; (yyval) = ens; // Dummy -;} +} break; - case 127: + case 128: + +/* Line 1806 of yacc.c */ +#line 1491 "Grammar.y" + { + (yyval) = (yyvsp[(1) - (1)]); +} + break; + + case 129: + +/* Line 1806 of yacc.c */ +#line 1495 "Grammar.y" + { + StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); + ContainedList cl = unit->currentContainer()->lookupContained(scoped->v); + IntegerTokPtr tok; + if(!cl.empty()) + { + ConstPtr constant = ConstPtr::dynamicCast(cl.front()); + if(constant) + { + unit->currentContainer()->checkIntroduced(scoped->v, constant); + BuiltinPtr b = BuiltinPtr::dynamicCast(constant->type()); + if(b && (b->kind() == Builtin::KindByte || b->kind() == Builtin::KindShort || + b->kind() == Builtin::KindInt || b->kind() == Builtin::KindLong)) + { + IceUtil::Int64 v; + if(IceUtilInternal::stringToInt64(constant->value(), v)) + { + tok = new IntegerTok; + tok->v = v; + tok->literal = constant->value(); + } + } + } + } -/* Line 1464 of yacc.c */ -#line 1468 "../Slice/Grammar.y" + if(!tok) + { + string msg = "illegal initializer: `" + scoped->v + "' is not an integer constant"; + unit->error(msg); // $$ is dummy + } + + (yyval) = tok; +} + break; + + case 130: + +/* Line 1806 of yacc.c */ +#line 1534 "Grammar.y" { BoolTokPtr out = new BoolTok; out->v = true; (yyval) = out; -;} +} break; - case 128: + case 131: -/* Line 1464 of yacc.c */ -#line 1474 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1540 "Grammar.y" { BoolTokPtr out = new BoolTok; out->v = false; (yyval) = out; -;} +} break; - case 129: + case 132: -/* Line 1464 of yacc.c */ -#line 1485 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1551 "Grammar.y" { -;} +} break; - case 130: + case 133: -/* Line 1464 of yacc.c */ -#line 1488 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1554 "Grammar.y" { BoolTokPtr isOutParam = BoolTokPtr::dynamicCast((yyvsp[(1) - (3)])); OptionalDefTokPtr tsp = OptionalDefTokPtr::dynamicCast((yyvsp[(3) - (3)])); @@ -3578,13 +3684,13 @@ yyreduce: pd->setMetaData(metaData->v); } } -;} +} break; - case 131: + case 134: -/* Line 1464 of yacc.c */ -#line 1504 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1570 "Grammar.y" { BoolTokPtr isOutParam = BoolTokPtr::dynamicCast((yyvsp[(3) - (5)])); OptionalDefTokPtr tsp = OptionalDefTokPtr::dynamicCast((yyvsp[(5) - (5)])); @@ -3599,13 +3705,13 @@ yyreduce: pd->setMetaData(metaData->v); } } -;} +} break; - case 132: + case 135: -/* Line 1464 of yacc.c */ -#line 1520 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1586 "Grammar.y" { BoolTokPtr isOutParam = BoolTokPtr::dynamicCast((yyvsp[(1) - (4)])); TypePtr type = TypePtr::dynamicCast((yyvsp[(3) - (4)])); @@ -3616,13 +3722,13 @@ yyreduce: op->createParamDecl(ident->v, type, isOutParam->v, false, 0); // Dummy unit->error("keyword `" + ident->v + "' cannot be used as parameter name"); } -;} +} break; - case 133: + case 136: -/* Line 1464 of yacc.c */ -#line 1532 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1598 "Grammar.y" { BoolTokPtr isOutParam = BoolTokPtr::dynamicCast((yyvsp[(3) - (6)])); TypePtr type = TypePtr::dynamicCast((yyvsp[(5) - (6)])); @@ -3633,13 +3739,13 @@ yyreduce: op->createParamDecl(ident->v, type, isOutParam->v, false, 0); // Dummy unit->error("keyword `" + ident->v + "' cannot be used as parameter name"); } -;} +} break; - case 134: + case 137: -/* Line 1464 of yacc.c */ -#line 1544 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1610 "Grammar.y" { BoolTokPtr isOutParam = BoolTokPtr::dynamicCast((yyvsp[(1) - (3)])); TypePtr type = TypePtr::dynamicCast((yyvsp[(3) - (3)])); @@ -3649,13 +3755,13 @@ yyreduce: op->createParamDecl(IceUtil::generateUUID(), type, isOutParam->v, false, 0); // Dummy unit->error("missing parameter name"); } -;} +} break; - case 135: + case 138: -/* Line 1464 of yacc.c */ -#line 1555 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1621 "Grammar.y" { BoolTokPtr isOutParam = BoolTokPtr::dynamicCast((yyvsp[(3) - (5)])); TypePtr type = TypePtr::dynamicCast((yyvsp[(5) - (5)])); @@ -3665,162 +3771,162 @@ yyreduce: op->createParamDecl(IceUtil::generateUUID(), type, isOutParam->v, false, 0); // Dummy unit->error("missing parameter name"); } -;} +} break; - case 136: + case 139: -/* Line 1464 of yacc.c */ -#line 1571 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1637 "Grammar.y" { (yyval) = (yyvsp[(2) - (2)]); -;} +} break; - case 137: + case 140: -/* Line 1464 of yacc.c */ -#line 1575 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1641 "Grammar.y" { (yyval) = new ExceptionListTok; -;} +} break; - case 138: + case 141: -/* Line 1464 of yacc.c */ -#line 1584 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1650 "Grammar.y" { -;} +} break; - case 139: + case 142: -/* Line 1464 of yacc.c */ -#line 1587 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1653 "Grammar.y" { StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); ident->v = "::" + ident->v; (yyval) = ident; -;} +} break; - case 140: + case 143: -/* Line 1464 of yacc.c */ -#line 1593 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1659 "Grammar.y" { StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(1) - (3)])); StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(3) - (3)])); scoped->v += "::"; scoped->v += ident->v; (yyval) = scoped; -;} +} break; - case 141: + case 144: -/* Line 1464 of yacc.c */ -#line 1606 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1672 "Grammar.y" { (yyval) = unit->builtin(Builtin::KindByte); -;} +} break; - case 142: + case 145: -/* Line 1464 of yacc.c */ -#line 1610 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1676 "Grammar.y" { (yyval) = unit->builtin(Builtin::KindBool); -;} +} break; - case 143: + case 146: -/* Line 1464 of yacc.c */ -#line 1614 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1680 "Grammar.y" { (yyval) = unit->builtin(Builtin::KindShort); -;} +} break; - case 144: + case 147: -/* Line 1464 of yacc.c */ -#line 1618 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1684 "Grammar.y" { (yyval) = unit->builtin(Builtin::KindInt); -;} +} break; - case 145: + case 148: -/* Line 1464 of yacc.c */ -#line 1622 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1688 "Grammar.y" { (yyval) = unit->builtin(Builtin::KindLong); -;} +} break; - case 146: + case 149: -/* Line 1464 of yacc.c */ -#line 1626 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1692 "Grammar.y" { (yyval) = unit->builtin(Builtin::KindFloat); -;} +} break; - case 147: + case 150: -/* Line 1464 of yacc.c */ -#line 1630 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1696 "Grammar.y" { (yyval) = unit->builtin(Builtin::KindDouble); -;} +} break; - case 148: + case 151: -/* Line 1464 of yacc.c */ -#line 1634 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1700 "Grammar.y" { (yyval) = unit->builtin(Builtin::KindString); -;} +} break; - case 149: + case 152: -/* Line 1464 of yacc.c */ -#line 1638 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1704 "Grammar.y" { (yyval) = unit->builtin(Builtin::KindObject); -;} +} break; - case 150: + case 153: -/* Line 1464 of yacc.c */ -#line 1642 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1708 "Grammar.y" { (yyval) = unit->builtin(Builtin::KindObjectProxy); -;} +} break; - case 151: + case 154: -/* Line 1464 of yacc.c */ -#line 1646 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1712 "Grammar.y" { (yyval) = unit->builtin(Builtin::KindLocalObject); -;} +} break; - case 152: + case 155: -/* Line 1464 of yacc.c */ -#line 1650 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1716 "Grammar.y" { StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); ContainerPtr cont = unit->currentContainer(); @@ -3838,13 +3944,13 @@ yyreduce: { (yyval) = 0; } -;} +} break; - case 153: + case 156: -/* Line 1464 of yacc.c */ -#line 1669 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1735 "Grammar.y" { StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(1) - (2)])); ContainerPtr cont = unit->currentContainer(); @@ -3879,78 +3985,78 @@ yyreduce: { (yyval) = 0; } -;} +} break; - case 154: + case 157: -/* Line 1464 of yacc.c */ -#line 1710 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1776 "Grammar.y" { StringTokPtr str1 = StringTokPtr::dynamicCast((yyvsp[(1) - (2)])); StringTokPtr str2 = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); str1->v += str2->v; -;} +} break; - case 155: + case 158: -/* Line 1464 of yacc.c */ -#line 1716 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1782 "Grammar.y" { -;} +} break; - case 156: + case 159: -/* Line 1464 of yacc.c */ -#line 1724 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1790 "Grammar.y" { StringTokPtr str = StringTokPtr::dynamicCast((yyvsp[(3) - (3)])); StringListTokPtr stringList = StringListTokPtr::dynamicCast((yyvsp[(1) - (3)])); stringList->v.push_back(str->v); (yyval) = stringList; -;} +} break; - case 157: + case 160: -/* Line 1464 of yacc.c */ -#line 1731 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1797 "Grammar.y" { StringTokPtr str = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); StringListTokPtr stringList = new StringListTok; stringList->v.push_back(str->v); (yyval) = stringList; -;} +} break; - case 158: + case 161: -/* Line 1464 of yacc.c */ -#line 1743 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1809 "Grammar.y" { BoolTokPtr local = new BoolTok; local->v = true; (yyval) = local; -;} +} break; - case 159: + case 162: -/* Line 1464 of yacc.c */ -#line 1749 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1815 "Grammar.y" { BoolTokPtr local = new BoolTok; local->v = false; (yyval) = local; -;} +} break; - case 160: + case 163: -/* Line 1464 of yacc.c */ -#line 1760 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1826 "Grammar.y" { BuiltinPtr type = unit->builtin(Builtin::KindLong); IntegerTokPtr intVal = IntegerTokPtr::dynamicCast((yyvsp[(1) - (1)])); @@ -3962,13 +4068,13 @@ yyreduce: def->v.valueAsString = sstr.str(); def->v.valueAsLiteral = intVal->literal; (yyval) = def; -;} +} break; - case 161: + case 164: -/* Line 1464 of yacc.c */ -#line 1773 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1839 "Grammar.y" { BuiltinPtr type = unit->builtin(Builtin::KindDouble); FloatingTokPtr floatVal = FloatingTokPtr::dynamicCast((yyvsp[(1) - (1)])); @@ -3980,13 +4086,13 @@ yyreduce: def->v.valueAsString = sstr.str(); def->v.valueAsLiteral = floatVal->literal; (yyval) = def; -;} +} break; - case 162: + case 165: -/* Line 1464 of yacc.c */ -#line 1786 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1852 "Grammar.y" { StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); ConstDefTokPtr def = new ConstDefTok; @@ -4031,13 +4137,13 @@ yyreduce: } } (yyval) = def; -;} +} break; - case 163: + case 166: -/* Line 1464 of yacc.c */ -#line 1832 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1898 "Grammar.y" { BuiltinPtr type = unit->builtin(Builtin::KindString); StringTokPtr literal = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); @@ -4047,13 +4153,13 @@ yyreduce: def->v.valueAsString = literal->v; def->v.valueAsLiteral = literal->literal; (yyval) = def; -;} +} break; - case 164: + case 167: -/* Line 1464 of yacc.c */ -#line 1843 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1909 "Grammar.y" { BuiltinPtr type = unit->builtin(Builtin::KindBool); StringTokPtr literal = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); @@ -4063,13 +4169,13 @@ yyreduce: def->v.valueAsString = "false"; def->v.valueAsLiteral = "false"; (yyval) = def; -;} +} break; - case 165: + case 168: -/* Line 1464 of yacc.c */ -#line 1854 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1920 "Grammar.y" { BuiltinPtr type = unit->builtin(Builtin::KindBool); StringTokPtr literal = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); @@ -4079,13 +4185,13 @@ yyreduce: def->v.valueAsString = "true"; def->v.valueAsLiteral = "true"; (yyval) = def; -;} +} break; - case 166: + case 169: -/* Line 1464 of yacc.c */ -#line 1870 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1936 "Grammar.y" { StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(2) - (6)])); TypePtr const_type = TypePtr::dynamicCast((yyvsp[(3) - (6)])); @@ -4093,13 +4199,13 @@ yyreduce: ConstDefTokPtr value = ConstDefTokPtr::dynamicCast((yyvsp[(6) - (6)])); (yyval) = unit->currentContainer()->createConst(ident->v, const_type, metaData->v, value->v.value, value->v.valueAsString, value->v.valueAsLiteral); -;} +} break; - case 167: + case 170: -/* Line 1464 of yacc.c */ -#line 1879 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1945 "Grammar.y" { StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(2) - (5)])); TypePtr const_type = TypePtr::dynamicCast((yyvsp[(3) - (5)])); @@ -4107,247 +4213,258 @@ yyreduce: unit->error("missing constant name"); (yyval) = unit->currentContainer()->createConst(IceUtil::generateUUID(), const_type, metaData->v, value->v.value, value->v.valueAsString, value->v.valueAsLiteral, Dummy); // Dummy -;} - break; - - case 168: - -/* Line 1464 of yacc.c */ -#line 1893 "../Slice/Grammar.y" - { -;} - break; - - case 169: - -/* Line 1464 of yacc.c */ -#line 1896 "../Slice/Grammar.y" - { -;} - break; - - case 170: - -/* Line 1464 of yacc.c */ -#line 1899 "../Slice/Grammar.y" - { -;} +} break; case 171: -/* Line 1464 of yacc.c */ -#line 1902 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1959 "Grammar.y" { -;} +} break; case 172: -/* Line 1464 of yacc.c */ -#line 1905 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1962 "Grammar.y" { -;} +} break; case 173: -/* Line 1464 of yacc.c */ -#line 1908 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1965 "Grammar.y" { -;} +} break; case 174: -/* Line 1464 of yacc.c */ -#line 1911 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1968 "Grammar.y" { -;} +} break; case 175: -/* Line 1464 of yacc.c */ -#line 1914 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1971 "Grammar.y" { -;} +} break; case 176: -/* Line 1464 of yacc.c */ -#line 1917 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1974 "Grammar.y" { -;} +} break; case 177: -/* Line 1464 of yacc.c */ -#line 1920 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1977 "Grammar.y" { -;} +} break; case 178: -/* Line 1464 of yacc.c */ -#line 1923 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1980 "Grammar.y" { -;} +} break; case 179: -/* Line 1464 of yacc.c */ -#line 1926 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1983 "Grammar.y" { -;} +} break; case 180: -/* Line 1464 of yacc.c */ -#line 1929 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1986 "Grammar.y" { -;} +} break; case 181: -/* Line 1464 of yacc.c */ -#line 1932 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1989 "Grammar.y" { -;} +} break; case 182: -/* Line 1464 of yacc.c */ -#line 1935 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1992 "Grammar.y" { -;} +} break; case 183: -/* Line 1464 of yacc.c */ -#line 1938 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1995 "Grammar.y" { -;} +} break; case 184: -/* Line 1464 of yacc.c */ -#line 1941 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 1998 "Grammar.y" { -;} +} break; case 185: -/* Line 1464 of yacc.c */ -#line 1944 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 2001 "Grammar.y" { -;} +} break; case 186: -/* Line 1464 of yacc.c */ -#line 1947 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 2004 "Grammar.y" { -;} +} break; case 187: -/* Line 1464 of yacc.c */ -#line 1950 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 2007 "Grammar.y" { -;} +} break; case 188: -/* Line 1464 of yacc.c */ -#line 1953 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 2010 "Grammar.y" { -;} +} break; case 189: -/* Line 1464 of yacc.c */ -#line 1956 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 2013 "Grammar.y" { -;} +} break; case 190: -/* Line 1464 of yacc.c */ -#line 1959 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 2016 "Grammar.y" { -;} +} break; case 191: -/* Line 1464 of yacc.c */ -#line 1962 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 2019 "Grammar.y" { -;} +} break; case 192: -/* Line 1464 of yacc.c */ -#line 1965 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 2022 "Grammar.y" { -;} +} break; case 193: -/* Line 1464 of yacc.c */ -#line 1968 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 2025 "Grammar.y" { -;} +} break; case 194: -/* Line 1464 of yacc.c */ -#line 1971 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 2028 "Grammar.y" { -;} +} break; case 195: -/* Line 1464 of yacc.c */ -#line 1974 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 2031 "Grammar.y" { -;} +} break; case 196: -/* Line 1464 of yacc.c */ -#line 1977 "../Slice/Grammar.y" +/* Line 1806 of yacc.c */ +#line 2034 "Grammar.y" { -;} +} break; + case 197: + +/* Line 1806 of yacc.c */ +#line 2037 "Grammar.y" + { +} + break; + + case 198: + +/* Line 1806 of yacc.c */ +#line 2040 "Grammar.y" + { +} + break; + + case 199: + +/* Line 1806 of yacc.c */ +#line 2043 "Grammar.y" + { +} + break; -/* Line 1464 of yacc.c */ -#line 4349 "Grammar.tab.c" + +/* Line 1806 of yacc.c */ +#line 4455 "Grammar.tab.c" default: break; } + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action invokes + YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or + if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an + incorrect destructor might then be invoked immediately. In the + case of YYERROR or YYBACKUP, subsequent parser actions might lead + to an incorrect destructor call or verbose syntax error message + before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); @@ -4375,6 +4492,10 @@ yyreduce: | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); + /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { @@ -4382,37 +4503,36 @@ yyerrlab: #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else +# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ + yyssp, yytoken) { - YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); - if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) - { - YYSIZE_T yyalloc = 2 * yysize; - if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) - yyalloc = YYSTACK_ALLOC_MAXIMUM; - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yyalloc); - if (yymsg) - yymsg_alloc = yyalloc; - else - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - } - } - - if (0 < yysize && yysize <= yymsg_alloc) - { - (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (yymsg); - } - else - { - yyerror (YY_("syntax error")); - if (yysize != 0) - goto yyexhaustedlab; - } + char const *yymsgp = YY_("syntax error"); + int yysyntax_error_status; + yysyntax_error_status = YYSYNTAX_ERROR; + if (yysyntax_error_status == 0) + yymsgp = yymsg; + else if (yysyntax_error_status == 1) + { + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); + if (!yymsg) + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = 2; + } + else + { + yysyntax_error_status = YYSYNTAX_ERROR; + yymsgp = yymsg; + } + } + yyerror (yymsgp); + if (yysyntax_error_status == 2) + goto yyexhaustedlab; } +# undef YYSYNTAX_ERROR #endif } @@ -4471,7 +4591,7 @@ yyerrlab1: for (;;) { yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) + if (!yypact_value_is_default (yyn)) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) @@ -4530,8 +4650,13 @@ yyexhaustedlab: yyreturn: if (yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); + { + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = YYTRANSLATE (yychar); + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + } /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); @@ -4556,7 +4681,7 @@ yyreturn: -/* Line 1684 of yacc.c */ -#line 1981 "../Slice/Grammar.y" +/* Line 2067 of yacc.c */ +#line 2047 "Grammar.y" diff --git a/cpp/src/Slice/Grammar.h b/cpp/src/Slice/Grammar.h index 4bae650f0c4..44fb7115b46 100644 --- a/cpp/src/Slice/Grammar.h +++ b/cpp/src/Slice/Grammar.h @@ -1,9 +1,8 @@ -/* A Bison parser, made by GNU Bison 2.4.3. */ +/* A Bison parser, made by GNU Bison 2.5. */ -/* Skeleton interface for Bison's Yacc-like parsers in C +/* Bison interface for Yacc-like parsers in C - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2011 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 diff --git a/cpp/src/Slice/Grammar.y b/cpp/src/Slice/Grammar.y index 3ab8c73d6af..e864d5f04cf 100644 --- a/cpp/src/Slice/Grammar.y +++ b/cpp/src/Slice/Grammar.y @@ -1447,6 +1447,29 @@ enumerator } $$ = ens; } +| ICE_IDENTIFIER '=' enumerator_initializer +{ + StringTokPtr ident = StringTokPtr::dynamicCast($1); + EnumeratorListTokPtr ens = new EnumeratorListTok; + ContainerPtr cont = unit->currentContainer(); + IntegerTokPtr intVal = IntegerTokPtr::dynamicCast($3); + if(intVal) + { + if(intVal->v < 0 || intVal->v > Int32Max) + { + unit->error("value for enumerator `" + ident->v + "' is out of range"); + } + else + { + EnumeratorPtr en = cont->createEnumerator(ident->v, static_cast<int>(intVal->v)); + if(en) + { + ens->v.push_front(en); + } + } + } + $$ = ens; +} | keyword { StringTokPtr ident = StringTokPtr::dynamicCast($1); @@ -1462,6 +1485,49 @@ enumerator ; // ---------------------------------------------------------------------- +enumerator_initializer +// ---------------------------------------------------------------------- +: ICE_INTEGER_LITERAL +{ + $$ = $1; +} +| scoped_name +{ + StringTokPtr scoped = StringTokPtr::dynamicCast($1); + ContainedList cl = unit->currentContainer()->lookupContained(scoped->v); + IntegerTokPtr tok; + if(!cl.empty()) + { + ConstPtr constant = ConstPtr::dynamicCast(cl.front()); + if(constant) + { + unit->currentContainer()->checkIntroduced(scoped->v, constant); + BuiltinPtr b = BuiltinPtr::dynamicCast(constant->type()); + if(b && (b->kind() == Builtin::KindByte || b->kind() == Builtin::KindShort || + b->kind() == Builtin::KindInt || b->kind() == Builtin::KindLong)) + { + IceUtil::Int64 v; + if(IceUtilInternal::stringToInt64(constant->value(), v)) + { + tok = new IntegerTok; + tok->v = v; + tok->literal = constant->value(); + } + } + } + } + + if(!tok) + { + string msg = "illegal initializer: `" + scoped->v + "' is not an integer constant"; + unit->error(msg); // $$ is dummy + } + + $$ = tok; +} +; + +// ---------------------------------------------------------------------- out_qualifier // ---------------------------------------------------------------------- : ICE_OUT diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp index d8418db67c1..881353ef07b 100755 --- a/cpp/src/Slice/Parser.cpp +++ b/cpp/src/Slice/Parser.cpp @@ -1054,37 +1054,27 @@ Slice::Container::createEnum(const string& name, bool local, NodeType nt) EnumeratorPtr Slice::Container::createEnumerator(const string& name) { - checkIdentifier(name); - - ContainedList matches = _unit->findContents(thisScope() + name); - if(!matches.empty()) + EnumeratorPtr p = validateEnumerator(name); + if(p) { - EnumeratorPtr p = EnumeratorPtr::dynamicCast(matches.front()); - if(p) - { - if(_unit->ignRedefs()) - { - p->updateIncludeLevel(); - return p; - } - } - if(matches.front()->name() == name) - { - string msg = "redefinition of " + matches.front()->kindOf() + " `" + matches.front()->name(); - msg += "' as enumerator"; - _unit->error(msg); - } - else - { - string msg = "enumerator `" + name + "' differs only in capitalization from "; - msg += matches.front()->kindOf() + " `" + matches.front()->name() + "'"; - _unit->error(msg); - } + return p; } - nameIsLegal(name, "enumerator"); // Don't return here -- we create the enumerator anyway. + p = new Enumerator(this, name); + _contents.push_back(p); + return p; +} - EnumeratorPtr p = new Enumerator(this, name); +EnumeratorPtr +Slice::Container::createEnumerator(const string& name, int value) +{ + EnumeratorPtr p = validateEnumerator(name); + if(p) + { + return p; + } + + p = new Enumerator(this, name, value); _contents.push_back(p); return p; } @@ -2609,6 +2599,42 @@ Slice::Container::validateConstant(const string& name, const TypePtr& type, cons return true; } +EnumeratorPtr +Slice::Container::validateEnumerator(const string& name) +{ + checkIdentifier(name); + + ContainedList matches = _unit->findContents(thisScope() + name); + if(!matches.empty()) + { + EnumeratorPtr p = EnumeratorPtr::dynamicCast(matches.front()); + if(p) + { + if(_unit->ignRedefs()) + { + p->updateIncludeLevel(); + return p; + } + } + if(matches.front()->name() == name) + { + string msg = "redefinition of " + matches.front()->kindOf() + " `" + matches.front()->name(); + msg += "' as enumerator"; + _unit->error(msg); + } + else + { + string msg = "enumerator `" + name + "' differs only in capitalization from "; + msg += matches.front()->kindOf() + " `" + matches.front()->name() + "'"; + _unit->error(msg); + } + } + + nameIsLegal(name, "enumerator"); // Don't return here -- we create the enumerator anyway. + + return 0; +} + // ---------------------------------------------------------------------- // Module // ---------------------------------------------------------------------- @@ -4586,12 +4612,75 @@ void Slice::Enum::setEnumerators(const EnumeratorList& ens) { _enumerators = ens; + int lastValue = -1; + set<int> values; for(EnumeratorList::iterator p = _enumerators.begin(); p != _enumerators.end(); ++p) { (*p)->_type = this; + + if((*p)->_explicitValue) + { + _explicitValue = true; + + if((*p)->_value < 0) + { + string msg = "value for enumerator `" + (*p)->name() + "' is out of range"; + _unit->error(msg); + } + } + else + { + if(lastValue == Int32Max) + { + string msg = "value for enumerator `" + (*p)->name() + "' is out of range"; + _unit->error(msg); + } + + // + // If the enumerator was not assigned an explicit value, we automatically assign + // it one more than the previous enumerator. + // + (*p)->_value = lastValue + 1; + } + + if(values.count((*p)->_value) != 0) + { + string msg = "enumerator `" + (*p)->name() + "' has a duplicate value"; + _unit->error(msg); + } + values.insert((*p)->_value); + + lastValue = (*p)->_value; + + if(lastValue > _maxValue) + { + _maxValue = lastValue; + } + if(lastValue < _minValue) + { + _minValue = lastValue; + } } } +bool +Slice::Enum::explicitValue() const +{ + return _explicitValue; +} + +int +Slice::Enum::minValue() const +{ + return static_cast<int>(_minValue); +} + +int +Slice::Enum::maxValue() const +{ + return static_cast<int>(_maxValue); +} + Contained::ContainedType Slice::Enum::containedType() const { @@ -4644,7 +4733,10 @@ Slice::Enum::Enum(const ContainerPtr& container, const string& name, bool local) SyntaxTreeBase(container->unit()), Type(container->unit()), Contained(container, name), - Constructed(container, name, local) + Constructed(container, name, local), + _explicitValue(false), + _minValue(Int32Max), + _maxValue(0) { } @@ -4676,9 +4768,31 @@ Slice::Enumerator::kindOf() const return "enumerator"; } +bool +Slice::Enumerator::explicitValue() const +{ + return _explicitValue; +} + +int +Slice::Enumerator::value() const +{ + return _value; +} + Slice::Enumerator::Enumerator(const ContainerPtr& container, const string& name) : SyntaxTreeBase(container->unit()), - Contained(container, name) + Contained(container, name), + _explicitValue(false), + _value(-1) +{ +} + +Slice::Enumerator::Enumerator(const ContainerPtr& container, const string& name, int value) : + SyntaxTreeBase(container->unit()), + Contained(container, name), + _explicitValue(true), + _value(value) { } diff --git a/cpp/src/Slice/PythonUtil.cpp b/cpp/src/Slice/PythonUtil.cpp index 5e9e42c7c04..7f5a93b93fd 100755 --- a/cpp/src/Slice/PythonUtil.cpp +++ b/cpp/src/Slice/PythonUtil.cpp @@ -1414,12 +1414,11 @@ Slice::Python::CodeVisitor::visitEnum(const EnumPtr& p) string name = fixIdent(p->name()); EnumeratorList enums = p->getEnumerators(); EnumeratorList::iterator q; - int i; _out << sp << nl << "if " << getDictLookup(p) << ':'; _out.inc(); _out << nl << "_M_" << abs << " = Ice.createTempClass()"; - _out << nl << "class " << name << "(object):"; + _out << nl << "class " << name << "(Ice.EnumBase):"; _out.inc(); string comment = p->comment(); @@ -1428,80 +1427,41 @@ Slice::Python::CodeVisitor::visitEnum(const EnumPtr& p) _out << nl << "'''" << editComment(comment) << "'''"; } - _out << sp << nl << "def __init__(self, val):"; + _out << sp << nl << "def __init__(self, _n, _v):"; _out.inc(); - { - ostringstream assertion; - assertion << "assert(val >= 0 and val < " << enums.size() << ')'; - _out << nl << assertion.str(); - } - _out << nl << "self.value = val"; + _out << nl << "Ice.EnumBase.__init__(self, _n, _v)"; _out.dec(); - _out << sp << nl << "def __str__(self):"; + _out << sp << nl << "def valueOf(self, _n):"; _out.inc(); - _out << nl << "return self._names[self.value]"; - _out.dec(); - _out << sp << nl << "__repr__ = __str__"; - _out << sp << nl << "def __hash__(self):"; + _out << nl << "if _n in self._enumerators:"; _out.inc(); - _out << nl << "return self.value"; + _out << nl << "return self._enumerators[_n]"; + _out.dec(); + _out << nl << "return None"; _out.dec(); + _out << nl << "valueOf = classmethod(valueOf)"; - // - // Rich operators. __lt__, __le__, __eq__, __ne__, __gt__, __ge__ - // - static const char* richOps[] = { - "__lt__", "<", - "__le__", "<=", - "__eq__", "==", - "__ne__", "!=", - "__gt__", ">", - "__ge__", ">=" - }; - for(int opIndex = 0; opIndex != sizeof(richOps)/sizeof(richOps[0]); opIndex += 2) - { - const char* opName = richOps[opIndex]; - const char* opSymbol = richOps[opIndex+1]; + _out.dec(); - _out << sp << nl << "def " << opName << "(self, other):"; - _out.inc(); - _out << nl << "if isinstance(other, _M_" << abs << "):"; - _out.inc(); - _out << nl << "return self.value " << opSymbol << " other.value;"; - _out.dec(); - _out << nl << "elif other == None:"; - _out.inc(); - _out << nl << "return False"; - _out.dec(); - _out << nl << "return NotImplemented"; - _out.dec(); + _out << sp; + for(q = enums.begin(); q != enums.end(); ++q) + { + string fixedEnum = fixIdent((*q)->name()); + _out << nl << name << '.' << fixedEnum << " = " << name << "(\"" << (*q)->name() << "\", " << (*q)->value() + << ')'; } - - _out << sp << nl << "_names = ("; - for(q = enums.begin(), i = 0; q != enums.end(); ++q, ++i) + _out << nl << name << "._enumerators = { "; + for(q = enums.begin(); q != enums.end(); ++q) { if(q != enums.begin()) { _out << ", "; } - _out << "'" << (*q)->name() << "'"; - } - if(enums.size() == 1) - { - _out << ','; - } - _out << ')'; - _out.dec(); - - _out << sp; - for(q = enums.begin(), i = 0; q != enums.end(); ++q, ++i) - { string fixedEnum = fixIdent((*q)->name()); - ostringstream idx; - idx << i; - _out << nl << name << '.' << fixedEnum << " = " << name << '(' << idx.str() << ')'; + _out << (*q)->value() << ':' << name << '.' << fixedEnum; } + _out << " }"; // // Emit the type information. @@ -1509,21 +1469,7 @@ Slice::Python::CodeVisitor::visitEnum(const EnumPtr& p) _out << sp << nl << "_M_" << getAbsolute(p, "_t_") << " = IcePy.defineEnum('" << scoped << "', " << name << ", "; writeMetaData(p->getMetaData()); - _out << ", ("; - for(q = enums.begin(); q != enums.end(); ++q) - { - if(q != enums.begin()) - { - _out << ", "; - } - string fixedEnum = fixIdent((*q)->name()); - _out << name << '.' << fixedEnum; - } - if(enums.size() == 1) - { - _out << ','; - } - _out << "))"; + _out << ", " << name << "._enumerators)"; registerName(name); diff --git a/cpp/src/Slice/RubyUtil.cpp b/cpp/src/Slice/RubyUtil.cpp index b4aa70e9ac6..558f4d42623 100755 --- a/cpp/src/Slice/RubyUtil.cpp +++ b/cpp/src/Slice/RubyUtil.cpp @@ -1162,23 +1162,16 @@ Slice::Ruby::CodeVisitor::visitEnum(const EnumPtr& p) string scoped = p->scoped(); string name = fixIdent(p->name(), IdentToUpper); EnumeratorList enums = p->getEnumerators(); - EnumeratorList::iterator q; - int i; _out << sp << nl << "if not defined?(" << getAbsolute(p, IdentToUpper) << ')'; _out.inc(); _out << nl << "class " << name; _out.inc(); _out << nl << "include Comparable"; - _out << sp << nl << "def initialize(val)"; + _out << sp << nl << "def initialize(name, value)"; _out.inc(); - { - ostringstream assertion; - assertion << "fail(\"invalid value #{val} for " << name << "\") unless(val >= 0 and val < " - << enums.size() << ')'; - _out << nl << assertion.str(); - } - _out << nl << "@val = val"; + _out << nl << "@name = name"; + _out << nl << "@value = value"; _out.dec(); _out << nl << "end"; @@ -1190,9 +1183,7 @@ Slice::Ruby::CodeVisitor::visitEnum(const EnumPtr& p) ostringstream sz; sz << enums.size() - 1; _out.inc(); - _out << nl << "raise IndexError, \"#{val} is out of range 0.." << sz.str() << "\" if(val < 0 || val > " - << sz.str() << ')'; - _out << nl << "@@_values[val]"; + _out << nl << "@@_enumerators[val]"; // Evaluates to nil if the key is not found _out.dec(); _out << nl << "end"; } @@ -1202,7 +1193,7 @@ Slice::Ruby::CodeVisitor::visitEnum(const EnumPtr& p) // _out << sp << nl << "def to_s"; _out.inc(); - _out << nl << "@@_names[@val]"; + _out << nl << "@name"; _out.dec(); _out << nl << "end"; @@ -1211,7 +1202,7 @@ Slice::Ruby::CodeVisitor::visitEnum(const EnumPtr& p) // _out << sp << nl << "def to_i"; _out.inc(); - _out << nl << "@val"; + _out << nl << "@value"; _out.dec(); _out << nl << "end"; @@ -1221,7 +1212,7 @@ Slice::Ruby::CodeVisitor::visitEnum(const EnumPtr& p) _out << sp << nl << "def <=>(other)"; _out.inc(); _out << nl << "other.is_a?(" << name << ") or raise ArgumentError, \"value must be a " << name << "\""; - _out << nl << "@val <=> other.to_i"; + _out << nl << "@value <=> other.to_i"; _out.dec(); _out << nl << "end"; @@ -1230,7 +1221,7 @@ Slice::Ruby::CodeVisitor::visitEnum(const EnumPtr& p) // _out << sp << nl << "def hash"; _out.inc(); - _out << nl << "@val.hash"; + _out << nl << "@value.hash"; _out.dec(); _out << nl << "end"; @@ -1239,7 +1230,7 @@ Slice::Ruby::CodeVisitor::visitEnum(const EnumPtr& p) // _out << sp << nl << "def inspect"; _out.inc(); - _out << nl << "@@_names[@val] + \"(#{@val})\""; + _out << nl << "@name + \"(#{@value})\""; _out.dec(); _out << nl << "end"; @@ -1248,44 +1239,39 @@ Slice::Ruby::CodeVisitor::visitEnum(const EnumPtr& p) // _out << sp << nl << "def " << name << ".each(&block)"; _out.inc(); - _out << nl << "@@_values.each(&block)"; + _out << nl << "@@_enumerators.each_value(&block)"; _out.dec(); _out << nl << "end"; - _out << sp << nl << "@@_names = ["; - for(q = enums.begin(); q != enums.end(); ++q) + // + // Constant for each enumerator. + // + _out << sp; + int i = 0; + for(EnumeratorList::iterator q = enums.begin(); q != enums.end(); ++q, ++i) { - if(q != enums.begin()) - { - _out << ", "; - } - _out << "'" << (*q)->name() << "'"; + ostringstream idx; + idx << i; + _out << nl << fixIdent((*q)->name(), IdentToUpper) << " = " << name << ".new(\"" << (*q)->name() + << "\", " << (*q)->value() << ')'; } - _out << ']'; - _out << nl << "@@_values = ["; - for(EnumeratorList::size_type j = 0; j < enums.size(); ++j) + _out << sp << nl << "@@_enumerators = {"; + for(EnumeratorList::iterator q = enums.begin(); q != enums.end(); ++q) { - if(j > 0) + if(q != enums.begin()) { _out << ", "; } - ostringstream idx; - idx << j; - _out << name << ".new(" << idx.str() << ')'; + _out << (*q)->value() << "=>" << fixIdent((*q)->name(), IdentToUpper); } - _out << ']'; + _out << '}'; - // - // Constant for each enumerator. - // - _out << sp; - for(q = enums.begin(), i = 0; q != enums.end(); ++q, ++i) - { - ostringstream idx; - idx << i; - _out << nl << fixIdent((*q)->name(), IdentToUpper) << " = @@_values[" << idx.str() << "]"; - } + _out << sp << nl << "def " << name << "._enumerators"; + _out.inc(); + _out << nl << "@@_enumerators"; + _out.dec(); + _out << nl << "end"; _out << sp << nl << "private_class_method :new"; @@ -1295,16 +1281,8 @@ Slice::Ruby::CodeVisitor::visitEnum(const EnumPtr& p) // // Emit the type information. // - _out << sp << nl << "T_" << name << " = ::Ice::__defineEnum('" << scoped << "', " << name << ", ["; - for(q = enums.begin(); q != enums.end(); ++q) - { - if(q != enums.begin()) - { - _out << ", "; - } - _out << name << "::" << fixIdent((*q)->name(), IdentToUpper); - } - _out << "])"; + _out << sp << nl << "T_" << name << " = ::Ice::__defineEnum('" << scoped << "', " << name << ", " << name + << "::_enumerators)"; _out.dec(); _out << nl << "end"; // if not defined?() diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index 88db0da48c4..7723b686ced 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -1310,12 +1310,27 @@ Slice::Gen::TypesVisitor::visitEnum(const EnumPtr& p) { string name = fixKwd(p->name()); EnumeratorList enumerators = p->getEnumerators(); + + // + // Check if any of the enumerators were assigned an explicit value. + // + const bool explicitValue = p->explicitValue(); + H << sp << nl << "enum " << name; H << sb; + EnumeratorList::const_iterator en = enumerators.begin(); while(en != enumerators.end()) { H << nl << fixKwd((*en)->name()); + // + // If any of the enumerators were assigned an explicit value, we emit + // an explicit value for *all* enumerators. + // + if(explicitValue) + { + H << " = " << int64ToString((*en)->value()); + } if(++en != enumerators.end()) { H << ','; @@ -6106,7 +6121,8 @@ Slice::Gen::StreamVisitor::visitEnum(const EnumPtr& p) H << nl << "struct StreamableTraits< " << scoped << ">"; H << sb; H << nl << "static const StreamHelperCategory helper = StreamHelperCategoryEnum;"; - H << nl << "static const int enumLimit = " << p->getEnumerators().size() << ";"; + H << nl << "static const int minValue = " << p->minValue() << ";"; + H << nl << "static const int maxValue = " << p->maxValue() << ";"; H << nl << "static const int minWireSize = " << p->minWireSize() << ";"; H << nl << "static const bool fixedLength = false;"; H << eb << ";" << nl; diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp index c93d29ecbc0..b32125284b9 100644 --- a/cpp/src/slice2cs/Gen.cpp +++ b/cpp/src/slice2cs/Gen.cpp @@ -3996,6 +3996,7 @@ Slice::Gen::TypesVisitor::visitEnum(const EnumPtr& p) string name = fixId(p->name()); string scoped = fixId(p->scoped()); EnumeratorList enumerators = p->getEnumerators(); + const bool explicitValue = p->explicitValue(); _out << sp; emitDeprecate(p, 0, _out, "type"); @@ -4003,18 +4004,21 @@ Slice::Gen::TypesVisitor::visitEnum(const EnumPtr& p) emitGeneratedCodeAttribute(); _out << nl << "public enum " << name; _out << sb; - EnumeratorList::const_iterator en = enumerators.begin(); - while(en != enumerators.end()) + for(EnumeratorList::const_iterator en = enumerators.begin(); en != enumerators.end(); ++en) { - _out << nl << fixId((*en)->name()); - if(++en != enumerators.end()) + if(en != enumerators.begin()) { _out << ','; } + _out << nl << fixId((*en)->name()); + if(explicitValue) + { + _out << " = " << (*en)->value(); + } } _out << eb; - if(_stream) + if(!p->isLocal() && _stream) { _out << sp; emitGeneratedCodeAttribute(); diff --git a/cpp/src/slice2java/Gen.cpp b/cpp/src/slice2java/Gen.cpp index 033e077302a..abf943ebfd8 100644 --- a/cpp/src/slice2java/Gen.cpp +++ b/cpp/src/slice2java/Gen.cpp @@ -3893,7 +3893,6 @@ Slice::Gen::TypesVisitor::visitEnum(const EnumPtr& p) string name = fixKwd(p->name()); string absolute = getAbsolute(p); EnumeratorList enumerators = p->getEnumerators(); - size_t sz = enumerators.size(); open(absolute, p->file()); @@ -3918,46 +3917,81 @@ Slice::Gen::TypesVisitor::visitEnum(const EnumPtr& p) } out << nl; writeDocComment(out, *en, getDeprecateReason(*en, 0, "enumerator")); - out << nl << fixKwd((*en)->name()); + out << nl << fixKwd((*en)->name()) << '(' << (*en)->value() << ')'; } out << ';'; + out << sp << nl << "public int" + << nl << "value()"; + out << sb; + out << nl << "return __value;"; + out << eb; + + out << sp << nl << "public static " << name + << nl << "valueOf(int __v)"; + out << sb; + out << nl << "switch(__v)"; + out << sb; + out.dec(); + for(EnumeratorList::const_iterator en = enumerators.begin(); en != enumerators.end(); ++en) + { + out << nl << "case " << (*en)->value() << ':'; + out.inc(); + out << nl << "return " << fixKwd((*en)->name()) << ';'; + out.dec(); + } + out.inc(); + out << eb; + out << nl << "return null;"; + out << eb; + + out << sp << nl << "private" + << nl << name << "(int __v)"; + out << sb; + out << nl << "__value = __v;"; + out << eb; + if(!p->isLocal()) { out << sp << nl << "public void" << nl << "__write(IceInternal.BasicStream __os)"; out << sb; - out << nl << "__os.writeEnum(ordinal(), " << sz << ");"; + out << nl << "__os.writeEnum(value(), " << p->maxValue() << ");"; out << eb; out << sp << nl << "public static " << name << nl << "__read(IceInternal.BasicStream __is)"; out << sb; - out << nl << "int __v = __is.readEnum(" << sz << ");"; - out << nl << "if(__v < 0 || __v >= " << sz << ')'; - out << sb; - out << nl << "throw new Ice.MarshalException(\"enumerator out of range\");"; - out << eb; - out << nl << "return values()[__v];"; + out << nl << "int __v = __is.readEnum(" << p->maxValue() << ");"; + out << nl << "return __validate(__v);"; out << eb; if(_stream) { out << sp << nl << "public void" << nl << "ice_write(Ice.OutputStream __outS)"; out << sb; - out << nl << "__outS.writeEnum(ordinal(), " << sz << ");"; + out << nl << "__outS.writeEnum(value(), " << p->maxValue() << ");"; out << eb; out << sp << nl << "public static " << name << nl << "ice_read(Ice.InputStream __inS)"; out << sb; - out << nl << "int __v = __inS.readEnum(" << sz << ");"; - out << nl << "if(__v < 0 || __v >= " << sz << ')'; - out << sb; - out << nl << "throw new Ice.MarshalException(\"enumerator out of range\");"; - out << eb; - out << nl << "return values()[__v];"; + out << nl << "int __v = __inS.readEnum(" << p->maxValue() << ");"; + out << nl << "return __validate(__v);"; out << eb; } + + out << sp << nl << "private static " << name + << nl << "__validate(int __v)"; + out << sb; + out << nl << "final " << name << " __e = valueOf(__v);"; + out << nl << "if(__e == null)"; + out << sb; + out << nl << "throw new Ice.MarshalException(\"enumerator value \" + __v + \" is out of range\");"; + out << eb; + out << nl << "return __e;"; + out << eb; } + out << sp << nl << "private final int __value;"; + out << eb; close(); } diff --git a/cpp/src/slice2php/Main.cpp b/cpp/src/slice2php/Main.cpp index dc2453fb77c..2209bee48b4 100644 --- a/cpp/src/slice2php/Main.cpp +++ b/cpp/src/slice2php/Main.cpp @@ -926,10 +926,7 @@ CodeVisitor::visitEnum(const EnumPtr& p) long i = 0; for(EnumeratorList::iterator q = enums.begin(); q != enums.end(); ++q, ++i) { - string fixedEnum = fixIdent((*q)->name()); - ostringstream idx; - idx << i; - _out << nl << "const " << fixedEnum << " = " << idx.str() << ';'; + _out << nl << "const " << fixIdent((*q)->name()) << " = " << (*q)->value() << ';'; } } @@ -945,7 +942,7 @@ CodeVisitor::visitEnum(const EnumPtr& p) { _out << ", "; } - _out << "'" << (*q)->name() << "'"; + _out << "'" << (*q)->name() << "', " << (*q)->value(); } _out << "));"; diff --git a/cpp/test/Ice/Makefile b/cpp/test/Ice/Makefile index 8d24b725a6f..a36a766fb15 100644 --- a/cpp/test/Ice/Makefile +++ b/cpp/test/Ice/Makefile @@ -46,7 +46,8 @@ SUBDIRS = proxy \ properties \ plugin \ admin \ - metrics + metrics \ + enums .PHONY: $(EVERYTHING) $(SUBDIRS) diff --git a/cpp/test/Ice/Makefile.mak b/cpp/test/Ice/Makefile.mak index 4965e966b13..bc813a20319 100644 --- a/cpp/test/Ice/Makefile.mak +++ b/cpp/test/Ice/Makefile.mak @@ -33,7 +33,8 @@ SUBDIRS = proxy \ plugin \
stream \
metrics \
- optional
+ optional \
+ enums
!if "$(WINRT)" != "yes"
SUBDIRS = $(SUBDIRS) \
diff --git a/cpp/test/Ice/enums/.depend b/cpp/test/Ice/enums/.depend new file mode 100644 index 00000000000..b8afe55967a --- /dev/null +++ b/cpp/test/Ice/enums/.depend @@ -0,0 +1,6 @@ +Test$(OBJEXT): Test.cpp Test.h $(includedir)/Ice/ProxyF.h $(includedir)/IceUtil/Shared.h $(includedir)/IceUtil/Config.h $(includedir)/Ice/Config.h $(includedir)/Ice/ProxyHandle.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/Ice/ObjectF.h $(includedir)/Ice/Handle.h $(includedir)/Ice/Exception.h $(includedir)/Ice/Format.h $(includedir)/Ice/StreamF.h $(includedir)/Ice/LocalObject.h $(includedir)/Ice/LocalObjectF.h $(includedir)/Ice/StreamHelpers.h $(includedir)/IceUtil/ScopedArray.h $(includedir)/IceUtil/Iterator.h $(includedir)/Ice/Proxy.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/IceUtil/Time.h $(includedir)/IceUtil/MutexProtocol.h $(includedir)/Ice/ProxyFactoryF.h $(includedir)/Ice/ConnectionIF.h $(includedir)/Ice/RequestHandlerF.h $(includedir)/Ice/EndpointIF.h $(includedir)/Ice/EndpointF.h $(includedir)/IceUtil/Optional.h $(includedir)/Ice/UndefSysMacros.h $(includedir)/Ice/EndpointTypes.h $(includedir)/Ice/ObjectAdapterF.h $(includedir)/Ice/ReferenceF.h $(includedir)/Ice/OutgoingAsync.h $(includedir)/IceUtil/Monitor.h $(includedir)/IceUtil/Cond.h $(includedir)/IceUtil/Timer.h $(includedir)/IceUtil/Thread.h $(includedir)/IceUtil/UniquePtr.h $(includedir)/Ice/OutgoingAsyncF.h $(includedir)/Ice/InstanceF.h $(includedir)/Ice/CommunicatorF.h $(includedir)/Ice/Current.h $(includedir)/Ice/ConnectionF.h $(includedir)/Ice/Identity.h $(includedir)/Ice/Version.h $(includedir)/Ice/BasicStream.h $(includedir)/Ice/ObjectFactoryF.h $(includedir)/Ice/Buffer.h $(includedir)/Ice/Protocol.h $(includedir)/Ice/SlicedDataF.h $(includedir)/Ice/UserExceptionFactory.h $(includedir)/Ice/ObserverHelper.h $(includedir)/Ice/Instrumentation.h $(includedir)/Ice/Object.h $(includedir)/Ice/GCShared.h $(includedir)/Ice/GCCountMap.h $(includedir)/Ice/IncomingAsyncF.h $(includedir)/Ice/Outgoing.h $(includedir)/Ice/Incoming.h $(includedir)/Ice/ServantLocatorF.h $(includedir)/Ice/ServantManagerF.h $(includedir)/Ice/Direct.h $(includedir)/Ice/LocalException.h $(includedir)/Ice/BuiltinSequences.h $(includedir)/Ice/ObjectFactory.h $(includedir)/Ice/Stream.h +Client$(OBJEXT): Client.cpp $(includedir)/Ice/Ice.h $(includedir)/IceUtil/Config.h $(includedir)/Ice/Initialize.h $(includedir)/Ice/CommunicatorF.h $(includedir)/Ice/ProxyF.h $(includedir)/IceUtil/Shared.h $(includedir)/Ice/Config.h $(includedir)/Ice/ProxyHandle.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/Ice/ObjectF.h $(includedir)/Ice/Handle.h $(includedir)/Ice/Exception.h $(includedir)/Ice/Format.h $(includedir)/Ice/StreamF.h $(includedir)/Ice/LocalObject.h $(includedir)/Ice/LocalObjectF.h $(includedir)/Ice/StreamHelpers.h $(includedir)/IceUtil/ScopedArray.h $(includedir)/IceUtil/Iterator.h $(includedir)/IceUtil/Optional.h $(includedir)/Ice/UndefSysMacros.h $(includedir)/Ice/PropertiesF.h $(includedir)/Ice/InstanceF.h $(includedir)/Ice/LoggerF.h $(includedir)/Ice/StatsF.h $(includedir)/Ice/InstrumentationF.h $(includedir)/Ice/Dispatcher.h $(includedir)/Ice/ConnectionF.h $(includedir)/Ice/StringConverter.h $(includedir)/Ice/Plugin.h $(includedir)/Ice/BuiltinSequences.h $(includedir)/IceUtil/Unicode.h $(includedir)/Ice/LocalException.h $(includedir)/Ice/Identity.h $(includedir)/Ice/Version.h $(includedir)/Ice/Properties.h $(includedir)/Ice/Proxy.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/IceUtil/Time.h $(includedir)/IceUtil/MutexProtocol.h $(includedir)/Ice/ProxyFactoryF.h $(includedir)/Ice/ConnectionIF.h $(includedir)/Ice/RequestHandlerF.h $(includedir)/Ice/EndpointIF.h $(includedir)/Ice/EndpointF.h $(includedir)/Ice/EndpointTypes.h $(includedir)/Ice/ObjectAdapterF.h $(includedir)/Ice/ReferenceF.h $(includedir)/Ice/OutgoingAsync.h $(includedir)/IceUtil/Monitor.h $(includedir)/IceUtil/Cond.h $(includedir)/IceUtil/Timer.h $(includedir)/IceUtil/Thread.h $(includedir)/IceUtil/UniquePtr.h $(includedir)/Ice/OutgoingAsyncF.h $(includedir)/Ice/Current.h $(includedir)/Ice/BasicStream.h $(includedir)/Ice/ObjectFactoryF.h $(includedir)/Ice/Buffer.h $(includedir)/Ice/Protocol.h $(includedir)/Ice/SlicedDataF.h $(includedir)/Ice/UserExceptionFactory.h $(includedir)/Ice/ObserverHelper.h $(includedir)/Ice/Instrumentation.h $(includedir)/Ice/Object.h $(includedir)/Ice/GCShared.h $(includedir)/Ice/GCCountMap.h $(includedir)/Ice/IncomingAsyncF.h $(includedir)/Ice/Outgoing.h $(includedir)/Ice/Incoming.h $(includedir)/Ice/ServantLocatorF.h $(includedir)/Ice/ServantManagerF.h $(includedir)/Ice/IncomingAsync.h $(includedir)/Ice/Direct.h $(includedir)/Ice/Logger.h $(includedir)/Ice/LoggerUtil.h $(includedir)/Ice/Stats.h $(includedir)/Ice/Communicator.h $(includedir)/Ice/RouterF.h $(includedir)/Ice/LocatorF.h $(includedir)/Ice/PluginF.h $(includedir)/Ice/ImplicitContextF.h $(includedir)/Ice/CommunicatorAsync.h $(includedir)/Ice/ObjectFactory.h $(includedir)/Ice/ObjectAdapter.h $(includedir)/Ice/FacetMap.h $(includedir)/Ice/Endpoint.h $(includedir)/Ice/ServantLocator.h $(includedir)/Ice/SlicedData.h $(includedir)/Ice/Process.h $(includedir)/Ice/Application.h $(includedir)/Ice/Connection.h $(includedir)/Ice/ConnectionAsync.h $(includedir)/Ice/Functional.h $(includedir)/IceUtil/Functional.h $(includedir)/Ice/Stream.h $(includedir)/Ice/ImplicitContext.h $(includedir)/Ice/Locator.h $(includedir)/Ice/FactoryTableInit.h $(includedir)/Ice/FactoryTable.h $(includedir)/Ice/ProcessF.h $(includedir)/Ice/Router.h $(includedir)/Ice/DispatchInterceptor.h $(includedir)/Ice/PropertiesAdmin.h $(includedir)/Ice/Metrics.h $(includedir)/Ice/Service.h $(includedir)/Ice/IconvStringConverter.h ../../include/TestCommon.h $(includedir)/IceUtil/IceUtil.h $(includedir)/IceUtil/AbstractMutex.h $(includedir)/IceUtil/Cache.h $(includedir)/IceUtil/CountDownLatch.h $(includedir)/IceUtil/CtrlCHandler.h $(includedir)/IceUtil/MutexPtrLock.h $(includedir)/IceUtil/RecMutex.h $(includedir)/IceUtil/UUID.h Test.h +AllTests$(OBJEXT): AllTests.cpp $(includedir)/Ice/Ice.h $(includedir)/IceUtil/Config.h $(includedir)/Ice/Initialize.h $(includedir)/Ice/CommunicatorF.h $(includedir)/Ice/ProxyF.h $(includedir)/IceUtil/Shared.h $(includedir)/Ice/Config.h $(includedir)/Ice/ProxyHandle.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/Ice/ObjectF.h $(includedir)/Ice/Handle.h $(includedir)/Ice/Exception.h $(includedir)/Ice/Format.h $(includedir)/Ice/StreamF.h $(includedir)/Ice/LocalObject.h $(includedir)/Ice/LocalObjectF.h $(includedir)/Ice/StreamHelpers.h $(includedir)/IceUtil/ScopedArray.h $(includedir)/IceUtil/Iterator.h $(includedir)/IceUtil/Optional.h $(includedir)/Ice/UndefSysMacros.h $(includedir)/Ice/PropertiesF.h $(includedir)/Ice/InstanceF.h $(includedir)/Ice/LoggerF.h $(includedir)/Ice/StatsF.h $(includedir)/Ice/InstrumentationF.h $(includedir)/Ice/Dispatcher.h $(includedir)/Ice/ConnectionF.h $(includedir)/Ice/StringConverter.h $(includedir)/Ice/Plugin.h $(includedir)/Ice/BuiltinSequences.h $(includedir)/IceUtil/Unicode.h $(includedir)/Ice/LocalException.h $(includedir)/Ice/Identity.h $(includedir)/Ice/Version.h $(includedir)/Ice/Properties.h $(includedir)/Ice/Proxy.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/IceUtil/Time.h $(includedir)/IceUtil/MutexProtocol.h $(includedir)/Ice/ProxyFactoryF.h $(includedir)/Ice/ConnectionIF.h $(includedir)/Ice/RequestHandlerF.h $(includedir)/Ice/EndpointIF.h $(includedir)/Ice/EndpointF.h $(includedir)/Ice/EndpointTypes.h $(includedir)/Ice/ObjectAdapterF.h $(includedir)/Ice/ReferenceF.h $(includedir)/Ice/OutgoingAsync.h $(includedir)/IceUtil/Monitor.h $(includedir)/IceUtil/Cond.h $(includedir)/IceUtil/Timer.h $(includedir)/IceUtil/Thread.h $(includedir)/IceUtil/UniquePtr.h $(includedir)/Ice/OutgoingAsyncF.h $(includedir)/Ice/Current.h $(includedir)/Ice/BasicStream.h $(includedir)/Ice/ObjectFactoryF.h $(includedir)/Ice/Buffer.h $(includedir)/Ice/Protocol.h $(includedir)/Ice/SlicedDataF.h $(includedir)/Ice/UserExceptionFactory.h $(includedir)/Ice/ObserverHelper.h $(includedir)/Ice/Instrumentation.h $(includedir)/Ice/Object.h $(includedir)/Ice/GCShared.h $(includedir)/Ice/GCCountMap.h $(includedir)/Ice/IncomingAsyncF.h $(includedir)/Ice/Outgoing.h $(includedir)/Ice/Incoming.h $(includedir)/Ice/ServantLocatorF.h $(includedir)/Ice/ServantManagerF.h $(includedir)/Ice/IncomingAsync.h $(includedir)/Ice/Direct.h $(includedir)/Ice/Logger.h $(includedir)/Ice/LoggerUtil.h $(includedir)/Ice/Stats.h $(includedir)/Ice/Communicator.h $(includedir)/Ice/RouterF.h $(includedir)/Ice/LocatorF.h $(includedir)/Ice/PluginF.h $(includedir)/Ice/ImplicitContextF.h $(includedir)/Ice/CommunicatorAsync.h $(includedir)/Ice/ObjectFactory.h $(includedir)/Ice/ObjectAdapter.h $(includedir)/Ice/FacetMap.h $(includedir)/Ice/Endpoint.h $(includedir)/Ice/ServantLocator.h $(includedir)/Ice/SlicedData.h $(includedir)/Ice/Process.h $(includedir)/Ice/Application.h $(includedir)/Ice/Connection.h $(includedir)/Ice/ConnectionAsync.h $(includedir)/Ice/Functional.h $(includedir)/IceUtil/Functional.h $(includedir)/Ice/Stream.h $(includedir)/Ice/ImplicitContext.h $(includedir)/Ice/Locator.h $(includedir)/Ice/FactoryTableInit.h $(includedir)/Ice/FactoryTable.h $(includedir)/Ice/ProcessF.h $(includedir)/Ice/Router.h $(includedir)/Ice/DispatchInterceptor.h $(includedir)/Ice/PropertiesAdmin.h $(includedir)/Ice/Metrics.h $(includedir)/Ice/Service.h $(includedir)/Ice/IconvStringConverter.h ../../include/TestCommon.h $(includedir)/IceUtil/IceUtil.h $(includedir)/IceUtil/AbstractMutex.h $(includedir)/IceUtil/Cache.h $(includedir)/IceUtil/CountDownLatch.h $(includedir)/IceUtil/CtrlCHandler.h $(includedir)/IceUtil/MutexPtrLock.h $(includedir)/IceUtil/RecMutex.h $(includedir)/IceUtil/UUID.h Test.h +TestI$(OBJEXT): TestI.cpp $(includedir)/Ice/Ice.h $(includedir)/IceUtil/Config.h $(includedir)/Ice/Initialize.h $(includedir)/Ice/CommunicatorF.h $(includedir)/Ice/ProxyF.h $(includedir)/IceUtil/Shared.h $(includedir)/Ice/Config.h $(includedir)/Ice/ProxyHandle.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/Ice/ObjectF.h $(includedir)/Ice/Handle.h $(includedir)/Ice/Exception.h $(includedir)/Ice/Format.h $(includedir)/Ice/StreamF.h $(includedir)/Ice/LocalObject.h $(includedir)/Ice/LocalObjectF.h $(includedir)/Ice/StreamHelpers.h $(includedir)/IceUtil/ScopedArray.h $(includedir)/IceUtil/Iterator.h $(includedir)/IceUtil/Optional.h $(includedir)/Ice/UndefSysMacros.h $(includedir)/Ice/PropertiesF.h $(includedir)/Ice/InstanceF.h $(includedir)/Ice/LoggerF.h $(includedir)/Ice/StatsF.h $(includedir)/Ice/InstrumentationF.h $(includedir)/Ice/Dispatcher.h $(includedir)/Ice/ConnectionF.h $(includedir)/Ice/StringConverter.h $(includedir)/Ice/Plugin.h $(includedir)/Ice/BuiltinSequences.h $(includedir)/IceUtil/Unicode.h $(includedir)/Ice/LocalException.h $(includedir)/Ice/Identity.h $(includedir)/Ice/Version.h $(includedir)/Ice/Properties.h $(includedir)/Ice/Proxy.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/IceUtil/Time.h $(includedir)/IceUtil/MutexProtocol.h $(includedir)/Ice/ProxyFactoryF.h $(includedir)/Ice/ConnectionIF.h $(includedir)/Ice/RequestHandlerF.h $(includedir)/Ice/EndpointIF.h $(includedir)/Ice/EndpointF.h $(includedir)/Ice/EndpointTypes.h $(includedir)/Ice/ObjectAdapterF.h $(includedir)/Ice/ReferenceF.h $(includedir)/Ice/OutgoingAsync.h $(includedir)/IceUtil/Monitor.h $(includedir)/IceUtil/Cond.h $(includedir)/IceUtil/Timer.h $(includedir)/IceUtil/Thread.h $(includedir)/IceUtil/UniquePtr.h $(includedir)/Ice/OutgoingAsyncF.h $(includedir)/Ice/Current.h $(includedir)/Ice/BasicStream.h $(includedir)/Ice/ObjectFactoryF.h $(includedir)/Ice/Buffer.h $(includedir)/Ice/Protocol.h $(includedir)/Ice/SlicedDataF.h $(includedir)/Ice/UserExceptionFactory.h $(includedir)/Ice/ObserverHelper.h $(includedir)/Ice/Instrumentation.h $(includedir)/Ice/Object.h $(includedir)/Ice/GCShared.h $(includedir)/Ice/GCCountMap.h $(includedir)/Ice/IncomingAsyncF.h $(includedir)/Ice/Outgoing.h $(includedir)/Ice/Incoming.h $(includedir)/Ice/ServantLocatorF.h $(includedir)/Ice/ServantManagerF.h $(includedir)/Ice/IncomingAsync.h $(includedir)/Ice/Direct.h $(includedir)/Ice/Logger.h $(includedir)/Ice/LoggerUtil.h $(includedir)/Ice/Stats.h $(includedir)/Ice/Communicator.h $(includedir)/Ice/RouterF.h $(includedir)/Ice/LocatorF.h $(includedir)/Ice/PluginF.h $(includedir)/Ice/ImplicitContextF.h $(includedir)/Ice/CommunicatorAsync.h $(includedir)/Ice/ObjectFactory.h $(includedir)/Ice/ObjectAdapter.h $(includedir)/Ice/FacetMap.h $(includedir)/Ice/Endpoint.h $(includedir)/Ice/ServantLocator.h $(includedir)/Ice/SlicedData.h $(includedir)/Ice/Process.h $(includedir)/Ice/Application.h $(includedir)/Ice/Connection.h $(includedir)/Ice/ConnectionAsync.h $(includedir)/Ice/Functional.h $(includedir)/IceUtil/Functional.h $(includedir)/Ice/Stream.h $(includedir)/Ice/ImplicitContext.h $(includedir)/Ice/Locator.h $(includedir)/Ice/FactoryTableInit.h $(includedir)/Ice/FactoryTable.h $(includedir)/Ice/ProcessF.h $(includedir)/Ice/Router.h $(includedir)/Ice/DispatchInterceptor.h $(includedir)/Ice/PropertiesAdmin.h $(includedir)/Ice/Metrics.h $(includedir)/Ice/Service.h $(includedir)/Ice/IconvStringConverter.h TestI.h Test.h +Server$(OBJEXT): Server.cpp $(includedir)/Ice/Ice.h $(includedir)/IceUtil/Config.h $(includedir)/Ice/Initialize.h $(includedir)/Ice/CommunicatorF.h $(includedir)/Ice/ProxyF.h $(includedir)/IceUtil/Shared.h $(includedir)/Ice/Config.h $(includedir)/Ice/ProxyHandle.h $(includedir)/IceUtil/Handle.h $(includedir)/IceUtil/Exception.h $(includedir)/Ice/ObjectF.h $(includedir)/Ice/Handle.h $(includedir)/Ice/Exception.h $(includedir)/Ice/Format.h $(includedir)/Ice/StreamF.h $(includedir)/Ice/LocalObject.h $(includedir)/Ice/LocalObjectF.h $(includedir)/Ice/StreamHelpers.h $(includedir)/IceUtil/ScopedArray.h $(includedir)/IceUtil/Iterator.h $(includedir)/IceUtil/Optional.h $(includedir)/Ice/UndefSysMacros.h $(includedir)/Ice/PropertiesF.h $(includedir)/Ice/InstanceF.h $(includedir)/Ice/LoggerF.h $(includedir)/Ice/StatsF.h $(includedir)/Ice/InstrumentationF.h $(includedir)/Ice/Dispatcher.h $(includedir)/Ice/ConnectionF.h $(includedir)/Ice/StringConverter.h $(includedir)/Ice/Plugin.h $(includedir)/Ice/BuiltinSequences.h $(includedir)/IceUtil/Unicode.h $(includedir)/Ice/LocalException.h $(includedir)/Ice/Identity.h $(includedir)/Ice/Version.h $(includedir)/Ice/Properties.h $(includedir)/Ice/Proxy.h $(includedir)/IceUtil/Mutex.h $(includedir)/IceUtil/Lock.h $(includedir)/IceUtil/ThreadException.h $(includedir)/IceUtil/Time.h $(includedir)/IceUtil/MutexProtocol.h $(includedir)/Ice/ProxyFactoryF.h $(includedir)/Ice/ConnectionIF.h $(includedir)/Ice/RequestHandlerF.h $(includedir)/Ice/EndpointIF.h $(includedir)/Ice/EndpointF.h $(includedir)/Ice/EndpointTypes.h $(includedir)/Ice/ObjectAdapterF.h $(includedir)/Ice/ReferenceF.h $(includedir)/Ice/OutgoingAsync.h $(includedir)/IceUtil/Monitor.h $(includedir)/IceUtil/Cond.h $(includedir)/IceUtil/Timer.h $(includedir)/IceUtil/Thread.h $(includedir)/IceUtil/UniquePtr.h $(includedir)/Ice/OutgoingAsyncF.h $(includedir)/Ice/Current.h $(includedir)/Ice/BasicStream.h $(includedir)/Ice/ObjectFactoryF.h $(includedir)/Ice/Buffer.h $(includedir)/Ice/Protocol.h $(includedir)/Ice/SlicedDataF.h $(includedir)/Ice/UserExceptionFactory.h $(includedir)/Ice/ObserverHelper.h $(includedir)/Ice/Instrumentation.h $(includedir)/Ice/Object.h $(includedir)/Ice/GCShared.h $(includedir)/Ice/GCCountMap.h $(includedir)/Ice/IncomingAsyncF.h $(includedir)/Ice/Outgoing.h $(includedir)/Ice/Incoming.h $(includedir)/Ice/ServantLocatorF.h $(includedir)/Ice/ServantManagerF.h $(includedir)/Ice/IncomingAsync.h $(includedir)/Ice/Direct.h $(includedir)/Ice/Logger.h $(includedir)/Ice/LoggerUtil.h $(includedir)/Ice/Stats.h $(includedir)/Ice/Communicator.h $(includedir)/Ice/RouterF.h $(includedir)/Ice/LocatorF.h $(includedir)/Ice/PluginF.h $(includedir)/Ice/ImplicitContextF.h $(includedir)/Ice/CommunicatorAsync.h $(includedir)/Ice/ObjectFactory.h $(includedir)/Ice/ObjectAdapter.h $(includedir)/Ice/FacetMap.h $(includedir)/Ice/Endpoint.h $(includedir)/Ice/ServantLocator.h $(includedir)/Ice/SlicedData.h $(includedir)/Ice/Process.h $(includedir)/Ice/Application.h $(includedir)/Ice/Connection.h $(includedir)/Ice/ConnectionAsync.h $(includedir)/Ice/Functional.h $(includedir)/IceUtil/Functional.h $(includedir)/Ice/Stream.h $(includedir)/Ice/ImplicitContext.h $(includedir)/Ice/Locator.h $(includedir)/Ice/FactoryTableInit.h $(includedir)/Ice/FactoryTable.h $(includedir)/Ice/ProcessF.h $(includedir)/Ice/Router.h $(includedir)/Ice/DispatchInterceptor.h $(includedir)/Ice/PropertiesAdmin.h $(includedir)/Ice/Metrics.h $(includedir)/Ice/Service.h $(includedir)/Ice/IconvStringConverter.h TestI.h Test.h +Test.h Test.cpp: Test.ice $(SLICE2CPP) $(SLICEPARSERLIB) diff --git a/cpp/test/Ice/enums/.depend.mak b/cpp/test/Ice/enums/.depend.mak new file mode 100644 index 00000000000..eab664ce196 --- /dev/null +++ b/cpp/test/Ice/enums/.depend.mak @@ -0,0 +1,6 @@ +Test$(OBJEXT): Test.cpp Test.h "$(includedir)/Ice/ProxyF.h" "$(includedir)/IceUtil/Shared.h" "$(includedir)/IceUtil/Config.h" "$(includedir)/Ice/Config.h" "$(includedir)/Ice/ProxyHandle.h" "$(includedir)/IceUtil/Handle.h" "$(includedir)/IceUtil/Exception.h" "$(includedir)/Ice/ObjectF.h" "$(includedir)/Ice/Handle.h" "$(includedir)/Ice/Exception.h" "$(includedir)/Ice/Format.h" "$(includedir)/Ice/StreamF.h" "$(includedir)/Ice/LocalObject.h" "$(includedir)/Ice/LocalObjectF.h" "$(includedir)/Ice/StreamHelpers.h" "$(includedir)/IceUtil/ScopedArray.h" "$(includedir)/IceUtil/Iterator.h" "$(includedir)/Ice/Proxy.h" "$(includedir)/IceUtil/Mutex.h" "$(includedir)/IceUtil/Lock.h" "$(includedir)/IceUtil/ThreadException.h" "$(includedir)/IceUtil/Time.h" "$(includedir)/IceUtil/MutexProtocol.h" "$(includedir)/Ice/ProxyFactoryF.h" "$(includedir)/Ice/ConnectionIF.h" "$(includedir)/Ice/RequestHandlerF.h" "$(includedir)/Ice/EndpointIF.h" "$(includedir)/Ice/EndpointF.h" "$(includedir)/IceUtil/Optional.h" "$(includedir)/Ice/UndefSysMacros.h" "$(includedir)/Ice/EndpointTypes.h" "$(includedir)/Ice/ObjectAdapterF.h" "$(includedir)/Ice/ReferenceF.h" "$(includedir)/Ice/OutgoingAsync.h" "$(includedir)/IceUtil/Monitor.h" "$(includedir)/IceUtil/Cond.h" "$(includedir)/IceUtil/Timer.h" "$(includedir)/IceUtil/Thread.h" "$(includedir)/IceUtil/UniquePtr.h" "$(includedir)/Ice/OutgoingAsyncF.h" "$(includedir)/Ice/InstanceF.h" "$(includedir)/Ice/CommunicatorF.h" "$(includedir)/Ice/Current.h" "$(includedir)/Ice/ConnectionF.h" "$(includedir)/Ice/Identity.h" "$(includedir)/Ice/Version.h" "$(includedir)/Ice/BasicStream.h" "$(includedir)/Ice/ObjectFactoryF.h" "$(includedir)/Ice/Buffer.h" "$(includedir)/Ice/Protocol.h" "$(includedir)/Ice/SlicedDataF.h" "$(includedir)/Ice/UserExceptionFactory.h" "$(includedir)/Ice/ObserverHelper.h" "$(includedir)/Ice/Instrumentation.h" "$(includedir)/Ice/Object.h" "$(includedir)/Ice/GCShared.h" "$(includedir)/Ice/GCCountMap.h" "$(includedir)/Ice/IncomingAsyncF.h" "$(includedir)/Ice/Outgoing.h" "$(includedir)/Ice/Incoming.h" "$(includedir)/Ice/ServantLocatorF.h" "$(includedir)/Ice/ServantManagerF.h" "$(includedir)/Ice/Direct.h" "$(includedir)/Ice/LocalException.h" "$(includedir)/Ice/BuiltinSequences.h" "$(includedir)/Ice/ObjectFactory.h" "$(includedir)/Ice/Stream.h" +Client$(OBJEXT): Client.cpp "$(includedir)/Ice/Ice.h" "$(includedir)/IceUtil/Config.h" "$(includedir)/Ice/Initialize.h" "$(includedir)/Ice/CommunicatorF.h" "$(includedir)/Ice/ProxyF.h" "$(includedir)/IceUtil/Shared.h" "$(includedir)/Ice/Config.h" "$(includedir)/Ice/ProxyHandle.h" "$(includedir)/IceUtil/Handle.h" "$(includedir)/IceUtil/Exception.h" "$(includedir)/Ice/ObjectF.h" "$(includedir)/Ice/Handle.h" "$(includedir)/Ice/Exception.h" "$(includedir)/Ice/Format.h" "$(includedir)/Ice/StreamF.h" "$(includedir)/Ice/LocalObject.h" "$(includedir)/Ice/LocalObjectF.h" "$(includedir)/Ice/StreamHelpers.h" "$(includedir)/IceUtil/ScopedArray.h" "$(includedir)/IceUtil/Iterator.h" "$(includedir)/IceUtil/Optional.h" "$(includedir)/Ice/UndefSysMacros.h" "$(includedir)/Ice/PropertiesF.h" "$(includedir)/Ice/InstanceF.h" "$(includedir)/Ice/LoggerF.h" "$(includedir)/Ice/StatsF.h" "$(includedir)/Ice/InstrumentationF.h" "$(includedir)/Ice/Dispatcher.h" "$(includedir)/Ice/ConnectionF.h" "$(includedir)/Ice/StringConverter.h" "$(includedir)/Ice/Plugin.h" "$(includedir)/Ice/BuiltinSequences.h" "$(includedir)/IceUtil/Unicode.h" "$(includedir)/Ice/LocalException.h" "$(includedir)/Ice/Identity.h" "$(includedir)/Ice/Version.h" "$(includedir)/Ice/Properties.h" "$(includedir)/Ice/Proxy.h" "$(includedir)/IceUtil/Mutex.h" "$(includedir)/IceUtil/Lock.h" "$(includedir)/IceUtil/ThreadException.h" "$(includedir)/IceUtil/Time.h" "$(includedir)/IceUtil/MutexProtocol.h" "$(includedir)/Ice/ProxyFactoryF.h" "$(includedir)/Ice/ConnectionIF.h" "$(includedir)/Ice/RequestHandlerF.h" "$(includedir)/Ice/EndpointIF.h" "$(includedir)/Ice/EndpointF.h" "$(includedir)/Ice/EndpointTypes.h" "$(includedir)/Ice/ObjectAdapterF.h" "$(includedir)/Ice/ReferenceF.h" "$(includedir)/Ice/OutgoingAsync.h" "$(includedir)/IceUtil/Monitor.h" "$(includedir)/IceUtil/Cond.h" "$(includedir)/IceUtil/Timer.h" "$(includedir)/IceUtil/Thread.h" "$(includedir)/IceUtil/UniquePtr.h" "$(includedir)/Ice/OutgoingAsyncF.h" "$(includedir)/Ice/Current.h" "$(includedir)/Ice/BasicStream.h" "$(includedir)/Ice/ObjectFactoryF.h" "$(includedir)/Ice/Buffer.h" "$(includedir)/Ice/Protocol.h" "$(includedir)/Ice/SlicedDataF.h" "$(includedir)/Ice/UserExceptionFactory.h" "$(includedir)/Ice/ObserverHelper.h" "$(includedir)/Ice/Instrumentation.h" "$(includedir)/Ice/Object.h" "$(includedir)/Ice/GCShared.h" "$(includedir)/Ice/GCCountMap.h" "$(includedir)/Ice/IncomingAsyncF.h" "$(includedir)/Ice/Outgoing.h" "$(includedir)/Ice/Incoming.h" "$(includedir)/Ice/ServantLocatorF.h" "$(includedir)/Ice/ServantManagerF.h" "$(includedir)/Ice/IncomingAsync.h" "$(includedir)/Ice/Direct.h" "$(includedir)/Ice/Logger.h" "$(includedir)/Ice/LoggerUtil.h" "$(includedir)/Ice/Stats.h" "$(includedir)/Ice/Communicator.h" "$(includedir)/Ice/RouterF.h" "$(includedir)/Ice/LocatorF.h" "$(includedir)/Ice/PluginF.h" "$(includedir)/Ice/ImplicitContextF.h" "$(includedir)/Ice/CommunicatorAsync.h" "$(includedir)/Ice/ObjectFactory.h" "$(includedir)/Ice/ObjectAdapter.h" "$(includedir)/Ice/FacetMap.h" "$(includedir)/Ice/Endpoint.h" "$(includedir)/Ice/ServantLocator.h" "$(includedir)/Ice/SlicedData.h" "$(includedir)/Ice/Process.h" "$(includedir)/Ice/Application.h" "$(includedir)/Ice/Connection.h" "$(includedir)/Ice/ConnectionAsync.h" "$(includedir)/Ice/Functional.h" "$(includedir)/IceUtil/Functional.h" "$(includedir)/Ice/Stream.h" "$(includedir)/Ice/ImplicitContext.h" "$(includedir)/Ice/Locator.h" "$(includedir)/Ice/FactoryTableInit.h" "$(includedir)/Ice/FactoryTable.h" "$(includedir)/Ice/ProcessF.h" "$(includedir)/Ice/Router.h" "$(includedir)/Ice/DispatchInterceptor.h" "$(includedir)/Ice/PropertiesAdmin.h" "$(includedir)/Ice/Metrics.h" "$(includedir)/Ice/Service.h" "$(includedir)/Ice/IconvStringConverter.h" ../../include/TestCommon.h "$(includedir)/IceUtil/IceUtil.h" "$(includedir)/IceUtil/AbstractMutex.h" "$(includedir)/IceUtil/Cache.h" "$(includedir)/IceUtil/CountDownLatch.h" "$(includedir)/IceUtil/CtrlCHandler.h" "$(includedir)/IceUtil/MutexPtrLock.h" "$(includedir)/IceUtil/RecMutex.h" "$(includedir)/IceUtil/UUID.h" Test.h +AllTests$(OBJEXT): AllTests.cpp "$(includedir)/Ice/Ice.h" "$(includedir)/IceUtil/Config.h" "$(includedir)/Ice/Initialize.h" "$(includedir)/Ice/CommunicatorF.h" "$(includedir)/Ice/ProxyF.h" "$(includedir)/IceUtil/Shared.h" "$(includedir)/Ice/Config.h" "$(includedir)/Ice/ProxyHandle.h" "$(includedir)/IceUtil/Handle.h" "$(includedir)/IceUtil/Exception.h" "$(includedir)/Ice/ObjectF.h" "$(includedir)/Ice/Handle.h" "$(includedir)/Ice/Exception.h" "$(includedir)/Ice/Format.h" "$(includedir)/Ice/StreamF.h" "$(includedir)/Ice/LocalObject.h" "$(includedir)/Ice/LocalObjectF.h" "$(includedir)/Ice/StreamHelpers.h" "$(includedir)/IceUtil/ScopedArray.h" "$(includedir)/IceUtil/Iterator.h" "$(includedir)/IceUtil/Optional.h" "$(includedir)/Ice/UndefSysMacros.h" "$(includedir)/Ice/PropertiesF.h" "$(includedir)/Ice/InstanceF.h" "$(includedir)/Ice/LoggerF.h" "$(includedir)/Ice/StatsF.h" "$(includedir)/Ice/InstrumentationF.h" "$(includedir)/Ice/Dispatcher.h" "$(includedir)/Ice/ConnectionF.h" "$(includedir)/Ice/StringConverter.h" "$(includedir)/Ice/Plugin.h" "$(includedir)/Ice/BuiltinSequences.h" "$(includedir)/IceUtil/Unicode.h" "$(includedir)/Ice/LocalException.h" "$(includedir)/Ice/Identity.h" "$(includedir)/Ice/Version.h" "$(includedir)/Ice/Properties.h" "$(includedir)/Ice/Proxy.h" "$(includedir)/IceUtil/Mutex.h" "$(includedir)/IceUtil/Lock.h" "$(includedir)/IceUtil/ThreadException.h" "$(includedir)/IceUtil/Time.h" "$(includedir)/IceUtil/MutexProtocol.h" "$(includedir)/Ice/ProxyFactoryF.h" "$(includedir)/Ice/ConnectionIF.h" "$(includedir)/Ice/RequestHandlerF.h" "$(includedir)/Ice/EndpointIF.h" "$(includedir)/Ice/EndpointF.h" "$(includedir)/Ice/EndpointTypes.h" "$(includedir)/Ice/ObjectAdapterF.h" "$(includedir)/Ice/ReferenceF.h" "$(includedir)/Ice/OutgoingAsync.h" "$(includedir)/IceUtil/Monitor.h" "$(includedir)/IceUtil/Cond.h" "$(includedir)/IceUtil/Timer.h" "$(includedir)/IceUtil/Thread.h" "$(includedir)/IceUtil/UniquePtr.h" "$(includedir)/Ice/OutgoingAsyncF.h" "$(includedir)/Ice/Current.h" "$(includedir)/Ice/BasicStream.h" "$(includedir)/Ice/ObjectFactoryF.h" "$(includedir)/Ice/Buffer.h" "$(includedir)/Ice/Protocol.h" "$(includedir)/Ice/SlicedDataF.h" "$(includedir)/Ice/UserExceptionFactory.h" "$(includedir)/Ice/ObserverHelper.h" "$(includedir)/Ice/Instrumentation.h" "$(includedir)/Ice/Object.h" "$(includedir)/Ice/GCShared.h" "$(includedir)/Ice/GCCountMap.h" "$(includedir)/Ice/IncomingAsyncF.h" "$(includedir)/Ice/Outgoing.h" "$(includedir)/Ice/Incoming.h" "$(includedir)/Ice/ServantLocatorF.h" "$(includedir)/Ice/ServantManagerF.h" "$(includedir)/Ice/IncomingAsync.h" "$(includedir)/Ice/Direct.h" "$(includedir)/Ice/Logger.h" "$(includedir)/Ice/LoggerUtil.h" "$(includedir)/Ice/Stats.h" "$(includedir)/Ice/Communicator.h" "$(includedir)/Ice/RouterF.h" "$(includedir)/Ice/LocatorF.h" "$(includedir)/Ice/PluginF.h" "$(includedir)/Ice/ImplicitContextF.h" "$(includedir)/Ice/CommunicatorAsync.h" "$(includedir)/Ice/ObjectFactory.h" "$(includedir)/Ice/ObjectAdapter.h" "$(includedir)/Ice/FacetMap.h" "$(includedir)/Ice/Endpoint.h" "$(includedir)/Ice/ServantLocator.h" "$(includedir)/Ice/SlicedData.h" "$(includedir)/Ice/Process.h" "$(includedir)/Ice/Application.h" "$(includedir)/Ice/Connection.h" "$(includedir)/Ice/ConnectionAsync.h" "$(includedir)/Ice/Functional.h" "$(includedir)/IceUtil/Functional.h" "$(includedir)/Ice/Stream.h" "$(includedir)/Ice/ImplicitContext.h" "$(includedir)/Ice/Locator.h" "$(includedir)/Ice/FactoryTableInit.h" "$(includedir)/Ice/FactoryTable.h" "$(includedir)/Ice/ProcessF.h" "$(includedir)/Ice/Router.h" "$(includedir)/Ice/DispatchInterceptor.h" "$(includedir)/Ice/PropertiesAdmin.h" "$(includedir)/Ice/Metrics.h" "$(includedir)/Ice/Service.h" "$(includedir)/Ice/IconvStringConverter.h" ../../include/TestCommon.h "$(includedir)/IceUtil/IceUtil.h" "$(includedir)/IceUtil/AbstractMutex.h" "$(includedir)/IceUtil/Cache.h" "$(includedir)/IceUtil/CountDownLatch.h" "$(includedir)/IceUtil/CtrlCHandler.h" "$(includedir)/IceUtil/MutexPtrLock.h" "$(includedir)/IceUtil/RecMutex.h" "$(includedir)/IceUtil/UUID.h" Test.h +TestI$(OBJEXT): TestI.cpp "$(includedir)/Ice/Ice.h" "$(includedir)/IceUtil/Config.h" "$(includedir)/Ice/Initialize.h" "$(includedir)/Ice/CommunicatorF.h" "$(includedir)/Ice/ProxyF.h" "$(includedir)/IceUtil/Shared.h" "$(includedir)/Ice/Config.h" "$(includedir)/Ice/ProxyHandle.h" "$(includedir)/IceUtil/Handle.h" "$(includedir)/IceUtil/Exception.h" "$(includedir)/Ice/ObjectF.h" "$(includedir)/Ice/Handle.h" "$(includedir)/Ice/Exception.h" "$(includedir)/Ice/Format.h" "$(includedir)/Ice/StreamF.h" "$(includedir)/Ice/LocalObject.h" "$(includedir)/Ice/LocalObjectF.h" "$(includedir)/Ice/StreamHelpers.h" "$(includedir)/IceUtil/ScopedArray.h" "$(includedir)/IceUtil/Iterator.h" "$(includedir)/IceUtil/Optional.h" "$(includedir)/Ice/UndefSysMacros.h" "$(includedir)/Ice/PropertiesF.h" "$(includedir)/Ice/InstanceF.h" "$(includedir)/Ice/LoggerF.h" "$(includedir)/Ice/StatsF.h" "$(includedir)/Ice/InstrumentationF.h" "$(includedir)/Ice/Dispatcher.h" "$(includedir)/Ice/ConnectionF.h" "$(includedir)/Ice/StringConverter.h" "$(includedir)/Ice/Plugin.h" "$(includedir)/Ice/BuiltinSequences.h" "$(includedir)/IceUtil/Unicode.h" "$(includedir)/Ice/LocalException.h" "$(includedir)/Ice/Identity.h" "$(includedir)/Ice/Version.h" "$(includedir)/Ice/Properties.h" "$(includedir)/Ice/Proxy.h" "$(includedir)/IceUtil/Mutex.h" "$(includedir)/IceUtil/Lock.h" "$(includedir)/IceUtil/ThreadException.h" "$(includedir)/IceUtil/Time.h" "$(includedir)/IceUtil/MutexProtocol.h" "$(includedir)/Ice/ProxyFactoryF.h" "$(includedir)/Ice/ConnectionIF.h" "$(includedir)/Ice/RequestHandlerF.h" "$(includedir)/Ice/EndpointIF.h" "$(includedir)/Ice/EndpointF.h" "$(includedir)/Ice/EndpointTypes.h" "$(includedir)/Ice/ObjectAdapterF.h" "$(includedir)/Ice/ReferenceF.h" "$(includedir)/Ice/OutgoingAsync.h" "$(includedir)/IceUtil/Monitor.h" "$(includedir)/IceUtil/Cond.h" "$(includedir)/IceUtil/Timer.h" "$(includedir)/IceUtil/Thread.h" "$(includedir)/IceUtil/UniquePtr.h" "$(includedir)/Ice/OutgoingAsyncF.h" "$(includedir)/Ice/Current.h" "$(includedir)/Ice/BasicStream.h" "$(includedir)/Ice/ObjectFactoryF.h" "$(includedir)/Ice/Buffer.h" "$(includedir)/Ice/Protocol.h" "$(includedir)/Ice/SlicedDataF.h" "$(includedir)/Ice/UserExceptionFactory.h" "$(includedir)/Ice/ObserverHelper.h" "$(includedir)/Ice/Instrumentation.h" "$(includedir)/Ice/Object.h" "$(includedir)/Ice/GCShared.h" "$(includedir)/Ice/GCCountMap.h" "$(includedir)/Ice/IncomingAsyncF.h" "$(includedir)/Ice/Outgoing.h" "$(includedir)/Ice/Incoming.h" "$(includedir)/Ice/ServantLocatorF.h" "$(includedir)/Ice/ServantManagerF.h" "$(includedir)/Ice/IncomingAsync.h" "$(includedir)/Ice/Direct.h" "$(includedir)/Ice/Logger.h" "$(includedir)/Ice/LoggerUtil.h" "$(includedir)/Ice/Stats.h" "$(includedir)/Ice/Communicator.h" "$(includedir)/Ice/RouterF.h" "$(includedir)/Ice/LocatorF.h" "$(includedir)/Ice/PluginF.h" "$(includedir)/Ice/ImplicitContextF.h" "$(includedir)/Ice/CommunicatorAsync.h" "$(includedir)/Ice/ObjectFactory.h" "$(includedir)/Ice/ObjectAdapter.h" "$(includedir)/Ice/FacetMap.h" "$(includedir)/Ice/Endpoint.h" "$(includedir)/Ice/ServantLocator.h" "$(includedir)/Ice/SlicedData.h" "$(includedir)/Ice/Process.h" "$(includedir)/Ice/Application.h" "$(includedir)/Ice/Connection.h" "$(includedir)/Ice/ConnectionAsync.h" "$(includedir)/Ice/Functional.h" "$(includedir)/IceUtil/Functional.h" "$(includedir)/Ice/Stream.h" "$(includedir)/Ice/ImplicitContext.h" "$(includedir)/Ice/Locator.h" "$(includedir)/Ice/FactoryTableInit.h" "$(includedir)/Ice/FactoryTable.h" "$(includedir)/Ice/ProcessF.h" "$(includedir)/Ice/Router.h" "$(includedir)/Ice/DispatchInterceptor.h" "$(includedir)/Ice/PropertiesAdmin.h" "$(includedir)/Ice/Metrics.h" "$(includedir)/Ice/Service.h" "$(includedir)/Ice/IconvStringConverter.h" TestI.h Test.h +Server$(OBJEXT): Server.cpp "$(includedir)/Ice/Ice.h" "$(includedir)/IceUtil/Config.h" "$(includedir)/Ice/Initialize.h" "$(includedir)/Ice/CommunicatorF.h" "$(includedir)/Ice/ProxyF.h" "$(includedir)/IceUtil/Shared.h" "$(includedir)/Ice/Config.h" "$(includedir)/Ice/ProxyHandle.h" "$(includedir)/IceUtil/Handle.h" "$(includedir)/IceUtil/Exception.h" "$(includedir)/Ice/ObjectF.h" "$(includedir)/Ice/Handle.h" "$(includedir)/Ice/Exception.h" "$(includedir)/Ice/Format.h" "$(includedir)/Ice/StreamF.h" "$(includedir)/Ice/LocalObject.h" "$(includedir)/Ice/LocalObjectF.h" "$(includedir)/Ice/StreamHelpers.h" "$(includedir)/IceUtil/ScopedArray.h" "$(includedir)/IceUtil/Iterator.h" "$(includedir)/IceUtil/Optional.h" "$(includedir)/Ice/UndefSysMacros.h" "$(includedir)/Ice/PropertiesF.h" "$(includedir)/Ice/InstanceF.h" "$(includedir)/Ice/LoggerF.h" "$(includedir)/Ice/StatsF.h" "$(includedir)/Ice/InstrumentationF.h" "$(includedir)/Ice/Dispatcher.h" "$(includedir)/Ice/ConnectionF.h" "$(includedir)/Ice/StringConverter.h" "$(includedir)/Ice/Plugin.h" "$(includedir)/Ice/BuiltinSequences.h" "$(includedir)/IceUtil/Unicode.h" "$(includedir)/Ice/LocalException.h" "$(includedir)/Ice/Identity.h" "$(includedir)/Ice/Version.h" "$(includedir)/Ice/Properties.h" "$(includedir)/Ice/Proxy.h" "$(includedir)/IceUtil/Mutex.h" "$(includedir)/IceUtil/Lock.h" "$(includedir)/IceUtil/ThreadException.h" "$(includedir)/IceUtil/Time.h" "$(includedir)/IceUtil/MutexProtocol.h" "$(includedir)/Ice/ProxyFactoryF.h" "$(includedir)/Ice/ConnectionIF.h" "$(includedir)/Ice/RequestHandlerF.h" "$(includedir)/Ice/EndpointIF.h" "$(includedir)/Ice/EndpointF.h" "$(includedir)/Ice/EndpointTypes.h" "$(includedir)/Ice/ObjectAdapterF.h" "$(includedir)/Ice/ReferenceF.h" "$(includedir)/Ice/OutgoingAsync.h" "$(includedir)/IceUtil/Monitor.h" "$(includedir)/IceUtil/Cond.h" "$(includedir)/IceUtil/Timer.h" "$(includedir)/IceUtil/Thread.h" "$(includedir)/IceUtil/UniquePtr.h" "$(includedir)/Ice/OutgoingAsyncF.h" "$(includedir)/Ice/Current.h" "$(includedir)/Ice/BasicStream.h" "$(includedir)/Ice/ObjectFactoryF.h" "$(includedir)/Ice/Buffer.h" "$(includedir)/Ice/Protocol.h" "$(includedir)/Ice/SlicedDataF.h" "$(includedir)/Ice/UserExceptionFactory.h" "$(includedir)/Ice/ObserverHelper.h" "$(includedir)/Ice/Instrumentation.h" "$(includedir)/Ice/Object.h" "$(includedir)/Ice/GCShared.h" "$(includedir)/Ice/GCCountMap.h" "$(includedir)/Ice/IncomingAsyncF.h" "$(includedir)/Ice/Outgoing.h" "$(includedir)/Ice/Incoming.h" "$(includedir)/Ice/ServantLocatorF.h" "$(includedir)/Ice/ServantManagerF.h" "$(includedir)/Ice/IncomingAsync.h" "$(includedir)/Ice/Direct.h" "$(includedir)/Ice/Logger.h" "$(includedir)/Ice/LoggerUtil.h" "$(includedir)/Ice/Stats.h" "$(includedir)/Ice/Communicator.h" "$(includedir)/Ice/RouterF.h" "$(includedir)/Ice/LocatorF.h" "$(includedir)/Ice/PluginF.h" "$(includedir)/Ice/ImplicitContextF.h" "$(includedir)/Ice/CommunicatorAsync.h" "$(includedir)/Ice/ObjectFactory.h" "$(includedir)/Ice/ObjectAdapter.h" "$(includedir)/Ice/FacetMap.h" "$(includedir)/Ice/Endpoint.h" "$(includedir)/Ice/ServantLocator.h" "$(includedir)/Ice/SlicedData.h" "$(includedir)/Ice/Process.h" "$(includedir)/Ice/Application.h" "$(includedir)/Ice/Connection.h" "$(includedir)/Ice/ConnectionAsync.h" "$(includedir)/Ice/Functional.h" "$(includedir)/IceUtil/Functional.h" "$(includedir)/Ice/Stream.h" "$(includedir)/Ice/ImplicitContext.h" "$(includedir)/Ice/Locator.h" "$(includedir)/Ice/FactoryTableInit.h" "$(includedir)/Ice/FactoryTable.h" "$(includedir)/Ice/ProcessF.h" "$(includedir)/Ice/Router.h" "$(includedir)/Ice/DispatchInterceptor.h" "$(includedir)/Ice/PropertiesAdmin.h" "$(includedir)/Ice/Metrics.h" "$(includedir)/Ice/Service.h" "$(includedir)/Ice/IconvStringConverter.h" TestI.h Test.h +Test.h Test.cpp: Test.ice "$(SLICE2CPP)" "$(SLICEPARSERLIB)" diff --git a/cpp/test/Ice/enums/.gitignore b/cpp/test/Ice/enums/.gitignore new file mode 100644 index 00000000000..67872faa673 --- /dev/null +++ b/cpp/test/Ice/enums/.gitignore @@ -0,0 +1,7 @@ +// Generated by makegitignore.py + +// IMPORTANT: Do not edit this file -- any edits made here will be lost! +client +server +Test.cpp +Test.h diff --git a/cpp/test/Ice/enums/AllTests.cpp b/cpp/test/Ice/enums/AllTests.cpp new file mode 100644 index 00000000000..6302e94a088 --- /dev/null +++ b/cpp/test/Ice/enums/AllTests.cpp @@ -0,0 +1,188 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2012 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +#include <Ice/Ice.h> +#include <Ice/Stream.h> +#include <TestCommon.h> +#include <Test.h> + +using namespace std; +using namespace Test; + +TestIntfPrx +allTests(const Ice::CommunicatorPtr& communicator) +{ + string ref = "test:default -p 12010"; + Ice::ObjectPrx obj = communicator->stringToProxy(ref); + test(obj); + TestIntfPrx proxy = TestIntfPrx::checkedCast(obj); + test(proxy); + + cout << "testing enum values... " << flush; + + test(static_cast<int>(benum1) == 0); + test(static_cast<int>(benum2) == 1); + test(static_cast<int>(benum3) == ByteConst1); + test(static_cast<int>(benum4) == ByteConst1 + 1); + test(static_cast<int>(benum5) == ShortConst1); + test(static_cast<int>(benum6) == ShortConst1 + 1); + test(static_cast<int>(benum7) == IntConst1); + test(static_cast<int>(benum8) == IntConst1 + 1); + test(static_cast<int>(benum9) == LongConst1); + test(static_cast<int>(benum10) == LongConst1 + 1); + test(static_cast<int>(benum11) == ByteConst2); + + test(static_cast<int>(senum1) == 3); + test(static_cast<int>(senum2) == 4); + test(static_cast<int>(senum3) == ByteConst1); + test(static_cast<int>(senum4) == ByteConst1 + 1); + test(static_cast<int>(senum5) == ShortConst1); + test(static_cast<int>(senum6) == ShortConst1 + 1); + test(static_cast<int>(senum7) == IntConst1); + test(static_cast<int>(senum8) == IntConst1 + 1); + test(static_cast<int>(senum9) == LongConst1); + test(static_cast<int>(senum10) == LongConst1 + 1); + test(static_cast<int>(senum11) == ShortConst2); + + test(static_cast<int>(ienum1) == 0); + test(static_cast<int>(ienum2) == 1); + test(static_cast<int>(ienum3) == ByteConst1); + test(static_cast<int>(ienum4) == ByteConst1 + 1); + test(static_cast<int>(ienum5) == ShortConst1); + test(static_cast<int>(ienum6) == ShortConst1 + 1); + test(static_cast<int>(ienum7) == IntConst1); + test(static_cast<int>(ienum8) == IntConst1 + 1); + test(static_cast<int>(ienum9) == LongConst1); + test(static_cast<int>(ienum10) == LongConst1 + 1); + test(static_cast<int>(ienum11) == IntConst2); + test(static_cast<int>(ienum12) == LongConst2); + + test(static_cast<int>(red) == 0); + test(static_cast<int>(green) == 1); + test(static_cast<int>(blue) == 2); + + cout << "ok" << endl; + + cout << "testing enum streaming... " << flush; + + Ice::OutputStreamPtr out; + Ice::ByteSeq bytes; + + const bool encoding_1_0 = communicator->getProperties()->getProperty("Ice.Default.EncodingVersion") == "1.0"; + + out = Ice::createOutputStream(communicator); + out->write(benum11); + out->finished(bytes); + test(bytes.size() == 1); // ByteEnum should require one byte + + out = Ice::createOutputStream(communicator); + out->write(senum11); + out->finished(bytes); + test(bytes.size() == (encoding_1_0 ? 2 : 5)); + + out = Ice::createOutputStream(communicator); + out->write(ienum11); + out->finished(bytes); + test(bytes.size() == (encoding_1_0 ? 4 : 5)); + + out = Ice::createOutputStream(communicator); + out->write(blue); + out->finished(bytes); + test(bytes.size() == 1); // SimpleEnum should require one byte + + cout << "ok" << endl; + + cout << "testing enum operations... " << flush; + + ByteEnum byteEnum; + test(proxy->opByte(benum1, byteEnum) == benum1); + test(byteEnum == benum1); + test(proxy->opByte(benum11, byteEnum) == benum11); + test(byteEnum == benum11); + + ShortEnum shortEnum; + test(proxy->opShort(senum1, shortEnum) == senum1); + test(shortEnum == senum1); + test(proxy->opShort(senum11, shortEnum) == senum11); + test(shortEnum == senum11); + + IntEnum intEnum; + test(proxy->opInt(ienum1, intEnum) == ienum1); + test(intEnum == ienum1); + test(proxy->opInt(ienum11, intEnum) == ienum11); + test(intEnum == ienum11); + test(proxy->opInt(ienum12, intEnum) == ienum12); + test(intEnum == ienum12); + + SimpleEnum s; + test(proxy->opSimple(green, s) == green); + test(s == green); + + cout << "ok" << endl; + + cout << "testing enum exceptions... " << flush; + + try + { + proxy->opByte(static_cast<ByteEnum>(-1), byteEnum); // Negative enumerators are not supported + test(false); + } + catch(const Ice::MarshalException&) + { + } + + try + { + proxy->opByte(static_cast<ByteEnum>(127), byteEnum); // Invalid enumerator + test(false); + } + catch(const Ice::MarshalException&) + { + } + + try + { + proxy->opShort(static_cast<ShortEnum>(-1), shortEnum); // Negative enumerators are not supported + test(false); + } + catch(const Ice::MarshalException&) + { + } + + try + { + proxy->opShort(static_cast<ShortEnum>(0), shortEnum); // Invalid enumerator + test(false); + } + catch(const Ice::MarshalException&) + { + } + + try + { + proxy->opShort(static_cast<ShortEnum>(32767), shortEnum); // Invalid enumerator + test(false); + } + catch(const Ice::MarshalException&) + { + } + + try + { + proxy->opInt(static_cast<IntEnum>(-1), intEnum); // Negative enumerators are not supported + test(false); + } + catch(const Ice::MarshalException&) + { + } + + cout << "ok" << endl; + + return proxy; +} diff --git a/cpp/test/Ice/enums/Client.cpp b/cpp/test/Ice/enums/Client.cpp new file mode 100644 index 00000000000..83e29a291e2 --- /dev/null +++ b/cpp/test/Ice/enums/Client.cpp @@ -0,0 +1,57 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2012 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +#include <Ice/Ice.h> +#include <TestCommon.h> +#include <Test.h> + +using namespace std; +using namespace Test; + +int +run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) +{ + TestIntfPrx allTests(const Ice::CommunicatorPtr&); + TestIntfPrx t = allTests(communicator); + t->shutdown(); + return EXIT_SUCCESS; +} + +int +main(int argc, char* argv[]) +{ + int status; + Ice::CommunicatorPtr communicator; + + try + { + communicator = Ice::initialize(argc, argv); + status = run(argc, argv, communicator); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } + + if(communicator) + { + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } + } + + return status; +} diff --git a/cpp/test/Ice/enums/Makefile b/cpp/test/Ice/enums/Makefile new file mode 100644 index 00000000000..b695fccadb2 --- /dev/null +++ b/cpp/test/Ice/enums/Makefile @@ -0,0 +1,44 @@ +# ********************************************************************** +# +# Copyright (c) 2003-2012 ZeroC, Inc. All rights reserved. +# +# This copy of Ice is licensed to you under the terms described in the +# ICE_LICENSE file included in this distribution. +# +# ********************************************************************** + +top_srcdir = ../../.. + +CLIENT = client +SERVER = server + +TARGETS = $(CLIENT) $(SERVER) + +OBJS = Test.o \ + +COBJS = Client.o \ + AllTests.o + +SOBJS = TestI.o \ + Server.o + +SRCS = $(OBJS:.o=.cpp) \ + $(COBJS:.o=.cpp) \ + $(SOBJS:.o=.cpp) + +SLICE_SRCS = Test.ice + +include $(top_srcdir)/config/Make.rules + +CPPFLAGS := -I. -I../../include $(CPPFLAGS) +SLICE2CPPFLAGS := --stream $(SLICE2CPPFLAGS) + +$(CLIENT): $(OBJS) $(COBJS) + rm -f $@ + $(CXX) $(LDFLAGS) -o $@ $(OBJS) $(COBJS) $(LIBS) + +$(SERVER): $(OBJS) $(SOBJS) + rm -f $@ + $(CXX) $(LDFLAGS) -o $@ $(OBJS) $(SOBJS) $(LIBS) + +include .depend diff --git a/cpp/test/Ice/enums/Makefile.mak b/cpp/test/Ice/enums/Makefile.mak new file mode 100644 index 00000000000..10824798919 --- /dev/null +++ b/cpp/test/Ice/enums/Makefile.mak @@ -0,0 +1,51 @@ +# **********************************************************************
+#
+# Copyright (c) 2003-2012 ZeroC, Inc. All rights reserved.
+#
+# This copy of Ice is licensed to you under the terms described in the
+# ICE_LICENSE file included in this distribution.
+#
+# **********************************************************************
+
+top_srcdir = ..\..\..
+
+CLIENT = client.exe
+SERVER = server.exe
+
+TARGETS = $(CLIENT) $(SERVER)
+
+COBJS = Test.obj \
+ Client.obj \
+ AllTests.obj
+
+SOBJS = Test.obj \
+ TestI.obj \
+ Server.obj
+
+SRCS = $(COBJS:.obj=.cpp) \
+ $(SOBJS:.obj=.cpp)
+
+!include $(top_srcdir)/config/Make.rules.mak
+
+CPPFLAGS = -I. -I../../include $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN
+SLICE2CPPFLAGS = --stream $(SLICE2CPPFLAGS)
+
+!if "$(GENERATE_PDB)" == "yes"
+CPDBFLAGS = /pdb:$(CLIENT:.exe=.pdb)
+SPDBFLAGS = /pdb:$(SERVER:.exe=.pdb)
+!endif
+
+$(CLIENT): $(COBJS)
+ $(LINK) $(LD_EXEFLAGS) $(CPDBFLAGS) $(SETARGV) $(COBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS)
+ @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \
+ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest
+
+$(SERVER): $(SOBJS)
+ $(LINK) $(LD_EXEFLAGS) $(SPDBFLAGS) $(SETARGV) $(SOBJS) $(PREOUT)$@ $(PRELIBS)$(LIBS)
+ @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \
+ $(MT) -nologo -manifest $@.manifest -outputresource:$@;#1 && del /q $@.manifest
+
+clean::
+ del /q Test.cpp Test.h
+
+!include .depend.mak
diff --git a/cpp/test/Ice/enums/Server.cpp b/cpp/test/Ice/enums/Server.cpp new file mode 100644 index 00000000000..b4e594ceca8 --- /dev/null +++ b/cpp/test/Ice/enums/Server.cpp @@ -0,0 +1,60 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2012 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +#include <Ice/Ice.h> +#include <TestI.h> + +using namespace std; + +int +run(int argc, char* argv[], const Ice::CommunicatorPtr& communicator) +{ + communicator->getProperties()->setProperty("TestAdapter.Endpoints", "default -p 12010"); + Ice::ObjectAdapterPtr adapter = communicator->createObjectAdapter("TestAdapter"); + Ice::ObjectPtr obj = new TestIntfI; + adapter->add(obj, communicator->stringToIdentity("test")); + + adapter->activate(); + communicator->waitForShutdown(); + + return EXIT_SUCCESS; +} + +int +main(int argc, char* argv[]) +{ + int status; + Ice::CommunicatorPtr communicator; + + try + { + communicator = Ice::initialize(argc, argv); + status = run(argc, argv, communicator); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } + + if(communicator) + { + try + { + communicator->destroy(); + } + catch(const Ice::Exception& ex) + { + cerr << ex << endl; + status = EXIT_FAILURE; + } + } + + return status; +} diff --git a/cpp/test/Ice/enums/Test.ice b/cpp/test/Ice/enums/Test.ice new file mode 100644 index 00000000000..cb77421cd84 --- /dev/null +++ b/cpp/test/Ice/enums/Test.ice @@ -0,0 +1,88 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2012 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +#pragma once + +module Test +{ + +const byte ByteConst1 = 10; +const short ShortConst1 = 20; +const int IntConst1 = 30; +const long LongConst1 = 40; + +const byte ByteConst2 = 126; +const short ShortConst2 = 32766; +const int IntConst2 = 2147483647; +const long LongConst2 = 2147483646; + +enum ByteEnum +{ + benum1, + benum2, + benum3 = ByteConst1, + benum4, + benum5 = ShortConst1, + benum6, + benum7 = IntConst1, + benum8, + benum9 = LongConst1, + benum10, + benum11 = ByteConst2 +}; + +enum ShortEnum +{ + senum1 = 3, + senum2, + senum3 = ByteConst1, + senum4, + senum5 = ShortConst1, + senum6, + senum7 = IntConst1, + senum8, + senum9 = LongConst1, + senum10, + senum11 = ShortConst2 +}; + +enum IntEnum +{ + ienum1, + ienum2, + ienum3 = ByteConst1, + ienum4, + ienum5 = ShortConst1, + ienum6, + ienum7 = IntConst1, + ienum8, + ienum9 = LongConst1, + ienum10, + ienum11 = IntConst2, + ienum12 = LongConst2 +}; + +enum SimpleEnum +{ + red, + green, + blue +}; + +interface TestIntf +{ + ByteEnum opByte(ByteEnum b1, out ByteEnum b2); + ShortEnum opShort(ShortEnum s1, out ShortEnum s2); + IntEnum opInt(IntEnum i1, out IntEnum i2); + SimpleEnum opSimple(SimpleEnum s1, out SimpleEnum s2); + + void shutdown(); +}; + +}; diff --git a/cpp/test/Ice/enums/TestI.cpp b/cpp/test/Ice/enums/TestI.cpp new file mode 100644 index 00000000000..a9fe959c084 --- /dev/null +++ b/cpp/test/Ice/enums/TestI.cpp @@ -0,0 +1,45 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2012 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +#include <Ice/Ice.h> +#include <TestI.h> + +Test::ByteEnum +TestIntfI::opByte(Test::ByteEnum b1, Test::ByteEnum& b2, const Ice::Current&) +{ + b2 = b1; + return b1; +} + +Test::ShortEnum +TestIntfI::opShort(Test::ShortEnum s1, Test::ShortEnum& s2, const Ice::Current&) +{ + s2 = s1; + return s1; +} + +Test::IntEnum +TestIntfI::opInt(Test::IntEnum i1, Test::IntEnum& i2, const Ice::Current&) +{ + i2 = i1; + return i1; +} + +Test::SimpleEnum +TestIntfI::opSimple(Test::SimpleEnum s1, Test::SimpleEnum& s2, const Ice::Current&) +{ + s2 = s1; + return s1; +} + +void +TestIntfI::shutdown(const Ice::Current& current) +{ + current.adapter->getCommunicator()->shutdown(); +} diff --git a/cpp/test/Ice/enums/TestI.h b/cpp/test/Ice/enums/TestI.h new file mode 100644 index 00000000000..6461a14c9af --- /dev/null +++ b/cpp/test/Ice/enums/TestI.h @@ -0,0 +1,30 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2012 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +#ifndef TEST_I_H +#define TEST_I_H + +#include <Test.h> + +class TestIntfI : virtual public Test::TestIntf +{ +public: + + virtual Test::ByteEnum opByte(Test::ByteEnum, Test::ByteEnum&, const Ice::Current&); + + virtual Test::ShortEnum opShort(Test::ShortEnum, Test::ShortEnum&, const Ice::Current&); + + virtual Test::IntEnum opInt(Test::IntEnum, Test::IntEnum&, const Ice::Current&); + + virtual Test::SimpleEnum opSimple(Test::SimpleEnum, Test::SimpleEnum&, const Ice::Current&); + + virtual void shutdown(const Ice::Current&); +}; + +#endif diff --git a/cpp/test/Ice/enums/run.py b/cpp/test/Ice/enums/run.py new file mode 100755 index 00000000000..ecadfca52b9 --- /dev/null +++ b/cpp/test/Ice/enums/run.py @@ -0,0 +1,26 @@ +#!/usr/bin/env python +# ********************************************************************** +# +# Copyright (c) 2003-2012 ZeroC, Inc. All rights reserved. +# +# This copy of Ice is licensed to you under the terms described in the +# ICE_LICENSE file included in this distribution. +# +# ********************************************************************** + +import os, sys + +path = [ ".", "..", "../..", "../../..", "../../../.." ] +head = os.path.dirname(sys.argv[0]) +if len(head) > 0: + path = [os.path.join(head, p) for p in path] +path = [os.path.abspath(p) for p in path if os.path.exists(os.path.join(p, "scripts", "TestUtil.py")) ] +if len(path) == 0: + raise RuntimeError("can't find toplevel directory!") +sys.path.append(os.path.join(path[0], "scripts")) +import TestUtil + +print("Running test with 1.0 encoding.") +TestUtil.clientServerTest(additionalClientOptions="--Ice.Default.EncodingVersion=1.0", additionalServerOptions="--Ice.Default.EncodingVersion=1.0") +print("Running test with 1.1 encoding.") +TestUtil.clientServerTest() diff --git a/cpp/test/Slice/errorDetection/EnumeratorDuplication.err b/cpp/test/Slice/errorDetection/EnumeratorDuplication.err new file mode 100644 index 00000000000..4b950071a87 --- /dev/null +++ b/cpp/test/Slice/errorDetection/EnumeratorDuplication.err @@ -0,0 +1,2 @@ +EnumeratorDuplication.ice:19: enumerator `B' has a duplicate value +EnumeratorDuplication.ice:19: enumerator `D' has a duplicate value diff --git a/cpp/test/Slice/errorDetection/EnumeratorDuplication.ice b/cpp/test/Slice/errorDetection/EnumeratorDuplication.ice new file mode 100644 index 00000000000..be9d0cf41c7 --- /dev/null +++ b/cpp/test/Slice/errorDetection/EnumeratorDuplication.ice @@ -0,0 +1,21 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2012 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +module Test +{ + +enum Enum1 +{ + A, + B = 0, + C, + D = 1 +}; + +}; diff --git a/cpp/test/Slice/errorDetection/EnumeratorValues.err b/cpp/test/Slice/errorDetection/EnumeratorValues.err new file mode 100644 index 00000000000..0c8d45e9399 --- /dev/null +++ b/cpp/test/Slice/errorDetection/EnumeratorValues.err @@ -0,0 +1,4 @@ +EnumeratorValues.ice:18: value for enumerator `D' is out of range +EnumeratorValues.ice:19: value for enumerator `E' is out of range +EnumeratorValues.ice:20: value for enumerator `F' is out of range +EnumeratorValues.ice:21: value for enumerator `C' is out of range diff --git a/cpp/test/Slice/errorDetection/EnumeratorValues.ice b/cpp/test/Slice/errorDetection/EnumeratorValues.ice new file mode 100644 index 00000000000..0b083c00590 --- /dev/null +++ b/cpp/test/Slice/errorDetection/EnumeratorValues.ice @@ -0,0 +1,23 @@ +// ********************************************************************** +// +// Copyright (c) 2003-2012 ZeroC, Inc. All rights reserved. +// +// This copy of Ice is licensed to you under the terms described in the +// ICE_LICENSE file included in this distribution. +// +// ********************************************************************** + +module Test +{ + +enum Enum1 +{ + A = 0, + B = 2147483647, + C, + D = 2147483649, + E = -1, + F = -2147483649 +}; + +}; |