diff options
Diffstat (limited to 'cpp/src/Slice')
-rwxr-xr-x | cpp/src/Slice/.depend.mak | 275 | ||||
-rw-r--r-- | cpp/src/Slice/CPlusPlusUtil.cpp | 401 | ||||
-rw-r--r-- | cpp/src/Slice/CsUtil.cpp | 289 | ||||
-rw-r--r-- | cpp/src/Slice/FileTracker.cpp | 10 | ||||
-rw-r--r-- | cpp/src/Slice/Grammar.cpp | 4354 | ||||
-rw-r--r-- | cpp/src/Slice/Grammar.h | 125 | ||||
-rw-r--r-- | cpp/src/Slice/Grammar.y | 447 | ||||
-rw-r--r-- | cpp/src/Slice/JavaUtil.cpp | 1299 | ||||
-rw-r--r-- | cpp/src/Slice/Makefile.mak | 87 | ||||
-rw-r--r-- | cpp/src/Slice/ObjCUtil.cpp | 20 | ||||
-rw-r--r-- | cpp/src/Slice/Parser.cpp | 250 | ||||
-rw-r--r-- | cpp/src/Slice/PythonUtil.cpp | 9 | ||||
-rw-r--r-- | cpp/src/Slice/RubyUtil.cpp | 5 | ||||
-rw-r--r-- | cpp/src/Slice/Scanner.cpp | 535 | ||||
-rw-r--r-- | cpp/src/Slice/Scanner.l | 440 | ||||
-rw-r--r-- | cpp/src/Slice/Slice.rc | 16 | ||||
-rw-r--r-- | cpp/src/Slice/Util.cpp | 3 | ||||
-rw-r--r-- | cpp/src/Slice/log.txt | 188 | ||||
-rw-r--r-- | cpp/src/Slice/msbuild/packages.config | 5 | ||||
-rw-r--r-- | cpp/src/Slice/msbuild/slice.vcxproj | 144 | ||||
-rw-r--r-- | cpp/src/Slice/msbuild/slice.vcxproj.filters | 137 |
21 files changed, 3919 insertions, 5120 deletions
diff --git a/cpp/src/Slice/.depend.mak b/cpp/src/Slice/.depend.mak deleted file mode 100755 index a4855d54a00..00000000000 --- a/cpp/src/Slice/.depend.mak +++ /dev/null @@ -1,275 +0,0 @@ - -Checksum.obj: \ - Checksum.cpp \ - "$(includedir)\Slice\Checksum.h" \ - "$(includedir)\Slice\Parser.h" \ - "$(includedir)\IceUtil\Shared.h" \ - "$(includedir)\IceUtil\Config.h" \ - "$(includedir)\IceUtil\Atomic.h" \ - "$(includedir)\IceUtil\Handle.h" \ - "$(includedir)\IceUtil\Exception.h" \ - "MD5.h" \ - "$(includedir)\IceUtil\OutputUtil.h" \ - -CPlusPlusUtil.obj: \ - CPlusPlusUtil.cpp \ - "$(includedir)\Slice\CPlusPlusUtil.h" \ - "$(includedir)\Slice\Parser.h" \ - "$(includedir)\IceUtil\Shared.h" \ - "$(includedir)\IceUtil\Config.h" \ - "$(includedir)\IceUtil\Atomic.h" \ - "$(includedir)\IceUtil\Handle.h" \ - "$(includedir)\IceUtil\Exception.h" \ - "$(includedir)\IceUtil\OutputUtil.h" \ - "$(includedir)\Slice\Util.h" \ - -CsUtil.obj: \ - CsUtil.cpp \ - "$(includedir)\Slice\CsUtil.h" \ - "$(includedir)\Slice\Parser.h" \ - "$(includedir)\IceUtil\Shared.h" \ - "$(includedir)\IceUtil\Config.h" \ - "$(includedir)\IceUtil\Atomic.h" \ - "$(includedir)\IceUtil\Handle.h" \ - "$(includedir)\IceUtil\Exception.h" \ - "$(includedir)\IceUtil\OutputUtil.h" \ - "$(includedir)\Slice\DotNetNames.h" \ - "$(includedir)\Slice\Util.h" \ - "$(includedir)\IceUtil\Functional.h" \ - -DotNetNames.obj: \ - DotNetNames.cpp \ - "$(includedir)\Slice\DotNetNames.h" \ - -FileTracker.obj: \ - FileTracker.cpp \ - "$(includedir)\Slice\FileTracker.h" \ - "$(includedir)\IceUtil\Shared.h" \ - "$(includedir)\IceUtil\Config.h" \ - "$(includedir)\IceUtil\Atomic.h" \ - "$(includedir)\Slice\Parser.h" \ - "$(includedir)\IceUtil\Handle.h" \ - "$(includedir)\IceUtil\Exception.h" \ - -JavaUtil.obj: \ - JavaUtil.cpp \ - "$(includedir)\IceUtil\DisableWarnings.h" \ - "$(includedir)\Slice\JavaUtil.h" \ - "$(includedir)\Slice\Parser.h" \ - "$(includedir)\IceUtil\Shared.h" \ - "$(includedir)\IceUtil\Config.h" \ - "$(includedir)\IceUtil\Atomic.h" \ - "$(includedir)\IceUtil\Handle.h" \ - "$(includedir)\IceUtil\Exception.h" \ - "$(includedir)\IceUtil\OutputUtil.h" \ - "$(includedir)\Slice\FileTracker.h" \ - "$(includedir)\Slice\Util.h" \ - "MD5.h" \ - "$(includedir)\IceUtil\Functional.h" \ - -MD5.obj: \ - MD5.cpp \ - "MD5.h" \ - "$(includedir)\IceUtil\Config.h" \ - "MD5I.h" \ - -MD5I.obj: \ - MD5I.cpp \ - "MD5I.h" \ - -Parser.obj: \ - Parser.cpp \ - "$(includedir)\IceUtil\Functional.h" \ - "$(includedir)\IceUtil\Handle.h" \ - "$(includedir)\IceUtil\Exception.h" \ - "$(includedir)\IceUtil\Config.h" \ - "$(includedir)\IceUtil\InputUtil.h" \ - "$(includedir)\IceUtil\StringUtil.h" \ - "$(includedir)\Slice\Parser.h" \ - "$(includedir)\IceUtil\Shared.h" \ - "$(includedir)\IceUtil\Atomic.h" \ - "GrammarUtil.h" \ - "$(includedir)\Slice\Util.h" \ - "$(includedir)\IceUtil\OutputUtil.h" \ - -PHPUtil.obj: \ - PHPUtil.cpp \ - "$(includedir)\Slice\PHPUtil.h" \ - "$(includedir)\Slice\Parser.h" \ - "$(includedir)\IceUtil\Shared.h" \ - "$(includedir)\IceUtil\Config.h" \ - "$(includedir)\IceUtil\Atomic.h" \ - "$(includedir)\IceUtil\Handle.h" \ - "$(includedir)\IceUtil\Exception.h" \ - -Preprocessor.obj: \ - Preprocessor.cpp \ - "$(includedir)\Slice\Preprocessor.h" \ - "$(includedir)\IceUtil\Shared.h" \ - "$(includedir)\IceUtil\Config.h" \ - "$(includedir)\IceUtil\Atomic.h" \ - "$(includedir)\IceUtil\Handle.h" \ - "$(includedir)\IceUtil\Exception.h" \ - "$(includedir)\Slice\Util.h" \ - "$(includedir)\Slice\Parser.h" \ - "$(includedir)\IceUtil\OutputUtil.h" \ - "$(includedir)\IceUtil\StringUtil.h" \ - "$(includedir)\IceUtil\StringConverter.h" \ - "..\..\src\IceUtil\FileUtil.h" \ - "$(includedir)\IceUtil\UUID.h" \ - -PythonUtil.obj: \ - PythonUtil.cpp \ - "$(includedir)\Slice\PythonUtil.h" \ - "$(includedir)\Slice\Parser.h" \ - "$(includedir)\IceUtil\Shared.h" \ - "$(includedir)\IceUtil\Config.h" \ - "$(includedir)\IceUtil\Atomic.h" \ - "$(includedir)\IceUtil\Handle.h" \ - "$(includedir)\IceUtil\Exception.h" \ - "$(includedir)\IceUtil\OutputUtil.h" \ - "$(includedir)\Slice\Checksum.h" \ - "$(includedir)\Slice\Util.h" \ - "$(includedir)\IceUtil\IceUtil.h" \ - "$(includedir)\IceUtil\PushDisableWarnings.h" \ - "$(includedir)\IceUtil\AbstractMutex.h" \ - "$(includedir)\IceUtil\Lock.h" \ - "$(includedir)\IceUtil\ThreadException.h" \ - "$(includedir)\IceUtil\Time.h" \ - "$(includedir)\IceUtil\Cache.h" \ - "$(includedir)\IceUtil\Mutex.h" \ - "$(includedir)\IceUtil\MutexProtocol.h" \ - "$(includedir)\IceUtil\CountDownLatch.h" \ - "$(includedir)\IceUtil\Cond.h" \ - "$(includedir)\IceUtil\CtrlCHandler.h" \ - "$(includedir)\IceUtil\Functional.h" \ - "$(includedir)\IceUtil\Monitor.h" \ - "$(includedir)\IceUtil\MutexPtrLock.h" \ - "$(includedir)\IceUtil\RecMutex.h" \ - "$(includedir)\IceUtil\ScopedArray.h" \ - "$(includedir)\IceUtil\StringConverter.h" \ - "$(includedir)\IceUtil\Thread.h" \ - "$(includedir)\IceUtil\Timer.h" \ - "$(includedir)\IceUtil\UUID.h" \ - "$(includedir)\IceUtil\UniquePtr.h" \ - "$(includedir)\IceUtil\PopDisableWarnings.h" \ - "$(includedir)\IceUtil\StringUtil.h" \ - "$(includedir)\IceUtil\InputUtil.h" \ - -Python.obj: \ - Python.cpp \ - "$(includedir)\IceUtil\DisableWarnings.h" \ - "$(includedir)\IceUtil\IceUtil.h" \ - "$(includedir)\IceUtil\PushDisableWarnings.h" \ - "$(includedir)\IceUtil\Config.h" \ - "$(includedir)\IceUtil\AbstractMutex.h" \ - "$(includedir)\IceUtil\Lock.h" \ - "$(includedir)\IceUtil\ThreadException.h" \ - "$(includedir)\IceUtil\Exception.h" \ - "$(includedir)\IceUtil\Time.h" \ - "$(includedir)\IceUtil\Cache.h" \ - "$(includedir)\IceUtil\Handle.h" \ - "$(includedir)\IceUtil\Mutex.h" \ - "$(includedir)\IceUtil\MutexProtocol.h" \ - "$(includedir)\IceUtil\CountDownLatch.h" \ - "$(includedir)\IceUtil\Cond.h" \ - "$(includedir)\IceUtil\CtrlCHandler.h" \ - "$(includedir)\IceUtil\Functional.h" \ - "$(includedir)\IceUtil\Monitor.h" \ - "$(includedir)\IceUtil\MutexPtrLock.h" \ - "$(includedir)\IceUtil\RecMutex.h" \ - "$(includedir)\IceUtil\ScopedArray.h" \ - "$(includedir)\IceUtil\Shared.h" \ - "$(includedir)\IceUtil\Atomic.h" \ - "$(includedir)\IceUtil\StringConverter.h" \ - "$(includedir)\IceUtil\Thread.h" \ - "$(includedir)\IceUtil\Timer.h" \ - "$(includedir)\IceUtil\UUID.h" \ - "$(includedir)\IceUtil\UniquePtr.h" \ - "$(includedir)\IceUtil\PopDisableWarnings.h" \ - "$(includedir)\IceUtil\Options.h" \ - "$(includedir)\IceUtil\StringUtil.h" \ - "..\..\src\IceUtil\FileUtil.h" \ - "$(includedir)\Slice\Preprocessor.h" \ - "$(includedir)\Slice\FileTracker.h" \ - "$(includedir)\Slice\Parser.h" \ - "$(includedir)\Slice\PythonUtil.h" \ - "$(includedir)\IceUtil\OutputUtil.h" \ - "$(includedir)\Slice\Util.h" \ - -RubyUtil.obj: \ - RubyUtil.cpp \ - "$(includedir)\Slice\RubyUtil.h" \ - "$(includedir)\Slice\Parser.h" \ - "$(includedir)\IceUtil\Shared.h" \ - "$(includedir)\IceUtil\Config.h" \ - "$(includedir)\IceUtil\Atomic.h" \ - "$(includedir)\IceUtil\Handle.h" \ - "$(includedir)\IceUtil\Exception.h" \ - "$(includedir)\IceUtil\OutputUtil.h" \ - "$(includedir)\Slice\Checksum.h" \ - "$(includedir)\Slice\Util.h" \ - "$(includedir)\IceUtil\Functional.h" \ - "$(includedir)\IceUtil\InputUtil.h" \ - -Util.obj: \ - Util.cpp \ - "$(includedir)\Slice\Util.h" \ - "$(includedir)\Slice\Parser.h" \ - "$(includedir)\IceUtil\Shared.h" \ - "$(includedir)\IceUtil\Config.h" \ - "$(includedir)\IceUtil\Atomic.h" \ - "$(includedir)\IceUtil\Handle.h" \ - "$(includedir)\IceUtil\Exception.h" \ - "$(includedir)\IceUtil\OutputUtil.h" \ - "..\..\src\IceUtil\FileUtil.h" \ - "$(includedir)\IceUtil\StringUtil.h" \ - -Ruby.obj: \ - Ruby.cpp \ - "$(includedir)\IceUtil\DisableWarnings.h" \ - "$(includedir)\IceUtil\Options.h" \ - "$(includedir)\IceUtil\Config.h" \ - "$(includedir)\IceUtil\RecMutex.h" \ - "$(includedir)\IceUtil\Lock.h" \ - "$(includedir)\IceUtil\ThreadException.h" \ - "$(includedir)\IceUtil\Exception.h" \ - "$(includedir)\IceUtil\Time.h" \ - "$(includedir)\IceUtil\MutexProtocol.h" \ - "$(includedir)\IceUtil\Shared.h" \ - "$(includedir)\IceUtil\Atomic.h" \ - "$(includedir)\IceUtil\Handle.h" \ - "$(includedir)\IceUtil\CtrlCHandler.h" \ - "$(includedir)\IceUtil\Mutex.h" \ - "$(includedir)\IceUtil\MutexPtrLock.h" \ - "$(includedir)\Slice\Preprocessor.h" \ - "$(includedir)\Slice\FileTracker.h" \ - "$(includedir)\Slice\Parser.h" \ - "$(includedir)\Slice\RubyUtil.h" \ - "$(includedir)\IceUtil\OutputUtil.h" \ - "$(includedir)\Slice\Util.h" \ - -Grammar.obj: \ - Grammar.cpp \ - "GrammarUtil.h" \ - "$(includedir)\Slice\Parser.h" \ - "$(includedir)\IceUtil\Shared.h" \ - "$(includedir)\IceUtil\Config.h" \ - "$(includedir)\IceUtil\Atomic.h" \ - "$(includedir)\IceUtil\Handle.h" \ - "$(includedir)\IceUtil\Exception.h" \ - "$(includedir)\IceUtil\InputUtil.h" \ - "$(includedir)\IceUtil\UUID.h" \ - -Scanner.obj: \ - Scanner.cpp \ - "$(includedir)\IceUtil\ScannerConfig.h" \ - "$(includedir)\IceUtil\Config.h" \ - "GrammarUtil.h" \ - "$(includedir)\Slice\Parser.h" \ - "$(includedir)\IceUtil\Shared.h" \ - "$(includedir)\IceUtil\Atomic.h" \ - "$(includedir)\IceUtil\Handle.h" \ - "$(includedir)\IceUtil\Exception.h" \ - "Grammar.h" \ - "$(includedir)\IceUtil\InputUtil.h" \ diff --git a/cpp/src/Slice/CPlusPlusUtil.cpp b/cpp/src/Slice/CPlusPlusUtil.cpp index a7206d3219a..20b4f22fb7e 100644 --- a/cpp/src/Slice/CPlusPlusUtil.cpp +++ b/cpp/src/Slice/CPlusPlusUtil.cpp @@ -48,14 +48,7 @@ stringTypeToString(const TypePtr& type, const StringList& metaData, int typeCtx) string strType = findMetaData(metaData, typeCtx); if(strType == "wstring" || (typeCtx & TypeContextUseWstring && strType == "")) { - if(featureProfile == IceE) - { - return "::Ice::Wstring"; - } - else - { - return "::std::wstring"; - } + return "::std::wstring"; } else if(strType != "" && strType != "string") { @@ -151,9 +144,9 @@ dictionaryTypeToString(const DictionaryPtr& dict, const StringList& metaData, in void writeParamAllocateCode(Output& out, const TypePtr& type, bool optional, const string& fixedName, - const StringList& metaData, int typeCtx, bool endArg) + const StringList& metaData, int typeCtx, bool cpp11, bool endArg) { - string s = typeToString(type, metaData, typeCtx); + string s = typeToString(type, metaData, typeCtx, cpp11); if(optional) { s = "IceUtil::Optional<" + toTemplateArg(s) + '>'; @@ -181,7 +174,7 @@ writeParamAllocateCode(Output& out, const TypePtr& type, bool optional, const st string s; if(seqType == "%array") { - s = typeToString(seq, metaData, TypeContextAMIPrivateEnd); + s = typeToString(seq, metaData, TypeContextAMIPrivateEnd, cpp11); } else if(seqType.find("%range") == 0) { @@ -190,7 +183,7 @@ writeParamAllocateCode(Output& out, const TypePtr& type, bool optional, const st { md.push_back("cpp:type:" + seqType.substr(strlen("%range:"))); } - s = typeToString(seq, md); + s = typeToString(seq, md, 0, cpp11); } if(!s.empty()) @@ -295,7 +288,8 @@ writeParamEndCode(Output& out, const TypePtr& type, bool optional, const string& } void -writeMarshalUnmarshalParams(Output& out, const ParamDeclList& params, const OperationPtr& op, bool marshal, bool prepend, int typeCtx) +writeMarshalUnmarshalParams(Output& out, const ParamDeclList& params, const OperationPtr& op, bool marshal, + bool prepend, int typeCtx) { string prefix = prepend ? paramPrefix : ""; @@ -450,9 +444,33 @@ Slice::printDllExportStuff(Output& out, const string& dllExport) } } +bool +Slice::isMovable(const TypePtr& type) +{ + BuiltinPtr builtin = BuiltinPtr::dynamicCast(type); + if(builtin) + { + switch(builtin->kind()) + { + case Builtin::KindString: + case Builtin::KindObject: + case Builtin::KindObjectProxy: + case Builtin::KindLocalObject: + case Builtin::KindValue: + { + return true; + } + default: + { + return false; + } + } + } + return !EnumPtr::dynamicCast(type); +} string -Slice::typeToString(const TypePtr& type, const StringList& metaData, int typeCtx) +Slice::typeToString(const TypePtr& type, const StringList& metaData, int typeCtx, bool cpp11) { static const char* builtinTable[] = { @@ -466,7 +484,24 @@ Slice::typeToString(const TypePtr& type, const StringList& metaData, int typeCtx "::std::string", "::Ice::ObjectPtr", "::Ice::ObjectPrx", - "::Ice::LocalObjectPtr" + "::Ice::LocalObjectPtr", + "::Ice::ValuePtr" + }; + + static const char* cpp11BuiltinTable[] = + { + "::Ice::Byte", + "bool", + "short", + "int", + "long long int", + "float", + "double", + "::std::string", + "::std::shared_ptr<::Ice::Object>", + "::std::shared_ptr<::Ice::ObjectPrx>", + "::std::shared_ptr<void>", + "::std::shared_ptr<::Ice::Value>" }; BuiltinPtr builtin = BuiltinPtr::dynamicCast(type); @@ -478,20 +513,55 @@ Slice::typeToString(const TypePtr& type, const StringList& metaData, int typeCtx } else { - return builtinTable[builtin->kind()]; + if(cpp11) + { + if(builtin->kind() == Builtin::KindObject && !(typeCtx & TypeContextLocal)) + { + return "::std::shared_ptr<::Ice::Value>"; + } + else + { + return cpp11BuiltinTable[builtin->kind()]; + } + } + else + { + return builtinTable[builtin->kind()]; + } } } ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type); if(cl) { - return fixKwd(cl->scoped() + "Ptr"); + if(cpp11) + { + if(cl->definition() && cl->definition()->isDelegate()) + { + return classDefToDelegateString(cl->definition()); + } + else if(cl->isInterface() && !cl->isLocal()) + { + return "std::shared_ptr<::Ice::Value>"; + } + else + { + return "::std::shared_ptr<" + cl->scoped() + ">"; + } + } + else + { + return cl->scoped() + "Ptr"; + } } StructPtr st = StructPtr::dynamicCast(type); if(st) { - if(findMetaData(st->getMetaData()) == "%class") + // + // C++11 mapping doesn't accept cpp:class metdata + // + if(!cpp11 && findMetaData(st->getMetaData()) == "%class") { return fixKwd(st->scoped() + "Ptr"); } @@ -501,7 +571,26 @@ Slice::typeToString(const TypePtr& type, const StringList& metaData, int typeCtx ProxyPtr proxy = ProxyPtr::dynamicCast(type); if(proxy) { - return fixKwd(proxy->_class()->scoped() + "Prx"); + if(cpp11) + { + ClassDefPtr def = proxy->_class()->definition(); + // + // Non local classes without operations map to the base + // proxy class shared_ptr<Ice::ObjectPrx> + // + if(def && !def->isInterface() && def->allOperations().empty()) + { + return "::std::shared_ptr<::Ice::ObjectPrx>"; + } + else + { + return "::std::shared_ptr<" + fixKwd(proxy->_class()->scoped() + "Prx") + ">"; + } + } + else + { + return fixKwd(proxy->_class()->scoped() + "Prx"); + } } SequencePtr seq = SequencePtr::dynamicCast(type); @@ -532,20 +621,20 @@ Slice::typeToString(const TypePtr& type, const StringList& metaData, int typeCtx } string -Slice::typeToString(const TypePtr& type, bool optional, const StringList& metaData, int typeCtx) +Slice::typeToString(const TypePtr& type, bool optional, const StringList& metaData, int typeCtx, bool cpp11) { if(optional) { - return "IceUtil::Optional<" + toTemplateArg(typeToString(type, metaData, typeCtx)) + ">"; + return "IceUtil::Optional<" + toTemplateArg(typeToString(type, metaData, typeCtx, cpp11)) + ">"; } else { - return typeToString(type, metaData, typeCtx); + return typeToString(type, metaData, typeCtx, cpp11); } } string -Slice::returnTypeToString(const TypePtr& type, bool optional, const StringList& metaData, int typeCtx) +Slice::returnTypeToString(const TypePtr& type, bool optional, const StringList& metaData, int typeCtx, bool cpp11) { if(!type) { @@ -554,16 +643,16 @@ Slice::returnTypeToString(const TypePtr& type, bool optional, const StringList& if(optional) { - return "IceUtil::Optional<" + toTemplateArg(typeToString(type, metaData, typeCtx)) + ">"; + return "IceUtil::Optional<" + toTemplateArg(typeToString(type, metaData, typeCtx, cpp11)) + ">"; } - return typeToString(type, metaData, typeCtx); + return typeToString(type, metaData, typeCtx, cpp11); } string -Slice::inputTypeToString(const TypePtr& type, bool optional, const StringList& metaData, int typeCtx) +Slice::inputTypeToString(const TypePtr& type, bool optional, const StringList& metaData, int typeCtx, bool cpp11) { - static const char* inputBuiltinTable[] = + static const char* cpp98InputBuiltinTable[] = { "::Ice::Byte", "bool", @@ -575,14 +664,31 @@ Slice::inputTypeToString(const TypePtr& type, bool optional, const StringList& m "const ::std::string&", "const ::Ice::ObjectPtr&", "const ::Ice::ObjectPrx&", - "const ::Ice::LocalObjectPtr&" + "const ::Ice::LocalObjectPtr&", + "const ::Ice::ValuePtr&" + }; + + static const char* cpp11InputBuiltinTable[] = + { + "::Ice::Byte", + "bool", + "short", + "int", + "long long int", + "float", + "double", + "const ::std::string&", + "const ::std::shared_ptr<::Ice::Object>&", + "const ::std::shared_ptr<::Ice::ObjectPrx>&", + "const ::std::shared_ptr<void>&", + "const ::std::shared_ptr<::Ice::Value>&" }; typeCtx |= TypeContextInParam; if(optional) { - return "const IceUtil::Optional<" + toTemplateArg(typeToString(type, metaData, typeCtx)) +">&"; + return "const IceUtil::Optional<" + toTemplateArg(typeToString(type, metaData, typeCtx, cpp11)) +">&"; } BuiltinPtr builtin = BuiltinPtr::dynamicCast(type); @@ -594,30 +700,87 @@ Slice::inputTypeToString(const TypePtr& type, bool optional, const StringList& m } else { - return inputBuiltinTable[builtin->kind()]; + if(cpp11) + { + if(builtin->kind() == Builtin::KindObject && !(typeCtx & TypeContextLocal)) + { + return "const ::std::shared_ptr<::Ice::Value>&"; + } + else + { + return cpp11InputBuiltinTable[builtin->kind()]; + } + } + else + { + return cpp98InputBuiltinTable[builtin->kind()]; + } } } ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type); if(cl) { - return "const " + fixKwd(cl->scoped() + "Ptr&"); + if(cpp11) + { + if(cl->definition() && cl->definition()->isDelegate()) + { + return classDefToDelegateString(cl->definition(), typeCtx, cpp11); + } + else if(cl->isInterface() && !cl->isLocal()) + { + return "const ::std::shared_ptr<::Ice::Value>&"; + } + else + { + return "const ::std::shared_ptr<" + fixKwd(cl->scoped()) + ">&"; + } + } + else + { + return "const " + fixKwd(cl->scoped() + "Ptr&"); + } } StructPtr st = StructPtr::dynamicCast(type); if(st) { - if(findMetaData(st->getMetaData()) == "%class") + if(cpp11) { - return "const " + fixKwd(st->scoped() + "Ptr&"); + return "const " + fixKwd(st->scoped()) + "&"; + } + else + { + if(findMetaData(st->getMetaData()) == "%class") + { + return "const " + fixKwd(st->scoped() + "Ptr&"); + } + else + { + return "const " + fixKwd(st->scoped()) + "&"; + } } - return "const " + fixKwd(st->scoped()) + "&"; } ProxyPtr proxy = ProxyPtr::dynamicCast(type); if(proxy) { - return "const " + fixKwd(proxy->_class()->scoped() + "Prx&"); + if(cpp11) + { + ClassDefPtr def = proxy->_class()->definition(); + if(def && !def->isInterface() && def->allOperations().empty()) + { + return "const ::std::shared_ptr<::Ice::ObjectPrx>&"; + } + else + { + return "const ::std::shared_ptr<" + fixKwd(proxy->_class()->scoped() + "Prx") + ">&"; + } + } + else + { + return "const " + fixKwd(proxy->_class()->scoped() + "Prx&"); + } } EnumPtr en = EnumPtr::dynamicCast(type); @@ -648,7 +811,7 @@ Slice::inputTypeToString(const TypePtr& type, bool optional, const StringList& m } string -Slice::outputTypeToString(const TypePtr& type, bool optional, const StringList& metaData, int typeCtx) +Slice::outputTypeToString(const TypePtr& type, bool optional, const StringList& metaData, int typeCtx, bool cpp11) { static const char* outputBuiltinTable[] = { @@ -661,13 +824,30 @@ Slice::outputTypeToString(const TypePtr& type, bool optional, const StringList& "::Ice::Double&", "::std::string&", "::Ice::ObjectPtr&", - "::Ice::ObjectPrx&", - "::Ice::LocalObjectPtr&" + "::Ice::ObjectPrxPtr&", + "::Ice::LocalObjectPtr&", + "::Ice::ValuePtr&" + }; + + static const char* cpp11OutputBuiltinTable[] = + { + "::Ice::Byte&", + "bool&", + "short&", + "int&", + "long long int&", + "float&", + "double&", + "::std::string&", + "::std::shared_ptr<::Ice::Object>&", + "::std::shared_ptr<::Ice::ObjectPrx>&", + "::std::shared_ptr<void>&", + "::std::shared_ptr<::Ice::Value>&" }; if(optional) { - return "IceUtil::Optional<" + toTemplateArg(typeToString(type, metaData, typeCtx)) +">&"; + return "IceUtil::Optional<" + toTemplateArg(typeToString(type, metaData, typeCtx, cpp11)) +">&"; } BuiltinPtr builtin = BuiltinPtr::dynamicCast(type); @@ -679,30 +859,84 @@ Slice::outputTypeToString(const TypePtr& type, bool optional, const StringList& } else { - return outputBuiltinTable[builtin->kind()]; + if(cpp11) + { + if(builtin->kind() == Builtin::KindObject && !(typeCtx & TypeContextLocal)) + { + return "::std::shared_ptr<::Ice::Value>"; + } + else + { + return cpp11OutputBuiltinTable[builtin->kind()]; + } + } + else + { + return outputBuiltinTable[builtin->kind()]; + } } } ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type); if(cl) { - return fixKwd(cl->scoped() + "Ptr&"); + if(cpp11) + { + if(cl->definition() && cl->definition()->isDelegate()) + { + return classDefToDelegateString(cl->definition(), typeCtx, cpp11) + "&"; + } + else if(cl->isInterface() && !cl->isLocal()) + { + return "::std::shared_ptr<::Ice::Value>&"; + } + else + { + return "::std::shared_ptr<" + fixKwd(cl->scoped()) + ">&"; + } + } + else + { + return fixKwd(cl->scoped() + "Ptr&"); + } } StructPtr st = StructPtr::dynamicCast(type); if(st) { - if(findMetaData(st->getMetaData()) == "%class") + if(!cpp11 && findMetaData(st->getMetaData()) == "%class") { return fixKwd(st->scoped() + "Ptr&"); } - return fixKwd(st->scoped()) + "&"; + else + { + return fixKwd(st->scoped()) + "&"; + } } ProxyPtr proxy = ProxyPtr::dynamicCast(type); if(proxy) { - return fixKwd(proxy->_class()->scoped() + "Prx&"); + if(cpp11) + { + ClassDefPtr def = proxy->_class()->definition(); + // + // Non local classes without operations map to the base + // proxy class shared_ptr<Ice::ObjectPrx> + // + if(def && !def->isInterface() && def->allOperations().empty()) + { + return "::std::shared_ptr<::Ice::ObjectPrx>"; + } + else + { + return "::std::shared_ptr<" + fixKwd(proxy->_class()->scoped() + "Prx") + ">&"; + } + } + else + { + return fixKwd(proxy->_class()->scoped() + "Prx&"); + } } SequencePtr seq = SequencePtr::dynamicCast(type); @@ -727,23 +961,23 @@ Slice::outputTypeToString(const TypePtr& type, bool optional, const StringList& } string -Slice::operationModeToString(Operation::Mode mode) +Slice::operationModeToString(Operation::Mode mode, bool cpp11) { switch(mode) { case Operation::Normal: { - return "::Ice::Normal"; + return cpp11 ? "::Ice::OperationMode::Normal" : "::Ice::Normal"; } case Operation::Nonmutating: { - return "::Ice::Nonmutating"; + return cpp11 ? "::Ice::OperationMode::Nonmutating" : "::Ice::Nonmutating"; } case Operation::Idempotent: { - return "::Ice::Idempotent"; + return cpp11 ? "::Ice::OperationMode::Idempotent" : "::Ice::Idempotent"; } default: @@ -949,17 +1183,17 @@ Slice::writeUnmarshalCode(Output& out, const ParamDeclList& params, const Operat } void -Slice::writeAllocateCode(Output& out, const ParamDeclList& params, const OperationPtr& op, bool prepend, int typeCtx) +Slice::writeAllocateCode(Output& out, const ParamDeclList& params, const OperationPtr& op, bool prepend, int typeCtx, bool cpp11) { string prefix = prepend ? paramPrefix : ""; for(ParamDeclList::const_iterator p = params.begin(); p != params.end(); ++p) { writeParamAllocateCode(out, (*p)->type(), (*p)->optional(), fixKwd(prefix + (*p)->name()), (*p)->getMetaData(), - typeCtx, getEndArg((*p)->type(),(*p)->getMetaData(), (*p)->name()) != (*p)->name()); + typeCtx, cpp11, getEndArg((*p)->type(),(*p)->getMetaData(), (*p)->name()) != (*p)->name()); } if(op && op->returnType()) { - writeParamAllocateCode(out, op->returnType(), op->returnIsOptional(), "__ret", op->getMetaData(), typeCtx, + writeParamAllocateCode(out, op->returnType(), op->returnIsOptional(), "__ret", op->getMetaData(), typeCtx, cpp11, getEndArg(op->returnType(), op->getMetaData(), "__ret") != "__ret"); } } @@ -1020,6 +1254,33 @@ Slice::writeEndCode(Output& out, const ParamDeclList& params, const OperationPtr } } +bool +Slice::findMetaData(const string& prefix, const ClassDeclPtr& cl, string& value) +{ + if(findMetaData(prefix, cl->getMetaData(), value)) + { + return true; + } + + ClassDefPtr def = cl->definition(); + return def ? findMetaData(prefix, def->getMetaData(), value) : false; +} + +bool +Slice::findMetaData(const string& prefix, const StringList& metaData, string& value) +{ + for(StringList::const_iterator i = metaData.begin(); i != metaData.end(); i++) + { + string s = *i; + if(s.find(prefix) == 0) + { + value = s.substr(prefix.size()); + return true; + } + } + return false; +} + string Slice::findMetaData(const StringList& metaData, int typeCtx) { @@ -1084,7 +1345,7 @@ Slice::findMetaData(const StringList& metaData, int typeCtx) } } // - // Otherwise if the data is "class" it is returned. + // Otherwise if the data is "class", "unscoped" it is returned. // else { @@ -1093,6 +1354,10 @@ Slice::findMetaData(const StringList& metaData, int typeCtx) { return "%class"; } + else if(ss == "unscoped") + { + return "%unscoped"; + } } } } @@ -1144,3 +1409,35 @@ Slice::getDataMemberRef(const DataMemberPtr& p) return "(*" + name + ")"; } } + +string +Slice::classDefToDelegateString(const ClassDefPtr& cl, int typeCtx, bool cpp11) +{ + assert(cl->isDelegate()); + + // A delegate only has one operation + OperationPtr op = cl->allOperations().front(); + + TypePtr ret = op->returnType(); + string retS = returnTypeToString(ret, op->returnIsOptional(), op->getMetaData(), typeCtx, cpp11); + + string t = "::std::function<" + retS + " ("; + + ParamDeclList paramList = cl->allOperations().front()->parameters(); + for(ParamDeclList::iterator q = paramList.begin(); q != paramList.end(); ++q) + { + if((*q)->isOutParam()) + { + t += outputTypeToString((*q)->type(), (*q)->optional(), (*q)->getMetaData(), typeCtx, cpp11); + } + else + { + t += inputTypeToString((*q)->type(), (*q)->optional(), (*q)->getMetaData(), typeCtx, cpp11); + } + + t += distance(q, paramList.end()) == 1 ? "" : ", "; + } + + t += ")>"; + return t; +} diff --git a/cpp/src/Slice/CsUtil.cpp b/cpp/src/Slice/CsUtil.cpp index a177b99a816..d2591cdeb76 100644 --- a/cpp/src/Slice/CsUtil.cpp +++ b/cpp/src/Slice/CsUtil.cpp @@ -191,6 +191,10 @@ Slice::CsGenerator::getOptionalFormat(const TypePtr& type) assert(false); break; } + case Builtin::KindValue: + { + return "Ice.OptionalFormat.Class"; + } } } @@ -277,7 +281,8 @@ Slice::CsGenerator::typeToString(const TypePtr& type, bool optional) "string", "Ice.Object", "Ice.ObjectPrx", - "_System.Object" + "_System.Object", + "Ice.Object" // Ice.Value }; BuiltinPtr builtin = BuiltinPtr::dynamicCast(type); @@ -369,6 +374,7 @@ Slice::CsGenerator::isValueType(const TypePtr& type) case Builtin::KindObject: case Builtin::KindObjectProxy: case Builtin::KindLocalObject: + case Builtin::KindValue: { return false; break; @@ -436,19 +442,9 @@ void Slice::CsGenerator::writeMarshalUnmarshalCode(Output &out, const TypePtr& type, const string& param, - bool marshal, - bool streamingAPI) + bool marshal) { - string stream; - - if(marshal) - { - stream = streamingAPI ? "outS__" : "os__"; - } - else - { - stream = streamingAPI ? "inS__" : "is__"; - } + string stream = marshal ? "os__" : "is__"; BuiltinPtr builtin = BuiltinPtr::dynamicCast(type); if(builtin) @@ -552,6 +548,7 @@ Slice::CsGenerator::writeMarshalUnmarshalCode(Output &out, break; } case Builtin::KindObject: + case Builtin::KindValue: { if(marshal) { @@ -591,21 +588,11 @@ Slice::CsGenerator::writeMarshalUnmarshalCode(Output &out, string typeS = typeToString(type); if(marshal) { - out << nl << typeS << "Helper.write"; - if(!streamingAPI) - { - out << "__"; - } - out << "(" << stream << ", " << param << ");"; + out << nl << typeS << "Helper.write__(" << stream << ", " << param << ");"; } else { - out << nl << param << " = " << typeS << "Helper.read"; - if(!streamingAPI) - { - out << "__"; - } - out << "(" << stream << ");"; + out << nl << param << " = " << typeS << "Helper.read__(" << stream << ");"; } return; } @@ -629,27 +616,24 @@ Slice::CsGenerator::writeMarshalUnmarshalCode(Output &out, { if(marshal) { - const string write = streamingAPI ? "ice_write" : "write__"; if(!isValueType(st)) { - out << nl << typeToString(st) << "." << write << "(" << stream << ", " << param << ");"; + out << nl << typeToString(st) << ".write__(" << stream << ", " << param << ");"; } else { - out << nl << param << "." << write << "(" << stream << ");"; + out << nl << param << ".write__(" << stream << ");"; } } else { if(!isValueType(st)) { - const string r = streamingAPI ? "ice_read" : "read__"; - out << nl << param << " = " << typeToString(type) << "." << r << "(" << stream << ", " << param << ");"; + out << nl << param << " = " << typeToString(type) << ".read__(" << stream << ", " << param << ");"; } else { - const string read = streamingAPI ? "ice_read" : "read__"; - out << nl << param << "." << read << "(" << stream << ");"; + out << nl << param << ".read__(" << stream << ");"; } } return; @@ -660,28 +644,12 @@ Slice::CsGenerator::writeMarshalUnmarshalCode(Output &out, { if(marshal) { - if(streamingAPI) - { - 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 << ", " << en->maxValue() << ");"; } else { out << nl << param << " = (" << fixId(en->scoped()) << ')' << stream << ".readEnum(" << en->maxValue() << ");"; - if(streamingAPI) - { - 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; - } } return; } @@ -689,7 +657,7 @@ Slice::CsGenerator::writeMarshalUnmarshalCode(Output &out, SequencePtr seq = SequencePtr::dynamicCast(type); if(seq) { - writeSequenceMarshalUnmarshalCode(out, seq, param, marshal, streamingAPI, true); + writeSequenceMarshalUnmarshalCode(out, seq, param, marshal, true); return; } @@ -719,19 +687,9 @@ Slice::CsGenerator::writeOptionalMarshalUnmarshalCode(Output &out, const TypePtr& type, const string& param, int tag, - bool marshal, - bool streamingAPI) + bool marshal) { - string stream; - - if(marshal) - { - stream = streamingAPI ? "outS__" : "os__"; - } - else - { - stream = streamingAPI ? "inS__" : "is__"; - } + string stream = marshal ? "os__" : "is__"; BuiltinPtr builtin = BuiltinPtr::dynamicCast(type); if(builtin) @@ -835,6 +793,7 @@ Slice::CsGenerator::writeOptionalMarshalUnmarshalCode(Output &out, break; } case Builtin::KindObject: + case Builtin::KindValue: { if(marshal) { @@ -874,23 +833,23 @@ Slice::CsGenerator::writeOptionalMarshalUnmarshalCode(Output &out, { if(marshal) { - out << nl << "if(" << param << ".HasValue && " << stream << ".writeOpt(" << tag + out << nl << "if(" << param << ".HasValue && " << stream << ".writeOptional(" << tag << ", Ice.OptionalFormat.FSize))"; out << sb; out << nl << "int pos__ = " << stream << ".startSize();"; - writeMarshalUnmarshalCode(out, type, param + ".Value", marshal, streamingAPI); + writeMarshalUnmarshalCode(out, type, param + ".Value", marshal); out << nl << stream << ".endSize(pos__);"; out << eb; } else { - out << nl << "if(" << stream << ".readOpt(" << tag << ", Ice.OptionalFormat.FSize))"; + out << nl << "if(" << stream << ".readOptional(" << tag << ", Ice.OptionalFormat.FSize))"; out << sb; out << nl << stream << ".skip(4);"; string tmp = "tmpVal__"; string typeS = typeToString(type); out << nl << typeS << ' ' << tmp << ';'; - writeMarshalUnmarshalCode(out, type, tmp, marshal, streamingAPI); + writeMarshalUnmarshalCode(out, type, tmp, marshal); out << nl << param << " = new Ice.Optional<" << typeS << ">(" << tmp << ");"; out << eb; out << nl << "else"; @@ -920,7 +879,7 @@ Slice::CsGenerator::writeOptionalMarshalUnmarshalCode(Output &out, { if(marshal) { - out << nl << "if(" << param << ".HasValue && " << stream << ".writeOpt(" << tag << ", " + out << nl << "if(" << param << ".HasValue && " << stream << ".writeOptional(" << tag << ", " << getOptionalFormat(st) << "))"; out << sb; if(st->isVariableLength()) @@ -931,7 +890,7 @@ Slice::CsGenerator::writeOptionalMarshalUnmarshalCode(Output &out, { out << nl << stream << ".writeSize(" << st->minWireSize() << ");"; } - writeMarshalUnmarshalCode(out, type, param + ".Value", marshal, streamingAPI); + writeMarshalUnmarshalCode(out, type, param + ".Value", marshal); if(st->isVariableLength()) { out << nl << stream << ".endSize(pos__);"; @@ -940,7 +899,7 @@ Slice::CsGenerator::writeOptionalMarshalUnmarshalCode(Output &out, } else { - out << nl << "if(" << stream << ".readOpt(" << tag << ", " << getOptionalFormat(st) << "))"; + out << nl << "if(" << stream << ".readOptional(" << tag << ", " << getOptionalFormat(st) << "))"; out << sb; if(st->isVariableLength()) { @@ -960,7 +919,7 @@ Slice::CsGenerator::writeOptionalMarshalUnmarshalCode(Output &out, { out << nl << typeS << ' ' << tmp << " = null;"; } - writeMarshalUnmarshalCode(out, type, tmp, marshal, streamingAPI); + writeMarshalUnmarshalCode(out, type, tmp, marshal); out << nl << param << " = new Ice.Optional<" << typeS << ">(" << tmp << ");"; out << eb; out << nl << "else"; @@ -984,12 +943,12 @@ Slice::CsGenerator::writeOptionalMarshalUnmarshalCode(Output &out, } else { - out << nl << "if(" << stream << ".readOpt(" << tag << ", Ice.OptionalFormat.Size))"; + out << nl << "if(" << stream << ".readOptional(" << tag << ", Ice.OptionalFormat.Size))"; out << sb; string typeS = typeToString(type); string tmp = "tmpVal__"; out << nl << typeS << ' ' << tmp << ';'; - writeMarshalUnmarshalCode(out, type, tmp, marshal, streamingAPI); + writeMarshalUnmarshalCode(out, type, tmp, marshal); out << nl << param << " = new Ice.Optional<" << typeS << ">(" << tmp << ");"; out << eb; out << nl << "else"; @@ -1003,7 +962,7 @@ Slice::CsGenerator::writeOptionalMarshalUnmarshalCode(Output &out, SequencePtr seq = SequencePtr::dynamicCast(type); if(seq) { - writeOptionalSequenceMarshalUnmarshalCode(out, seq, param, tag, marshal, streamingAPI); + writeOptionalSequenceMarshalUnmarshalCode(out, seq, param, tag, marshal); return; } @@ -1013,7 +972,7 @@ Slice::CsGenerator::writeOptionalMarshalUnmarshalCode(Output &out, TypePtr valueType = d->valueType(); if(marshal) { - out << nl << "if(" << param << ".HasValue && " << stream << ".writeOpt(" << tag << ", " + out << nl << "if(" << param << ".HasValue && " << stream << ".writeOptional(" << tag << ", " << getOptionalFormat(d) << "))"; out << sb; if(keyType->isVariableLength() || valueType->isVariableLength()) @@ -1026,7 +985,7 @@ Slice::CsGenerator::writeOptionalMarshalUnmarshalCode(Output &out, << (keyType->minWireSize() + valueType->minWireSize()) << " + (" << param << ".Value.Count > 254 ? 5 : 1));"; } - writeMarshalUnmarshalCode(out, type, param + ".Value", marshal, streamingAPI); + writeMarshalUnmarshalCode(out, type, param + ".Value", marshal); if(keyType->isVariableLength() || valueType->isVariableLength()) { out << nl << stream << ".endSize(pos__);"; @@ -1035,7 +994,7 @@ Slice::CsGenerator::writeOptionalMarshalUnmarshalCode(Output &out, } else { - out << nl << "if(" << stream << ".readOpt(" << tag << ", " << getOptionalFormat(d) << "))"; + out << nl << "if(" << stream << ".readOptional(" << tag << ", " << getOptionalFormat(d) << "))"; out << sb; if(keyType->isVariableLength() || valueType->isVariableLength()) { @@ -1048,7 +1007,7 @@ Slice::CsGenerator::writeOptionalMarshalUnmarshalCode(Output &out, string typeS = typeToString(type); string tmp = "tmpVal__"; out << nl << typeS << ' ' << tmp << " = new " << typeS << "();"; - writeMarshalUnmarshalCode(out, type, tmp, marshal, streamingAPI); + writeMarshalUnmarshalCode(out, type, tmp, marshal); out << nl << param << " = new Ice.Optional<" << typeS << ">(" << tmp << ");"; out << eb; out << nl << "else"; @@ -1063,18 +1022,9 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, const SequencePtr& seq, const string& param, bool marshal, - bool streamingAPI, bool useHelper) { - string stream; - if(marshal) - { - stream = streamingAPI ? "outS__" : "os__"; - } - else - { - stream = streamingAPI ? "inS__" : "is__"; - } + string stream = marshal ? "os__" : "is__"; if(useHelper) { @@ -1138,6 +1088,7 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, { switch(builtin->kind()) { + case Builtin::KindValue: case Builtin::KindObject: case Builtin::KindObjectProxy: { @@ -1170,7 +1121,8 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, << "> e__ = " << param << ".GetEnumerator();"; out << nl << "while(e__.MoveNext())"; out << sb; - string func = builtin->kind() == Builtin::KindObject ? "writeObject" : "writeProxy"; + string func = (builtin->kind() == Builtin::KindObject || + builtin->kind() == Builtin::KindValue) ? "writeObject" : "writeProxy"; out << nl << stream << '.' << func << "(e__.Current);"; out << eb; } @@ -1179,7 +1131,8 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, { out << nl << "for(int ix__ = 0; ix__ < " << param << '.' << limitID << "; ++ix__)"; out << sb; - string func = builtin->kind() == Builtin::KindObject ? "writeObject" : "writeProxy"; + string func = (builtin->kind() == Builtin::KindObject || + builtin->kind() == Builtin::KindValue) ? "writeObject" : "writeProxy"; out << nl << stream << '.' << func << '(' << param << "[ix__]);"; out << eb; } @@ -1190,7 +1143,7 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, out << nl << "int " << param << "_lenx = " << stream << ".readAndCheckSeqSize(" << static_cast<unsigned>(builtin->minWireSize()) << ");"; out << nl << param << " = new "; - if(builtin->kind() == Builtin::KindObject) + if((builtin->kind() == Builtin::KindObject || builtin->kind() == Builtin::KindValue)) { if(isArray) { @@ -1215,7 +1168,6 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, } out << nl << "for(int ix__ = 0; ix__ < " << param << "_lenx; ++ix__)"; out << sb; - out << nl << stream << ".readObject("; string patcherName; if(isCustom) { @@ -1233,8 +1185,9 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, { patcherName = "Sequence"; } - out << "new IceInternal." << patcherName << "Patcher<Ice.Object>(\"::Ice::Object\", " - << param << ", ix__));"; + out << nl << "IceInternal." << patcherName << "Patcher<Ice.Object> p__ = new IceInternal." + << patcherName << "Patcher<Ice.Object>(\"::Ice::Object\", " << param << ", ix__);"; + out << nl << stream << ".readObject(p__.patch);"; } else { @@ -1304,45 +1257,14 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, } else if(isCustom) { - if(streamingAPI) - { - out << nl << stream << ".writeSize(" << param << '.' << limitID << ");"; - out << nl << "_System.Collections.Generic.IEnumerator<" << typeS - << "> e__ = " << param << ".GetEnumerator();"; - out << nl << "while(e__.MoveNext())"; - out << sb; - out << nl << stream << ".write" << func << "(e__.Current);"; - out << eb; - } - else - { - out << nl << stream << ".write" << func << "Seq(" << param << " == null ? 0 : " - << param << ".Count, " << param << ");"; - } + out << nl << stream << ".write" << func << "Seq(" << param << " == null ? 0 : " + << param << ".Count, " << param << ");"; } else { assert(isGeneric); - if(!streamingAPI) - { - out << nl << stream << ".write" << func << "Seq(" << param << " == null ? 0 : " - << param << ".Count, " << param << ");"; - } - else if(isLinkedList) - { - out << nl << stream << ".writeSize(" << param << '.' << limitID << ");"; - out << nl << "_System.Collections.Generic.IEnumerator<" << typeS - << "> e__ = " << param << ".GetEnumerator();"; - out << nl << "while(e__.MoveNext())"; - out << sb; - out << nl << stream << ".write" << func << "(e__.Current);"; - out << eb; - } - else - { - out << nl << stream << ".write" << func << "Seq(" << param << " == null ? null : " - << param << ".ToArray());"; - } + out << nl << stream << ".write" << func << "Seq(" << param << " == null ? 0 : " + << param << ".Count, " << param << ");"; } } else @@ -1371,29 +1293,7 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, else { assert(isGeneric); - if(streamingAPI) - { - if(isStack) - { - // - // Stacks are marshaled in top-to-bottom order. The "Stack(type[])" - // constructor assumes the array is in bottom-to-top order, so we - // read the array first, then reverse it. - // - out << nl << typeS << "[] arr__ = " << stream << ".read" << func << "Seq();"; - out << nl << "_System.Array.Reverse(arr__);"; - out << nl << param << " = new " << typeToString(seq) << "(arr__);"; - } - else - { - out << nl << param << " = new " << typeToString(seq) << '(' << stream - << ".read" << func << "Seq());"; - } - } - else - { - out << nl << stream << ".read" << func << "Seq(out " << param << ");"; - } + out << nl << stream << ".read" << func << "Seq(out " << param << ");"; } } break; @@ -1487,8 +1387,7 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, string scoped = ContainedPtr::dynamicCast(type)->scoped(); out << nl << "IceInternal." << patcherName << "Patcher<" << typeS << "> spx = new IceInternal." << patcherName << "Patcher<" << typeS << ">(\"" << scoped << "\", " << param << ", ix__);"; - out << nl << stream << ".readObject("; - out << "spx);"; + out << nl << stream << ".readObject(spx.patch);"; out << eb; out << eb; } @@ -1573,7 +1472,7 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, } } call += "."; - call += streamingAPI ? "ice_write" : "write__"; + call += "write__"; call += "(" + stream + ");"; out << nl << call; out << eb; @@ -1618,26 +1517,12 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, { out << nl << v << "[ix__] = new " << typeS << "();"; } - if(streamingAPI) - { - out << nl << v << "[ix__].ice_read(" << stream << ");"; - } - else - { - out << nl << v << "[ix__].read__(" << stream << ");"; - } + out << nl << v << "[ix__].read__(" << stream << ");"; } else { out << nl << typeS << " val__ = new " << typeS << "();"; - if(streamingAPI) - { - out << nl << "val__.ice_read(" << stream << ");"; - } - else - { - out << nl << "val__.read__(" << stream << ");"; - } + out << nl << "val__.read__(" << stream << ");"; out << nl << param << "." << addMethod << "(val__);"; } out << eb; @@ -1764,7 +1649,7 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, if(marshal) { func = "write"; - if(!streamingAPI && ProxyPtr::dynamicCast(type)) + if(ProxyPtr::dynamicCast(type)) { func += "__"; } @@ -1810,7 +1695,7 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, else { func = "read"; - if(!streamingAPI && ProxyPtr::dynamicCast(type)) + if(ProxyPtr::dynamicCast(type)) { func += "__"; } @@ -1866,18 +1751,9 @@ Slice::CsGenerator::writeOptionalSequenceMarshalUnmarshalCode(Output& out, const SequencePtr& seq, const string& param, int tag, - bool marshal, - bool streamingAPI) + bool marshal) { - string stream; - if(marshal) - { - stream = streamingAPI ? "outS__" : "os__"; - } - else - { - stream = streamingAPI ? "inS__" : "is__"; - } + string stream = marshal ? "os__" : "is__"; const TypePtr type = seq->type(); const string typeS = typeToString(type); @@ -1909,7 +1785,7 @@ Slice::CsGenerator::writeOptionalSequenceMarshalUnmarshalCode(Output& out, { if(isSerializable) { - out << nl << "if(" << param << ".HasValue && " << stream << ".writeOpt(" << tag + out << nl << "if(" << param << ".HasValue && " << stream << ".writeOptional(" << tag << ", Ice.OptionalFormat.VSize))"; out << sb; out << nl << stream << ".writeSerializable(" << param << ".Value);"; @@ -1930,7 +1806,7 @@ Slice::CsGenerator::writeOptionalSequenceMarshalUnmarshalCode(Output& out, } else { - out << nl << "if(" << stream << ".readOpt(" << tag << ", " << getOptionalFormat(seq) << "))"; + out << nl << "if(" << stream << ".readOptional(" << tag << ", " << getOptionalFormat(seq) << "))"; out << sb; if(builtin->isVariableLength()) { @@ -1942,7 +1818,7 @@ Slice::CsGenerator::writeOptionalSequenceMarshalUnmarshalCode(Output& out, } string tmp = "tmpVal__"; out << nl << seqS << ' ' << tmp << ';'; - writeSequenceMarshalUnmarshalCode(out, seq, tmp, marshal, streamingAPI, true); + writeSequenceMarshalUnmarshalCode(out, seq, tmp, marshal, true); out << nl << param << " = new Ice.Optional<" << seqS << ">(" << tmp << ");"; out << eb; out << nl << "else"; @@ -1953,27 +1829,28 @@ Slice::CsGenerator::writeOptionalSequenceMarshalUnmarshalCode(Output& out, break; } + case Builtin::KindValue: case Builtin::KindObject: case Builtin::KindObjectProxy: { if(marshal) { - out << nl << "if(" << param << ".HasValue && " << stream << ".writeOpt(" << tag << ", " + out << nl << "if(" << param << ".HasValue && " << stream << ".writeOptional(" << tag << ", " << getOptionalFormat(seq) << "))"; out << sb; out << nl << "int pos__ = " << stream << ".startSize();"; - writeSequenceMarshalUnmarshalCode(out, seq, param + ".Value", marshal, streamingAPI, true); + writeSequenceMarshalUnmarshalCode(out, seq, param + ".Value", marshal, true); out << nl << stream << ".endSize(pos__);"; out << eb; } else { - out << nl << "if(" << stream << ".readOpt(" << tag << ", " << getOptionalFormat(seq) << "))"; + out << nl << "if(" << stream << ".readOptional(" << tag << ", " << getOptionalFormat(seq) << "))"; out << sb; out << nl << stream << ".skip(4);"; string tmp = "tmpVal__"; out << nl << seqS << ' ' << tmp << ';'; - writeSequenceMarshalUnmarshalCode(out, seq, tmp, marshal, streamingAPI, true); + writeSequenceMarshalUnmarshalCode(out, seq, tmp, marshal, true); out << nl << param << " = new Ice.Optional<" << seqS << ">(" << tmp << ");"; out << eb; out << nl << "else"; @@ -1996,7 +1873,7 @@ Slice::CsGenerator::writeOptionalSequenceMarshalUnmarshalCode(Output& out, { if(marshal) { - out << nl << "if(" << param << ".HasValue && " << stream << ".writeOpt(" << tag << ", " + out << nl << "if(" << param << ".HasValue && " << stream << ".writeOptional(" << tag << ", " << getOptionalFormat(seq) << "))"; out << sb; if(st->isVariableLength()) @@ -2008,7 +1885,7 @@ Slice::CsGenerator::writeOptionalSequenceMarshalUnmarshalCode(Output& out, out << nl << stream << ".writeSize(" << param << ".Value == null ? 1 : " << length << " * " << st->minWireSize() << " + (" << length << " > 254 ? 5 : 1));"; } - writeSequenceMarshalUnmarshalCode(out, seq, param + ".Value", marshal, streamingAPI, true); + writeSequenceMarshalUnmarshalCode(out, seq, param + ".Value", marshal, true); if(st->isVariableLength()) { out << nl << stream << ".endSize(pos__);"; @@ -2017,7 +1894,7 @@ Slice::CsGenerator::writeOptionalSequenceMarshalUnmarshalCode(Output& out, } else { - out << nl << "if(" << stream << ".readOpt(" << tag << ", " << getOptionalFormat(seq) << "))"; + out << nl << "if(" << stream << ".readOptional(" << tag << ", " << getOptionalFormat(seq) << "))"; out << sb; if(st->isVariableLength()) { @@ -2029,7 +1906,7 @@ Slice::CsGenerator::writeOptionalSequenceMarshalUnmarshalCode(Output& out, } string tmp = "tmpVal__"; out << nl << seqS << ' ' << tmp << ';'; - writeSequenceMarshalUnmarshalCode(out, seq, tmp, marshal, streamingAPI, true); + writeSequenceMarshalUnmarshalCode(out, seq, tmp, marshal, true); out << nl << param << " = new Ice.Optional<" << seqS << ">(" << tmp << ");"; out << eb; out << nl << "else"; @@ -2045,22 +1922,22 @@ Slice::CsGenerator::writeOptionalSequenceMarshalUnmarshalCode(Output& out, // if(marshal) { - out << nl << "if(" << param << ".HasValue && " << stream << ".writeOpt(" << tag << ", " + out << nl << "if(" << param << ".HasValue && " << stream << ".writeOptional(" << tag << ", " << getOptionalFormat(seq) << "))"; out << sb; out << nl << "int pos__ = " << stream << ".startSize();"; - writeSequenceMarshalUnmarshalCode(out, seq, param + ".Value", marshal, streamingAPI, true); + writeSequenceMarshalUnmarshalCode(out, seq, param + ".Value", marshal, true); out << nl << stream << ".endSize(pos__);"; out << eb; } else { - out << nl << "if(" << stream << ".readOpt(" << tag << ", " << getOptionalFormat(seq) << "))"; + out << nl << "if(" << stream << ".readOptional(" << tag << ", " << getOptionalFormat(seq) << "))"; out << sb; out << nl << stream << ".skip(4);"; string tmp = "tmpVal__"; out << nl << seqS << ' ' << tmp << ';'; - writeSequenceMarshalUnmarshalCode(out, seq, tmp, marshal, streamingAPI, true); + writeSequenceMarshalUnmarshalCode(out, seq, tmp, marshal, true); out << nl << param << " = new Ice.Optional<" << seqS << ">(" << tmp << ");"; out << eb; out << nl << "else"; @@ -2200,6 +2077,7 @@ Slice::CsGenerator::writeSerializeDeserializeCode(Output &out, } break; } + case Builtin::KindValue: case Builtin::KindObject: case Builtin::KindLocalObject: { @@ -2530,7 +2408,8 @@ Slice::CsGenerator::MetaDataVisitor::validate(const ContainedPtr& cont) { ClassDeclPtr cd = ClassDeclPtr::dynamicCast(seq->type()); BuiltinPtr builtin = BuiltinPtr::dynamicCast(seq->type()); - if(!cd && !(builtin && builtin->kind() == Builtin::KindObject)) + if(!cd && !(builtin && (builtin->kind() == Builtin::KindObject || + builtin->kind() == Builtin::KindValue))) { continue; } @@ -2625,5 +2504,19 @@ Slice::CsGenerator::MetaDataVisitor::validate(const ContainedPtr& cont) _history.insert(s); } } + + if(_history.count(s) == 0) + { + if(s == "delegate") + { + ClassDefPtr cl = ClassDefPtr::dynamicCast(cont); + if(cl && cl->isDelegate()) + { + continue; + } + emitWarning(cont->file(), cont->line(), msg + " `" + s + "'"); + _history.insert(s); + } + } } } diff --git a/cpp/src/Slice/FileTracker.cpp b/cpp/src/Slice/FileTracker.cpp index a6e1dc810ea..09c14f64a34 100644 --- a/cpp/src/Slice/FileTracker.cpp +++ b/cpp/src/Slice/FileTracker.cpp @@ -23,16 +23,14 @@ Slice::FileException::FileException(const char* file, int line, const string& r) { } -Slice::FileException::~FileException() throw() +Slice::FileException::~FileException() ICE_NOEXCEPT { } -const char* Slice::FileException::_name = "Slice::FileException"; - string -Slice::FileException::ice_name() const +Slice::FileException::ice_id() const { - return _name; + return "::Slice::FileException"; } void @@ -42,11 +40,13 @@ Slice::FileException::ice_print(ostream& out) const out << ": " << _reason; } +#ifndef ICE_CPP11_MAPPING Slice::FileException* Slice::FileException::ice_clone() const { return new FileException(*this); } +#endif void Slice::FileException::ice_throw() const diff --git a/cpp/src/Slice/Grammar.cpp b/cpp/src/Slice/Grammar.cpp index 24588b6ba35..af37d694387 100644 --- a/cpp/src/Slice/Grammar.cpp +++ b/cpp/src/Slice/Grammar.cpp @@ -1,21 +1,19 @@ +/* A Bison parser, made by GNU Bison 3.0.2. */ -/* A Bison parser, made by GNU Bison 2.4.1. */ +/* Bison implementation for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. -/* Skeleton implementation for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. - This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ @@ -28,7 +26,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -46,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.4.1" +#define YYBISON_VERSION "3.0.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -60,23 +58,17 @@ /* Pull parsers. */ #define YYPULL 1 -/* Using locations. */ -#define YYLSP_NEEDED 0 /* Substitute the variable and function names. */ #define yyparse slice_parse #define yylex slice_lex #define yyerror slice_error -#define yylval slice_lval -#define yychar slice_char #define yydebug slice_debug #define yynerrs slice_nerrs /* Copy the first part of user declarations. */ - -/* Line 189 of yacc.c */ -#line 1 "../Slice/Grammar.y" +#line 1 "../Slice/Grammar.y" /* yacc.c:339 */ // ********************************************************************** @@ -119,23 +111,24 @@ slice_error(const char* s) if (strcmp(s, "parse error") == 0) { - unit->error("syntax error"); + unit->error("syntax error"); } else { - unit->error(s); + unit->error(s); } } +#line 124 "Grammar.tab.c" /* yacc.c:339 */ -/* Line 189 of yacc.c */ -#line 134 "Grammar.tab.c" - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 1 -#endif +# ifndef YY_NULLPTR +# if defined __cplusplus && 201103L <= __cplusplus +# define YY_NULLPTR nullptr +# else +# define YY_NULLPTR 0 +# endif +# endif /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE @@ -145,78 +138,85 @@ slice_error(const char* s) # define YYERROR_VERBOSE 0 #endif -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 +/* In a future release of Bison, this section will be replaced + by #include "Grammar.tab.h". */ +#ifndef YY_SLICE_GRAMMAR_TAB_H_INCLUDED +# define YY_SLICE_GRAMMAR_TAB_H_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 1 +#endif +#if YYDEBUG +extern int slice_debug; #endif - -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - ICE_MODULE = 258, - ICE_CLASS = 259, - ICE_INTERFACE = 260, - ICE_EXCEPTION = 261, - ICE_STRUCT = 262, - ICE_SEQUENCE = 263, - ICE_DICTIONARY = 264, - ICE_ENUM = 265, - ICE_OUT = 266, - ICE_EXTENDS = 267, - ICE_IMPLEMENTS = 268, - ICE_THROWS = 269, - ICE_VOID = 270, - ICE_BYTE = 271, - ICE_BOOL = 272, - ICE_SHORT = 273, - ICE_INT = 274, - ICE_LONG = 275, - ICE_FLOAT = 276, - ICE_DOUBLE = 277, - ICE_STRING = 278, - ICE_OBJECT = 279, - ICE_LOCAL_OBJECT = 280, - ICE_LOCAL = 281, - ICE_CONST = 282, - ICE_FALSE = 283, - ICE_TRUE = 284, - ICE_IDEMPOTENT = 285, - ICE_OPTIONAL = 286, - ICE_SCOPE_DELIMITER = 287, - ICE_IDENTIFIER = 288, - ICE_STRING_LITERAL = 289, - ICE_INTEGER_LITERAL = 290, - ICE_FLOATING_POINT_LITERAL = 291, - ICE_IDENT_OP = 292, - ICE_KEYWORD_OP = 293, - ICE_OPTIONAL_OP = 294, - ICE_METADATA_OPEN = 295, - ICE_METADATA_CLOSE = 296, - ICE_GLOBAL_METADATA_OPEN = 297, - ICE_GLOBAL_METADATA_CLOSE = 298, - BAD_CHAR = 299 - }; + enum yytokentype + { + ICE_MODULE = 258, + ICE_CLASS = 259, + ICE_INTERFACE = 260, + ICE_EXCEPTION = 261, + ICE_STRUCT = 262, + ICE_SEQUENCE = 263, + ICE_DICTIONARY = 264, + ICE_ENUM = 265, + ICE_OUT = 266, + ICE_EXTENDS = 267, + ICE_IMPLEMENTS = 268, + ICE_THROWS = 269, + ICE_VOID = 270, + ICE_BYTE = 271, + ICE_BOOL = 272, + ICE_SHORT = 273, + ICE_INT = 274, + ICE_LONG = 275, + ICE_FLOAT = 276, + ICE_DOUBLE = 277, + ICE_STRING = 278, + ICE_OBJECT = 279, + ICE_LOCAL_OBJECT = 280, + ICE_LOCAL = 281, + ICE_CONST = 282, + ICE_FALSE = 283, + ICE_TRUE = 284, + ICE_IDEMPOTENT = 285, + ICE_OPTIONAL = 286, + ICE_VALUE = 287, + ICE_SCOPE_DELIMITER = 288, + ICE_IDENTIFIER = 289, + ICE_STRING_LITERAL = 290, + ICE_INTEGER_LITERAL = 291, + ICE_FLOATING_POINT_LITERAL = 292, + ICE_IDENT_OP = 293, + ICE_KEYWORD_OP = 294, + ICE_OPTIONAL_OP = 295, + ICE_METADATA_OPEN = 296, + ICE_METADATA_CLOSE = 297, + ICE_GLOBAL_METADATA_OPEN = 298, + ICE_GLOBAL_METADATA_CLOSE = 299, + BAD_CHAR = 300 + }; #endif - - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif -/* Copy the second part of user declarations. */ +int slice_parse (void); -/* Line 264 of yacc.c */ -#line 220 "Grammar.tab.c" +#endif /* !YY_SLICE_GRAMMAR_TAB_H_INCLUDED */ + +/* Copy the second part of user declarations. */ + +#line 220 "Grammar.tab.c" /* yacc.c:358 */ #ifdef short # undef short @@ -230,11 +230,8 @@ typedef unsigned char yytype_uint8; #ifdef YYTYPE_INT8 typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; #else -typedef short int yytype_int8; +typedef signed char yytype_int8; #endif #ifdef YYTYPE_UINT16 @@ -254,8 +251,7 @@ typedef short int yytype_int16; # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# elif ! defined YYSIZE_T # include <stddef.h> /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else @@ -266,42 +262,71 @@ typedef short int yytype_int16; #define YYSIZE_MAXIMUM ((YYSIZE_T) -1) #ifndef YY_ -# if YYENABLE_NLS +# if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include <libintl.h> /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) +# define YY_(Msgid) dgettext ("bison-runtime", Msgid) # endif # endif # ifndef YY_ -# define YY_(msgid) msgid +# define YY_(Msgid) Msgid +# endif +#endif + +#ifndef YY_ATTRIBUTE +# if (defined __GNUC__ \ + && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \ + || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C +# define YY_ATTRIBUTE(Spec) __attribute__(Spec) +# else +# define YY_ATTRIBUTE(Spec) /* empty */ +# endif +#endif + +#ifndef YY_ATTRIBUTE_PURE +# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__)) +#endif + +#ifndef YY_ATTRIBUTE_UNUSED +# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__)) +#endif + +#if !defined _Noreturn \ + && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112) +# if defined _MSC_VER && 1200 <= _MSC_VER +# define _Noreturn __declspec (noreturn) +# else +# define _Noreturn YY_ATTRIBUTE ((__noreturn__)) # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) +# define YYUSE(E) ((void) (E)) #else -# define YYUSE(e) /* empty */ +# define YYUSE(E) /* empty */ #endif -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(n) (n) +#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__ +/* Suppress an incorrect diagnostic about yylval being uninitialized. */ +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ + _Pragma ("GCC diagnostic push") \ + _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\ + _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") +# define YY_IGNORE_MAYBE_UNINITIALIZED_END \ + _Pragma ("GCC diagnostic pop") #else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int yyi) -#else -static int -YYID (yyi) - int yyi; +# define YY_INITIAL_VALUE(Value) Value #endif -{ - return yyi; -} +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif + #if ! defined yyoverflow || YYERROR_VERBOSE /* The parser invokes alloca or malloc; define the necessary symbols. */ @@ -319,11 +344,11 @@ YYID (yyi) # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include <stdlib.h> /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 + /* Use EXIT_SUCCESS as a witness for stdlib.h. */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 # endif # endif # endif @@ -331,8 +356,8 @@ YYID (yyi) # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) + /* Pacify GCC's 'empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely @@ -346,25 +371,23 @@ 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))) + && (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__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined malloc && ! defined EXIT_SUCCESS 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__ \ - || defined __cplusplus || defined _MSC_VER) +# if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif @@ -374,7 +397,7 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ #if (! defined yyoverflow \ && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc @@ -392,79 +415,85 @@ 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 elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ + do \ + { \ + YYSIZE_T yynewbytes; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ + yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ + yyptr += yynewbytes / sizeof (*yyptr); \ + } \ + while (0) #endif +#if defined YYCOPY_NEEDED && YYCOPY_NEEDED +/* Copy COUNT objects from SRC to DST. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(Dst, Src, Count) \ + __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) +# else +# define YYCOPY(Dst, Src, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (Dst)[yyi] = (Src)[yyi]; \ + } \ + while (0) +# endif +# endif +#endif /* !YYCOPY_NEEDED */ + /* YYFINAL -- State number of the termination state. */ #define YYFINAL 13 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 886 +#define YYLAST 920 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 54 +#define YYNTOKENS 55 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 72 /* YYNRULES -- Number of rules. */ -#define YYNRULES 202 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 301 +#define YYNRULES 205 +/* YYNSTATES -- Number of states. */ +#define YYNSTATES 304 -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned + by yylex, with out-of-bounds checking. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 299 +#define YYMAXUTOK 300 -#define YYTRANSLATE(YYX) \ +#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ +/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM + as returned by yylex, without out-of-bounds checking. */ static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 48, 53, 2, 50, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 45, - 51, 49, 52, 2, 2, 2, 2, 2, 2, 2, + 2, 49, 54, 2, 51, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 46, + 52, 50, 53, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 46, 2, 47, 2, 2, 2, 2, + 2, 2, 2, 47, 2, 48, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -481,129 +510,39 @@ static const yytype_uint8 yytranslate[] = 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44 + 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45 }; #if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint16 yyprhs[] = -{ - 0, 0, 3, 5, 9, 13, 14, 15, 19, 20, - 26, 27, 32, 35, 36, 38, 40, 42, 44, 46, - 48, 50, 52, 54, 56, 58, 60, 62, 63, 70, - 73, 76, 79, 80, 88, 91, 92, 97, 101, 104, - 105, 108, 112, 116, 119, 121, 124, 126, 128, 131, - 134, 137, 138, 145, 150, 154, 157, 158, 160, 163, - 166, 171, 176, 178, 181, 182, 191, 194, 195, 198, - 199, 204, 208, 211, 212, 214, 218, 221, 223, 225, - 229, 232, 237, 240, 242, 245, 247, 249, 252, 256, - 259, 263, 264, 270, 271, 277, 279, 281, 284, 287, - 290, 291, 299, 303, 305, 307, 310, 311, 316, 320, - 323, 324, 326, 330, 332, 334, 336, 344, 352, 363, - 374, 377, 380, 381, 388, 394, 398, 400, 402, 406, - 408, 409, 411, 413, 415, 416, 417, 421, 427, 432, - 439, 443, 449, 452, 453, 455, 458, 462, 464, 466, - 468, 470, 472, 474, 476, 478, 480, 483, 485, 487, - 490, 493, 495, 499, 501, 503, 504, 506, 508, 510, - 512, 514, 516, 523, 529, 531, 533, 535, 537, 539, - 541, 543, 545, 547, 549, 551, 553, 555, 557, 559, - 561, 563, 565, 567, 569, 571, 573, 575, 577, 579, - 581, 583, 585 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int8 yyrhs[] = -{ - 55, 0, -1, 58, -1, 42, 121, 43, -1, 40, - 121, 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, 83, -1, - 84, -1, 98, -1, 99, -1, 66, -1, 67, -1, - 76, -1, 77, -1, 107, -1, 108, -1, 110, -1, - 124, -1, -1, 3, 33, 64, 46, 58, 47, -1, - 6, 33, -1, 6, 125, -1, 122, 65, -1, -1, - 122, 65, 69, 68, 46, 70, 47, -1, 12, 118, - -1, -1, 57, 74, 45, 70, -1, 1, 45, 70, - -1, 57, 74, -1, -1, 119, 33, -1, 39, 35, - 48, -1, 39, 118, 48, -1, 39, 48, -1, 31, - -1, 72, 71, -1, 71, -1, 89, -1, 7, 33, - -1, 7, 125, -1, 122, 75, -1, -1, 122, 75, - 78, 46, 79, 47, -1, 57, 80, 45, 79, -1, - 1, 45, 79, -1, 57, 80, -1, -1, 90, -1, - 4, 33, -1, 4, 125, -1, 4, 37, 35, 48, - -1, 4, 37, 118, 48, -1, 81, -1, 122, 81, - -1, -1, 122, 82, 86, 87, 85, 46, 88, 47, - -1, 12, 118, -1, -1, 13, 101, -1, -1, 57, - 96, 45, 88, -1, 1, 45, 88, -1, 57, 96, - -1, -1, 73, -1, 73, 49, 123, -1, 119, 125, - -1, 119, -1, 71, -1, 71, 49, 123, -1, 72, - 71, -1, 72, 71, 49, 123, -1, 119, 125, -1, - 119, -1, 72, 119, -1, 119, -1, 15, -1, 91, - 37, -1, 30, 91, 37, -1, 91, 38, -1, 30, - 91, 38, -1, -1, 92, 116, 48, 94, 117, -1, - -1, 92, 1, 48, 95, 117, -1, 89, -1, 93, - -1, 5, 33, -1, 5, 125, -1, 122, 97, -1, - -1, 122, 97, 102, 100, 46, 103, 47, -1, 118, - 50, 101, -1, 118, -1, 24, -1, 12, 101, -1, - -1, 57, 104, 45, 103, -1, 1, 45, 103, -1, - 57, 104, -1, -1, 93, -1, 106, 50, 105, -1, - 106, -1, 118, -1, 125, -1, 122, 8, 51, 57, - 119, 52, 33, -1, 122, 8, 51, 57, 119, 52, - 125, -1, 122, 9, 51, 57, 119, 50, 57, 119, - 52, 33, -1, 122, 9, 51, 57, 119, 50, 57, - 119, 52, 125, -1, 10, 33, -1, 10, 125, -1, - -1, 122, 109, 111, 46, 112, 47, -1, 122, 10, - 46, 112, 47, -1, 113, 50, 112, -1, 113, -1, - 33, -1, 33, 49, 114, -1, 125, -1, -1, 35, - -1, 118, -1, 11, -1, -1, -1, 115, 57, 73, - -1, 116, 50, 115, 57, 73, -1, 115, 57, 119, - 125, -1, 116, 50, 115, 57, 119, 125, -1, 115, - 57, 119, -1, 116, 50, 115, 57, 119, -1, 14, - 105, -1, -1, 33, -1, 32, 33, -1, 118, 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, 118, -1, 118, 53, -1, - 34, 120, -1, 34, -1, 121, 50, 120, -1, 120, - -1, 26, -1, -1, 35, -1, 36, -1, 118, -1, - 34, -1, 28, -1, 29, -1, 27, 57, 119, 33, - 49, 123, -1, 27, 57, 119, 49, 123, -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. */ + /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 114, 114, 122, 131, 136, 145, 144, 154, 153, - 164, 163, 168, 173, 180, 184, 188, 192, 196, 200, - 204, 208, 212, 216, 220, 224, 228, 238, 237, 271, - 275, 286, 297, 296, 323, 332, 340, 349, 352, 357, - 364, 377, 397, 453, 461, 474, 482, 497, 503, 507, - 518, 529, 528, 570, 579, 582, 587, 594, 600, 604, - 615, 640, 705, 717, 731, 730, 770, 805, 813, 818, - 826, 835, 838, 843, 850, 872, 899, 921, 947, 956, - 967, 976, 985, 995, 1009, 1015, 1023, 1035, 1059, 1084, - 1108, 1139, 1138, 1161, 1160, 1183, 1184, 1190, 1194, 1205, - 1220, 1219, 1254, 1289, 1324, 1334, 1339, 1347, 1356, 1359, - 1364, 1371, 1377, 1384, 1396, 1408, 1419, 1428, 1443, 1454, - 1471, 1475, 1487, 1486, 1510, 1525, 1531, 1539, 1551, 1574, - 1582, 1591, 1595, 1634, 1641, 1652, 1654, 1670, 1686, 1698, - 1710, 1721, 1737, 1742, 1750, 1753, 1759, 1772, 1776, 1780, - 1784, 1788, 1792, 1796, 1800, 1804, 1808, 1812, 1816, 1835, - 1876, 1882, 1890, 1897, 1909, 1916, 1926, 1939, 1952, 1998, - 2009, 2020, 2036, 2045, 2059, 2062, 2065, 2068, 2071, 2074, - 2077, 2080, 2083, 2086, 2089, 2092, 2095, 2098, 2101, 2104, - 2107, 2110, 2113, 2116, 2119, 2122, 2125, 2128, 2131, 2134, - 2137, 2140, 2143 + 0, 115, 115, 123, 132, 137, 146, 145, 155, 154, + 165, 164, 169, 174, 181, 185, 189, 193, 197, 201, + 205, 209, 213, 217, 221, 225, 229, 239, 238, 272, + 276, 287, 298, 297, 324, 333, 341, 350, 353, 358, + 365, 378, 398, 454, 462, 475, 483, 498, 504, 508, + 519, 530, 529, 571, 580, 583, 588, 595, 601, 605, + 616, 641, 706, 718, 732, 731, 771, 806, 814, 819, + 827, 836, 839, 844, 851, 873, 900, 922, 948, 957, + 968, 977, 986, 996, 1010, 1016, 1024, 1036, 1060, 1085, + 1109, 1140, 1139, 1162, 1161, 1184, 1185, 1191, 1195, 1206, + 1221, 1220, 1255, 1290, 1325, 1330, 1340, 1345, 1353, 1362, + 1365, 1370, 1377, 1383, 1390, 1402, 1414, 1425, 1434, 1449, + 1460, 1477, 1481, 1493, 1492, 1516, 1531, 1537, 1545, 1557, + 1580, 1588, 1597, 1601, 1640, 1647, 1658, 1660, 1676, 1692, + 1704, 1716, 1727, 1743, 1748, 1756, 1759, 1765, 1778, 1782, + 1786, 1790, 1794, 1798, 1802, 1806, 1810, 1814, 1818, 1822, + 1826, 1845, 1886, 1892, 1900, 1907, 1919, 1926, 1936, 1949, + 1962, 2008, 2019, 2030, 2046, 2055, 2069, 2072, 2075, 2078, + 2081, 2084, 2087, 2090, 2093, 2096, 2099, 2102, 2105, 2108, + 2111, 2114, 2117, 2120, 2123, 2126, 2129, 2132, 2135, 2138, + 2141, 2144, 2147, 2150, 2153, 2156 }; #endif -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +#if YYDEBUG || YYERROR_VERBOSE || 0 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = @@ -614,7 +553,7 @@ static const char *const yytname[] = "ICE_THROWS", "ICE_VOID", "ICE_BYTE", "ICE_BOOL", "ICE_SHORT", "ICE_INT", "ICE_LONG", "ICE_FLOAT", "ICE_DOUBLE", "ICE_STRING", "ICE_OBJECT", "ICE_LOCAL_OBJECT", "ICE_LOCAL", "ICE_CONST", "ICE_FALSE", "ICE_TRUE", - "ICE_IDEMPOTENT", "ICE_OPTIONAL", "ICE_SCOPE_DELIMITER", + "ICE_IDEMPOTENT", "ICE_OPTIONAL", "ICE_VALUE", "ICE_SCOPE_DELIMITER", "ICE_IDENTIFIER", "ICE_STRING_LITERAL", "ICE_INTEGER_LITERAL", "ICE_FLOATING_POINT_LITERAL", "ICE_IDENT_OP", "ICE_KEYWORD_OP", "ICE_OPTIONAL_OP", "ICE_METADATA_OPEN", "ICE_METADATA_CLOSE", @@ -635,495 +574,456 @@ static const char *const yytname[] = "dictionary_def", "enum_id", "enum_def", "@11", "enumerator_list", "enumerator", "enumerator_initializer", "out_qualifier", "parameters", "throws", "scoped_name", "type", "string_literal", "string_list", - "local_qualifier", "const_initializer", "const_def", "keyword", 0 + "local_qualifier", "const_initializer", "const_def", "keyword", YY_NULLPTR }; #endif # ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ +/* YYTOKNUM[NUM] -- (External) token number corresponding to the + (internal) symbol number NUM (which must be that of a token). */ static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 59, 123, 125, 41, 61, - 44, 60, 62, 42 + 295, 296, 297, 298, 299, 300, 59, 123, 125, 41, + 61, 44, 60, 62, 42 }; # endif -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 54, 55, 56, 57, 57, 59, 58, 60, 58, - 61, 58, 58, 58, 62, 62, 62, 62, 62, 62, - 62, 62, 62, 62, 62, 62, 62, 64, 63, 65, - 65, 66, 68, 67, 69, 69, 70, 70, 70, 70, - 71, 72, 72, 72, 72, 73, 73, 74, 75, 75, - 76, 78, 77, 79, 79, 79, 79, 80, 81, 81, - 82, 82, 82, 83, 85, 84, 86, 86, 87, 87, - 88, 88, 88, 88, 89, 89, 89, 89, 90, 90, - 90, 90, 90, 90, 91, 91, 91, 92, 92, 92, - 92, 94, 93, 95, 93, 96, 96, 97, 97, 98, - 100, 99, 101, 101, 101, 102, 102, 103, 103, 103, - 103, 104, 105, 105, 106, 106, 107, 107, 108, 108, - 109, 109, 111, 110, 110, 112, 112, 113, 113, 113, - 113, 114, 114, 115, 115, 116, 116, 116, 116, 116, - 116, 116, 117, 117, 118, 118, 118, 119, 119, 119, - 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, - 120, 120, 121, 121, 122, 122, 123, 123, 123, 123, - 123, 123, 124, 124, 125, 125, 125, 125, 125, 125, - 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, - 125, 125, 125, 125, 125, 125, 125, 125, 125, 125, - 125, 125, 125 -}; +#define YYPACT_NINF -221 -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = +#define yypact_value_is_default(Yystate) \ + (!!((Yystate) == (-221))) + +#define YYTABLE_NINF -137 + +#define yytable_value_is_error(Yytable_value) \ + 0 + + /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +static const yytype_int16 yypact[] = { - 0, 2, 1, 3, 3, 0, 0, 3, 0, 5, - 0, 4, 2, 0, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 0, 6, 2, - 2, 2, 0, 7, 2, 0, 4, 3, 2, 0, - 2, 3, 3, 2, 1, 2, 1, 1, 2, 2, - 2, 0, 6, 4, 3, 2, 0, 1, 2, 2, - 4, 4, 1, 2, 0, 8, 2, 0, 2, 0, - 4, 3, 2, 0, 1, 3, 2, 1, 1, 3, - 2, 4, 2, 1, 2, 1, 1, 2, 3, 2, - 3, 0, 5, 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, 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 + 523, -16, 2, 2, 34, -221, 19, -221, -221, 2, + -221, 24, -15, -221, 115, 43, -221, 40, 39, -221, + -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, + -221, 124, -221, 115, -221, -221, 2, -221, -221, -221, + 221, 65, 601, 669, 701, 733, 60, 61, 488, 3, + 79, 9, 123, 4, -221, -221, -221, 89, -221, -221, + -221, -221, -221, -221, -221, -221, 83, -221, -221, 104, + -221, 6, -10, 115, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -1, -221, -221, -221, -221, + -221, -221, -221, 40, 40, -221, 765, -221, 46, -221, + 93, 46, 130, 59, -221, 100, 442, -221, -221, 114, + -221, 99, 66, -221, 101, 10, 221, 221, 102, 103, + 106, -221, 120, 108, 362, 120, 59, -221, -221, -221, + -221, -7, 112, 765, 116, -221, 66, -221, -221, -221, + -221, -221, 120, -221, -221, -221, 117, 118, 54, -221, + 765, 396, 119, 880, 125, -221, 121, 59, 294, 127, + -221, -221, 797, 40, -221, -221, 120, -221, 126, 880, + 131, 362, -221, 35, 128, 221, 134, -221, 829, -221, + 328, -221, 136, 440, 137, -221, -221, -221, 221, 396, + -221, 221, 138, 141, -221, 829, -221, -221, 122, -221, + 29, 66, 139, 133, 362, -221, -221, 144, 440, 143, + 294, -221, 521, 221, 67, 257, -221, 147, -221, -221, + 142, -221, -221, 66, 396, -221, -221, -221, -221, 66, + -221, 328, 221, -221, -221, 148, 564, -221, -221, 69, + -221, -221, -221, 135, -221, 40, 23, 294, 861, -221, + -221, -221, -221, 133, 328, -221, -221, -221, 880, -221, + 185, -221, -221, -221, -221, 184, -221, 829, 184, 40, + 637, -221, -221, -221, 880, -221, 149, 120, -221, -221, + 829, 637, -221, -221 }; -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ + /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE does not specify something else to do. Zero + means the default is an error. */ static const yytype_uint8 yydefact[] = { - 0, 0, 0, 0, 0, 6, 165, 2, 10, 161, - 163, 0, 0, 1, 0, 0, 164, 5, 12, 14, + 0, 0, 0, 0, 0, 6, 167, 2, 10, 163, + 165, 0, 0, 1, 0, 0, 166, 5, 12, 14, 19, 20, 21, 22, 15, 16, 17, 18, 23, 24, - 25, 0, 26, 0, 160, 4, 0, 3, 7, 27, + 25, 0, 26, 0, 162, 4, 0, 3, 7, 27, 0, 0, 0, 0, 0, 0, 0, 0, 0, 31, - 50, 62, 67, 99, 122, 11, 162, 0, 147, 148, - 149, 150, 151, 152, 153, 154, 155, 157, 0, 144, - 158, 0, 0, 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, 200, - 201, 202, 58, 0, 59, 97, 98, 29, 30, 48, - 49, 5, 5, 120, 130, 121, 0, 32, 0, 0, - 69, 0, 100, 0, 0, 156, 145, 0, 159, 0, - 0, 9, 0, 0, 0, 0, 127, 0, 126, 129, - 34, 0, 0, 66, 0, 64, 104, 105, 103, 0, - 130, 0, 146, 0, 170, 171, 169, 166, 167, 168, - 173, 60, 61, 0, 0, 0, 124, 130, 0, 0, - 0, 0, 68, 0, 0, 0, 0, 28, 172, 0, - 5, 131, 128, 132, 125, 0, 0, 0, 0, 44, - 0, 78, 0, 55, 57, 83, 52, 0, 102, 0, - 0, 0, 123, 116, 117, 0, 0, 46, 0, 74, - 38, 47, 77, 33, 54, 0, 43, 0, 0, 80, - 0, 0, 40, 82, 0, 0, 0, 0, 86, 0, - 0, 0, 0, 111, 109, 85, 101, 0, 37, 45, - 0, 0, 76, 41, 42, 79, 0, 53, 0, 0, - 95, 96, 72, 77, 65, 108, 0, 84, 87, 89, - 0, 133, 5, 0, 0, 0, 75, 36, 81, 71, - 84, 0, 88, 90, 93, 0, 91, 134, 107, 118, - 119, 70, 143, 136, 140, 143, 5, 0, 94, 138, - 92, 0, 142, 113, 114, 115, 137, 141, 0, 139, - 112 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = -{ - -1, 4, 5, 6, 7, 14, 41, 33, 18, 19, - 57, 49, 20, 21, 141, 117, 187, 207, 208, 209, - 210, 50, 22, 23, 118, 171, 193, 51, 52, 24, - 25, 173, 120, 145, 226, 211, 194, 231, 232, 233, - 285, 282, 252, 53, 26, 27, 149, 147, 122, 201, - 234, 292, 293, 28, 29, 54, 30, 123, 137, 138, - 182, 262, 263, 288, 70, 220, 10, 11, 31, 160, - 32, 139 + 50, 62, 67, 99, 123, 11, 164, 0, 148, 149, + 150, 151, 152, 153, 154, 155, 156, 158, 159, 0, + 145, 160, 0, 0, 176, 177, 178, 179, 180, 181, + 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, + 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, + 202, 203, 204, 205, 58, 0, 59, 97, 98, 29, + 30, 48, 49, 5, 5, 121, 131, 122, 0, 32, + 0, 0, 69, 0, 100, 0, 0, 157, 146, 0, + 161, 0, 0, 9, 0, 0, 0, 0, 128, 0, + 127, 130, 34, 0, 0, 66, 0, 64, 104, 105, + 106, 103, 0, 131, 0, 147, 0, 172, 173, 171, + 168, 169, 170, 175, 60, 61, 0, 0, 0, 125, + 131, 0, 0, 0, 0, 68, 0, 0, 0, 0, + 28, 174, 0, 5, 132, 129, 133, 126, 0, 0, + 0, 0, 44, 0, 78, 0, 55, 57, 83, 52, + 0, 102, 0, 0, 0, 124, 117, 118, 0, 0, + 46, 0, 74, 38, 47, 77, 33, 54, 0, 43, + 0, 0, 80, 0, 0, 40, 82, 0, 0, 0, + 0, 86, 0, 0, 0, 0, 112, 110, 85, 101, + 0, 37, 45, 0, 0, 76, 41, 42, 79, 0, + 53, 0, 0, 95, 96, 72, 77, 65, 109, 0, + 84, 87, 89, 0, 134, 5, 0, 0, 0, 75, + 36, 81, 71, 84, 0, 88, 90, 93, 0, 91, + 135, 108, 119, 120, 70, 144, 137, 141, 144, 5, + 0, 94, 139, 92, 0, 143, 114, 115, 116, 138, + 142, 0, 140, 113 }; -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -227 -static const yytype_int16 yypact[] = + /* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = { - 126, -16, 4, 4, 65, -227, 21, -227, -227, 4, - -227, -10, -11, -227, 73, 38, -227, 46, 58, -227, - -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, - -227, 291, -227, 73, -227, -227, 4, -227, -227, -227, - 853, 61, 559, 625, 656, 687, 59, 63, 479, 6, - 77, 9, 99, 11, -227, -227, -227, 82, -227, -227, - -227, -227, -227, -227, -227, -227, 84, -227, 106, -227, - 5, 26, 73, -227, -227, -227, -227, -227, -227, -227, - -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, - -227, -227, -227, -227, -227, -227, -227, -227, -227, -227, - -227, -227, -227, 29, -227, -227, -227, -227, -227, -227, - -227, 46, 46, -227, 718, -227, 1, -227, 94, 1, - 129, 3, -227, 100, 434, -227, -227, 112, -227, 98, - 158, -227, 101, 37, 853, 853, 105, 103, 110, -227, - 116, 109, 356, 116, 3, -227, -227, -227, -6, 115, - 718, 117, -227, 158, -227, -227, -227, -227, -227, 116, - -227, -227, -227, 104, 119, 86, -227, 718, 389, 120, - 829, 123, -227, 121, 3, 290, 125, -227, -227, 749, - 46, -227, -227, 116, -227, 130, 829, 132, 356, -227, - 69, 113, 853, 131, -227, 780, -227, 323, -227, 136, - 432, 135, -227, -227, -227, 853, 389, -227, 853, 128, - 138, -227, 780, -227, -227, 140, -227, 57, 158, 146, - 151, 356, -227, -227, 152, 432, 153, 290, -227, 219, - 853, 54, 254, -227, 154, -227, -227, 149, -227, -227, - 158, 389, -227, -227, -227, -227, 158, -227, 323, 853, - -227, -227, 160, 523, -227, -227, 60, -227, -227, -227, - 159, -227, 46, 74, 290, 811, -227, -227, -227, -227, - 151, 323, -227, -227, -227, 829, -227, 195, -227, -227, - -227, -227, 194, -227, 780, 194, 46, 594, -227, -227, - -227, 829, -227, 161, 116, -227, -227, 780, 594, -227, - -227 + -221, -221, -221, -17, -12, -221, -221, -221, -221, -221, + -221, -221, -221, -221, -221, -221, -191, -170, -165, -208, + -221, -221, -221, -221, -221, -168, -221, -221, -221, -221, + -221, -221, -221, -221, -220, -29, -221, -30, -221, -25, + -221, -221, -221, -221, -221, -221, -221, -119, -221, -218, + -221, -97, -221, -221, -221, -221, -221, -221, -105, -221, + -221, -72, -221, -79, -104, -27, 11, 207, -221, -145, + -221, -38 }; -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = + /* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = { - -227, -227, -227, -17, -12, -227, -227, -227, -227, -227, - -227, -227, -227, -227, -227, -227, -191, -162, -159, -182, - -227, -227, -227, -227, -227, -168, -227, -227, -227, -227, - -227, -227, -227, -227, -226, -13, -227, -20, -227, -9, - -227, -227, -227, -227, -227, -227, -227, -119, -227, -215, - -227, -85, -227, -227, -227, -227, -227, -227, -83, -227, - -227, -63, -227, -68, -102, -27, 7, 215, -227, -150, - -227, -38 + -1, 4, 5, 6, 7, 14, 41, 33, 18, 19, + 57, 49, 20, 21, 143, 119, 190, 210, 211, 212, + 213, 50, 22, 23, 120, 174, 196, 51, 52, 24, + 25, 176, 122, 147, 229, 214, 197, 234, 235, 236, + 288, 285, 255, 53, 26, 27, 152, 150, 124, 204, + 237, 295, 296, 28, 29, 54, 30, 125, 139, 140, + 185, 265, 266, 291, 71, 223, 10, 11, 31, 163, + 32, 141 }; -/* 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 -136 + /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If + positive, shift that token. If negative, reduce the rule whose + number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 40, 133, 38, 178, 104, 106, 108, 110, 191, -63, - 115, 192, 255, 71, 140, 238, 34, 143, 116, 148, - 214, 55, 269, 121, 15, 172, 127, 146, 159, 8, - 219, 35, 37, 68, 69, 68, 69, 127, 9, 36, - 36, 230, 148, 56, 174, 281, 239, 16, 17, 278, - 267, 159, -35, 247, -63, 198, -63, -106, 128, 129, - 131, 68, 69, 183, 132, 13, 249, 176, 245, 127, - 230, 39, 148, -13, 1, 130, -5, -5, -5, -5, - -5, -5, -5, -5, 184, 162, 2, 239, 217, 127, - 266, 258, 259, 283, 134, 135, 268, 272, 273, -5, - -5, 68, 69, -8, 215, 244, 72, 163, 164, 296, - 111, 119, 151, 2, 112, 3, 159, 216, 68, 69, - -13, 181, 276, -51, 277, 170, -13, 1, 124, -5, - -5, -5, -5, -5, -5, -5, -5, 125, 159, 126, - 142, 204, 144, 195, 159, 152, 150, 153, 127, 161, - 166, 186, -5, -5, 165, 168, 179, 223, 200, 212, - 167, 175, 218, 205, 177, 188, 2, 197, 3, 180, - 196, 170, 202, 235, 242, 206, 221, 240, 237, 213, - 225, 227, 236, 241, 222, 294, 154, 155, 243, 186, - 68, 69, 156, 157, 158, 246, 294, 248, 253, 264, - 254, 265, 235, 257, 170, 271, 261, 274, 287, 256, - 200, 298, 250, 300, 286, 242, 251, 290, 12, 0, - 0, 0, 270, 0, 186, 0, 0, 280, 0, 0, - 0, 225, 0, 0, 228, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 275, 289, 200, 284, 295, - 189, 68, 69, 0, 225, 260, 0, 0, 190, 299, - 295, 0, 0, 0, 297, 261, 0, 0, 0, 291, - -134, -134, -134, -134, -134, -134, -134, -134, -134, -134, - 0, 0, 0, 0, 0, -134, -134, -134, 0, 0, - 0, 199, 0, -134, -134, 42, 43, 44, 45, 46, - 47, 48, -135, 0, -135, -5, -5, -5, -5, -5, - -5, -5, -5, -5, -5, -5, 0, 0, 0, 0, - -5, -5, -5, -5, 224, 0, 0, 0, 0, -5, - 2, 0, 0, 0, 0, 0, 0, -110, -5, -5, - -5, -5, -5, -5, -5, -5, -5, -5, -5, 0, - 0, 0, 0, -5, -5, -5, -5, 169, 0, 0, + 40, 135, 38, 194, 106, 108, 110, 112, 195, -63, + 117, 181, 258, 72, 142, 118, 123, 145, 241, 151, + 34, 55, 15, 217, 131, 222, 129, 175, 162, 37, + 8, 272, 69, 70, 13, 134, 36, 9, 233, 129, + 132, 242, 151, 129, 177, 16, 17, 56, 179, 281, + -35, -107, 162, 270, 284, -63, 250, -63, 201, 165, + 130, 133, 129, 252, 186, 187, 35, 233, 69, 70, + 286, 218, 279, 151, 280, 36, 248, 39, 247, 69, + 70, 2, 242, 148, 219, -8, 299, 69, 70, 220, + 184, 149, 69, 70, 157, 158, 136, 137, 269, 69, + 70, 159, 160, 161, 271, 261, 262, 275, 276, 166, + 167, 73, 113, 114, 154, -13, 1, 162, -5, -5, + -5, -5, -5, -5, -5, -5, -51, 173, 42, 43, + 44, 45, 46, 47, 48, 121, 126, 127, 128, 162, + 144, -5, -5, 146, 207, 162, 198, 153, 155, 156, + 164, 169, 168, 129, 189, 171, 2, 170, 3, 178, + 226, 203, 215, -13, 180, 191, 208, 225, 200, 183, + 182, 246, 209, 199, 173, 205, 238, 245, 221, 216, + 224, 240, 230, 228, 277, 239, 297, 244, 243, 249, + 251, 257, 189, 267, 274, 268, 264, 297, 290, 253, + 301, 256, 259, 254, 303, 238, 260, 173, 289, 293, + 12, 0, 0, 203, 0, 0, 0, 0, 245, 0, + 0, 0, 0, 0, 0, 273, 0, 189, 0, 0, + 283, 0, 0, 0, 228, 0, 0, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 0, 278, 292, + 203, 287, 298, 68, 69, 70, 0, 228, 263, 0, + 0, 0, 302, 298, 0, 0, 0, 300, 264, 0, + 0, 0, 294, -135, -135, -135, -135, -135, -135, -135, + -135, -135, -135, 0, 0, 0, 0, 0, -135, -135, + -135, -135, 0, 0, 0, 202, 0, -135, -135, 0, + 0, 0, 0, 0, 0, 0, -136, 0, -136, -5, + -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, + 0, 0, 0, 0, -5, -5, -5, -5, -5, 227, + 0, 0, 0, 0, -5, 2, 0, 0, 0, 0, + 0, 0, -111, -5, -5, -5, -5, -5, -5, -5, + -5, -5, -5, -5, 0, 0, 0, 0, -5, -5, + -5, -5, -5, 172, 0, 0, 0, 0, -5, 2, + 0, 0, 0, 0, 0, 0, -73, 0, -5, -5, + -5, -5, -5, -5, -5, -5, -5, -5, 0, 0, + 0, 0, 0, -5, -5, -5, -5, 188, 0, 0, 0, 0, -5, 2, 0, 0, 0, 0, 0, 0, - -73, 0, -5, -5, -5, -5, -5, -5, -5, -5, + -56, 0, -5, -5, -5, -5, -5, -5, -5, -5, -5, -5, 0, 0, 0, 0, 0, -5, -5, -5, - 185, 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, 228, 58, 59, - 60, 61, 62, 63, 64, 65, 66, 67, 0, 0, - -5, -5, 229, 189, 68, 69, 0, 0, 0, 0, - 0, 190, 0, 0, 2, 0, 3, 0, 0, 0, - 0, -13, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 0, 113, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 114, 73, 74, 75, 76, + -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, 231, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 0, 0, -5, -5, + 232, 192, 68, 69, 70, 0, 0, 0, 0, 0, + 193, 0, 0, 2, 0, 3, 0, 0, 0, 0, + -13, 74, 75, 76, 77, 78, 79, 80, 81, 82, + 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, + 103, 0, 115, -13, 1, 0, -5, -5, -5, -5, + -5, -5, -5, -5, 0, 116, 231, 58, 59, 60, + 61, 62, 63, 64, 65, 66, 67, 0, 0, -5, + -5, 0, 192, 68, 69, 70, 0, 0, 0, 0, + 0, 193, 0, 0, 2, 0, 3, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, - 97, 98, 99, 100, 101, 0, 222, 0, 0, 0, - -85, -85, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 0, 102, 0, 0, 0, 103, 73, 74, 75, + 97, 98, 99, 100, 101, 102, 103, 0, 225, 0, + 0, 0, -85, -85, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 0, 104, 0, 0, 0, 105, + 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, + 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 69, 70, 74, 75, 76, 77, 78, 79, 80, 81, + 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, + 102, 103, 0, 107, 74, 75, 76, 77, 78, 79, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, + 100, 101, 102, 103, 0, 109, 74, 75, 76, 77, + 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, + 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 0, 111, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, - 96, 97, 98, 99, 100, 101, 68, 69, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 96, 97, 98, 99, 100, 101, 0, 105, 73, + 96, 97, 98, 99, 100, 101, 102, 103, 0, 138, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 100, 101, 0, 107, - 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, - 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 96, 97, 98, 99, 100, 101, 0, - 109, 73, 74, 75, 76, 77, 78, 79, 80, 81, + 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, + 0, 206, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, - 0, 136, 73, 74, 75, 76, 77, 78, 79, 80, - 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, - 101, 0, 203, 73, 74, 75, 76, 77, 78, 79, + 102, 103, 0, 225, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, - 100, 101, 0, 222, 73, 74, 75, 76, 77, 78, - 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, - 99, 100, 101, 0, 279, 58, 59, 60, 61, 62, - 63, 64, 65, 66, 67, 0, 0, 0, 0, 0, - 189, 68, 69, 0, 0, 0, 0, 0, 190, 58, - 59, 60, 61, 62, 63, 64, 65, 66, 67, 0, - 0, 0, 0, 0, 0, 68, 69 + 100, 101, 102, 103, 0, 282, 58, 59, 60, 61, + 62, 63, 64, 65, 66, 67, 0, 0, 0, 0, + 0, 192, 68, 69, 70, 0, 0, 0, 0, 0, + 193 }; static const yytype_int16 yycheck[] = { - 17, 103, 14, 153, 42, 43, 44, 45, 170, 0, - 48, 170, 227, 40, 116, 206, 9, 119, 12, 121, - 188, 33, 248, 12, 3, 144, 32, 24, 130, 45, - 192, 41, 43, 32, 33, 32, 33, 32, 34, 50, - 50, 200, 144, 36, 50, 271, 208, 26, 27, 264, - 241, 153, 46, 221, 45, 174, 47, 46, 53, 33, - 72, 32, 33, 165, 35, 0, 225, 150, 218, 32, - 229, 33, 174, 0, 1, 49, 3, 4, 5, 6, - 7, 8, 9, 10, 167, 48, 40, 249, 190, 32, - 240, 37, 38, 275, 111, 112, 246, 37, 38, 26, - 27, 32, 33, 45, 35, 48, 45, 134, 135, 291, - 51, 12, 124, 40, 51, 42, 218, 48, 32, 33, - 47, 35, 48, 46, 50, 142, 0, 1, 46, 3, - 4, 5, 6, 7, 8, 9, 10, 53, 240, 33, - 46, 179, 13, 170, 246, 33, 46, 49, 32, 48, - 47, 168, 26, 27, 49, 46, 52, 195, 175, 186, - 50, 46, 49, 180, 47, 45, 40, 46, 42, 50, - 47, 188, 47, 200, 212, 45, 45, 49, 205, 47, - 197, 45, 47, 45, 33, 287, 28, 29, 48, 206, - 32, 33, 34, 35, 36, 49, 298, 45, 225, 45, - 47, 52, 229, 230, 221, 45, 11, 48, 14, 229, - 227, 50, 225, 298, 277, 253, 225, 285, 3, -1, - -1, -1, 249, -1, 241, -1, -1, 265, -1, -1, - -1, 248, -1, -1, 15, 16, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 262, 284, 264, 275, 287, - 31, 32, 33, -1, 271, 1, -1, -1, 39, 297, - 298, -1, -1, -1, 291, 11, -1, -1, -1, 286, + 17, 105, 14, 173, 42, 43, 44, 45, 173, 0, + 48, 156, 230, 40, 118, 12, 12, 121, 209, 123, + 9, 33, 3, 191, 34, 195, 33, 146, 132, 44, + 46, 251, 33, 34, 0, 36, 51, 35, 203, 33, + 50, 211, 146, 33, 51, 26, 27, 36, 153, 267, + 47, 47, 156, 244, 274, 46, 224, 48, 177, 49, + 54, 73, 33, 228, 168, 170, 42, 232, 33, 34, + 278, 36, 49, 177, 51, 51, 221, 34, 49, 33, + 34, 41, 252, 24, 49, 46, 294, 33, 34, 193, + 36, 32, 33, 34, 28, 29, 113, 114, 243, 33, + 34, 35, 36, 37, 249, 38, 39, 38, 39, 136, + 137, 46, 52, 52, 126, 0, 1, 221, 3, 4, + 5, 6, 7, 8, 9, 10, 47, 144, 4, 5, + 6, 7, 8, 9, 10, 12, 47, 54, 34, 243, + 47, 26, 27, 13, 182, 249, 173, 47, 34, 50, + 49, 48, 50, 33, 171, 47, 41, 51, 43, 47, + 198, 178, 189, 48, 48, 46, 183, 34, 47, 51, + 53, 49, 46, 48, 191, 48, 203, 215, 50, 48, + 46, 208, 46, 200, 49, 48, 290, 46, 50, 50, + 46, 48, 209, 46, 46, 53, 11, 301, 14, 228, + 51, 228, 232, 228, 301, 232, 233, 224, 280, 288, + 3, -1, -1, 230, -1, -1, -1, -1, 256, -1, + -1, -1, -1, -1, -1, 252, -1, 244, -1, -1, + 268, -1, -1, -1, 251, -1, -1, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, -1, 265, 287, + 267, 278, 290, 32, 33, 34, -1, 274, 1, -1, + -1, -1, 300, 301, -1, -1, -1, 294, 11, -1, + -1, -1, 289, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, -1, -1, -1, -1, -1, 31, 32, + 33, 34, -1, -1, -1, 1, -1, 40, 41, -1, + -1, -1, -1, -1, -1, -1, 49, -1, 51, 15, 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, 4, 5, 6, 7, 8, - 9, 10, 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, - 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, + -1, -1, -1, -1, 30, 31, 32, 33, 34, 1, + -1, -1, -1, -1, 40, 41, -1, -1, -1, -1, + -1, -1, 48, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, -1, -1, -1, -1, 30, 31, + 32, 33, 34, 1, -1, -1, -1, -1, 40, 41, + -1, -1, -1, -1, -1, -1, 48, -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, + -1, -1, -1, 31, 32, 33, 34, 1, -1, -1, + -1, -1, 40, 41, -1, -1, -1, -1, -1, -1, + 48, -1, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, -1, -1, -1, -1, -1, 31, 32, 33, + 34, -1, -1, -1, -1, -1, 40, 41, -1, -1, + -1, -1, -1, 1, 48, 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, 34, -1, -1, -1, -1, -1, + 40, -1, -1, 41, -1, 43, -1, -1, -1, -1, + 48, 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, -1, 34, 0, 1, -1, 3, 4, 5, 6, + 7, 8, 9, 10, -1, 47, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, -1, -1, 26, + 27, -1, 31, 32, 33, 34, -1, -1, -1, -1, + -1, 40, -1, -1, 41, -1, 43, 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, -1, 34, -1, + -1, -1, 38, 39, 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, -1, 34, -1, -1, -1, 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, 34, 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, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 46, 3, 4, 5, 6, + 31, 32, -1, 34, 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, -1, 34, 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, -1, 33, -1, -1, -1, 37, 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, + 27, 28, 29, 30, 31, 32, -1, 34, 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, + 25, 26, 27, 28, 29, 30, 31, 32, -1, 34, 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, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + -1, 34, 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, + 31, 32, -1, 34, 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, - 31, 32, 33, -1, -1, -1, -1, -1, 39, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, - -1, -1, -1, -1, -1, 32, 33 + 29, 30, 31, 32, -1, 34, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, + -1, 31, 32, 33, 34, -1, -1, -1, -1, -1, + 40 }; -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ + /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 1, 40, 42, 55, 56, 57, 58, 45, 34, - 120, 121, 121, 0, 59, 3, 26, 27, 62, 63, - 66, 67, 76, 77, 83, 84, 98, 99, 107, 108, - 110, 122, 124, 61, 120, 41, 50, 43, 58, 33, - 57, 60, 4, 5, 6, 7, 8, 9, 10, 65, - 75, 81, 82, 97, 109, 58, 120, 64, 16, 17, + 0, 1, 41, 43, 56, 57, 58, 59, 46, 35, + 121, 122, 122, 0, 60, 3, 26, 27, 63, 64, + 67, 68, 77, 78, 84, 85, 99, 100, 108, 109, + 111, 123, 125, 62, 121, 42, 51, 44, 59, 34, + 58, 61, 4, 5, 6, 7, 8, 9, 10, 66, + 76, 82, 83, 98, 110, 59, 121, 65, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 32, 33, - 118, 119, 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, 37, 125, 33, 125, 33, 125, 33, - 125, 51, 51, 33, 46, 125, 12, 69, 78, 12, - 86, 12, 102, 111, 46, 53, 33, 32, 53, 33, - 49, 58, 35, 118, 57, 57, 33, 112, 113, 125, - 118, 68, 46, 118, 13, 87, 24, 101, 118, 100, - 46, 58, 33, 49, 28, 29, 34, 35, 36, 118, - 123, 48, 48, 119, 119, 49, 47, 50, 46, 1, - 57, 79, 101, 85, 50, 46, 112, 47, 123, 52, - 50, 35, 114, 118, 112, 1, 57, 70, 45, 31, - 39, 71, 72, 80, 90, 119, 47, 46, 101, 1, - 57, 103, 47, 33, 125, 57, 45, 71, 72, 73, - 74, 89, 119, 47, 79, 35, 48, 118, 49, 71, - 119, 45, 33, 125, 1, 57, 88, 45, 15, 30, - 72, 91, 92, 93, 104, 119, 47, 119, 70, 71, - 49, 45, 125, 48, 48, 123, 49, 79, 45, 72, - 89, 93, 96, 119, 47, 103, 91, 119, 37, 38, - 1, 11, 115, 116, 45, 52, 123, 70, 123, 88, - 119, 45, 37, 38, 48, 57, 48, 50, 103, 33, - 125, 88, 95, 73, 119, 94, 115, 14, 117, 125, - 117, 57, 105, 106, 118, 125, 73, 119, 50, 125, - 105 + 34, 119, 120, 46, 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, 34, 38, 126, 34, 126, 34, + 126, 34, 126, 52, 52, 34, 47, 126, 12, 70, + 79, 12, 87, 12, 103, 112, 47, 54, 34, 33, + 54, 34, 50, 59, 36, 119, 58, 58, 34, 113, + 114, 126, 119, 69, 47, 119, 13, 88, 24, 32, + 102, 119, 101, 47, 59, 34, 50, 28, 29, 35, + 36, 37, 119, 124, 49, 49, 120, 120, 50, 48, + 51, 47, 1, 58, 80, 102, 86, 51, 47, 113, + 48, 124, 53, 51, 36, 115, 119, 113, 1, 58, + 71, 46, 31, 40, 72, 73, 81, 91, 120, 48, + 47, 102, 1, 58, 104, 48, 34, 126, 58, 46, + 72, 73, 74, 75, 90, 120, 48, 80, 36, 49, + 119, 50, 72, 120, 46, 34, 126, 1, 58, 89, + 46, 15, 30, 73, 92, 93, 94, 105, 120, 48, + 120, 71, 72, 50, 46, 126, 49, 49, 124, 50, + 80, 46, 73, 90, 94, 97, 120, 48, 104, 92, + 120, 38, 39, 1, 11, 116, 117, 46, 53, 124, + 71, 124, 89, 120, 46, 38, 39, 49, 58, 49, + 51, 104, 34, 126, 89, 96, 74, 120, 95, 116, + 14, 118, 126, 118, 58, 106, 107, 119, 126, 74, + 120, 51, 126, 106 +}; + + /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 55, 56, 57, 58, 58, 60, 59, 61, 59, + 62, 59, 59, 59, 63, 63, 63, 63, 63, 63, + 63, 63, 63, 63, 63, 63, 63, 65, 64, 66, + 66, 67, 69, 68, 70, 70, 71, 71, 71, 71, + 72, 73, 73, 73, 73, 74, 74, 75, 76, 76, + 77, 79, 78, 80, 80, 80, 80, 81, 82, 82, + 83, 83, 83, 84, 86, 85, 87, 87, 88, 88, + 89, 89, 89, 89, 90, 90, 90, 90, 91, 91, + 91, 91, 91, 91, 92, 92, 92, 93, 93, 93, + 93, 95, 94, 96, 94, 97, 97, 98, 98, 99, + 101, 100, 102, 102, 102, 102, 103, 103, 104, 104, + 104, 104, 105, 106, 106, 107, 107, 108, 108, 109, + 109, 110, 110, 112, 111, 111, 113, 113, 114, 114, + 114, 114, 115, 115, 116, 116, 117, 117, 117, 117, + 117, 117, 117, 118, 118, 119, 119, 119, 120, 120, + 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, + 120, 120, 121, 121, 122, 122, 123, 123, 124, 124, + 124, 124, 124, 124, 125, 125, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, + 126, 126, 126, 126, 126, 126 }; -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 + /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 1, 3, 3, 0, 0, 3, 0, 5, + 0, 4, 2, 0, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 0, 6, 2, + 2, 2, 0, 7, 2, 0, 4, 3, 2, 0, + 2, 3, 3, 2, 1, 2, 1, 1, 2, 2, + 2, 0, 6, 4, 3, 2, 0, 1, 2, 2, + 4, 4, 1, 2, 0, 8, 2, 0, 2, 0, + 4, 3, 2, 0, 1, 3, 2, 1, 1, 3, + 2, 4, 2, 1, 2, 1, 1, 2, 3, 2, + 3, 0, 5, 0, 5, 1, 1, 2, 2, 2, + 0, 7, 3, 1, 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, 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, + 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 +}; -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY (-2) +#define YYEOF 0 -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ +#define YYACCEPT goto yyacceptlab +#define YYABORT goto yyabortlab +#define YYERROR goto yyerrorlab -#define YYFAIL goto yyerrlab #define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK (1); \ - goto yybackup; \ - } \ - else \ - { \ +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) - - -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (YYID (0)) -#endif + YYERROR; \ + } \ +while (0) +/* Error token number */ +#define YYTERROR 1 +#define YYERRCODE 256 -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ -#ifndef YY_LOCATION_PRINT -# if YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - -#ifdef YYLEX_PARAM -# define YYLEX yylex (&yylval, YYLEX_PARAM) -#else -# define YYLEX yylex (&yylval) -#endif /* Enable debugging if requested. */ #if YYDEBUG @@ -1133,54 +1033,46 @@ while (YYID (0)) # define YYFPRINTF fprintf # endif -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) +# define YYDPRINTF(Args) \ +do { \ + if (yydebug) \ + YYFPRINTF Args; \ +} while (0) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) +/* This macro is provided for backward compatibility. */ +#ifndef YY_LOCATION_PRINT +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +#endif -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (0) + + +/*----------------------------------------. +| Print this symbol's value on YYOUTPUT. | +`----------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif { + FILE *yyo = yyoutput; + YYUSE (yyo); if (!yyvaluep) return; # ifdef YYPRINT if (yytype < YYNTOKENS) YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); # endif - switch (yytype) - { - default: - break; - } + YYUSE (yytype); } @@ -1188,22 +1080,11 @@ yy_symbol_value_print (yyoutput, yytype, yyvaluep) | Print this symbol on YYOUTPUT. | `--------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif { - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + YYFPRINTF (yyoutput, "%s %s (", + yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]); yy_symbol_value_print (yyoutput, yytype, yyvaluep); YYFPRINTF (yyoutput, ")"); @@ -1214,16 +1095,8 @@ yy_symbol_print (yyoutput, yytype, yyvaluep) | TOP (included). | `------------------------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -#else -static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; -#endif { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) @@ -1234,49 +1107,42 @@ yy_stack_print (yybottom, yytop) YYFPRINTF (stderr, "\n"); } -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) +# define YY_STACK_PRINT(Bottom, Top) \ +do { \ + if (yydebug) \ + yy_stack_print ((Bottom), (Top)); \ +} while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule) -#else -static void -yy_reduce_print (yyvsp, yyrule) - YYSTYPE *yyvsp; - int yyrule; -#endif +yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule) { + unsigned long int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; - unsigned long int yylno = yyrline[yyrule]; YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); + yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - ); + yy_symbol_print (stderr, + yystos[yyssp[yyi + 1 - yynrhs]], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); YYFPRINTF (stderr, "\n"); } } -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule); \ -} while (YYID (0)) +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyssp, yyvsp, Rule); \ +} while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ @@ -1290,7 +1156,7 @@ int yydebug; /* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH +#ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif @@ -1305,7 +1171,6 @@ int yydebug; # define YYMAXDEPTH 10000 #endif - #if YYERROR_VERBOSE @@ -1314,15 +1179,8 @@ int yydebug; # define yystrlen strlen # else /* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static YYSIZE_T yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif { YYSIZE_T yylen; for (yylen = 0; yystr[yylen]; yylen++) @@ -1338,16 +1196,8 @@ yystrlen (yystr) # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static char * yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif { char *yyd = yydest; const char *yys = yysrc; @@ -1377,27 +1227,27 @@ yytnamerr (char *yyres, const char *yystr) char const *yyp = yystr; for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } do_not_strip_quotes: ; } @@ -1408,197 +1258,178 @@ 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) +/* 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. + + 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) { - int yyn = yypact[yystate]; + YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]); + YYSIZE_T yysize = yysize0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + /* Internationalized format string. */ + const char *yyformat = YY_NULLPTR; + /* 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: + - 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]; + { + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]); + if (! (yysize <= yysize1 + && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + } + } + } - if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else + 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_ + } + + { + YYSIZE_T yysize1 = yysize + yystrlen (yyformat); + if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + + if (*yymsg_alloc < yysize) { - 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; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - - if (yysize_overflow) - return YYSIZE_MAXIMUM; - - 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; + *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. | `-----------------------------------------------*/ -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) static void yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; -#endif { YYUSE (yyvaluep); - if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - switch (yytype) - { - - default: - break; - } + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN + YYUSE (yytype); + YY_IGNORE_MAYBE_UNINITIALIZED_END } -/* Prevent warnings from -Wmissing-prototypes. */ -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - - -/*-------------------------. -| yyparse or yypush_parse. | -`-------------------------*/ +/*----------. +| yyparse. | +`----------*/ -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) int yyparse (void) -#else -int -yyparse () - -#endif -#endif { /* The lookahead symbol. */ int yychar; + /* The semantic value of the lookahead symbol. */ -YYSTYPE yylval; +/* Default value used for initialization, for pacifying older GCCs + or non-GCC compilers. */ +YY_INITIAL_VALUE (static YYSTYPE yyval_default;) +YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default); /* Number of syntax errors so far. */ int yynerrs; @@ -1608,10 +1439,10 @@ YYSTYPE yylval; int yyerrstatus; /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. + 'yyss': related to states. + 'yyvs': related to semantic values. - Refer to the stacks thru separate pointers, to allow yyoverflow + Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ @@ -1629,7 +1460,7 @@ YYSTYPE yylval; int yyn; int yyresult; /* Lookahead token as an internal (translated) token number. */ - int yytoken; + int yytoken = 0; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; @@ -1647,9 +1478,8 @@ YYSTYPE yylval; Keep to zero when no symbol should be popped. */ int yylen = 0; - yytoken = 0; - yyss = yyssa; - yyvs = yyvsa; + yyssp = yyss = yyssa; + yyvsp = yyvs = yyvsa; yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); @@ -1658,14 +1488,6 @@ YYSTYPE yylval; yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - yyssp = yyss; - yyvsp = yyvs; - goto yysetstate; /*------------------------------------------------------------. @@ -1686,23 +1508,23 @@ YYSTYPE yylval; #ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; + /* Give user a chance to reallocate the stack. Use copies of + these so that the &'s don't force the real ones into + memory. */ + YYSTYPE *yyvs1 = yyvs; + yytype_int16 *yyss1 = yyss; + + /* Each stack pointer address is followed by the size of the + data in use in that stack, in bytes. This used to be a + conditional around just the two extra args, but that might + be undefined if yyoverflow is a macro. */ + yyoverflow (YY_("memory exhausted"), + &yyss1, yysize * sizeof (*yyssp), + &yyvs1, yysize * sizeof (*yyvsp), + &yystacksize); + + yyss = yyss1; + yyvs = yyvs1; } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE @@ -1710,22 +1532,22 @@ YYSTYPE yylval; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; + yystacksize = YYMAXDEPTH; { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); + yytype_int16 *yyss1 = yyss; + union yyalloc *yyptr = + (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); + if (! yyptr) + goto yyexhaustedlab; + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); } # endif #endif /* no yyoverflow */ @@ -1734,10 +1556,10 @@ YYSTYPE yylval; yyvsp = yyvs + yysize - 1; YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); + (unsigned long int) yystacksize)); if (yyss + yystacksize - 1 <= yyssp) - YYABORT; + YYABORT; } YYDPRINTF ((stderr, "Entering state %d\n", yystate)); @@ -1757,7 +1579,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. */ @@ -1766,7 +1588,7 @@ yybackup: if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; + yychar = yylex (&yylval); } if (yychar <= YYEOF) @@ -1788,8 +1610,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; } @@ -1806,7 +1628,9 @@ yybackup: yychar = YYEMPTY; yystate = yyn; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END goto yynewstate; @@ -1829,7 +1653,7 @@ yyreduce: yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. + '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison @@ -1843,391 +1667,353 @@ yyreduce: switch (yyn) { case 2: - -/* Line 1455 of yacc.c */ -#line 115 "../Slice/Grammar.y" +#line 116 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 1674 "Grammar.tab.c" /* yacc.c:1646 */ break; case 3: - -/* Line 1455 of yacc.c */ -#line 123 "../Slice/Grammar.y" +#line 124 "../Slice/Grammar.y" /* yacc.c:1646 */ { - (yyval) = (yyvsp[(2) - (3)]); -;} + (yyval) = (yyvsp[-1]); +} +#line 1682 "Grammar.tab.c" /* yacc.c:1646 */ break; case 4: - -/* Line 1455 of yacc.c */ -#line 132 "../Slice/Grammar.y" +#line 133 "../Slice/Grammar.y" /* yacc.c:1646 */ { - (yyval) = (yyvsp[(2) - (3)]); -;} + (yyval) = (yyvsp[-1]); +} +#line 1690 "Grammar.tab.c" /* yacc.c:1646 */ break; case 5: - -/* Line 1455 of yacc.c */ -#line 136 "../Slice/Grammar.y" +#line 137 "../Slice/Grammar.y" /* yacc.c:1646 */ { (yyval) = new StringListTok; -;} +} +#line 1698 "Grammar.tab.c" /* yacc.c:1646 */ break; case 6: - -/* Line 1455 of yacc.c */ -#line 145 "../Slice/Grammar.y" +#line 146 "../Slice/Grammar.y" /* yacc.c:1646 */ { - StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(1) - (1)])); + StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[0])); if(!metaData->v.empty()) { unit->addGlobalMetaData(metaData->v); } -;} +} +#line 1710 "Grammar.tab.c" /* yacc.c:1646 */ break; case 8: - -/* Line 1455 of yacc.c */ -#line 154 "../Slice/Grammar.y" +#line 155 "../Slice/Grammar.y" /* yacc.c:1646 */ { - StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(1) - (2)])); - ContainedPtr contained = ContainedPtr::dynamicCast((yyvsp[(2) - (2)])); + StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[-1])); + ContainedPtr contained = ContainedPtr::dynamicCast((yyvsp[0])); if(contained && !metaData->v.empty()) { - contained->setMetaData(metaData->v); + contained->setMetaData(metaData->v); } -;} +} +#line 1723 "Grammar.tab.c" /* yacc.c:1646 */ break; case 10: - -/* Line 1455 of yacc.c */ -#line 164 "../Slice/Grammar.y" +#line 165 "../Slice/Grammar.y" /* yacc.c:1646 */ { yyerrok; -;} +} +#line 1731 "Grammar.tab.c" /* yacc.c:1646 */ break; case 12: - -/* Line 1455 of yacc.c */ -#line 169 "../Slice/Grammar.y" +#line 170 "../Slice/Grammar.y" /* yacc.c:1646 */ { unit->error("`;' missing after definition"); -;} +} +#line 1739 "Grammar.tab.c" /* yacc.c:1646 */ break; case 13: - -/* Line 1455 of yacc.c */ -#line 173 "../Slice/Grammar.y" +#line 174 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 1746 "Grammar.tab.c" /* yacc.c:1646 */ break; case 14: - -/* Line 1455 of yacc.c */ -#line 181 "../Slice/Grammar.y" +#line 182 "../Slice/Grammar.y" /* yacc.c:1646 */ { - assert((yyvsp[(1) - (1)]) == 0 || ModulePtr::dynamicCast((yyvsp[(1) - (1)]))); -;} + assert((yyvsp[0]) == 0 || ModulePtr::dynamicCast((yyvsp[0]))); +} +#line 1754 "Grammar.tab.c" /* yacc.c:1646 */ break; case 15: - -/* Line 1455 of yacc.c */ -#line 185 "../Slice/Grammar.y" +#line 186 "../Slice/Grammar.y" /* yacc.c:1646 */ { - assert((yyvsp[(1) - (1)]) == 0 || ClassDeclPtr::dynamicCast((yyvsp[(1) - (1)]))); -;} + assert((yyvsp[0]) == 0 || ClassDeclPtr::dynamicCast((yyvsp[0]))); +} +#line 1762 "Grammar.tab.c" /* yacc.c:1646 */ break; case 16: - -/* Line 1455 of yacc.c */ -#line 189 "../Slice/Grammar.y" +#line 190 "../Slice/Grammar.y" /* yacc.c:1646 */ { - assert((yyvsp[(1) - (1)]) == 0 || ClassDefPtr::dynamicCast((yyvsp[(1) - (1)]))); -;} + assert((yyvsp[0]) == 0 || ClassDefPtr::dynamicCast((yyvsp[0]))); +} +#line 1770 "Grammar.tab.c" /* yacc.c:1646 */ break; case 17: - -/* Line 1455 of yacc.c */ -#line 193 "../Slice/Grammar.y" +#line 194 "../Slice/Grammar.y" /* yacc.c:1646 */ { - assert((yyvsp[(1) - (1)]) == 0 || ClassDeclPtr::dynamicCast((yyvsp[(1) - (1)]))); -;} + assert((yyvsp[0]) == 0 || ClassDeclPtr::dynamicCast((yyvsp[0]))); +} +#line 1778 "Grammar.tab.c" /* yacc.c:1646 */ break; case 18: - -/* Line 1455 of yacc.c */ -#line 197 "../Slice/Grammar.y" +#line 198 "../Slice/Grammar.y" /* yacc.c:1646 */ { - assert((yyvsp[(1) - (1)]) == 0 || ClassDefPtr::dynamicCast((yyvsp[(1) - (1)]))); -;} + assert((yyvsp[0]) == 0 || ClassDefPtr::dynamicCast((yyvsp[0]))); +} +#line 1786 "Grammar.tab.c" /* yacc.c:1646 */ break; case 19: - -/* Line 1455 of yacc.c */ -#line 201 "../Slice/Grammar.y" +#line 202 "../Slice/Grammar.y" /* yacc.c:1646 */ { - assert((yyvsp[(1) - (1)]) == 0); -;} + assert((yyvsp[0]) == 0); +} +#line 1794 "Grammar.tab.c" /* yacc.c:1646 */ break; case 20: - -/* Line 1455 of yacc.c */ -#line 205 "../Slice/Grammar.y" +#line 206 "../Slice/Grammar.y" /* yacc.c:1646 */ { - assert((yyvsp[(1) - (1)]) == 0 || ExceptionPtr::dynamicCast((yyvsp[(1) - (1)]))); -;} + assert((yyvsp[0]) == 0 || ExceptionPtr::dynamicCast((yyvsp[0]))); +} +#line 1802 "Grammar.tab.c" /* yacc.c:1646 */ break; case 21: - -/* Line 1455 of yacc.c */ -#line 209 "../Slice/Grammar.y" +#line 210 "../Slice/Grammar.y" /* yacc.c:1646 */ { - assert((yyvsp[(1) - (1)]) == 0); -;} + assert((yyvsp[0]) == 0); +} +#line 1810 "Grammar.tab.c" /* yacc.c:1646 */ break; case 22: - -/* Line 1455 of yacc.c */ -#line 213 "../Slice/Grammar.y" +#line 214 "../Slice/Grammar.y" /* yacc.c:1646 */ { - assert((yyvsp[(1) - (1)]) == 0 || StructPtr::dynamicCast((yyvsp[(1) - (1)]))); -;} + assert((yyvsp[0]) == 0 || StructPtr::dynamicCast((yyvsp[0]))); +} +#line 1818 "Grammar.tab.c" /* yacc.c:1646 */ break; case 23: - -/* Line 1455 of yacc.c */ -#line 217 "../Slice/Grammar.y" +#line 218 "../Slice/Grammar.y" /* yacc.c:1646 */ { - assert((yyvsp[(1) - (1)]) == 0 || SequencePtr::dynamicCast((yyvsp[(1) - (1)]))); -;} + assert((yyvsp[0]) == 0 || SequencePtr::dynamicCast((yyvsp[0]))); +} +#line 1826 "Grammar.tab.c" /* yacc.c:1646 */ break; case 24: - -/* Line 1455 of yacc.c */ -#line 221 "../Slice/Grammar.y" +#line 222 "../Slice/Grammar.y" /* yacc.c:1646 */ { - assert((yyvsp[(1) - (1)]) == 0 || DictionaryPtr::dynamicCast((yyvsp[(1) - (1)]))); -;} + assert((yyvsp[0]) == 0 || DictionaryPtr::dynamicCast((yyvsp[0]))); +} +#line 1834 "Grammar.tab.c" /* yacc.c:1646 */ break; case 25: - -/* Line 1455 of yacc.c */ -#line 225 "../Slice/Grammar.y" +#line 226 "../Slice/Grammar.y" /* yacc.c:1646 */ { - assert((yyvsp[(1) - (1)]) == 0 || EnumPtr::dynamicCast((yyvsp[(1) - (1)]))); -;} + assert((yyvsp[0]) == 0 || EnumPtr::dynamicCast((yyvsp[0]))); +} +#line 1842 "Grammar.tab.c" /* yacc.c:1646 */ break; case 26: - -/* Line 1455 of yacc.c */ -#line 229 "../Slice/Grammar.y" +#line 230 "../Slice/Grammar.y" /* yacc.c:1646 */ { - assert((yyvsp[(1) - (1)]) == 0 || ConstPtr::dynamicCast((yyvsp[(1) - (1)]))); -;} + assert((yyvsp[0]) == 0 || ConstPtr::dynamicCast((yyvsp[0]))); +} +#line 1850 "Grammar.tab.c" /* yacc.c:1646 */ break; case 27: - -/* Line 1455 of yacc.c */ -#line 238 "../Slice/Grammar.y" +#line 239 "../Slice/Grammar.y" /* yacc.c:1646 */ { unit->setSeenDefinition(); - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[0])); ContainerPtr cont = unit->currentContainer(); ModulePtr module = cont->createModule(ident->v); if(module) { - cont->checkIntroduced(ident->v, module); - unit->pushContainer(module); - (yyval) = module; + cont->checkIntroduced(ident->v, module); + unit->pushContainer(module); + (yyval) = module; } else { (yyval) = 0; } -;} +} +#line 1871 "Grammar.tab.c" /* yacc.c:1646 */ break; case 28: - -/* Line 1455 of yacc.c */ -#line 255 "../Slice/Grammar.y" +#line 256 "../Slice/Grammar.y" /* yacc.c:1646 */ { - if((yyvsp[(3) - (6)])) + if((yyvsp[-3])) { - unit->popContainer(); - (yyval) = (yyvsp[(3) - (6)]); + unit->popContainer(); + (yyval) = (yyvsp[-3]); } else { (yyval) = 0; } -;} +} +#line 1887 "Grammar.tab.c" /* yacc.c:1646 */ break; case 29: - -/* Line 1455 of yacc.c */ -#line 272 "../Slice/Grammar.y" +#line 273 "../Slice/Grammar.y" /* yacc.c:1646 */ { - (yyval) = (yyvsp[(2) - (2)]); -;} + (yyval) = (yyvsp[0]); +} +#line 1895 "Grammar.tab.c" /* yacc.c:1646 */ break; case 30: - -/* Line 1455 of yacc.c */ -#line 276 "../Slice/Grammar.y" +#line 277 "../Slice/Grammar.y" /* yacc.c:1646 */ { - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[0])); unit->error("keyword `" + ident->v + "' cannot be used as exception name"); - (yyval) = (yyvsp[(2) - (2)]); // Dummy -;} + (yyval) = (yyvsp[0]); // Dummy +} +#line 1905 "Grammar.tab.c" /* yacc.c:1646 */ break; case 31: - -/* Line 1455 of yacc.c */ -#line 287 "../Slice/Grammar.y" +#line 288 "../Slice/Grammar.y" /* yacc.c:1646 */ { unit->error("exceptions cannot be forward declared"); (yyval) = 0; -;} +} +#line 1914 "Grammar.tab.c" /* yacc.c:1646 */ break; case 32: - -/* Line 1455 of yacc.c */ -#line 297 "../Slice/Grammar.y" +#line 298 "../Slice/Grammar.y" /* yacc.c:1646 */ { - BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (3)])); - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (3)])); - ExceptionPtr base = ExceptionPtr::dynamicCast((yyvsp[(3) - (3)])); + BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[-2])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[-1])); + ExceptionPtr base = ExceptionPtr::dynamicCast((yyvsp[0])); ContainerPtr cont = unit->currentContainer(); ExceptionPtr ex = cont->createException(ident->v, base, local->v); if(ex) { - cont->checkIntroduced(ident->v, ex); - unit->pushContainer(ex); + cont->checkIntroduced(ident->v, ex); + unit->pushContainer(ex); } (yyval) = ex; -;} +} +#line 1932 "Grammar.tab.c" /* yacc.c:1646 */ break; case 33: - -/* Line 1455 of yacc.c */ -#line 311 "../Slice/Grammar.y" +#line 312 "../Slice/Grammar.y" /* yacc.c:1646 */ { - if((yyvsp[(4) - (7)])) + if((yyvsp[-3])) { - unit->popContainer(); + unit->popContainer(); } - (yyval) = (yyvsp[(4) - (7)]); -;} + (yyval) = (yyvsp[-3]); +} +#line 1944 "Grammar.tab.c" /* yacc.c:1646 */ break; case 34: - -/* Line 1455 of yacc.c */ -#line 324 "../Slice/Grammar.y" +#line 325 "../Slice/Grammar.y" /* yacc.c:1646 */ { - StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[0])); ContainerPtr cont = unit->currentContainer(); ContainedPtr contained = cont->lookupException(scoped->v); cont->checkIntroduced(scoped->v); (yyval) = contained; -;} +} +#line 1956 "Grammar.tab.c" /* yacc.c:1646 */ break; case 35: - -/* Line 1455 of yacc.c */ -#line 332 "../Slice/Grammar.y" +#line 333 "../Slice/Grammar.y" /* yacc.c:1646 */ { (yyval) = 0; -;} +} +#line 1964 "Grammar.tab.c" /* yacc.c:1646 */ break; case 36: - -/* Line 1455 of yacc.c */ -#line 341 "../Slice/Grammar.y" +#line 342 "../Slice/Grammar.y" /* yacc.c:1646 */ { - StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(1) - (4)])); - ContainedPtr contained = ContainedPtr::dynamicCast((yyvsp[(2) - (4)])); + StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[-3])); + ContainedPtr contained = ContainedPtr::dynamicCast((yyvsp[-2])); if(contained && !metaData->v.empty()) { - contained->setMetaData(metaData->v); + contained->setMetaData(metaData->v); } -;} +} +#line 1977 "Grammar.tab.c" /* yacc.c:1646 */ break; case 37: - -/* Line 1455 of yacc.c */ -#line 350 "../Slice/Grammar.y" +#line 351 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 1984 "Grammar.tab.c" /* yacc.c:1646 */ break; case 38: - -/* Line 1455 of yacc.c */ -#line 353 "../Slice/Grammar.y" +#line 354 "../Slice/Grammar.y" /* yacc.c:1646 */ { unit->error("`;' missing after definition"); -;} +} +#line 1992 "Grammar.tab.c" /* yacc.c:1646 */ break; case 39: - -/* Line 1455 of yacc.c */ -#line 357 "../Slice/Grammar.y" +#line 358 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 1999 "Grammar.tab.c" /* yacc.c:1646 */ break; case 40: - -/* Line 1455 of yacc.c */ -#line 365 "../Slice/Grammar.y" +#line 366 "../Slice/Grammar.y" /* yacc.c:1646 */ { - TypePtr type = TypePtr::dynamicCast((yyvsp[(1) - (2)])); - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + TypePtr type = TypePtr::dynamicCast((yyvsp[-1])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[0])); TypeStringTokPtr typestring = new TypeStringTok; typestring->v = make_pair(type, ident->v); (yyval) = typestring; -;} +} +#line 2011 "Grammar.tab.c" /* yacc.c:1646 */ break; case 41: - -/* Line 1455 of yacc.c */ -#line 378 "../Slice/Grammar.y" +#line 379 "../Slice/Grammar.y" /* yacc.c:1646 */ { - IntegerTokPtr i = IntegerTokPtr::dynamicCast((yyvsp[(2) - (3)])); + IntegerTokPtr i = IntegerTokPtr::dynamicCast((yyvsp[-1])); int tag; if(i->v < 0 || i->v > Int32Max) @@ -2244,15 +2030,14 @@ yyreduce: m->v.optional = tag >= 0; m->v.tag = tag; (yyval) = m; -;} +} +#line 2035 "Grammar.tab.c" /* yacc.c:1646 */ break; case 42: - -/* Line 1455 of yacc.c */ -#line 398 "../Slice/Grammar.y" +#line 399 "../Slice/Grammar.y" /* yacc.c:1646 */ { - StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(2) - (3)])); + StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[-1])); ContainerPtr cont = unit->currentContainer(); assert(cont); @@ -2305,106 +2090,98 @@ yyreduce: m->v.optional = tag >= 0; m->v.tag = tag; (yyval) = m; -;} +} +#line 2095 "Grammar.tab.c" /* yacc.c:1646 */ break; case 43: - -/* Line 1455 of yacc.c */ -#line 454 "../Slice/Grammar.y" +#line 455 "../Slice/Grammar.y" /* yacc.c:1646 */ { unit->error("missing tag for optional"); OptionalDefTokPtr m = new OptionalDefTok; // Dummy m->v.optional = false; m->v.tag = -1; (yyval) = m; -;} +} +#line 2107 "Grammar.tab.c" /* yacc.c:1646 */ break; case 44: - -/* Line 1455 of yacc.c */ -#line 462 "../Slice/Grammar.y" +#line 463 "../Slice/Grammar.y" /* yacc.c:1646 */ { unit->error("missing tag for optional"); OptionalDefTokPtr m = new OptionalDefTok; // Dummy m->v.optional = false; m->v.tag = -1; (yyval) = m; -;} +} +#line 2119 "Grammar.tab.c" /* yacc.c:1646 */ break; case 45: - -/* Line 1455 of yacc.c */ -#line 475 "../Slice/Grammar.y" +#line 476 "../Slice/Grammar.y" /* yacc.c:1646 */ { - OptionalDefTokPtr m = OptionalDefTokPtr::dynamicCast((yyvsp[(1) - (2)])); - TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + OptionalDefTokPtr m = OptionalDefTokPtr::dynamicCast((yyvsp[-1])); + TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast((yyvsp[0])); m->v.type = ts->v.first; m->v.name = ts->v.second; (yyval) = m; -;} +} +#line 2131 "Grammar.tab.c" /* yacc.c:1646 */ break; case 46: - -/* Line 1455 of yacc.c */ -#line 483 "../Slice/Grammar.y" +#line 484 "../Slice/Grammar.y" /* yacc.c:1646 */ { - TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast((yyvsp[(1) - (1)])); + TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast((yyvsp[0])); OptionalDefTokPtr m = new OptionalDefTok; m->v.type = ts->v.first; m->v.name = ts->v.second; m->v.optional = false; m->v.tag = -1; (yyval) = m; -;} +} +#line 2145 "Grammar.tab.c" /* yacc.c:1646 */ break; case 48: - -/* Line 1455 of yacc.c */ -#line 504 "../Slice/Grammar.y" +#line 505 "../Slice/Grammar.y" /* yacc.c:1646 */ { - (yyval) = (yyvsp[(2) - (2)]); -;} + (yyval) = (yyvsp[0]); +} +#line 2153 "Grammar.tab.c" /* yacc.c:1646 */ break; case 49: - -/* Line 1455 of yacc.c */ -#line 508 "../Slice/Grammar.y" +#line 509 "../Slice/Grammar.y" /* yacc.c:1646 */ { - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[0])); unit->error("keyword `" + ident->v + "' cannot be used as struct name"); - (yyval) = (yyvsp[(2) - (2)]); // Dummy -;} + (yyval) = (yyvsp[0]); // Dummy +} +#line 2163 "Grammar.tab.c" /* yacc.c:1646 */ break; case 50: - -/* Line 1455 of yacc.c */ -#line 519 "../Slice/Grammar.y" +#line 520 "../Slice/Grammar.y" /* yacc.c:1646 */ { unit->error("structs cannot be forward declared"); (yyval) = 0; // Dummy -;} +} +#line 2172 "Grammar.tab.c" /* yacc.c:1646 */ break; case 51: - -/* Line 1455 of yacc.c */ -#line 529 "../Slice/Grammar.y" +#line 530 "../Slice/Grammar.y" /* yacc.c:1646 */ { - BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (2)])); - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[-1])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[0])); ContainerPtr cont = unit->currentContainer(); StructPtr st = cont->createStruct(ident->v, local->v); if(st) { - cont->checkIntroduced(ident->v, st); - unit->pushContainer(st); + cont->checkIntroduced(ident->v, st); + unit->pushContainer(st); } else { @@ -2413,19 +2190,18 @@ yyreduce: unit->pushContainer(st); } (yyval) = st; -;} +} +#line 2195 "Grammar.tab.c" /* yacc.c:1646 */ break; case 52: - -/* Line 1455 of yacc.c */ -#line 548 "../Slice/Grammar.y" +#line 549 "../Slice/Grammar.y" /* yacc.c:1646 */ { - if((yyvsp[(3) - (6)])) + if((yyvsp[-3])) { - unit->popContainer(); + unit->popContainer(); } - (yyval) = (yyvsp[(3) - (6)]); + (yyval) = (yyvsp[-3]); // // Empty structures are not allowed @@ -2434,76 +2210,69 @@ yyreduce: assert(st); if(st->dataMembers().empty()) { - unit->error("struct `" + st->name() + "' must have at least one member"); // $$ is a dummy + unit->error("struct `" + st->name() + "' must have at least one member"); // $$ is a dummy } -;} +} +#line 2217 "Grammar.tab.c" /* yacc.c:1646 */ break; case 53: - -/* Line 1455 of yacc.c */ -#line 571 "../Slice/Grammar.y" +#line 572 "../Slice/Grammar.y" /* yacc.c:1646 */ { - StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(1) - (4)])); - ContainedPtr contained = ContainedPtr::dynamicCast((yyvsp[(2) - (4)])); + StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[-3])); + ContainedPtr contained = ContainedPtr::dynamicCast((yyvsp[-2])); if(contained && !metaData->v.empty()) { - contained->setMetaData(metaData->v); + contained->setMetaData(metaData->v); } -;} +} +#line 2230 "Grammar.tab.c" /* yacc.c:1646 */ break; case 54: - -/* Line 1455 of yacc.c */ -#line 580 "../Slice/Grammar.y" +#line 581 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 2237 "Grammar.tab.c" /* yacc.c:1646 */ break; case 55: - -/* Line 1455 of yacc.c */ -#line 583 "../Slice/Grammar.y" +#line 584 "../Slice/Grammar.y" /* yacc.c:1646 */ { unit->error("`;' missing after definition"); -;} +} +#line 2245 "Grammar.tab.c" /* yacc.c:1646 */ break; case 56: - -/* Line 1455 of yacc.c */ -#line 587 "../Slice/Grammar.y" +#line 588 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 2252 "Grammar.tab.c" /* yacc.c:1646 */ break; case 58: - -/* Line 1455 of yacc.c */ -#line 601 "../Slice/Grammar.y" +#line 602 "../Slice/Grammar.y" /* yacc.c:1646 */ { - (yyval) = (yyvsp[(2) - (2)]); -;} + (yyval) = (yyvsp[0]); +} +#line 2260 "Grammar.tab.c" /* yacc.c:1646 */ break; case 59: - -/* Line 1455 of yacc.c */ -#line 605 "../Slice/Grammar.y" +#line 606 "../Slice/Grammar.y" /* yacc.c:1646 */ { - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[0])); unit->error("keyword `" + ident->v + "' cannot be used as class name"); - (yyval) = (yyvsp[(2) - (2)]); // Dummy -;} + (yyval) = (yyvsp[0]); // Dummy +} +#line 2270 "Grammar.tab.c" /* yacc.c:1646 */ break; case 60: - -/* Line 1455 of yacc.c */ -#line 616 "../Slice/Grammar.y" +#line 617 "../Slice/Grammar.y" /* yacc.c:1646 */ { - IceUtil::Int64 id = IntegerTokPtr::dynamicCast((yyvsp[(3) - (4)]))->v; + IceUtil::Int64 id = IntegerTokPtr::dynamicCast((yyvsp[-1]))->v; if(id < 0) { unit->error("invalid compact id for class: id must be a positive integer"); @@ -2522,18 +2291,17 @@ yyreduce: } ClassIdTokPtr classId = new ClassIdTok(); - classId->v = StringTokPtr::dynamicCast((yyvsp[(2) - (4)]))->v; + classId->v = StringTokPtr::dynamicCast((yyvsp[-2]))->v; classId->t = static_cast<int>(id); (yyval) = classId; -;} +} +#line 2299 "Grammar.tab.c" /* yacc.c:1646 */ break; case 61: - -/* Line 1455 of yacc.c */ -#line 641 "../Slice/Grammar.y" +#line 642 "../Slice/Grammar.y" /* yacc.c:1646 */ { - StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(3) - (4)])); + StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[-1])); ContainerPtr cont = unit->currentContainer(); assert(cont); @@ -2591,194 +2359,181 @@ yyreduce: } ClassIdTokPtr classId = new ClassIdTok(); - classId->v = StringTokPtr::dynamicCast((yyvsp[(2) - (4)]))->v; + classId->v = StringTokPtr::dynamicCast((yyvsp[-2]))->v; classId->t = id; (yyval) = classId; -;} +} +#line 2368 "Grammar.tab.c" /* yacc.c:1646 */ break; case 62: - -/* Line 1455 of yacc.c */ -#line 706 "../Slice/Grammar.y" +#line 707 "../Slice/Grammar.y" /* yacc.c:1646 */ { ClassIdTokPtr classId = new ClassIdTok(); - classId->v = StringTokPtr::dynamicCast((yyvsp[(1) - (1)]))->v; + classId->v = StringTokPtr::dynamicCast((yyvsp[0]))->v; classId->t = -1; (yyval) = classId; -;} +} +#line 2379 "Grammar.tab.c" /* yacc.c:1646 */ break; case 63: - -/* Line 1455 of yacc.c */ -#line 718 "../Slice/Grammar.y" +#line 719 "../Slice/Grammar.y" /* yacc.c:1646 */ { - BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (2)])); - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[-1])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[0])); ContainerPtr cont = unit->currentContainer(); ClassDeclPtr cl = cont->createClassDecl(ident->v, false, local->v); (yyval) = cl; -;} +} +#line 2391 "Grammar.tab.c" /* yacc.c:1646 */ break; case 64: - -/* Line 1455 of yacc.c */ -#line 731 "../Slice/Grammar.y" +#line 732 "../Slice/Grammar.y" /* yacc.c:1646 */ { - BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (4)])); - ClassIdTokPtr ident = ClassIdTokPtr::dynamicCast((yyvsp[(2) - (4)])); + BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[-3])); + ClassIdTokPtr ident = ClassIdTokPtr::dynamicCast((yyvsp[-2])); ContainerPtr cont = unit->currentContainer(); - ClassDefPtr base = ClassDefPtr::dynamicCast((yyvsp[(3) - (4)])); - ClassListTokPtr bases = ClassListTokPtr::dynamicCast((yyvsp[(4) - (4)])); + ClassDefPtr base = ClassDefPtr::dynamicCast((yyvsp[-1])); + ClassListTokPtr bases = ClassListTokPtr::dynamicCast((yyvsp[0])); if(base) { - bases->v.push_front(base); + bases->v.push_front(base); } ClassDefPtr cl = cont->createClassDef(ident->v, ident->t, false, bases->v, local->v); if(cl) { - cont->checkIntroduced(ident->v, cl); - unit->pushContainer(cl); - (yyval) = cl; + cont->checkIntroduced(ident->v, cl); + unit->pushContainer(cl); + (yyval) = cl; } else { (yyval) = 0; } -;} +} +#line 2418 "Grammar.tab.c" /* yacc.c:1646 */ break; case 65: - -/* Line 1455 of yacc.c */ -#line 754 "../Slice/Grammar.y" +#line 755 "../Slice/Grammar.y" /* yacc.c:1646 */ { - if((yyvsp[(5) - (8)])) + if((yyvsp[-3])) { - unit->popContainer(); - (yyval) = (yyvsp[(5) - (8)]); + unit->popContainer(); + (yyval) = (yyvsp[-3]); } else { (yyval) = 0; } -;} +} +#line 2434 "Grammar.tab.c" /* yacc.c:1646 */ break; case 66: - -/* Line 1455 of yacc.c */ -#line 771 "../Slice/Grammar.y" +#line 772 "../Slice/Grammar.y" /* yacc.c:1646 */ { - StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[0])); ContainerPtr cont = unit->currentContainer(); TypeList types = cont->lookupType(scoped->v); (yyval) = 0; if(!types.empty()) { - ClassDeclPtr cl = ClassDeclPtr::dynamicCast(types.front()); - if(!cl || cl->isInterface()) - { - string msg = "`"; - msg += scoped->v; - msg += "' is not a class"; - unit->error(msg); - } - else - { - ClassDefPtr def = cl->definition(); - if(!def) - { - string msg = "`"; - msg += scoped->v; - msg += "' has been declared but not defined"; - unit->error(msg); - } - else - { - cont->checkIntroduced(scoped->v); - (yyval) = def; - } - } + ClassDeclPtr cl = ClassDeclPtr::dynamicCast(types.front()); + if(!cl || cl->isInterface()) + { + string msg = "`"; + msg += scoped->v; + msg += "' is not a class"; + unit->error(msg); + } + else + { + ClassDefPtr def = cl->definition(); + if(!def) + { + string msg = "`"; + msg += scoped->v; + msg += "' has been declared but not defined"; + unit->error(msg); + } + else + { + cont->checkIntroduced(scoped->v); + (yyval) = def; + } + } } -;} +} +#line 2472 "Grammar.tab.c" /* yacc.c:1646 */ break; case 67: - -/* Line 1455 of yacc.c */ -#line 805 "../Slice/Grammar.y" +#line 806 "../Slice/Grammar.y" /* yacc.c:1646 */ { (yyval) = 0; -;} +} +#line 2480 "Grammar.tab.c" /* yacc.c:1646 */ break; case 68: - -/* Line 1455 of yacc.c */ -#line 814 "../Slice/Grammar.y" +#line 815 "../Slice/Grammar.y" /* yacc.c:1646 */ { - (yyval) = (yyvsp[(2) - (2)]); -;} + (yyval) = (yyvsp[0]); +} +#line 2488 "Grammar.tab.c" /* yacc.c:1646 */ break; case 69: - -/* Line 1455 of yacc.c */ -#line 818 "../Slice/Grammar.y" +#line 819 "../Slice/Grammar.y" /* yacc.c:1646 */ { (yyval) = new ClassListTok; -;} +} +#line 2496 "Grammar.tab.c" /* yacc.c:1646 */ break; case 70: - -/* Line 1455 of yacc.c */ -#line 827 "../Slice/Grammar.y" +#line 828 "../Slice/Grammar.y" /* yacc.c:1646 */ { - StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(1) - (4)])); - ContainedPtr contained = ContainedPtr::dynamicCast((yyvsp[(2) - (4)])); + StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[-3])); + ContainedPtr contained = ContainedPtr::dynamicCast((yyvsp[-2])); if(contained && !metaData->v.empty()) { - contained->setMetaData(metaData->v); + contained->setMetaData(metaData->v); } -;} +} +#line 2509 "Grammar.tab.c" /* yacc.c:1646 */ break; case 71: - -/* Line 1455 of yacc.c */ -#line 836 "../Slice/Grammar.y" +#line 837 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 2516 "Grammar.tab.c" /* yacc.c:1646 */ break; case 72: - -/* Line 1455 of yacc.c */ -#line 839 "../Slice/Grammar.y" +#line 840 "../Slice/Grammar.y" /* yacc.c:1646 */ { unit->error("`;' missing after definition"); -;} +} +#line 2524 "Grammar.tab.c" /* yacc.c:1646 */ break; case 73: - -/* Line 1455 of yacc.c */ -#line 843 "../Slice/Grammar.y" +#line 844 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 2531 "Grammar.tab.c" /* yacc.c:1646 */ break; case 74: - -/* Line 1455 of yacc.c */ -#line 851 "../Slice/Grammar.y" +#line 852 "../Slice/Grammar.y" /* yacc.c:1646 */ { - OptionalDefTokPtr def = OptionalDefTokPtr::dynamicCast((yyvsp[(1) - (1)])); + OptionalDefTokPtr def = OptionalDefTokPtr::dynamicCast((yyvsp[0])); ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); DataMemberPtr dm; if(cl) @@ -2797,16 +2552,15 @@ yyreduce: } unit->currentContainer()->checkIntroduced(def->v.name, dm); (yyval) = dm; -;} +} +#line 2557 "Grammar.tab.c" /* yacc.c:1646 */ break; case 75: - -/* Line 1455 of yacc.c */ -#line 873 "../Slice/Grammar.y" +#line 874 "../Slice/Grammar.y" /* yacc.c:1646 */ { - OptionalDefTokPtr def = OptionalDefTokPtr::dynamicCast((yyvsp[(1) - (3)])); - ConstDefTokPtr value = ConstDefTokPtr::dynamicCast((yyvsp[(3) - (3)])); + OptionalDefTokPtr def = OptionalDefTokPtr::dynamicCast((yyvsp[-2])); + ConstDefTokPtr value = ConstDefTokPtr::dynamicCast((yyvsp[0])); ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); DataMemberPtr dm; @@ -2829,16 +2583,15 @@ yyreduce: } unit->currentContainer()->checkIntroduced(def->v.name, dm); (yyval) = dm; -;} +} +#line 2588 "Grammar.tab.c" /* yacc.c:1646 */ break; case 76: - -/* Line 1455 of yacc.c */ -#line 900 "../Slice/Grammar.y" +#line 901 "../Slice/Grammar.y" /* yacc.c:1646 */ { - TypePtr type = TypePtr::dynamicCast((yyvsp[(1) - (2)])); - string name = StringTokPtr::dynamicCast((yyvsp[(2) - (2)]))->v; + TypePtr type = TypePtr::dynamicCast((yyvsp[-1])); + string name = StringTokPtr::dynamicCast((yyvsp[0]))->v; ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); if(cl) { @@ -2856,15 +2609,14 @@ yyreduce: } assert((yyval)); unit->error("keyword `" + name + "' cannot be used as data member name"); -;} +} +#line 2614 "Grammar.tab.c" /* yacc.c:1646 */ break; case 77: - -/* Line 1455 of yacc.c */ -#line 922 "../Slice/Grammar.y" +#line 923 "../Slice/Grammar.y" /* yacc.c:1646 */ { - TypePtr type = TypePtr::dynamicCast((yyvsp[(1) - (1)])); + TypePtr type = TypePtr::dynamicCast((yyvsp[0])); ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); if(cl) { @@ -2882,758 +2634,719 @@ yyreduce: } assert((yyval)); unit->error("missing data member name"); -;} +} +#line 2639 "Grammar.tab.c" /* yacc.c:1646 */ break; case 78: - -/* Line 1455 of yacc.c */ -#line 948 "../Slice/Grammar.y" +#line 949 "../Slice/Grammar.y" /* yacc.c:1646 */ { - TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast((yyvsp[(1) - (1)])); + TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast((yyvsp[0])); StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); assert(st); DataMemberPtr dm = st->createDataMember(ts->v.second, ts->v.first, false, -1, 0, "", ""); unit->currentContainer()->checkIntroduced(ts->v.second, dm); (yyval) = dm; -;} +} +#line 2652 "Grammar.tab.c" /* yacc.c:1646 */ break; case 79: - -/* Line 1455 of yacc.c */ -#line 957 "../Slice/Grammar.y" +#line 958 "../Slice/Grammar.y" /* yacc.c:1646 */ { - TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast((yyvsp[(1) - (3)])); - ConstDefTokPtr value = ConstDefTokPtr::dynamicCast((yyvsp[(3) - (3)])); + TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast((yyvsp[-2])); + ConstDefTokPtr value = ConstDefTokPtr::dynamicCast((yyvsp[0])); StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); assert(st); DataMemberPtr dm = st->createDataMember(ts->v.second, ts->v.first, false, -1, value->v.value, value->v.valueAsString, value->v.valueAsLiteral); unit->currentContainer()->checkIntroduced(ts->v.second, dm); (yyval) = dm; -;} +} +#line 2667 "Grammar.tab.c" /* yacc.c:1646 */ break; case 80: - -/* Line 1455 of yacc.c */ -#line 968 "../Slice/Grammar.y" +#line 969 "../Slice/Grammar.y" /* yacc.c:1646 */ { - TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast((yyvsp[0])); StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); assert(st); (yyval) = st->createDataMember(ts->v.second, ts->v.first, false, 0, 0, "", ""); // Dummy assert((yyval)); unit->error("optional data members not supported in struct"); -;} +} +#line 2680 "Grammar.tab.c" /* yacc.c:1646 */ break; case 81: - -/* Line 1455 of yacc.c */ -#line 977 "../Slice/Grammar.y" +#line 978 "../Slice/Grammar.y" /* yacc.c:1646 */ { - TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast((yyvsp[(2) - (4)])); + TypeStringTokPtr ts = TypeStringTokPtr::dynamicCast((yyvsp[-2])); StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); assert(st); (yyval) = st->createDataMember(ts->v.second, ts->v.first, false, 0, 0, "", ""); // Dummy assert((yyval)); unit->error("optional data members not supported in struct"); -;} +} +#line 2693 "Grammar.tab.c" /* yacc.c:1646 */ break; case 82: - -/* Line 1455 of yacc.c */ -#line 986 "../Slice/Grammar.y" +#line 987 "../Slice/Grammar.y" /* yacc.c:1646 */ { - TypePtr type = TypePtr::dynamicCast((yyvsp[(1) - (2)])); - string name = StringTokPtr::dynamicCast((yyvsp[(2) - (2)]))->v; + TypePtr type = TypePtr::dynamicCast((yyvsp[-1])); + string name = StringTokPtr::dynamicCast((yyvsp[0]))->v; StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); assert(st); (yyval) = st->createDataMember(name, type, false, 0, 0, "", ""); // Dummy assert((yyval)); unit->error("keyword `" + name + "' cannot be used as data member name"); -;} +} +#line 2707 "Grammar.tab.c" /* yacc.c:1646 */ break; case 83: - -/* Line 1455 of yacc.c */ -#line 996 "../Slice/Grammar.y" +#line 997 "../Slice/Grammar.y" /* yacc.c:1646 */ { - TypePtr type = TypePtr::dynamicCast((yyvsp[(1) - (1)])); + TypePtr type = TypePtr::dynamicCast((yyvsp[0])); StructPtr st = StructPtr::dynamicCast(unit->currentContainer()); assert(st); (yyval) = st->createDataMember(IceUtil::generateUUID(), type, false, 0, 0, "", ""); // Dummy assert((yyval)); unit->error("missing data member name"); -;} +} +#line 2720 "Grammar.tab.c" /* yacc.c:1646 */ break; case 84: - -/* Line 1455 of yacc.c */ -#line 1010 "../Slice/Grammar.y" +#line 1011 "../Slice/Grammar.y" /* yacc.c:1646 */ { - OptionalDefTokPtr m = OptionalDefTokPtr::dynamicCast((yyvsp[(1) - (2)])); - m->v.type = TypePtr::dynamicCast((yyvsp[(2) - (2)])); + OptionalDefTokPtr m = OptionalDefTokPtr::dynamicCast((yyvsp[-1])); + m->v.type = TypePtr::dynamicCast((yyvsp[0])); (yyval) = m; -;} +} +#line 2730 "Grammar.tab.c" /* yacc.c:1646 */ break; case 85: - -/* Line 1455 of yacc.c */ -#line 1016 "../Slice/Grammar.y" +#line 1017 "../Slice/Grammar.y" /* yacc.c:1646 */ { OptionalDefTokPtr m = new OptionalDefTok(); - m->v.type = TypePtr::dynamicCast((yyvsp[(1) - (1)])); + m->v.type = TypePtr::dynamicCast((yyvsp[0])); m->v.optional = false; m->v.tag = -1; (yyval) = m; -;} +} +#line 2742 "Grammar.tab.c" /* yacc.c:1646 */ break; case 86: - -/* Line 1455 of yacc.c */ -#line 1024 "../Slice/Grammar.y" +#line 1025 "../Slice/Grammar.y" /* yacc.c:1646 */ { OptionalDefTokPtr m = new OptionalDefTok; m->v.optional = false; m->v.tag = -1; (yyval) = m; -;} +} +#line 2753 "Grammar.tab.c" /* yacc.c:1646 */ break; case 87: - -/* Line 1455 of yacc.c */ -#line 1036 "../Slice/Grammar.y" +#line 1037 "../Slice/Grammar.y" /* yacc.c:1646 */ { - OptionalDefTokPtr returnType = OptionalDefTokPtr::dynamicCast((yyvsp[(1) - (2)])); - string name = StringTokPtr::dynamicCast((yyvsp[(2) - (2)]))->v; + OptionalDefTokPtr returnType = OptionalDefTokPtr::dynamicCast((yyvsp[-1])); + string name = StringTokPtr::dynamicCast((yyvsp[0]))->v; ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); if(cl) { - OperationPtr op = cl->createOperation(name, returnType->v.type, returnType->v.optional, returnType->v.tag); - if(op) - { - cl->checkIntroduced(name, op); - unit->pushContainer(op); - (yyval) = op; - } - else - { - (yyval) = 0; - } + OperationPtr op = cl->createOperation(name, returnType->v.type, returnType->v.optional, returnType->v.tag); + if(op) + { + cl->checkIntroduced(name, op); + unit->pushContainer(op); + (yyval) = op; + } + else + { + (yyval) = 0; + } } else { (yyval) = 0; } -;} +} +#line 2781 "Grammar.tab.c" /* yacc.c:1646 */ break; case 88: - -/* Line 1455 of yacc.c */ -#line 1060 "../Slice/Grammar.y" +#line 1061 "../Slice/Grammar.y" /* yacc.c:1646 */ { - OptionalDefTokPtr returnType = OptionalDefTokPtr::dynamicCast((yyvsp[(2) - (3)])); - string name = StringTokPtr::dynamicCast((yyvsp[(3) - (3)]))->v; + OptionalDefTokPtr returnType = OptionalDefTokPtr::dynamicCast((yyvsp[-1])); + string name = StringTokPtr::dynamicCast((yyvsp[0]))->v; ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); if(cl) { - OperationPtr op = cl->createOperation(name, returnType->v.type, returnType->v.optional, returnType->v.tag, - Operation::Idempotent); - if(op) - { - cl->checkIntroduced(name, op); - unit->pushContainer(op); - (yyval) = op; - } - else - { - (yyval) = 0; - } + OperationPtr op = cl->createOperation(name, returnType->v.type, returnType->v.optional, returnType->v.tag, + Operation::Idempotent); + if(op) + { + cl->checkIntroduced(name, op); + unit->pushContainer(op); + (yyval) = op; + } + else + { + (yyval) = 0; + } } else { (yyval) = 0; } -;} +} +#line 2810 "Grammar.tab.c" /* yacc.c:1646 */ break; case 89: - -/* Line 1455 of yacc.c */ -#line 1085 "../Slice/Grammar.y" +#line 1086 "../Slice/Grammar.y" /* yacc.c:1646 */ { - OptionalDefTokPtr returnType = OptionalDefTokPtr::dynamicCast((yyvsp[(1) - (2)])); - string name = StringTokPtr::dynamicCast((yyvsp[(2) - (2)]))->v; + OptionalDefTokPtr returnType = OptionalDefTokPtr::dynamicCast((yyvsp[-1])); + string name = StringTokPtr::dynamicCast((yyvsp[0]))->v; ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); if(cl) { - OperationPtr op = cl->createOperation(name, returnType->v.type, returnType->v.optional, returnType->v.tag); - if(op) - { - unit->pushContainer(op); - unit->error("keyword `" + name + "' cannot be used as operation name"); - (yyval) = op; // Dummy - } - else - { - (yyval) = 0; - } + OperationPtr op = cl->createOperation(name, returnType->v.type, returnType->v.optional, returnType->v.tag); + if(op) + { + unit->pushContainer(op); + unit->error("keyword `" + name + "' cannot be used as operation name"); + (yyval) = op; // Dummy + } + else + { + (yyval) = 0; + } } else { (yyval) = 0; } -;} +} +#line 2838 "Grammar.tab.c" /* yacc.c:1646 */ break; case 90: - -/* Line 1455 of yacc.c */ -#line 1109 "../Slice/Grammar.y" +#line 1110 "../Slice/Grammar.y" /* yacc.c:1646 */ { - OptionalDefTokPtr returnType = OptionalDefTokPtr::dynamicCast((yyvsp[(2) - (3)])); - string name = StringTokPtr::dynamicCast((yyvsp[(3) - (3)]))->v; + OptionalDefTokPtr returnType = OptionalDefTokPtr::dynamicCast((yyvsp[-1])); + string name = StringTokPtr::dynamicCast((yyvsp[0]))->v; ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); if(cl) { - OperationPtr op = cl->createOperation(name, returnType->v.type, returnType->v.optional, returnType->v.tag, - Operation::Idempotent); - if(op) - { - unit->pushContainer(op); - unit->error("keyword `" + name + "' cannot be used as operation name"); - (yyval) = op; // Dummy - } - else - { - return 0; - } + OperationPtr op = cl->createOperation(name, returnType->v.type, returnType->v.optional, returnType->v.tag, + Operation::Idempotent); + if(op) + { + unit->pushContainer(op); + unit->error("keyword `" + name + "' cannot be used as operation name"); + (yyval) = op; // Dummy + } + else + { + return 0; + } } else { - (yyval) = 0; + (yyval) = 0; } -;} +} +#line 2867 "Grammar.tab.c" /* yacc.c:1646 */ break; case 91: - -/* Line 1455 of yacc.c */ -#line 1139 "../Slice/Grammar.y" +#line 1140 "../Slice/Grammar.y" /* yacc.c:1646 */ { - if((yyvsp[(1) - (3)])) + if((yyvsp[-2])) { - unit->popContainer(); - (yyval) = (yyvsp[(1) - (3)]); + unit->popContainer(); + (yyval) = (yyvsp[-2]); } else { (yyval) = 0; } -;} +} +#line 2883 "Grammar.tab.c" /* yacc.c:1646 */ break; case 92: - -/* Line 1455 of yacc.c */ -#line 1151 "../Slice/Grammar.y" +#line 1152 "../Slice/Grammar.y" /* yacc.c:1646 */ { - OperationPtr op = OperationPtr::dynamicCast((yyvsp[(4) - (5)])); - ExceptionListTokPtr el = ExceptionListTokPtr::dynamicCast((yyvsp[(5) - (5)])); + OperationPtr op = OperationPtr::dynamicCast((yyvsp[-1])); + ExceptionListTokPtr el = ExceptionListTokPtr::dynamicCast((yyvsp[0])); assert(el); if(op) { op->setExceptionList(el->v); } -;} +} +#line 2897 "Grammar.tab.c" /* yacc.c:1646 */ break; case 93: - -/* Line 1455 of yacc.c */ -#line 1161 "../Slice/Grammar.y" +#line 1162 "../Slice/Grammar.y" /* yacc.c:1646 */ { - if((yyvsp[(1) - (3)])) + if((yyvsp[-2])) { - unit->popContainer(); + unit->popContainer(); } yyerrok; -;} +} +#line 2909 "Grammar.tab.c" /* yacc.c:1646 */ break; case 94: - -/* Line 1455 of yacc.c */ -#line 1169 "../Slice/Grammar.y" +#line 1170 "../Slice/Grammar.y" /* yacc.c:1646 */ { - OperationPtr op = OperationPtr::dynamicCast((yyvsp[(4) - (5)])); - ExceptionListTokPtr el = ExceptionListTokPtr::dynamicCast((yyvsp[(5) - (5)])); + OperationPtr op = OperationPtr::dynamicCast((yyvsp[-1])); + ExceptionListTokPtr el = ExceptionListTokPtr::dynamicCast((yyvsp[0])); assert(el); if(op) { op->setExceptionList(el->v); // Dummy } -;} +} +#line 2923 "Grammar.tab.c" /* yacc.c:1646 */ break; case 97: - -/* Line 1455 of yacc.c */ -#line 1191 "../Slice/Grammar.y" +#line 1192 "../Slice/Grammar.y" /* yacc.c:1646 */ { - (yyval) = (yyvsp[(2) - (2)]); -;} + (yyval) = (yyvsp[0]); +} +#line 2931 "Grammar.tab.c" /* yacc.c:1646 */ break; case 98: - -/* Line 1455 of yacc.c */ -#line 1195 "../Slice/Grammar.y" +#line 1196 "../Slice/Grammar.y" /* yacc.c:1646 */ { - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[0])); unit->error("keyword `" + ident->v + "' cannot be used as interface name"); - (yyval) = (yyvsp[(2) - (2)]); // Dummy -;} + (yyval) = (yyvsp[0]); // Dummy +} +#line 2941 "Grammar.tab.c" /* yacc.c:1646 */ break; case 99: - -/* Line 1455 of yacc.c */ -#line 1206 "../Slice/Grammar.y" +#line 1207 "../Slice/Grammar.y" /* yacc.c:1646 */ { - BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (2)])); - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[-1])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[0])); ContainerPtr cont = unit->currentContainer(); ClassDeclPtr cl = cont->createClassDecl(ident->v, true, local->v); cont->checkIntroduced(ident->v, cl); (yyval) = cl; -;} +} +#line 2954 "Grammar.tab.c" /* yacc.c:1646 */ break; case 100: - -/* Line 1455 of yacc.c */ -#line 1220 "../Slice/Grammar.y" +#line 1221 "../Slice/Grammar.y" /* yacc.c:1646 */ { - BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (3)])); - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (3)])); + BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[-2])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[-1])); ContainerPtr cont = unit->currentContainer(); - ClassListTokPtr bases = ClassListTokPtr::dynamicCast((yyvsp[(3) - (3)])); + ClassListTokPtr bases = ClassListTokPtr::dynamicCast((yyvsp[0])); ClassDefPtr cl = cont->createClassDef(ident->v, -1, true, bases->v, local->v); if(cl) { - cont->checkIntroduced(ident->v, cl); - unit->pushContainer(cl); - (yyval) = cl; + cont->checkIntroduced(ident->v, cl); + unit->pushContainer(cl); + (yyval) = cl; } else { (yyval) = 0; } -;} +} +#line 2976 "Grammar.tab.c" /* yacc.c:1646 */ break; case 101: - -/* Line 1455 of yacc.c */ -#line 1238 "../Slice/Grammar.y" +#line 1239 "../Slice/Grammar.y" /* yacc.c:1646 */ { - if((yyvsp[(4) - (7)])) + if((yyvsp[-3])) { - unit->popContainer(); - (yyval) = (yyvsp[(4) - (7)]); + unit->popContainer(); + (yyval) = (yyvsp[-3]); } else { - (yyval) = 0; + (yyval) = 0; } -;} +} +#line 2992 "Grammar.tab.c" /* yacc.c:1646 */ break; case 102: - -/* Line 1455 of yacc.c */ -#line 1255 "../Slice/Grammar.y" +#line 1256 "../Slice/Grammar.y" /* yacc.c:1646 */ { - ClassListTokPtr intfs = ClassListTokPtr::dynamicCast((yyvsp[(3) - (3)])); - StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(1) - (3)])); + ClassListTokPtr intfs = ClassListTokPtr::dynamicCast((yyvsp[0])); + StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[-2])); ContainerPtr cont = unit->currentContainer(); TypeList types = cont->lookupType(scoped->v); if(!types.empty()) { - ClassDeclPtr cl = ClassDeclPtr::dynamicCast(types.front()); - if(!cl || !cl->isInterface()) - { - string msg = "`"; - msg += scoped->v; - msg += "' is not an interface"; - unit->error(msg); - } - else - { - ClassDefPtr def = cl->definition(); - if(!def) - { - string msg = "`"; - msg += scoped->v; - msg += "' has been declared but not defined"; - unit->error(msg); - } - else - { - cont->checkIntroduced(scoped->v); - intfs->v.push_front(def); - } - } + ClassDeclPtr cl = ClassDeclPtr::dynamicCast(types.front()); + if(!cl || !cl->isInterface()) + { + string msg = "`"; + msg += scoped->v; + msg += "' is not an interface"; + unit->error(msg); + } + else + { + ClassDefPtr def = cl->definition(); + if(!def) + { + string msg = "`"; + msg += scoped->v; + msg += "' has been declared but not defined"; + unit->error(msg); + } + else + { + cont->checkIntroduced(scoped->v); + intfs->v.push_front(def); + } + } } (yyval) = intfs; -;} +} +#line 3031 "Grammar.tab.c" /* yacc.c:1646 */ break; case 103: - -/* Line 1455 of yacc.c */ -#line 1290 "../Slice/Grammar.y" +#line 1291 "../Slice/Grammar.y" /* yacc.c:1646 */ { ClassListTokPtr intfs = new ClassListTok; - StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); + StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[0])); ContainerPtr cont = unit->currentContainer(); TypeList types = cont->lookupType(scoped->v); if(!types.empty()) { - ClassDeclPtr cl = ClassDeclPtr::dynamicCast(types.front()); - if(!cl || !cl->isInterface()) - { - string msg = "`"; - msg += scoped->v; - msg += "' is not an interface"; - unit->error(msg); // $$ is a dummy - } - else - { - ClassDefPtr def = cl->definition(); - if(!def) - { - string msg = "`"; - msg += scoped->v; - msg += "' has been declared but not defined"; - unit->error(msg); // $$ is a dummy - } - else - { - cont->checkIntroduced(scoped->v); - intfs->v.push_front(def); - } - } + ClassDeclPtr cl = ClassDeclPtr::dynamicCast(types.front()); + if(!cl || !cl->isInterface()) + { + string msg = "`"; + msg += scoped->v; + msg += "' is not an interface"; + unit->error(msg); // $$ is a dummy + } + else + { + ClassDefPtr def = cl->definition(); + if(!def) + { + string msg = "`"; + msg += scoped->v; + msg += "' has been declared but not defined"; + unit->error(msg); // $$ is a dummy + } + else + { + cont->checkIntroduced(scoped->v); + intfs->v.push_front(def); + } + } } (yyval) = intfs; -;} +} +#line 3070 "Grammar.tab.c" /* yacc.c:1646 */ break; case 104: - -/* Line 1455 of yacc.c */ -#line 1325 "../Slice/Grammar.y" +#line 1326 "../Slice/Grammar.y" /* yacc.c:1646 */ { unit->error("illegal inheritance from type Object"); (yyval) = new ClassListTok; // Dummy -;} +} +#line 3079 "Grammar.tab.c" /* yacc.c:1646 */ break; case 105: - -/* Line 1455 of yacc.c */ -#line 1335 "../Slice/Grammar.y" +#line 1331 "../Slice/Grammar.y" /* yacc.c:1646 */ { - (yyval) = (yyvsp[(2) - (2)]); -;} + unit->error("illegal inheritance from type Value"); + (yyval) = new ClassListTok; // Dummy +} +#line 3088 "Grammar.tab.c" /* yacc.c:1646 */ break; case 106: - -/* Line 1455 of yacc.c */ -#line 1339 "../Slice/Grammar.y" +#line 1341 "../Slice/Grammar.y" /* yacc.c:1646 */ { - (yyval) = new ClassListTok; -;} + (yyval) = (yyvsp[0]); +} +#line 3096 "Grammar.tab.c" /* yacc.c:1646 */ break; case 107: +#line 1345 "../Slice/Grammar.y" /* yacc.c:1646 */ + { + (yyval) = new ClassListTok; +} +#line 3104 "Grammar.tab.c" /* yacc.c:1646 */ + break; -/* Line 1455 of yacc.c */ -#line 1348 "../Slice/Grammar.y" + case 108: +#line 1354 "../Slice/Grammar.y" /* yacc.c:1646 */ { - StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(1) - (4)])); - ContainedPtr contained = ContainedPtr::dynamicCast((yyvsp[(2) - (4)])); + StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[-3])); + ContainedPtr contained = ContainedPtr::dynamicCast((yyvsp[-2])); if(contained && !metaData->v.empty()) { - contained->setMetaData(metaData->v); + contained->setMetaData(metaData->v); } -;} +} +#line 3117 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 108: - -/* Line 1455 of yacc.c */ -#line 1357 "../Slice/Grammar.y" + case 109: +#line 1363 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 3124 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 109: - -/* Line 1455 of yacc.c */ -#line 1360 "../Slice/Grammar.y" + case 110: +#line 1366 "../Slice/Grammar.y" /* yacc.c:1646 */ { unit->error("`;' missing after definition"); -;} +} +#line 3132 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 110: - -/* Line 1455 of yacc.c */ -#line 1364 "../Slice/Grammar.y" + case 111: +#line 1370 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 3139 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 112: - -/* Line 1455 of yacc.c */ -#line 1378 "../Slice/Grammar.y" + case 113: +#line 1384 "../Slice/Grammar.y" /* yacc.c:1646 */ { - ExceptionPtr exception = ExceptionPtr::dynamicCast((yyvsp[(1) - (3)])); - ExceptionListTokPtr exceptionList = ExceptionListTokPtr::dynamicCast((yyvsp[(3) - (3)])); + ExceptionPtr exception = ExceptionPtr::dynamicCast((yyvsp[-2])); + ExceptionListTokPtr exceptionList = ExceptionListTokPtr::dynamicCast((yyvsp[0])); exceptionList->v.push_front(exception); (yyval) = exceptionList; -;} +} +#line 3150 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 113: - -/* Line 1455 of yacc.c */ -#line 1385 "../Slice/Grammar.y" + case 114: +#line 1391 "../Slice/Grammar.y" /* yacc.c:1646 */ { - ExceptionPtr exception = ExceptionPtr::dynamicCast((yyvsp[(1) - (1)])); + ExceptionPtr exception = ExceptionPtr::dynamicCast((yyvsp[0])); ExceptionListTokPtr exceptionList = new ExceptionListTok; exceptionList->v.push_front(exception); (yyval) = exceptionList; -;} +} +#line 3161 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 114: - -/* Line 1455 of yacc.c */ -#line 1397 "../Slice/Grammar.y" + case 115: +#line 1403 "../Slice/Grammar.y" /* yacc.c:1646 */ { - StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); + StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[0])); ContainerPtr cont = unit->currentContainer(); ExceptionPtr exception = cont->lookupException(scoped->v); if(!exception) { - exception = cont->createException(IceUtil::generateUUID(), 0, false, Dummy); // Dummy + exception = cont->createException(IceUtil::generateUUID(), 0, false, Dummy); // Dummy } cont->checkIntroduced(scoped->v, exception); (yyval) = exception; -;} +} +#line 3177 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 115: - -/* Line 1455 of yacc.c */ -#line 1409 "../Slice/Grammar.y" + case 116: +#line 1415 "../Slice/Grammar.y" /* yacc.c:1646 */ { - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[0])); unit->error("keyword `" + ident->v + "' cannot be used as exception name"); (yyval) = unit->currentContainer()->createException(IceUtil::generateUUID(), 0, false, Dummy); // Dummy -;} +} +#line 3187 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 116: - -/* Line 1455 of yacc.c */ -#line 1420 "../Slice/Grammar.y" + case 117: +#line 1426 "../Slice/Grammar.y" /* yacc.c:1646 */ { - BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (7)])); - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(7) - (7)])); - StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(4) - (7)])); - TypePtr type = TypePtr::dynamicCast((yyvsp[(5) - (7)])); + BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[-6])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[0])); + StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[-3])); + TypePtr type = TypePtr::dynamicCast((yyvsp[-2])); ContainerPtr cont = unit->currentContainer(); (yyval) = cont->createSequence(ident->v, type, metaData->v, local->v); -;} +} +#line 3200 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 117: - -/* Line 1455 of yacc.c */ -#line 1429 "../Slice/Grammar.y" + case 118: +#line 1435 "../Slice/Grammar.y" /* yacc.c:1646 */ { - BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (7)])); - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(7) - (7)])); - StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(4) - (7)])); - TypePtr type = TypePtr::dynamicCast((yyvsp[(5) - (7)])); + BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[-6])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[0])); + StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[-3])); + TypePtr type = TypePtr::dynamicCast((yyvsp[-2])); 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"); -;} +} +#line 3214 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 118: - -/* Line 1455 of yacc.c */ -#line 1444 "../Slice/Grammar.y" - { - BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (10)])); - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(10) - (10)])); - StringListTokPtr keyMetaData = StringListTokPtr::dynamicCast((yyvsp[(4) - (10)])); - TypePtr keyType = TypePtr::dynamicCast((yyvsp[(5) - (10)])); - StringListTokPtr valueMetaData = StringListTokPtr::dynamicCast((yyvsp[(7) - (10)])); - TypePtr valueType = TypePtr::dynamicCast((yyvsp[(8) - (10)])); + case 119: +#line 1450 "../Slice/Grammar.y" /* yacc.c:1646 */ + { + BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[-9])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[0])); + StringListTokPtr keyMetaData = StringListTokPtr::dynamicCast((yyvsp[-6])); + TypePtr keyType = TypePtr::dynamicCast((yyvsp[-5])); + StringListTokPtr valueMetaData = StringListTokPtr::dynamicCast((yyvsp[-3])); + TypePtr valueType = TypePtr::dynamicCast((yyvsp[-2])); ContainerPtr cont = unit->currentContainer(); (yyval) = cont->createDictionary(ident->v, keyType, keyMetaData->v, valueType, valueMetaData->v, local->v); -;} +} +#line 3229 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 119: - -/* Line 1455 of yacc.c */ -#line 1455 "../Slice/Grammar.y" - { - BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (10)])); - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(10) - (10)])); - StringListTokPtr keyMetaData = StringListTokPtr::dynamicCast((yyvsp[(4) - (10)])); - TypePtr keyType = TypePtr::dynamicCast((yyvsp[(5) - (10)])); - StringListTokPtr valueMetaData = StringListTokPtr::dynamicCast((yyvsp[(7) - (10)])); - TypePtr valueType = TypePtr::dynamicCast((yyvsp[(8) - (10)])); + case 120: +#line 1461 "../Slice/Grammar.y" /* yacc.c:1646 */ + { + BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[-9])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[0])); + StringListTokPtr keyMetaData = StringListTokPtr::dynamicCast((yyvsp[-6])); + TypePtr keyType = TypePtr::dynamicCast((yyvsp[-5])); + StringListTokPtr valueMetaData = StringListTokPtr::dynamicCast((yyvsp[-3])); + TypePtr valueType = TypePtr::dynamicCast((yyvsp[-2])); 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"); -;} +} +#line 3245 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 120: - -/* Line 1455 of yacc.c */ -#line 1472 "../Slice/Grammar.y" + case 121: +#line 1478 "../Slice/Grammar.y" /* yacc.c:1646 */ { - (yyval) = (yyvsp[(2) - (2)]); -;} + (yyval) = (yyvsp[0]); +} +#line 3253 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 121: - -/* Line 1455 of yacc.c */ -#line 1476 "../Slice/Grammar.y" + case 122: +#line 1482 "../Slice/Grammar.y" /* yacc.c:1646 */ { - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[0])); unit->error("keyword `" + ident->v + "' cannot be used as enumeration name"); - (yyval) = (yyvsp[(2) - (2)]); // Dummy -;} + (yyval) = (yyvsp[0]); // Dummy +} +#line 3263 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 122: - -/* Line 1455 of yacc.c */ -#line 1487 "../Slice/Grammar.y" + case 123: +#line 1493 "../Slice/Grammar.y" /* yacc.c:1646 */ { - BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (2)])); - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[-1])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[0])); ContainerPtr cont = unit->currentContainer(); EnumPtr en = cont->createEnum(ident->v, local->v); cont->checkIntroduced(ident->v, en); (yyval) = en; -;} +} +#line 3276 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 123: - -/* Line 1455 of yacc.c */ -#line 1496 "../Slice/Grammar.y" + case 124: +#line 1502 "../Slice/Grammar.y" /* yacc.c:1646 */ { - EnumPtr en = EnumPtr::dynamicCast((yyvsp[(3) - (6)])); + EnumPtr en = EnumPtr::dynamicCast((yyvsp[-3])); if(en) { - EnumeratorListTokPtr enumerators = EnumeratorListTokPtr::dynamicCast((yyvsp[(5) - (6)])); - if(enumerators->v.empty()) - { - unit->error("enum `" + en->name() + "' must have at least one enumerator"); - } - en->setEnumerators(enumerators->v); // Dummy + EnumeratorListTokPtr enumerators = EnumeratorListTokPtr::dynamicCast((yyvsp[-1])); + if(enumerators->v.empty()) + { + unit->error("enum `" + en->name() + "' must have at least one enumerator"); } - (yyval) = (yyvsp[(3) - (6)]); -;} + en->setEnumerators(enumerators->v); // Dummy + } + (yyval) = (yyvsp[-3]); +} +#line 3294 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 124: - -/* Line 1455 of yacc.c */ -#line 1511 "../Slice/Grammar.y" + case 125: +#line 1517 "../Slice/Grammar.y" /* yacc.c:1646 */ { unit->error("missing enumeration name"); - BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[(1) - (5)])); + BoolTokPtr local = BoolTokPtr::dynamicCast((yyvsp[-4])); ContainerPtr cont = unit->currentContainer(); EnumPtr en = cont->createEnum(IceUtil::generateUUID(), local->v, Dummy); // Dummy - EnumeratorListTokPtr enumerators = EnumeratorListTokPtr::dynamicCast((yyvsp[(4) - (5)])); + EnumeratorListTokPtr enumerators = EnumeratorListTokPtr::dynamicCast((yyvsp[-1])); en->setEnumerators(enumerators->v); // Dummy (yyval) = en; -;} +} +#line 3308 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 125: - -/* Line 1455 of yacc.c */ -#line 1526 "../Slice/Grammar.y" + case 126: +#line 1532 "../Slice/Grammar.y" /* yacc.c:1646 */ { - EnumeratorListTokPtr ens = EnumeratorListTokPtr::dynamicCast((yyvsp[(1) - (3)])); - ens->v.splice(ens->v.end(), EnumeratorListTokPtr::dynamicCast((yyvsp[(3) - (3)]))->v); + EnumeratorListTokPtr ens = EnumeratorListTokPtr::dynamicCast((yyvsp[-2])); + ens->v.splice(ens->v.end(), EnumeratorListTokPtr::dynamicCast((yyvsp[0]))->v); (yyval) = ens; -;} +} +#line 3318 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 126: - -/* Line 1455 of yacc.c */ -#line 1532 "../Slice/Grammar.y" + case 127: +#line 1538 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 3325 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 127: - -/* Line 1455 of yacc.c */ -#line 1540 "../Slice/Grammar.y" + case 128: +#line 1546 "../Slice/Grammar.y" /* yacc.c:1646 */ { - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[0])); EnumeratorListTokPtr ens = new EnumeratorListTok; ContainerPtr cont = unit->currentContainer(); EnumeratorPtr en = cont->createEnumerator(ident->v); if(en) { - ens->v.push_front(en); + ens->v.push_front(en); } (yyval) = ens; -;} +} +#line 3341 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 128: - -/* Line 1455 of yacc.c */ -#line 1552 "../Slice/Grammar.y" + case 129: +#line 1558 "../Slice/Grammar.y" /* yacc.c:1646 */ { - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(1) - (3)])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[-2])); EnumeratorListTokPtr ens = new EnumeratorListTok; ContainerPtr cont = unit->currentContainer(); - IntegerTokPtr intVal = IntegerTokPtr::dynamicCast((yyvsp[(3) - (3)])); + IntegerTokPtr intVal = IntegerTokPtr::dynamicCast((yyvsp[0])); if(intVal) { if(intVal->v < 0 || intVal->v > Int32Max) @@ -3650,46 +3363,42 @@ yyreduce: } } (yyval) = ens; -;} +} +#line 3368 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 129: - -/* Line 1455 of yacc.c */ -#line 1575 "../Slice/Grammar.y" + case 130: +#line 1581 "../Slice/Grammar.y" /* yacc.c:1646 */ { - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[0])); unit->error("keyword `" + ident->v + "' cannot be used as enumerator"); EnumeratorListTokPtr ens = new EnumeratorListTok; // Dummy (yyval) = ens; -;} +} +#line 3379 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 130: - -/* Line 1455 of yacc.c */ -#line 1582 "../Slice/Grammar.y" + case 131: +#line 1588 "../Slice/Grammar.y" /* yacc.c:1646 */ { EnumeratorListTokPtr ens = new EnumeratorListTok; (yyval) = ens; // Dummy -;} +} +#line 3388 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 131: - -/* Line 1455 of yacc.c */ -#line 1592 "../Slice/Grammar.y" + case 132: +#line 1598 "../Slice/Grammar.y" /* yacc.c:1646 */ { - (yyval) = (yyvsp[(1) - (1)]); -;} + (yyval) = (yyvsp[0]); +} +#line 3396 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 132: - -/* Line 1455 of yacc.c */ -#line 1596 "../Slice/Grammar.y" + case 133: +#line 1602 "../Slice/Grammar.y" /* yacc.c:1646 */ { - StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); + StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[0])); ContainedList cl = unit->currentContainer()->lookupContained(scoped->v); IntegerTokPtr tok; if(!cl.empty()) @@ -3720,433 +3429,407 @@ yyreduce: } (yyval) = tok; -;} +} +#line 3434 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 133: - -/* Line 1455 of yacc.c */ -#line 1635 "../Slice/Grammar.y" + case 134: +#line 1641 "../Slice/Grammar.y" /* yacc.c:1646 */ { BoolTokPtr out = new BoolTok; out->v = true; (yyval) = out; -;} +} +#line 3444 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 134: - -/* Line 1455 of yacc.c */ -#line 1641 "../Slice/Grammar.y" + case 135: +#line 1647 "../Slice/Grammar.y" /* yacc.c:1646 */ { BoolTokPtr out = new BoolTok; out->v = false; (yyval) = out; -;} +} +#line 3454 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 135: - -/* Line 1455 of yacc.c */ -#line 1652 "../Slice/Grammar.y" + case 136: +#line 1658 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 3461 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 136: - -/* Line 1455 of yacc.c */ -#line 1655 "../Slice/Grammar.y" + case 137: +#line 1661 "../Slice/Grammar.y" /* yacc.c:1646 */ { - BoolTokPtr isOutParam = BoolTokPtr::dynamicCast((yyvsp[(1) - (3)])); - OptionalDefTokPtr tsp = OptionalDefTokPtr::dynamicCast((yyvsp[(3) - (3)])); + BoolTokPtr isOutParam = BoolTokPtr::dynamicCast((yyvsp[-2])); + OptionalDefTokPtr tsp = OptionalDefTokPtr::dynamicCast((yyvsp[0])); OperationPtr op = OperationPtr::dynamicCast(unit->currentContainer()); if(op) { - ParamDeclPtr pd = op->createParamDecl(tsp->v.name, tsp->v.type, isOutParam->v, tsp->v.optional, tsp->v.tag); - unit->currentContainer()->checkIntroduced(tsp->v.name, pd); - StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(2) - (3)])); + ParamDeclPtr pd = op->createParamDecl(tsp->v.name, tsp->v.type, isOutParam->v, tsp->v.optional, tsp->v.tag); + unit->currentContainer()->checkIntroduced(tsp->v.name, pd); + StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[-1])); if(!metaData->v.empty()) { pd->setMetaData(metaData->v); } } -;} +} +#line 3481 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 137: - -/* Line 1455 of yacc.c */ -#line 1671 "../Slice/Grammar.y" + case 138: +#line 1677 "../Slice/Grammar.y" /* yacc.c:1646 */ { - BoolTokPtr isOutParam = BoolTokPtr::dynamicCast((yyvsp[(3) - (5)])); - OptionalDefTokPtr tsp = OptionalDefTokPtr::dynamicCast((yyvsp[(5) - (5)])); + BoolTokPtr isOutParam = BoolTokPtr::dynamicCast((yyvsp[-2])); + OptionalDefTokPtr tsp = OptionalDefTokPtr::dynamicCast((yyvsp[0])); OperationPtr op = OperationPtr::dynamicCast(unit->currentContainer()); if(op) { - ParamDeclPtr pd = op->createParamDecl(tsp->v.name, tsp->v.type, isOutParam->v, tsp->v.optional, tsp->v.tag); - unit->currentContainer()->checkIntroduced(tsp->v.name, pd); - StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(4) - (5)])); + ParamDeclPtr pd = op->createParamDecl(tsp->v.name, tsp->v.type, isOutParam->v, tsp->v.optional, tsp->v.tag); + unit->currentContainer()->checkIntroduced(tsp->v.name, pd); + StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[-1])); if(!metaData->v.empty()) { pd->setMetaData(metaData->v); } } -;} - break; - - case 138: - -/* Line 1455 of yacc.c */ -#line 1687 "../Slice/Grammar.y" - { - BoolTokPtr isOutParam = BoolTokPtr::dynamicCast((yyvsp[(1) - (4)])); - TypePtr type = TypePtr::dynamicCast((yyvsp[(3) - (4)])); - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(4) - (4)])); - OperationPtr op = OperationPtr::dynamicCast(unit->currentContainer()); - if(op) - { - op->createParamDecl(ident->v, type, isOutParam->v, false, 0); // Dummy - unit->error("keyword `" + ident->v + "' cannot be used as parameter name"); - } -;} +} +#line 3501 "Grammar.tab.c" /* yacc.c:1646 */ break; case 139: - -/* Line 1455 of yacc.c */ -#line 1699 "../Slice/Grammar.y" +#line 1693 "../Slice/Grammar.y" /* yacc.c:1646 */ { - BoolTokPtr isOutParam = BoolTokPtr::dynamicCast((yyvsp[(3) - (6)])); - TypePtr type = TypePtr::dynamicCast((yyvsp[(5) - (6)])); - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(6) - (6)])); + BoolTokPtr isOutParam = BoolTokPtr::dynamicCast((yyvsp[-3])); + TypePtr type = TypePtr::dynamicCast((yyvsp[-1])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[0])); OperationPtr op = OperationPtr::dynamicCast(unit->currentContainer()); if(op) { - op->createParamDecl(ident->v, type, isOutParam->v, false, 0); // Dummy - unit->error("keyword `" + ident->v + "' cannot be used as parameter name"); + op->createParamDecl(ident->v, type, isOutParam->v, false, 0); // Dummy + unit->error("keyword `" + ident->v + "' cannot be used as parameter name"); } -;} +} +#line 3517 "Grammar.tab.c" /* yacc.c:1646 */ break; case 140: - -/* Line 1455 of yacc.c */ -#line 1711 "../Slice/Grammar.y" +#line 1705 "../Slice/Grammar.y" /* yacc.c:1646 */ { - BoolTokPtr isOutParam = BoolTokPtr::dynamicCast((yyvsp[(1) - (3)])); - TypePtr type = TypePtr::dynamicCast((yyvsp[(3) - (3)])); + BoolTokPtr isOutParam = BoolTokPtr::dynamicCast((yyvsp[-3])); + TypePtr type = TypePtr::dynamicCast((yyvsp[-1])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[0])); OperationPtr op = OperationPtr::dynamicCast(unit->currentContainer()); if(op) { - op->createParamDecl(IceUtil::generateUUID(), type, isOutParam->v, false, 0); // Dummy - unit->error("missing parameter name"); + op->createParamDecl(ident->v, type, isOutParam->v, false, 0); // Dummy + unit->error("keyword `" + ident->v + "' cannot be used as parameter name"); } -;} +} +#line 3533 "Grammar.tab.c" /* yacc.c:1646 */ break; case 141: - -/* Line 1455 of yacc.c */ -#line 1722 "../Slice/Grammar.y" +#line 1717 "../Slice/Grammar.y" /* yacc.c:1646 */ { - BoolTokPtr isOutParam = BoolTokPtr::dynamicCast((yyvsp[(3) - (5)])); - TypePtr type = TypePtr::dynamicCast((yyvsp[(5) - (5)])); + BoolTokPtr isOutParam = BoolTokPtr::dynamicCast((yyvsp[-2])); + TypePtr type = TypePtr::dynamicCast((yyvsp[0])); OperationPtr op = OperationPtr::dynamicCast(unit->currentContainer()); if(op) { - op->createParamDecl(IceUtil::generateUUID(), type, isOutParam->v, false, 0); // Dummy - unit->error("missing parameter name"); + op->createParamDecl(IceUtil::generateUUID(), type, isOutParam->v, false, 0); // Dummy + unit->error("missing parameter name"); } -;} +} +#line 3548 "Grammar.tab.c" /* yacc.c:1646 */ break; case 142: - -/* Line 1455 of yacc.c */ -#line 1738 "../Slice/Grammar.y" +#line 1728 "../Slice/Grammar.y" /* yacc.c:1646 */ { - (yyval) = (yyvsp[(2) - (2)]); -;} + BoolTokPtr isOutParam = BoolTokPtr::dynamicCast((yyvsp[-2])); + TypePtr type = TypePtr::dynamicCast((yyvsp[0])); + OperationPtr op = OperationPtr::dynamicCast(unit->currentContainer()); + if(op) + { + op->createParamDecl(IceUtil::generateUUID(), type, isOutParam->v, false, 0); // Dummy + unit->error("missing parameter name"); + } +} +#line 3563 "Grammar.tab.c" /* yacc.c:1646 */ break; case 143: - -/* Line 1455 of yacc.c */ -#line 1742 "../Slice/Grammar.y" +#line 1744 "../Slice/Grammar.y" /* yacc.c:1646 */ { - (yyval) = new ExceptionListTok; -;} + (yyval) = (yyvsp[0]); +} +#line 3571 "Grammar.tab.c" /* yacc.c:1646 */ break; case 144: - -/* Line 1455 of yacc.c */ -#line 1751 "../Slice/Grammar.y" +#line 1748 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} + (yyval) = new ExceptionListTok; +} +#line 3579 "Grammar.tab.c" /* yacc.c:1646 */ break; case 145: +#line 1757 "../Slice/Grammar.y" /* yacc.c:1646 */ + { +} +#line 3586 "Grammar.tab.c" /* yacc.c:1646 */ + break; -/* Line 1455 of yacc.c */ -#line 1754 "../Slice/Grammar.y" + case 146: +#line 1760 "../Slice/Grammar.y" /* yacc.c:1646 */ { - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[0])); ident->v = "::" + ident->v; (yyval) = ident; -;} +} +#line 3596 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 146: - -/* Line 1455 of yacc.c */ -#line 1760 "../Slice/Grammar.y" + case 147: +#line 1766 "../Slice/Grammar.y" /* yacc.c:1646 */ { - StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(1) - (3)])); - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(3) - (3)])); + StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[-2])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[0])); scoped->v += "::"; scoped->v += ident->v; (yyval) = scoped; -;} +} +#line 3608 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 147: - -/* Line 1455 of yacc.c */ -#line 1773 "../Slice/Grammar.y" + case 148: +#line 1779 "../Slice/Grammar.y" /* yacc.c:1646 */ { (yyval) = unit->builtin(Builtin::KindByte); -;} +} +#line 3616 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 148: - -/* Line 1455 of yacc.c */ -#line 1777 "../Slice/Grammar.y" + case 149: +#line 1783 "../Slice/Grammar.y" /* yacc.c:1646 */ { (yyval) = unit->builtin(Builtin::KindBool); -;} +} +#line 3624 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 149: - -/* Line 1455 of yacc.c */ -#line 1781 "../Slice/Grammar.y" + case 150: +#line 1787 "../Slice/Grammar.y" /* yacc.c:1646 */ { (yyval) = unit->builtin(Builtin::KindShort); -;} +} +#line 3632 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 150: - -/* Line 1455 of yacc.c */ -#line 1785 "../Slice/Grammar.y" + case 151: +#line 1791 "../Slice/Grammar.y" /* yacc.c:1646 */ { (yyval) = unit->builtin(Builtin::KindInt); -;} +} +#line 3640 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 151: - -/* Line 1455 of yacc.c */ -#line 1789 "../Slice/Grammar.y" + case 152: +#line 1795 "../Slice/Grammar.y" /* yacc.c:1646 */ { (yyval) = unit->builtin(Builtin::KindLong); -;} +} +#line 3648 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 152: - -/* Line 1455 of yacc.c */ -#line 1793 "../Slice/Grammar.y" + case 153: +#line 1799 "../Slice/Grammar.y" /* yacc.c:1646 */ { (yyval) = unit->builtin(Builtin::KindFloat); -;} +} +#line 3656 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 153: - -/* Line 1455 of yacc.c */ -#line 1797 "../Slice/Grammar.y" + case 154: +#line 1803 "../Slice/Grammar.y" /* yacc.c:1646 */ { (yyval) = unit->builtin(Builtin::KindDouble); -;} +} +#line 3664 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 154: - -/* Line 1455 of yacc.c */ -#line 1801 "../Slice/Grammar.y" + case 155: +#line 1807 "../Slice/Grammar.y" /* yacc.c:1646 */ { (yyval) = unit->builtin(Builtin::KindString); -;} +} +#line 3672 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 155: - -/* Line 1455 of yacc.c */ -#line 1805 "../Slice/Grammar.y" + case 156: +#line 1811 "../Slice/Grammar.y" /* yacc.c:1646 */ { (yyval) = unit->builtin(Builtin::KindObject); -;} +} +#line 3680 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 156: - -/* Line 1455 of yacc.c */ -#line 1809 "../Slice/Grammar.y" + case 157: +#line 1815 "../Slice/Grammar.y" /* yacc.c:1646 */ { (yyval) = unit->builtin(Builtin::KindObjectProxy); -;} +} +#line 3688 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 157: - -/* Line 1455 of yacc.c */ -#line 1813 "../Slice/Grammar.y" + case 158: +#line 1819 "../Slice/Grammar.y" /* yacc.c:1646 */ { (yyval) = unit->builtin(Builtin::KindLocalObject); -;} +} +#line 3696 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 158: + case 159: +#line 1823 "../Slice/Grammar.y" /* yacc.c:1646 */ + { + (yyval) = unit->builtin(Builtin::KindValue); +} +#line 3704 "Grammar.tab.c" /* yacc.c:1646 */ + break; -/* Line 1455 of yacc.c */ -#line 1817 "../Slice/Grammar.y" + case 160: +#line 1827 "../Slice/Grammar.y" /* yacc.c:1646 */ { - StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); + StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[0])); ContainerPtr cont = unit->currentContainer(); if(cont) { - TypeList types = cont->lookupType(scoped->v); - if(types.empty()) - { - YYERROR; // Can't continue, jump to next yyerrok - } - cont->checkIntroduced(scoped->v); - (yyval) = types.front(); + TypeList types = cont->lookupType(scoped->v); + if(types.empty()) + { + YYERROR; // Can't continue, jump to next yyerrok + } + cont->checkIntroduced(scoped->v); + (yyval) = types.front(); } else { (yyval) = 0; } -;} +} +#line 3727 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 159: - -/* Line 1455 of yacc.c */ -#line 1836 "../Slice/Grammar.y" + case 161: +#line 1846 "../Slice/Grammar.y" /* yacc.c:1646 */ { - StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(1) - (2)])); + StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[-1])); ContainerPtr cont = unit->currentContainer(); if(cont) { - TypeList types = cont->lookupType(scoped->v); - if(types.empty()) - { - YYERROR; // Can't continue, jump to next yyerrok - } - for(TypeList::iterator p = types.begin(); p != types.end(); ++p) - { - ClassDeclPtr cl = ClassDeclPtr::dynamicCast(*p); - if(!cl) - { - string msg = "`"; - msg += scoped->v; - msg += "' must be class or interface"; - unit->error(msg); - YYERROR; // Can't continue, jump to next yyerrok - } - cont->checkIntroduced(scoped->v); - if(cl->isLocal()) - { - unit->error("cannot create proxy for " + cl->kindOf() + " `" + cl->name() + "'"); // $$ is dummy - } - *p = new Proxy(cl); - } - (yyval) = types.front(); + TypeList types = cont->lookupType(scoped->v); + if(types.empty()) + { + YYERROR; // Can't continue, jump to next yyerrok + } + for(TypeList::iterator p = types.begin(); p != types.end(); ++p) + { + ClassDeclPtr cl = ClassDeclPtr::dynamicCast(*p); + if(!cl) + { + string msg = "`"; + msg += scoped->v; + msg += "' must be class or interface"; + unit->error(msg); + YYERROR; // Can't continue, jump to next yyerrok + } + cont->checkIntroduced(scoped->v); + if(cl->isLocal()) + { + unit->error("cannot create proxy for " + cl->kindOf() + " `" + cl->name() + "'"); // $$ is dummy + } + *p = new Proxy(cl); + } + (yyval) = types.front(); } else { (yyval) = 0; } -;} +} +#line 3767 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 160: - -/* Line 1455 of yacc.c */ -#line 1877 "../Slice/Grammar.y" + case 162: +#line 1887 "../Slice/Grammar.y" /* yacc.c:1646 */ { - StringTokPtr str1 = StringTokPtr::dynamicCast((yyvsp[(1) - (2)])); - StringTokPtr str2 = StringTokPtr::dynamicCast((yyvsp[(2) - (2)])); + StringTokPtr str1 = StringTokPtr::dynamicCast((yyvsp[-1])); + StringTokPtr str2 = StringTokPtr::dynamicCast((yyvsp[0])); str1->v += str2->v; -;} +} +#line 3777 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 161: - -/* Line 1455 of yacc.c */ -#line 1883 "../Slice/Grammar.y" + case 163: +#line 1893 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 3784 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 162: - -/* Line 1455 of yacc.c */ -#line 1891 "../Slice/Grammar.y" + case 164: +#line 1901 "../Slice/Grammar.y" /* yacc.c:1646 */ { - StringTokPtr str = StringTokPtr::dynamicCast((yyvsp[(3) - (3)])); - StringListTokPtr stringList = StringListTokPtr::dynamicCast((yyvsp[(1) - (3)])); + StringTokPtr str = StringTokPtr::dynamicCast((yyvsp[0])); + StringListTokPtr stringList = StringListTokPtr::dynamicCast((yyvsp[-2])); stringList->v.push_back(str->v); (yyval) = stringList; -;} +} +#line 3795 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 163: - -/* Line 1455 of yacc.c */ -#line 1898 "../Slice/Grammar.y" + case 165: +#line 1908 "../Slice/Grammar.y" /* yacc.c:1646 */ { - StringTokPtr str = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); + StringTokPtr str = StringTokPtr::dynamicCast((yyvsp[0])); StringListTokPtr stringList = new StringListTok; stringList->v.push_back(str->v); (yyval) = stringList; -;} +} +#line 3806 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 164: - -/* Line 1455 of yacc.c */ -#line 1910 "../Slice/Grammar.y" + case 166: +#line 1920 "../Slice/Grammar.y" /* yacc.c:1646 */ { BoolTokPtr local = new BoolTok; local->v = true; (yyval) = local; -;} +} +#line 3816 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 165: - -/* Line 1455 of yacc.c */ -#line 1916 "../Slice/Grammar.y" + case 167: +#line 1926 "../Slice/Grammar.y" /* yacc.c:1646 */ { BoolTokPtr local = new BoolTok; local->v = false; (yyval) = local; -;} +} +#line 3826 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 166: - -/* Line 1455 of yacc.c */ -#line 1927 "../Slice/Grammar.y" + case 168: +#line 1937 "../Slice/Grammar.y" /* yacc.c:1646 */ { BuiltinPtr type = unit->builtin(Builtin::KindLong); - IntegerTokPtr intVal = IntegerTokPtr::dynamicCast((yyvsp[(1) - (1)])); + IntegerTokPtr intVal = IntegerTokPtr::dynamicCast((yyvsp[0])); ostringstream sstr; sstr << intVal->v; ConstDefTokPtr def = new ConstDefTok; @@ -4155,16 +3838,15 @@ yyreduce: def->v.valueAsString = sstr.str(); def->v.valueAsLiteral = intVal->literal; (yyval) = def; -;} +} +#line 3843 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 167: - -/* Line 1455 of yacc.c */ -#line 1940 "../Slice/Grammar.y" + case 169: +#line 1950 "../Slice/Grammar.y" /* yacc.c:1646 */ { BuiltinPtr type = unit->builtin(Builtin::KindDouble); - FloatingTokPtr floatVal = FloatingTokPtr::dynamicCast((yyvsp[(1) - (1)])); + FloatingTokPtr floatVal = FloatingTokPtr::dynamicCast((yyvsp[0])); ostringstream sstr; sstr << floatVal->v; ConstDefTokPtr def = new ConstDefTok; @@ -4173,15 +3855,14 @@ yyreduce: def->v.valueAsString = sstr.str(); def->v.valueAsLiteral = floatVal->literal; (yyval) = def; -;} +} +#line 3860 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 168: - -/* Line 1455 of yacc.c */ -#line 1953 "../Slice/Grammar.y" + case 170: +#line 1963 "../Slice/Grammar.y" /* yacc.c:1646 */ { - StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); + StringTokPtr scoped = StringTokPtr::dynamicCast((yyvsp[0])); ConstDefTokPtr def = new ConstDefTok; ContainedList cl = unit->currentContainer()->lookupContained(scoped->v); if(cl.empty()) @@ -4193,9 +3874,9 @@ yyreduce: } else { - EnumeratorPtr enumerator = EnumeratorPtr::dynamicCast(cl.front()); + EnumeratorPtr enumerator = EnumeratorPtr::dynamicCast(cl.front()); ConstPtr constant = ConstPtr::dynamicCast(cl.front()); - if(enumerator) + if(enumerator) { unit->currentContainer()->checkIntroduced(scoped->v, enumerator); def->v.type = enumerator->type(); @@ -4211,336 +3892,319 @@ yyreduce: def->v.valueAsLiteral = constant->value(); } else - { - string msg = "illegal initializer: `" + scoped->v + "' is a"; - static const string vowels = "aeiou"; - string kindOf = cl.front()->kindOf(); - if(vowels.find_first_of(kindOf[0]) != string::npos) - { - msg += "n"; - } - msg += " " + kindOf; - unit->error(msg); // $$ is dummy - } + { + string msg = "illegal initializer: `" + scoped->v + "' is a"; + static const string vowels = "aeiou"; + string kindOf = cl.front()->kindOf(); + if(vowels.find_first_of(kindOf[0]) != string::npos) + { + msg += "n"; + } + msg += " " + kindOf; + unit->error(msg); // $$ is dummy + } } (yyval) = def; -;} +} +#line 3910 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 169: - -/* Line 1455 of yacc.c */ -#line 1999 "../Slice/Grammar.y" + case 171: +#line 2009 "../Slice/Grammar.y" /* yacc.c:1646 */ { BuiltinPtr type = unit->builtin(Builtin::KindString); - StringTokPtr literal = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); + StringTokPtr literal = StringTokPtr::dynamicCast((yyvsp[0])); ConstDefTokPtr def = new ConstDefTok; def->v.type = type; def->v.value = type; def->v.valueAsString = literal->v; def->v.valueAsLiteral = literal->literal; (yyval) = def; -;} +} +#line 3925 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 170: - -/* Line 1455 of yacc.c */ -#line 2010 "../Slice/Grammar.y" + case 172: +#line 2020 "../Slice/Grammar.y" /* yacc.c:1646 */ { BuiltinPtr type = unit->builtin(Builtin::KindBool); - StringTokPtr literal = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); + StringTokPtr literal = StringTokPtr::dynamicCast((yyvsp[0])); ConstDefTokPtr def = new ConstDefTok; def->v.type = type; def->v.value = type; def->v.valueAsString = "false"; def->v.valueAsLiteral = "false"; (yyval) = def; -;} +} +#line 3940 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 171: - -/* Line 1455 of yacc.c */ -#line 2021 "../Slice/Grammar.y" + case 173: +#line 2031 "../Slice/Grammar.y" /* yacc.c:1646 */ { BuiltinPtr type = unit->builtin(Builtin::KindBool); - StringTokPtr literal = StringTokPtr::dynamicCast((yyvsp[(1) - (1)])); + StringTokPtr literal = StringTokPtr::dynamicCast((yyvsp[0])); ConstDefTokPtr def = new ConstDefTok; def->v.type = type; def->v.value = type; def->v.valueAsString = "true"; def->v.valueAsLiteral = "true"; (yyval) = def; -;} +} +#line 3955 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 172: - -/* Line 1455 of yacc.c */ -#line 2037 "../Slice/Grammar.y" + case 174: +#line 2047 "../Slice/Grammar.y" /* yacc.c:1646 */ { - StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(2) - (6)])); - TypePtr const_type = TypePtr::dynamicCast((yyvsp[(3) - (6)])); - StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[(4) - (6)])); - ConstDefTokPtr value = ConstDefTokPtr::dynamicCast((yyvsp[(6) - (6)])); + StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[-4])); + TypePtr const_type = TypePtr::dynamicCast((yyvsp[-3])); + StringTokPtr ident = StringTokPtr::dynamicCast((yyvsp[-2])); + ConstDefTokPtr value = ConstDefTokPtr::dynamicCast((yyvsp[0])); (yyval) = unit->currentContainer()->createConst(ident->v, const_type, metaData->v, value->v.value, value->v.valueAsString, value->v.valueAsLiteral); -;} +} +#line 3968 "Grammar.tab.c" /* yacc.c:1646 */ break; - case 173: - -/* Line 1455 of yacc.c */ -#line 2046 "../Slice/Grammar.y" + case 175: +#line 2056 "../Slice/Grammar.y" /* yacc.c:1646 */ { - StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[(2) - (5)])); - TypePtr const_type = TypePtr::dynamicCast((yyvsp[(3) - (5)])); - ConstDefTokPtr value = ConstDefTokPtr::dynamicCast((yyvsp[(5) - (5)])); + StringListTokPtr metaData = StringListTokPtr::dynamicCast((yyvsp[-3])); + TypePtr const_type = TypePtr::dynamicCast((yyvsp[-2])); + ConstDefTokPtr value = ConstDefTokPtr::dynamicCast((yyvsp[0])); 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 174: - -/* Line 1455 of yacc.c */ -#line 2060 "../Slice/Grammar.y" - { -;} - break; - - case 175: - -/* Line 1455 of yacc.c */ -#line 2063 "../Slice/Grammar.y" - { -;} +} +#line 3981 "Grammar.tab.c" /* yacc.c:1646 */ break; case 176: - -/* Line 1455 of yacc.c */ -#line 2066 "../Slice/Grammar.y" +#line 2070 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 3988 "Grammar.tab.c" /* yacc.c:1646 */ break; case 177: - -/* Line 1455 of yacc.c */ -#line 2069 "../Slice/Grammar.y" +#line 2073 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 3995 "Grammar.tab.c" /* yacc.c:1646 */ break; case 178: - -/* Line 1455 of yacc.c */ -#line 2072 "../Slice/Grammar.y" +#line 2076 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 4002 "Grammar.tab.c" /* yacc.c:1646 */ break; case 179: - -/* Line 1455 of yacc.c */ -#line 2075 "../Slice/Grammar.y" +#line 2079 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 4009 "Grammar.tab.c" /* yacc.c:1646 */ break; case 180: - -/* Line 1455 of yacc.c */ -#line 2078 "../Slice/Grammar.y" +#line 2082 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 4016 "Grammar.tab.c" /* yacc.c:1646 */ break; case 181: - -/* Line 1455 of yacc.c */ -#line 2081 "../Slice/Grammar.y" +#line 2085 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 4023 "Grammar.tab.c" /* yacc.c:1646 */ break; case 182: - -/* Line 1455 of yacc.c */ -#line 2084 "../Slice/Grammar.y" +#line 2088 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 4030 "Grammar.tab.c" /* yacc.c:1646 */ break; case 183: - -/* Line 1455 of yacc.c */ -#line 2087 "../Slice/Grammar.y" +#line 2091 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 4037 "Grammar.tab.c" /* yacc.c:1646 */ break; case 184: - -/* Line 1455 of yacc.c */ -#line 2090 "../Slice/Grammar.y" +#line 2094 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 4044 "Grammar.tab.c" /* yacc.c:1646 */ break; case 185: - -/* Line 1455 of yacc.c */ -#line 2093 "../Slice/Grammar.y" +#line 2097 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 4051 "Grammar.tab.c" /* yacc.c:1646 */ break; case 186: - -/* Line 1455 of yacc.c */ -#line 2096 "../Slice/Grammar.y" +#line 2100 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 4058 "Grammar.tab.c" /* yacc.c:1646 */ break; case 187: - -/* Line 1455 of yacc.c */ -#line 2099 "../Slice/Grammar.y" +#line 2103 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 4065 "Grammar.tab.c" /* yacc.c:1646 */ break; case 188: - -/* Line 1455 of yacc.c */ -#line 2102 "../Slice/Grammar.y" +#line 2106 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 4072 "Grammar.tab.c" /* yacc.c:1646 */ break; case 189: - -/* Line 1455 of yacc.c */ -#line 2105 "../Slice/Grammar.y" +#line 2109 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 4079 "Grammar.tab.c" /* yacc.c:1646 */ break; case 190: - -/* Line 1455 of yacc.c */ -#line 2108 "../Slice/Grammar.y" +#line 2112 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 4086 "Grammar.tab.c" /* yacc.c:1646 */ break; case 191: - -/* Line 1455 of yacc.c */ -#line 2111 "../Slice/Grammar.y" +#line 2115 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 4093 "Grammar.tab.c" /* yacc.c:1646 */ break; case 192: - -/* Line 1455 of yacc.c */ -#line 2114 "../Slice/Grammar.y" +#line 2118 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 4100 "Grammar.tab.c" /* yacc.c:1646 */ break; case 193: - -/* Line 1455 of yacc.c */ -#line 2117 "../Slice/Grammar.y" +#line 2121 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 4107 "Grammar.tab.c" /* yacc.c:1646 */ break; case 194: - -/* Line 1455 of yacc.c */ -#line 2120 "../Slice/Grammar.y" +#line 2124 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 4114 "Grammar.tab.c" /* yacc.c:1646 */ break; case 195: - -/* Line 1455 of yacc.c */ -#line 2123 "../Slice/Grammar.y" +#line 2127 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 4121 "Grammar.tab.c" /* yacc.c:1646 */ break; case 196: - -/* Line 1455 of yacc.c */ -#line 2126 "../Slice/Grammar.y" +#line 2130 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 4128 "Grammar.tab.c" /* yacc.c:1646 */ break; case 197: - -/* Line 1455 of yacc.c */ -#line 2129 "../Slice/Grammar.y" +#line 2133 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 4135 "Grammar.tab.c" /* yacc.c:1646 */ break; case 198: - -/* Line 1455 of yacc.c */ -#line 2132 "../Slice/Grammar.y" +#line 2136 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 4142 "Grammar.tab.c" /* yacc.c:1646 */ break; case 199: - -/* Line 1455 of yacc.c */ -#line 2135 "../Slice/Grammar.y" +#line 2139 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 4149 "Grammar.tab.c" /* yacc.c:1646 */ break; case 200: - -/* Line 1455 of yacc.c */ -#line 2138 "../Slice/Grammar.y" +#line 2142 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 4156 "Grammar.tab.c" /* yacc.c:1646 */ break; case 201: - -/* Line 1455 of yacc.c */ -#line 2141 "../Slice/Grammar.y" +#line 2145 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 4163 "Grammar.tab.c" /* yacc.c:1646 */ break; case 202: +#line 2148 "../Slice/Grammar.y" /* yacc.c:1646 */ + { +} +#line 4170 "Grammar.tab.c" /* yacc.c:1646 */ + break; -/* Line 1455 of yacc.c */ -#line 2144 "../Slice/Grammar.y" + case 203: +#line 2151 "../Slice/Grammar.y" /* yacc.c:1646 */ { -;} +} +#line 4177 "Grammar.tab.c" /* yacc.c:1646 */ break; + case 204: +#line 2154 "../Slice/Grammar.y" /* yacc.c:1646 */ + { +} +#line 4184 "Grammar.tab.c" /* yacc.c:1646 */ + break; + + case 205: +#line 2157 "../Slice/Grammar.y" /* yacc.c:1646 */ + { +} +#line 4191 "Grammar.tab.c" /* yacc.c:1646 */ + break; -/* Line 1455 of yacc.c */ -#line 4542 "Grammar.tab.c" +#line 4195 "Grammar.tab.c" /* yacc.c:1646 */ 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); @@ -4549,7 +4213,7 @@ yyreduce: *++yyvsp = yyval; - /* Now `shift' the result of the reduction. Determine what state + /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ @@ -4564,10 +4228,14 @@ yyreduce: goto yynewstate; -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ +/*--------------------------------------. +| 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) { @@ -4575,37 +4243,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 } @@ -4614,20 +4281,20 @@ yyerrlab: if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an - error, discard it. */ + error, discard it. */ if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } } /* Else will try to reuse lookahead token after shifting the error @@ -4646,7 +4313,7 @@ yyerrorlab: if (/*CONSTCOND*/ 0) goto yyerrorlab; - /* Do not reclaim the symbols of the rule which action triggered + /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; @@ -4659,35 +4326,37 @@ yyerrorlab: | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ + yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) { yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } + if (!yypact_value_is_default (yyn)) + { + yyn += YYTERROR; + if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) + { + yyn = yytable[yyn]; + if (0 < yyn) + break; + } + } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) - YYABORT; + YYABORT; yydestruct ("Error: popping", - yystos[yystate], yyvsp); + yystos[yystate], yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END /* Shift the error token. */ @@ -4711,7 +4380,7 @@ yyabortlab: yyresult = 1; goto yyreturn; -#if !defined(yyoverflow) || YYERROR_VERBOSE +#if !defined yyoverflow || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ @@ -4723,16 +4392,21 @@ yyexhaustedlab: yyreturn: if (yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - /* Do not reclaim the symbols of the rule which action triggered + { + /* 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 whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); + yystos[*yyssp], yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow @@ -4743,13 +4417,7 @@ yyreturn: if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); #endif - /* Make sure YYID is used. */ - return YYID (yyresult); + return yyresult; } - - - -/* Line 1675 of yacc.c */ -#line 2148 "../Slice/Grammar.y" - +#line 2161 "../Slice/Grammar.y" /* yacc.c:1906 */ diff --git a/cpp/src/Slice/Grammar.h b/cpp/src/Slice/Grammar.h index 0ee3d141315..66aa4b73ccd 100644 --- a/cpp/src/Slice/Grammar.h +++ b/cpp/src/Slice/Grammar.h @@ -1,21 +1,19 @@ +/* A Bison parser, made by GNU Bison 3.0.2. */ -/* A Bison parser, made by GNU Bison 2.4.1. */ +/* Bison interface for Yacc-like parsers in C + + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. -/* Skeleton interface for Bison's Yacc-like parsers in C - - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 - Free Software Foundation, Inc. - This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. */ @@ -28,71 +26,80 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ +#ifndef YY_SLICE_GRAMMAR_TAB_H_INCLUDED +# define YY_SLICE_GRAMMAR_TAB_H_INCLUDED +/* Debug traces. */ +#ifndef YYDEBUG +# define YYDEBUG 1 +#endif +#if YYDEBUG +extern int slice_debug; +#endif -/* Tokens. */ +/* Token type. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - ICE_MODULE = 258, - ICE_CLASS = 259, - ICE_INTERFACE = 260, - ICE_EXCEPTION = 261, - ICE_STRUCT = 262, - ICE_SEQUENCE = 263, - ICE_DICTIONARY = 264, - ICE_ENUM = 265, - ICE_OUT = 266, - ICE_EXTENDS = 267, - ICE_IMPLEMENTS = 268, - ICE_THROWS = 269, - ICE_VOID = 270, - ICE_BYTE = 271, - ICE_BOOL = 272, - ICE_SHORT = 273, - ICE_INT = 274, - ICE_LONG = 275, - ICE_FLOAT = 276, - ICE_DOUBLE = 277, - ICE_STRING = 278, - ICE_OBJECT = 279, - ICE_LOCAL_OBJECT = 280, - ICE_LOCAL = 281, - ICE_CONST = 282, - ICE_FALSE = 283, - ICE_TRUE = 284, - ICE_IDEMPOTENT = 285, - ICE_OPTIONAL = 286, - ICE_SCOPE_DELIMITER = 287, - ICE_IDENTIFIER = 288, - ICE_STRING_LITERAL = 289, - ICE_INTEGER_LITERAL = 290, - ICE_FLOATING_POINT_LITERAL = 291, - ICE_IDENT_OP = 292, - ICE_KEYWORD_OP = 293, - ICE_OPTIONAL_OP = 294, - ICE_METADATA_OPEN = 295, - ICE_METADATA_CLOSE = 296, - ICE_GLOBAL_METADATA_OPEN = 297, - ICE_GLOBAL_METADATA_CLOSE = 298, - BAD_CHAR = 299 - }; + enum yytokentype + { + ICE_MODULE = 258, + ICE_CLASS = 259, + ICE_INTERFACE = 260, + ICE_EXCEPTION = 261, + ICE_STRUCT = 262, + ICE_SEQUENCE = 263, + ICE_DICTIONARY = 264, + ICE_ENUM = 265, + ICE_OUT = 266, + ICE_EXTENDS = 267, + ICE_IMPLEMENTS = 268, + ICE_THROWS = 269, + ICE_VOID = 270, + ICE_BYTE = 271, + ICE_BOOL = 272, + ICE_SHORT = 273, + ICE_INT = 274, + ICE_LONG = 275, + ICE_FLOAT = 276, + ICE_DOUBLE = 277, + ICE_STRING = 278, + ICE_OBJECT = 279, + ICE_LOCAL_OBJECT = 280, + ICE_LOCAL = 281, + ICE_CONST = 282, + ICE_FALSE = 283, + ICE_TRUE = 284, + ICE_IDEMPOTENT = 285, + ICE_OPTIONAL = 286, + ICE_VALUE = 287, + ICE_SCOPE_DELIMITER = 288, + ICE_IDENTIFIER = 289, + ICE_STRING_LITERAL = 290, + ICE_INTEGER_LITERAL = 291, + ICE_FLOATING_POINT_LITERAL = 292, + ICE_IDENT_OP = 293, + ICE_KEYWORD_OP = 294, + ICE_OPTIONAL_OP = 295, + ICE_METADATA_OPEN = 296, + ICE_METADATA_CLOSE = 297, + ICE_GLOBAL_METADATA_OPEN = 298, + ICE_GLOBAL_METADATA_CLOSE = 299, + BAD_CHAR = 300 + }; #endif - - +/* Value type. */ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 #endif +int slice_parse (void); +#endif /* !YY_SLICE_GRAMMAR_TAB_H_INCLUDED */ diff --git a/cpp/src/Slice/Grammar.y b/cpp/src/Slice/Grammar.y index 43d61962ea0..9d04ed64c73 100644 --- a/cpp/src/Slice/Grammar.y +++ b/cpp/src/Slice/Grammar.y @@ -40,11 +40,11 @@ slice_error(const char* s) if (strcmp(s, "parse error") == 0) { - unit->error("syntax error"); + unit->error("syntax error"); } else { - unit->error(s); + unit->error(s); } } @@ -86,6 +86,7 @@ slice_error(const char* s) %token ICE_TRUE %token ICE_IDEMPOTENT %token ICE_OPTIONAL +%token ICE_VALUE // // Other tokens. @@ -156,7 +157,7 @@ definitions ContainedPtr contained = ContainedPtr::dynamicCast($2); if(contained && !metaData->v.empty()) { - contained->setMetaData(metaData->v); + contained->setMetaData(metaData->v); } } ';' definitions @@ -242,9 +243,9 @@ module_def ModulePtr module = cont->createModule(ident->v); if(module) { - cont->checkIntroduced(ident->v, module); - unit->pushContainer(module); - $$ = module; + cont->checkIntroduced(ident->v, module); + unit->pushContainer(module); + $$ = module; } else { @@ -255,8 +256,8 @@ module_def { if($3) { - unit->popContainer(); - $$ = $3; + unit->popContainer(); + $$ = $3; } else { @@ -302,8 +303,8 @@ exception_def ExceptionPtr ex = cont->createException(ident->v, base, local->v); if(ex) { - cont->checkIntroduced(ident->v, ex); - unit->pushContainer(ex); + cont->checkIntroduced(ident->v, ex); + unit->pushContainer(ex); } $$ = ex; } @@ -311,7 +312,7 @@ exception_def { if($4) { - unit->popContainer(); + unit->popContainer(); } $$ = $4; } @@ -343,7 +344,7 @@ exception_exports ContainedPtr contained = ContainedPtr::dynamicCast($2); if(contained && !metaData->v.empty()) { - contained->setMetaData(metaData->v); + contained->setMetaData(metaData->v); } } | error ';' exception_exports @@ -533,8 +534,8 @@ struct_def StructPtr st = cont->createStruct(ident->v, local->v); if(st) { - cont->checkIntroduced(ident->v, st); - unit->pushContainer(st); + cont->checkIntroduced(ident->v, st); + unit->pushContainer(st); } else { @@ -548,7 +549,7 @@ struct_def { if($3) { - unit->popContainer(); + unit->popContainer(); } $$ = $3; @@ -559,7 +560,7 @@ struct_def assert(st); if(st->dataMembers().empty()) { - unit->error("struct `" + st->name() + "' must have at least one member"); // $$ is a dummy + unit->error("struct `" + st->name() + "' must have at least one member"); // $$ is a dummy } } ; @@ -573,7 +574,7 @@ struct_exports ContainedPtr contained = ContainedPtr::dynamicCast($2); if(contained && !metaData->v.empty()) { - contained->setMetaData(metaData->v); + contained->setMetaData(metaData->v); } } | error ';' struct_exports @@ -736,14 +737,14 @@ class_def ClassListTokPtr bases = ClassListTokPtr::dynamicCast($4); if(base) { - bases->v.push_front(base); + bases->v.push_front(base); } ClassDefPtr cl = cont->createClassDef(ident->v, ident->t, false, bases->v, local->v); if(cl) { - cont->checkIntroduced(ident->v, cl); - unit->pushContainer(cl); - $$ = cl; + cont->checkIntroduced(ident->v, cl); + unit->pushContainer(cl); + $$ = cl; } else { @@ -754,8 +755,8 @@ class_def { if($5) { - unit->popContainer(); - $$ = $5; + unit->popContainer(); + $$ = $5; } else { @@ -775,30 +776,30 @@ class_extends $$ = 0; if(!types.empty()) { - ClassDeclPtr cl = ClassDeclPtr::dynamicCast(types.front()); - if(!cl || cl->isInterface()) - { - string msg = "`"; - msg += scoped->v; - msg += "' is not a class"; - unit->error(msg); - } - else - { - ClassDefPtr def = cl->definition(); - if(!def) - { - string msg = "`"; - msg += scoped->v; - msg += "' has been declared but not defined"; - unit->error(msg); - } - else - { - cont->checkIntroduced(scoped->v); - $$ = def; - } - } + ClassDeclPtr cl = ClassDeclPtr::dynamicCast(types.front()); + if(!cl || cl->isInterface()) + { + string msg = "`"; + msg += scoped->v; + msg += "' is not a class"; + unit->error(msg); + } + else + { + ClassDefPtr def = cl->definition(); + if(!def) + { + string msg = "`"; + msg += scoped->v; + msg += "' has been declared but not defined"; + unit->error(msg); + } + else + { + cont->checkIntroduced(scoped->v); + $$ = def; + } + } } } | @@ -829,7 +830,7 @@ class_exports ContainedPtr contained = ContainedPtr::dynamicCast($2); if(contained && !metaData->v.empty()) { - contained->setMetaData(metaData->v); + contained->setMetaData(metaData->v); } } | error ';' class_exports @@ -1039,17 +1040,17 @@ operation_preamble ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); if(cl) { - OperationPtr op = cl->createOperation(name, returnType->v.type, returnType->v.optional, returnType->v.tag); - if(op) - { - cl->checkIntroduced(name, op); - unit->pushContainer(op); - $$ = op; - } - else - { - $$ = 0; - } + OperationPtr op = cl->createOperation(name, returnType->v.type, returnType->v.optional, returnType->v.tag); + if(op) + { + cl->checkIntroduced(name, op); + unit->pushContainer(op); + $$ = op; + } + else + { + $$ = 0; + } } else { @@ -1063,18 +1064,18 @@ operation_preamble ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); if(cl) { - OperationPtr op = cl->createOperation(name, returnType->v.type, returnType->v.optional, returnType->v.tag, - Operation::Idempotent); - if(op) - { - cl->checkIntroduced(name, op); - unit->pushContainer(op); - $$ = op; - } - else - { - $$ = 0; - } + OperationPtr op = cl->createOperation(name, returnType->v.type, returnType->v.optional, returnType->v.tag, + Operation::Idempotent); + if(op) + { + cl->checkIntroduced(name, op); + unit->pushContainer(op); + $$ = op; + } + else + { + $$ = 0; + } } else { @@ -1088,17 +1089,17 @@ operation_preamble ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); if(cl) { - OperationPtr op = cl->createOperation(name, returnType->v.type, returnType->v.optional, returnType->v.tag); - if(op) - { - unit->pushContainer(op); - unit->error("keyword `" + name + "' cannot be used as operation name"); - $$ = op; // Dummy - } - else - { - $$ = 0; - } + OperationPtr op = cl->createOperation(name, returnType->v.type, returnType->v.optional, returnType->v.tag); + if(op) + { + unit->pushContainer(op); + unit->error("keyword `" + name + "' cannot be used as operation name"); + $$ = op; // Dummy + } + else + { + $$ = 0; + } } else { @@ -1112,22 +1113,22 @@ operation_preamble ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); if(cl) { - OperationPtr op = cl->createOperation(name, returnType->v.type, returnType->v.optional, returnType->v.tag, - Operation::Idempotent); - if(op) - { - unit->pushContainer(op); - unit->error("keyword `" + name + "' cannot be used as operation name"); - $$ = op; // Dummy - } - else - { - return 0; - } + OperationPtr op = cl->createOperation(name, returnType->v.type, returnType->v.optional, returnType->v.tag, + Operation::Idempotent); + if(op) + { + unit->pushContainer(op); + unit->error("keyword `" + name + "' cannot be used as operation name"); + $$ = op; // Dummy + } + else + { + return 0; + } } else { - $$ = 0; + $$ = 0; } } ; @@ -1139,8 +1140,8 @@ operation { if($1) { - unit->popContainer(); - $$ = $1; + unit->popContainer(); + $$ = $1; } else { @@ -1161,7 +1162,7 @@ throws { if($1) { - unit->popContainer(); + unit->popContainer(); } yyerrok; } @@ -1225,9 +1226,9 @@ interface_def ClassDefPtr cl = cont->createClassDef(ident->v, -1, true, bases->v, local->v); if(cl) { - cont->checkIntroduced(ident->v, cl); - unit->pushContainer(cl); - $$ = cl; + cont->checkIntroduced(ident->v, cl); + unit->pushContainer(cl); + $$ = cl; } else { @@ -1238,12 +1239,12 @@ interface_def { if($4) { - unit->popContainer(); - $$ = $4; + unit->popContainer(); + $$ = $4; } else { - $$ = 0; + $$ = 0; } } ; @@ -1259,30 +1260,30 @@ interface_list TypeList types = cont->lookupType(scoped->v); if(!types.empty()) { - ClassDeclPtr cl = ClassDeclPtr::dynamicCast(types.front()); - if(!cl || !cl->isInterface()) - { - string msg = "`"; - msg += scoped->v; - msg += "' is not an interface"; - unit->error(msg); - } - else - { - ClassDefPtr def = cl->definition(); - if(!def) - { - string msg = "`"; - msg += scoped->v; - msg += "' has been declared but not defined"; - unit->error(msg); - } - else - { - cont->checkIntroduced(scoped->v); - intfs->v.push_front(def); - } - } + ClassDeclPtr cl = ClassDeclPtr::dynamicCast(types.front()); + if(!cl || !cl->isInterface()) + { + string msg = "`"; + msg += scoped->v; + msg += "' is not an interface"; + unit->error(msg); + } + else + { + ClassDefPtr def = cl->definition(); + if(!def) + { + string msg = "`"; + msg += scoped->v; + msg += "' has been declared but not defined"; + unit->error(msg); + } + else + { + cont->checkIntroduced(scoped->v); + intfs->v.push_front(def); + } + } } $$ = intfs; } @@ -1294,30 +1295,30 @@ interface_list TypeList types = cont->lookupType(scoped->v); if(!types.empty()) { - ClassDeclPtr cl = ClassDeclPtr::dynamicCast(types.front()); - if(!cl || !cl->isInterface()) - { - string msg = "`"; - msg += scoped->v; - msg += "' is not an interface"; - unit->error(msg); // $$ is a dummy - } - else - { - ClassDefPtr def = cl->definition(); - if(!def) - { - string msg = "`"; - msg += scoped->v; - msg += "' has been declared but not defined"; - unit->error(msg); // $$ is a dummy - } - else - { - cont->checkIntroduced(scoped->v); - intfs->v.push_front(def); - } - } + ClassDeclPtr cl = ClassDeclPtr::dynamicCast(types.front()); + if(!cl || !cl->isInterface()) + { + string msg = "`"; + msg += scoped->v; + msg += "' is not an interface"; + unit->error(msg); // $$ is a dummy + } + else + { + ClassDefPtr def = cl->definition(); + if(!def) + { + string msg = "`"; + msg += scoped->v; + msg += "' has been declared but not defined"; + unit->error(msg); // $$ is a dummy + } + else + { + cont->checkIntroduced(scoped->v); + intfs->v.push_front(def); + } + } } $$ = intfs; } @@ -1326,6 +1327,11 @@ interface_list unit->error("illegal inheritance from type Object"); $$ = new ClassListTok; // Dummy } +| ICE_VALUE +{ + unit->error("illegal inheritance from type Value"); + $$ = new ClassListTok; // Dummy +} ; // ---------------------------------------------------------------------- @@ -1350,7 +1356,7 @@ interface_exports ContainedPtr contained = ContainedPtr::dynamicCast($2); if(contained && !metaData->v.empty()) { - contained->setMetaData(metaData->v); + contained->setMetaData(metaData->v); } } | error ';' interface_exports @@ -1400,7 +1406,7 @@ exception ExceptionPtr exception = cont->lookupException(scoped->v); if(!exception) { - exception = cont->createException(IceUtil::generateUUID(), 0, false, Dummy); // Dummy + exception = cont->createException(IceUtil::generateUUID(), 0, false, Dummy); // Dummy } cont->checkIntroduced(scoped->v, exception); $$ = exception; @@ -1497,12 +1503,12 @@ enum_def EnumPtr en = EnumPtr::dynamicCast($3); if(en) { - EnumeratorListTokPtr enumerators = EnumeratorListTokPtr::dynamicCast($5); - if(enumerators->v.empty()) - { - unit->error("enum `" + en->name() + "' must have at least one enumerator"); - } - en->setEnumerators(enumerators->v); // Dummy + EnumeratorListTokPtr enumerators = EnumeratorListTokPtr::dynamicCast($5); + if(enumerators->v.empty()) + { + unit->error("enum `" + en->name() + "' must have at least one enumerator"); + } + en->setEnumerators(enumerators->v); // Dummy } $$ = $3; } @@ -1544,7 +1550,7 @@ enumerator EnumeratorPtr en = cont->createEnumerator(ident->v); if(en) { - ens->v.push_front(en); + ens->v.push_front(en); } $$ = ens; } @@ -1658,8 +1664,8 @@ parameters OperationPtr op = OperationPtr::dynamicCast(unit->currentContainer()); if(op) { - ParamDeclPtr pd = op->createParamDecl(tsp->v.name, tsp->v.type, isOutParam->v, tsp->v.optional, tsp->v.tag); - unit->currentContainer()->checkIntroduced(tsp->v.name, pd); + ParamDeclPtr pd = op->createParamDecl(tsp->v.name, tsp->v.type, isOutParam->v, tsp->v.optional, tsp->v.tag); + unit->currentContainer()->checkIntroduced(tsp->v.name, pd); StringListTokPtr metaData = StringListTokPtr::dynamicCast($2); if(!metaData->v.empty()) { @@ -1674,8 +1680,8 @@ parameters OperationPtr op = OperationPtr::dynamicCast(unit->currentContainer()); if(op) { - ParamDeclPtr pd = op->createParamDecl(tsp->v.name, tsp->v.type, isOutParam->v, tsp->v.optional, tsp->v.tag); - unit->currentContainer()->checkIntroduced(tsp->v.name, pd); + ParamDeclPtr pd = op->createParamDecl(tsp->v.name, tsp->v.type, isOutParam->v, tsp->v.optional, tsp->v.tag); + unit->currentContainer()->checkIntroduced(tsp->v.name, pd); StringListTokPtr metaData = StringListTokPtr::dynamicCast($4); if(!metaData->v.empty()) { @@ -1691,8 +1697,8 @@ parameters OperationPtr op = OperationPtr::dynamicCast(unit->currentContainer()); if(op) { - op->createParamDecl(ident->v, type, isOutParam->v, false, 0); // Dummy - unit->error("keyword `" + ident->v + "' cannot be used as parameter name"); + op->createParamDecl(ident->v, type, isOutParam->v, false, 0); // Dummy + unit->error("keyword `" + ident->v + "' cannot be used as parameter name"); } } | parameters ',' out_qualifier meta_data type keyword @@ -1703,8 +1709,8 @@ parameters OperationPtr op = OperationPtr::dynamicCast(unit->currentContainer()); if(op) { - op->createParamDecl(ident->v, type, isOutParam->v, false, 0); // Dummy - unit->error("keyword `" + ident->v + "' cannot be used as parameter name"); + op->createParamDecl(ident->v, type, isOutParam->v, false, 0); // Dummy + unit->error("keyword `" + ident->v + "' cannot be used as parameter name"); } } | out_qualifier meta_data type @@ -1714,8 +1720,8 @@ parameters OperationPtr op = OperationPtr::dynamicCast(unit->currentContainer()); if(op) { - op->createParamDecl(IceUtil::generateUUID(), type, isOutParam->v, false, 0); // Dummy - unit->error("missing parameter name"); + op->createParamDecl(IceUtil::generateUUID(), type, isOutParam->v, false, 0); // Dummy + unit->error("missing parameter name"); } } | parameters ',' out_qualifier meta_data type @@ -1725,8 +1731,8 @@ parameters OperationPtr op = OperationPtr::dynamicCast(unit->currentContainer()); if(op) { - op->createParamDecl(IceUtil::generateUUID(), type, isOutParam->v, false, 0); // Dummy - unit->error("missing parameter name"); + op->createParamDecl(IceUtil::generateUUID(), type, isOutParam->v, false, 0); // Dummy + unit->error("missing parameter name"); } } ; @@ -1813,19 +1819,23 @@ type { $$ = unit->builtin(Builtin::KindLocalObject); } +| ICE_VALUE +{ + $$ = unit->builtin(Builtin::KindValue); +} | scoped_name { StringTokPtr scoped = StringTokPtr::dynamicCast($1); ContainerPtr cont = unit->currentContainer(); if(cont) { - TypeList types = cont->lookupType(scoped->v); - if(types.empty()) - { - YYERROR; // Can't continue, jump to next yyerrok - } - cont->checkIntroduced(scoped->v); - $$ = types.front(); + TypeList types = cont->lookupType(scoped->v); + if(types.empty()) + { + YYERROR; // Can't continue, jump to next yyerrok + } + cont->checkIntroduced(scoped->v); + $$ = types.front(); } else { @@ -1838,30 +1848,30 @@ type ContainerPtr cont = unit->currentContainer(); if(cont) { - TypeList types = cont->lookupType(scoped->v); - if(types.empty()) - { - YYERROR; // Can't continue, jump to next yyerrok - } - for(TypeList::iterator p = types.begin(); p != types.end(); ++p) - { - ClassDeclPtr cl = ClassDeclPtr::dynamicCast(*p); - if(!cl) - { - string msg = "`"; - msg += scoped->v; - msg += "' must be class or interface"; - unit->error(msg); - YYERROR; // Can't continue, jump to next yyerrok - } - cont->checkIntroduced(scoped->v); - if(cl->isLocal()) - { - unit->error("cannot create proxy for " + cl->kindOf() + " `" + cl->name() + "'"); // $$ is dummy - } - *p = new Proxy(cl); - } - $$ = types.front(); + TypeList types = cont->lookupType(scoped->v); + if(types.empty()) + { + YYERROR; // Can't continue, jump to next yyerrok + } + for(TypeList::iterator p = types.begin(); p != types.end(); ++p) + { + ClassDeclPtr cl = ClassDeclPtr::dynamicCast(*p); + if(!cl) + { + string msg = "`"; + msg += scoped->v; + msg += "' must be class or interface"; + unit->error(msg); + YYERROR; // Can't continue, jump to next yyerrok + } + cont->checkIntroduced(scoped->v); + if(cl->isLocal()) + { + unit->error("cannot create proxy for " + cl->kindOf() + " `" + cl->name() + "'"); // $$ is dummy + } + *p = new Proxy(cl); + } + $$ = types.front(); } else { @@ -1963,9 +1973,9 @@ const_initializer } else { - EnumeratorPtr enumerator = EnumeratorPtr::dynamicCast(cl.front()); + EnumeratorPtr enumerator = EnumeratorPtr::dynamicCast(cl.front()); ConstPtr constant = ConstPtr::dynamicCast(cl.front()); - if(enumerator) + if(enumerator) { unit->currentContainer()->checkIntroduced(scoped->v, enumerator); def->v.type = enumerator->type(); @@ -1981,17 +1991,17 @@ const_initializer def->v.valueAsLiteral = constant->value(); } else - { - string msg = "illegal initializer: `" + scoped->v + "' is a"; - static const string vowels = "aeiou"; - string kindOf = cl.front()->kindOf(); - if(vowels.find_first_of(kindOf[0]) != string::npos) - { - msg += "n"; - } - msg += " " + kindOf; - unit->error(msg); // $$ is dummy - } + { + string msg = "illegal initializer: `" + scoped->v + "' is a"; + static const string vowels = "aeiou"; + string kindOf = cl.front()->kindOf(); + if(vowels.find_first_of(kindOf[0]) != string::npos) + { + msg += "n"; + } + msg += " " + kindOf; + unit->error(msg); // $$ is dummy + } } $$ = def; } @@ -2143,6 +2153,9 @@ keyword | ICE_OPTIONAL { } +| ICE_VALUE +{ +} ; %% diff --git a/cpp/src/Slice/JavaUtil.cpp b/cpp/src/Slice/JavaUtil.cpp index 207b64fa6ea..67893e4ce24 100644 --- a/cpp/src/Slice/JavaUtil.cpp +++ b/cpp/src/Slice/JavaUtil.cpp @@ -573,7 +573,7 @@ Slice::JavaGenerator::getStaticId(const TypePtr& type, const string& package) co BuiltinPtr b = BuiltinPtr::dynamicCast(type); ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type); - assert((b && b->kind() == Builtin::KindObject) || cl); + assert((b && (b->kind() == Builtin::KindObject || b->kind() == Builtin::KindValue)) || cl); if(b) { @@ -650,6 +650,10 @@ Slice::JavaGenerator::getOptionalFormat(const TypePtr& type) assert(false); break; } + case Builtin::KindValue: + { + return "Ice.OptionalFormat.Class"; + } } } @@ -707,7 +711,8 @@ Slice::JavaGenerator::typeToString(const TypePtr& type, "String", "Ice.Object", "Ice.ObjectPrx", - "java.lang.Object" + "java.lang.Object", + "Ice.Object" // Ice.Value }; static const char* builtinHolderTable[] = { @@ -721,7 +726,8 @@ Slice::JavaGenerator::typeToString(const TypePtr& type, "Ice.StringHolder", "Ice.ObjectHolder", "Ice.ObjectPrxHolder", - "Ice.LocalObjectHolder" + "Ice.LocalObjectHolder", + "Ice.ObjectHolder" // Ice.ValueHolder }; static const char* builtinOptionalTable[] = { @@ -735,6 +741,7 @@ Slice::JavaGenerator::typeToString(const TypePtr& type, "???", "???", "???", + "???", "???" }; @@ -765,6 +772,7 @@ Slice::JavaGenerator::typeToString(const TypePtr& type, case Builtin::KindObject: case Builtin::KindObjectProxy: case Builtin::KindLocalObject: + case Builtin::KindValue: { break; } @@ -904,7 +912,8 @@ Slice::JavaGenerator::typeToObjectString(const TypePtr& type, "java.lang.String", "Ice.Object", "Ice.ObjectPrx", - "java.lang.Object" + "java.lang.Object", + "Ice.Object" // Ice.Value }; BuiltinPtr builtin = BuiltinPtr::dynamicCast(type); @@ -1157,6 +1166,7 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out, break; } case Builtin::KindObject: + case Builtin::KindValue: { if(marshal) { @@ -1249,8 +1259,8 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out, { if(optionalMapping) { - out << nl << "if(" << v << " != null && " << v << ".isSet() && " << stream << ".writeOpt(" << tag - << ", " << getOptionalFormat(type) << "))"; + out << nl << "if(" << v << " != null && " << v << ".isSet() && " << stream << ".writeOptional(" + << tag << ", " << getOptionalFormat(type) << "))"; out << sb; out << nl << "int __pos = " << stream << ".startSize();"; out << nl << typeS << "Helper.__write(" << stream << ", " << v << ".get());"; @@ -1259,7 +1269,7 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out, } else { - out << nl << "if(" << stream << ".writeOpt(" << tag << ", " << getOptionalFormat(type) << "))"; + out << nl << "if(" << stream << ".writeOptional(" << tag << ", " << getOptionalFormat(type) << "))"; out << sb; out << nl << "int __pos = " << stream << ".startSize();"; out << nl << typeS << "Helper.__write(" << stream << ", " << v << ");"; @@ -1282,7 +1292,7 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out, { if(optionalParam) { - out << nl << "if(" << stream << ".readOpt(" << tag << ", " << getOptionalFormat(type) << "))"; + out << nl << "if(" << stream << ".readOptional(" << tag << ", " << getOptionalFormat(type) << "))"; out << sb; out << nl << stream << ".skip(4);"; out << nl << v << ".set(" << typeS << "Helper.__read(" << stream << "));"; @@ -1327,7 +1337,7 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out, if(optionalParam) { string typeS = typeToString(type, TypeModeIn, package); - out << nl << "if(" << stream << ".readOpt(" << tag << ", " << getOptionalFormat(type) << "))"; + out << nl << "if(" << stream << ".readOptional(" << tag << ", " << getOptionalFormat(type) << "))"; out << sb; out << nl << stream << ".readObject(new Ice.OptionalObject(" << v << ", " << typeS << ".class, " << getStaticId(type, package) << "));"; @@ -1375,13 +1385,14 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out, { if(optionalMapping) { - out << nl << "if(" << v << " != null && " << v << ".isSet() && " << stream << ".writeOpt(" + out << nl << "if(" << v << " != null && " << v << ".isSet() && " << stream << ".writeOptional(" << tag << ", " << getOptionalFormat(type) << "))"; val = v + ".get()"; } else { - out << nl << "if(" << stream << ".writeOpt(" << tag << ", " << getOptionalFormat(type) << "))"; + out << nl << "if(" << stream << ".writeOptional(" << tag << ", " << getOptionalFormat(type) + << "))"; val = v; } out << sb; @@ -1394,13 +1405,13 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out, if(st->isVariableLength()) { out << nl << "int __pos = " << stream << ".startSize();"; - out << nl << typeS << ".__write(" << stream << ", " << val << ");"; + out << nl << typeS << ".ice_write(" << stream << ", " << val << ");"; out << nl << stream << ".endSize(__pos);"; } else { out << nl << stream << ".writeSize(" << st->minWireSize() << ");"; - out << nl << typeS << ".__write(" << stream << ", " << val << ");"; + out << nl << typeS << ".ice_write(" << stream << ", " << val << ");"; } if(optionalParam) { @@ -1409,14 +1420,14 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out, } else { - out << nl << typeS << ".__write(" << stream << ", " << v << ");"; + out << nl << typeS << ".ice_write(" << stream << ", " << v << ");"; } } else { if(optionalParam) { - out << nl << "if(" << stream << ".readOpt(" << tag << ", " << getOptionalFormat(type) << "))"; + out << nl << "if(" << stream << ".readOptional(" << tag << ", " << getOptionalFormat(type) << "))"; out << sb; if(st->isVariableLength()) @@ -1429,7 +1440,7 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out, } out << nl << typeS << " __tmpOpt = new " << typeS << "();"; - out << nl << "__tmpOpt.__read(" << stream << ");"; + out << nl << "__tmpOpt.ice_read(" << stream << ");"; out << nl << v << ".set(__tmpOpt);"; out << eb; @@ -1452,11 +1463,11 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out, { out << nl << stream << ".skipSize();"; } - out << nl << v << " = " << typeS << ".__read(" << stream << ", " << v << ");"; + out << nl << v << " = " << typeS << ".ice_read(" << stream << ", " << v << ");"; } else { - out << nl << v << " = " << typeS << ".__read(" << stream << ", " << v << ");"; + out << nl << v << " = " << typeS << ".ice_read(" << stream << ", " << v << ");"; } } return; @@ -1472,32 +1483,32 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out, { if(optionalMapping) { - out << nl << "if(" << v << " != null && " << v << ".isSet() && " << stream << ".writeOpt(" << tag - << ", " << getOptionalFormat(type) << "))"; + out << nl << "if(" << v << " != null && " << v << ".isSet() && " << stream << ".writeOptional(" + << tag << ", " << getOptionalFormat(type) << "))"; out << sb; - out << nl << typeS << ".__write(" << stream << ", " << v << ".get());"; + out << nl << typeS << ".ice_write(" << stream << ", " << v << ".get());"; out << eb; } else { - out << nl << "if(" << stream << ".writeOpt(" << tag << ", " << getOptionalFormat(type) << "))"; + out << nl << "if(" << stream << ".writeOptional(" << tag << ", " << getOptionalFormat(type) << "))"; out << sb; - out << nl << typeS << ".__write(" << stream << ", " << v << ");"; + out << nl << typeS << ".ice_write(" << stream << ", " << v << ");"; out << eb; } } else { - out << nl << typeS << ".__write(" << stream << ", " << v << ");"; + out << nl << typeS << ".ice_write(" << stream << ", " << v << ");"; } } else { if(optionalParam) { - out << nl << "if(" << stream << ".readOpt(" << tag << ", " << getOptionalFormat(type) << "))"; + out << nl << "if(" << stream << ".readOptional(" << tag << ", " << getOptionalFormat(type) << "))"; out << sb; - out << nl << v << ".set(" << typeS << ".__read(" << stream << "));"; + out << nl << v << ".set(" << typeS << ".ice_read(" << stream << "));"; out << eb; if(mode == OptionalOutParam) { @@ -1509,7 +1520,7 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out, } else { - out << nl << v << " = " << typeS << ".__read(" << stream << ");"; + out << nl << v << " = " << typeS << ".ice_read(" << stream << ");"; } } return; @@ -1530,13 +1541,14 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out, { if(optionalMapping) { - out << nl << "if(" << v << " != null && " << v << ".isSet() && " << stream << ".writeOpt(" + out << nl << "if(" << v << " != null && " << v << ".isSet() && " << stream << ".writeOptional(" << tag << ", " << getOptionalFormat(type) << "))"; out << sb; } else { - out << nl << "if(" << stream << ".writeOpt(" << tag << ", " << getOptionalFormat(type) << "))"; + out << nl << "if(" << stream << ".writeOptional(" << tag << ", " << getOptionalFormat(type) + << "))"; out << sb; } } @@ -1579,7 +1591,7 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out, if(optionalParam) { tmpName = "__optDict"; - out << nl << "if(" << stream << ".readOpt(" << tag << ", " << getOptionalFormat(type) << "))"; + out << nl << "if(" << stream << ".readOptional(" << tag << ", " << getOptionalFormat(type) << "))"; out << sb; out << nl << typeS << ' ' << tmpName << ';'; } @@ -1630,7 +1642,8 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out, BuiltinPtr elemBuiltin = BuiltinPtr::dynamicCast(elemType); if(optionalParam && elemBuiltin && elemBuiltin->kind() != Builtin::KindObject && - elemBuiltin->kind() != Builtin::KindObjectProxy && !hasTypeMetaData(seq, metaData)) + elemBuiltin->kind() != Builtin::KindObjectProxy && elemBuiltin->kind() != Builtin::KindValue && + !hasTypeMetaData(seq, metaData)) { static const char* builtinTable[] = { @@ -1670,6 +1683,7 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out, } return; } + case Builtin::KindValue: case Builtin::KindObject: case Builtin::KindObjectProxy: case Builtin::KindLocalObject: @@ -1689,12 +1703,13 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out, { if(optionalMapping) { - out << nl << "if(" << v << " != null && " << v << ".isSet() && " << stream << ".writeOpt(" + out << nl << "if(" << v << " != null && " << v << ".isSet() && " << stream << ".writeOptional(" << tag << ", " << getOptionalFormat(type) << "))"; } else { - out << nl << "if(" << stream << ".writeOpt(" << tag << ", " << getOptionalFormat(type) << "))"; + out << nl << "if(" << stream << ".writeOptional(" << tag << ", " << getOptionalFormat(type) + << "))"; } out << sb; @@ -1781,7 +1796,7 @@ Slice::JavaGenerator::writeMarshalUnmarshalCode(Output& out, if(optionalParam) { tmpName = "__optSeq"; - out << nl << "if(" << stream << ".readOpt(" << tag << ", " << getOptionalFormat(type) << "))"; + out << nl << "if(" << stream << ".readOptional(" << tag << ", " << getOptionalFormat(type) << "))"; out << sb; out << nl << typeS << ' ' << tmpName << ';'; } @@ -1972,7 +1987,7 @@ Slice::JavaGenerator::writeDictionaryMarshalUnmarshalCode(Output& out, } BuiltinPtr b = BuiltinPtr::dynamicCast(type); - if(ClassDeclPtr::dynamicCast(type) || (b && b->kind() == Builtin::KindObject)) + if(ClassDeclPtr::dynamicCast(type) || (b && (b->kind() == Builtin::KindObject || b->kind() == Builtin::KindValue))) { string keyTypeStr = typeToObjectString(key, TypeModeIn, package); string valueTypeStr = typeToObjectString(value, TypeModeIn, package); @@ -1995,7 +2010,8 @@ Slice::JavaGenerator::writeDictionaryMarshalUnmarshalCode(Output& out, } } BuiltinPtr builtin = BuiltinPtr::dynamicCast(value); - if(!(builtin && builtin->kind() == Builtin::KindObject) && !ClassDeclPtr::dynamicCast(value)) + if(!(builtin && (builtin->kind() == Builtin::KindObject || builtin->kind() == Builtin::KindValue)) && + !ClassDeclPtr::dynamicCast(value)) { out << nl << "" << v << ".put(__key, __value);"; } @@ -2153,6 +2169,7 @@ Slice::JavaGenerator::writeSequenceMarshalUnmarshalCode(Output& out, case Builtin::KindObject: case Builtin::KindObjectProxy: case Builtin::KindLocalObject: + case Builtin::KindValue: { assert(false); break; @@ -2263,7 +2280,7 @@ Slice::JavaGenerator::writeSequenceMarshalUnmarshalCode(Output& out, { bool isObject = false; ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type); - if((b && b->kind() == Builtin::KindObject) || cl) + if((b && (b->kind() == Builtin::KindObject || b->kind() == Builtin::KindValue)) || cl) { isObject = true; } @@ -2328,7 +2345,9 @@ Slice::JavaGenerator::writeSequenceMarshalUnmarshalCode(Output& out, else { BuiltinPtr b = BuiltinPtr::dynamicCast(type); - if(b && b->kind() != Builtin::KindObject && b->kind() != Builtin::KindObjectProxy) + if(b && b->kind() != Builtin::KindObject && + b->kind() != Builtin::KindValue && + b->kind() != Builtin::KindObjectProxy) { switch(b->kind()) { @@ -2428,6 +2447,7 @@ Slice::JavaGenerator::writeSequenceMarshalUnmarshalCode(Output& out, } break; } + case Builtin::KindValue: case Builtin::KindObject: case Builtin::KindObjectProxy: case Builtin::KindLocalObject: @@ -2462,7 +2482,7 @@ Slice::JavaGenerator::writeSequenceMarshalUnmarshalCode(Output& out, { bool isObject = false; ClassDeclPtr cl = ClassDeclPtr::dynamicCast(origContent); - if((b && b->kind() == Builtin::KindObject) || cl) + if((b && (b->kind() == Builtin::KindObject || b->kind() == Builtin::KindValue)) || cl) { isObject = true; } @@ -2553,1193 +2573,6 @@ Slice::JavaGenerator::writeSequenceMarshalUnmarshalCode(Output& out, } } -void -Slice::JavaGenerator::writeStreamMarshalUnmarshalCode(Output& out, - const string& package, - const TypePtr& type, - bool optional, - int /*tag*/, - const string& param, - bool marshal, - int& iter, - bool holder, - const StringList& metaData, - const string& patchParams) -{ - string stream = marshal ? "__outS" : "__inS"; - string v; - if(holder && !optional) - { - v = param + ".value"; - } - else - { - v = param; - } - - BuiltinPtr builtin = BuiltinPtr::dynamicCast(type); - if(builtin) - { - switch(builtin->kind()) - { - case Builtin::KindByte: - { - if(marshal) - { - out << nl << stream << ".writeByte(" << v << ");"; - } - else - { - out << nl << v << " = " << stream << ".readByte();"; - } - break; - } - case Builtin::KindBool: - { - if(marshal) - { - out << nl << stream << ".writeBool(" << v << ");"; - } - else - { - out << nl << v << " = " << stream << ".readBool();"; - } - break; - } - case Builtin::KindShort: - { - if(marshal) - { - out << nl << stream << ".writeShort(" << v << ");"; - } - else - { - out << nl << v << " = " << stream << ".readShort();"; - } - break; - } - case Builtin::KindInt: - { - if(marshal) - { - out << nl << stream << ".writeInt(" << v << ");"; - } - else - { - out << nl << v << " = " << stream << ".readInt();"; - } - break; - } - case Builtin::KindLong: - { - if(marshal) - { - out << nl << stream << ".writeLong(" << v << ");"; - } - else - { - out << nl << v << " = " << stream << ".readLong();"; - } - break; - } - case Builtin::KindFloat: - { - if(marshal) - { - out << nl << stream << ".writeFloat(" << v << ");"; - } - else - { - out << nl << v << " = " << stream << ".readFloat();"; - } - break; - } - case Builtin::KindDouble: - { - if(marshal) - { - out << nl << stream << ".writeDouble(" << v << ");"; - } - else - { - out << nl << v << " = " << stream << ".readDouble();"; - } - break; - } - case Builtin::KindString: - { - if(marshal) - { - out << nl << stream << ".writeString(" << v << ");"; - } - else - { - out << nl << v << " = " << stream << ".readString();"; - } - break; - } - case Builtin::KindObject: - { - if(marshal) - { - out << nl << stream << ".writeObject(" << v << ");"; - } - else - { - if(holder && !optional) - { - out << nl << stream << ".readObject(" << param << ");"; - } - else - { - if(patchParams.empty()) - { - out << nl << stream << ".readObject(new Patcher());"; - } - else - { - out << nl << stream << ".readObject(" << patchParams << ");"; - } - } - } - break; - } - case Builtin::KindObjectProxy: - { - if(marshal) - { - if(optional) - { - out << nl << "int __pos = " << stream << ".startSize();"; - out << nl << stream << ".writeProxy(" << v << ");"; - out << nl << stream << ".endSize(__pos);"; - } - else - { - out << nl << stream << ".writeProxy(" << v << ");"; - } - } - else - { - if(optional) - { - out << nl << stream << ".skip(4);"; - } - out << nl << v << " = " << stream << ".readProxy();"; - } - break; - } - case Builtin::KindLocalObject: - { - assert(false); - break; - } - } - return; - } - - ProxyPtr prx = ProxyPtr::dynamicCast(type); - if(prx) - { - string typeS = typeToString(type, TypeModeIn, package); - if(marshal) - { - if(optional) - { - out << nl << "int __pos = " << stream << ".startSize();"; - out << nl << typeS << "Helper.write(" << stream << ", " << v << ");"; - out << nl << stream << ".endSize(__pos);"; - } - else - { - out << nl << typeS << "Helper.write(" << stream << ", " << v << ");"; - } - } - else - { - if(optional) - { - out << nl << stream << ".skip(4);"; - } - out << nl << v << " = " << typeS << "Helper.read(" << stream << ");"; - } - return; - } - - ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type); - if(cl) - { - if(marshal) - { - out << nl << stream << ".writeObject(" << v << ");"; - } - else - { - if(holder && !optional) - { - out << nl << stream << ".readObject(" << param << ");"; - } - else - { - if(patchParams.empty()) - { - out << nl << stream << ".readObject(new Patcher());"; - } - else - { - out << nl << stream << ".readObject(" << patchParams << ");"; - } - } - } - return; - } - - StructPtr st = StructPtr::dynamicCast(type); - if(st) - { - string typeS = typeToString(type, TypeModeIn, package); - if(marshal) - { - if(optional) - { - if(st->isVariableLength()) - { - out << nl << "int __pos = " << stream << ".startSize();"; - out << nl << typeS << ".ice_write(" << stream << ", " << v << ");"; - out << nl << stream << ".endSize(__pos);"; - } - else - { - out << nl << stream << ".writeSize(" << st->minWireSize() << ");"; - out << nl << typeS << ".ice_write(" << stream << ", " << v << ");"; - } - } - else - { - out << nl << typeS << ".ice_write(" << stream << ", " << v << ");"; - } - } - else - { - if(optional) - { - if(st->isVariableLength()) - { - out << nl << stream << ".skip(4);"; - } - else - { - out << nl << stream << ".skipSize();"; - } - } - out << nl << v << " = " << typeS << ".ice_read(" << stream << ", " << v << ");"; - } - return; - } - - EnumPtr en = EnumPtr::dynamicCast(type); - if(en) - { - string typeS = typeToString(type, TypeModeIn, package); - if(marshal) - { - out << nl << typeS << ".ice_write(" << stream << ", " << v << ");"; - } - else - { - out << nl << v << " = " << typeS << ".ice_read(" << stream << ");"; - } - return; - } - - DictionaryPtr dict = DictionaryPtr::dynamicCast(type); - if(dict) - { - if(optional) - { - string typeS = typeToString(type, TypeModeIn, package, metaData); - TypePtr keyType = dict->keyType(); - TypePtr valueType = dict->valueType(); - - if(marshal) - { - if(keyType->isVariableLength() || valueType->isVariableLength()) - { - out << nl << "int __pos = " << stream << ".startSize();"; - writeStreamDictionaryMarshalUnmarshalCode(out, package, dict, v, marshal, iter, true, metaData); - out << nl << stream << ".endSize(__pos);"; - } - else - { - const size_t wireSize = keyType->minWireSize() + valueType->minWireSize(); - out << nl << "final int __optSize = " << v << " == null ? 0 : " << v << ".size();"; - out << nl << stream << ".writeSize(__optSize > 254 ? __optSize * " << wireSize - << " + 5 : __optSize * " << wireSize << " + 1);"; - writeStreamDictionaryMarshalUnmarshalCode(out, package, dict, v, marshal, iter, true, metaData); - } - } - else - { - if(keyType->isVariableLength() || valueType->isVariableLength()) - { - out << nl << stream << ".skip(4);"; - } - else - { - out << nl << stream << ".skipSize();"; - } - - writeStreamDictionaryMarshalUnmarshalCode(out, package, dict, v, marshal, iter, true, metaData); - } - } - else - { - writeStreamDictionaryMarshalUnmarshalCode(out, package, dict, v, marshal, iter, true, metaData); - } - return; - } - - SequencePtr seq = SequencePtr::dynamicCast(type); - if(seq) - { - if(optional) - { - string typeS = typeToString(type, TypeModeIn, package, metaData); - TypePtr elemType = seq->type(); - BuiltinPtr elemBuiltin = BuiltinPtr::dynamicCast(elemType); - - string ignore; - - if(marshal) - { - if(elemType->isVariableLength()) - { - out << nl << "int __pos = " << stream << ".startSize();"; - writeStreamSequenceMarshalUnmarshalCode(out, package, seq, v, marshal, iter, true, metaData); - out << nl << stream << ".endSize(__pos);"; - } - else if(findMetaData("java:type:", metaData, ignore) || - findMetaData("java:type:", seq->getMetaData(), ignore)) - { - // - // The sequence is an instance of java.util.List<E>, where E is a fixed-size type. - // If the element type is bool or byte, we do NOT write an extra size. - // - - if(!elemBuiltin || - (elemBuiltin->kind() != Builtin::KindByte && elemBuiltin->kind() != Builtin::KindBool)) - { - out << nl << "final int __optSize = " << v << " == null ? 0 : " << v << ".size();"; - const size_t wireSize = elemType->minWireSize(); - - if(wireSize > 1) - { - out << nl << stream << ".writeSize(__optSize > 254 ? __optSize * " << wireSize - << " + 5 : __optSize * " << wireSize << " + 1);"; - } - else - { - // - // The element type could be a struct with a wire size of 1. - // - out << nl << stream << ".writeSize(__optSize > 254 ? __optSize + 5 : __optSize + 1);"; - } - } - writeStreamSequenceMarshalUnmarshalCode(out, package, seq, v, marshal, iter, true, metaData); - } - else if(findMetaData("java:protobuf:", seq->getMetaData(), ignore) || - findMetaData("java:serializable:", seq->getMetaData(), ignore)) - { - // - // This just writes a byte sequence. - // - writeStreamSequenceMarshalUnmarshalCode(out, package, seq, v, marshal, iter, true, metaData); - } - else - { - // - // At this point we have a regular Java array of a fixed-size type. - // - - if(!elemBuiltin || (elemBuiltin->kind() != Builtin::KindByte && - elemBuiltin->kind() != Builtin::KindBool)) - { - out << nl << "final int __optSize = " << v << " == null ? 0 : " << v << ".length;"; - const size_t wireSize = elemType->minWireSize(); - - if(wireSize > 1) - { - out << nl << stream << ".writeSize(__optSize > 254 ? __optSize * " << wireSize - << " + 5 : __optSize * " << wireSize << " + 1);"; - } - else - { - // - // The element type could be a struct with a wire size of 1. - // - out << nl << stream << ".writeSize(__optSize > 254 ? __optSize + 5 : __optSize + 1);"; - } - } - - writeStreamSequenceMarshalUnmarshalCode(out, package, seq, v, marshal, iter, true, metaData); - } - } - else - { - if(elemType->isVariableLength()) - { - out << nl << stream << ".skip(4);"; - } - else if(findMetaData("java:type:", metaData, ignore) || - findMetaData("java:type:", seq->getMetaData(), ignore)) - { - // - // The sequence is an instance of java.util.List<E>, where E is a fixed-size type. - // If the element type is bool or byte, we do NOT write an extra size. - // - - if(!elemBuiltin || - (elemBuiltin->kind() != Builtin::KindByte && elemBuiltin->kind() != Builtin::KindBool)) - { - out << nl << stream << ".skipSize();"; - } - } - else if(!findMetaData("java:protobuf:", seq->getMetaData(), ignore) && - !findMetaData("java:serializable:", seq->getMetaData(), ignore)) - { - if(!elemBuiltin || - (elemBuiltin->kind() != Builtin::KindByte && elemBuiltin->kind() != Builtin::KindBool)) - { - out << nl << stream << ".skipSize();"; - } - } - - writeStreamSequenceMarshalUnmarshalCode(out, package, seq, v, marshal, iter, true, metaData); - } - } - else - { - writeStreamSequenceMarshalUnmarshalCode(out, package, seq, v, marshal, iter, true, metaData); - } - return; - } - - ConstructedPtr constructed = ConstructedPtr::dynamicCast(type); - assert(constructed); - string typeS = getAbsolute(constructed, package); - if(marshal) - { - out << nl << typeS << "Helper.write(" << stream << ", " << v << ");"; - } - else - { - out << nl << v << " = " << typeS << "Helper.read(" << stream << ");"; - } -} - -void -Slice::JavaGenerator::writeStreamDictionaryMarshalUnmarshalCode(Output& out, - const string& package, - const DictionaryPtr& dict, - const string& param, - bool marshal, - int& iter, - bool useHelper, - const StringList& metaData) -{ - string stream = marshal ? "__outS" : "__inS"; - string v = param; - - // - // We have to determine whether it's possible to use the - // type's generated helper class for this marshal/unmarshal - // task. Since the user may have specified a custom type in - // metadata, it's possible that the helper class is not - // compatible and therefore we'll need to generate the code - // in-line instead. - // - // Specifically, there may be "local" metadata (i.e., from - // a data member or parameter definition) that overrides the - // original type. We'll compare the mapped types with and - // without local metadata to determine whether we can use - // the helper. - // - string instanceType, formalType; - getDictionaryTypes(dict, "", metaData, instanceType, formalType); - string origInstanceType, origFormalType; - getDictionaryTypes(dict, "", StringList(), origInstanceType, origFormalType); - if((formalType != origFormalType) || (!marshal && instanceType != origInstanceType)) - { - useHelper = false; - } - - // - // If we can use the helper, it's easy. - // - if(useHelper) - { - string typeS = getAbsolute(dict, package); - if(marshal) - { - out << nl << typeS << "Helper.write(" << stream << ", " << v << ");"; - } - else - { - out << nl << v << " = " << typeS << "Helper.read(" << stream << ");"; - } - return; - } - - TypePtr key = dict->keyType(); - TypePtr value = dict->valueType(); - - string keyS = typeToString(key, TypeModeIn, package); - string valueS = typeToString(value, TypeModeIn, package); - - ostringstream o; - o << iter; - string iterS = o.str(); - iter++; - - if(marshal) - { - out << nl << "if(" << v << " == null)"; - out << sb; - out << nl << "__outS.writeSize(0);"; - out << eb; - out << nl << "else"; - out << sb; - out << nl << "__outS.writeSize(" << v << ".size());"; - string keyObjectS = typeToObjectString(key, TypeModeIn, package); - string valueObjectS = typeToObjectString(value, TypeModeIn, package); - out << nl << "for(java.util.Map.Entry<" << keyObjectS << ", " << valueObjectS << "> __e : " << v - << ".entrySet())"; - out << sb; - for(int i = 0; i < 2; i++) - { - string arg; - TypePtr type; - if(i == 0) - { - arg = "__e.getKey()"; - type = key; - } - else - { - arg = "__e.getValue()"; - type = value; - } - writeStreamMarshalUnmarshalCode(out, package, type, false, 0, arg, true, iter, false); - } - out << eb; - out << eb; - } - else - { - out << nl << v << " = new " << instanceType << "();"; - out << nl << "int __sz" << iterS << " = __inS.readSize();"; - out << nl << "for(int __i" << iterS << " = 0; __i" << iterS << " < __sz" << iterS << "; __i" << iterS << "++)"; - out << sb; - for(int i = 0; i < 2; i++) - { - string arg; - TypePtr type; - string typeS; - if(i == 0) - { - arg = "__key"; - type = key; - typeS = keyS; - } - else - { - arg = "__value"; - type = value; - typeS = valueS; - } - - BuiltinPtr b = BuiltinPtr::dynamicCast(type); - string s = typeToString(type, TypeModeIn, package); - if(ClassDeclPtr::dynamicCast(type) || (b && b->kind() == Builtin::KindObject)) - { - string keyTypeStr = typeToObjectString(key, TypeModeIn, package); - string valueTypeStr = typeToObjectString(value, TypeModeIn, package); - writeStreamMarshalUnmarshalCode(out, package, type, false, 0, arg, false, iter, false, - StringList(), "new IceInternal.DictionaryPatcher<" + keyTypeStr + - ", " + valueTypeStr + ">(" + v + ", " + s + ".class, \"" + - type->typeId() + "\", __key)"); - } - else - { - if(StructPtr::dynamicCast(type)) - { - out << nl << s << ' ' << arg << " = null;"; - } - else - { - out << nl << s << ' ' << arg << ';'; - } - writeStreamMarshalUnmarshalCode(out, package, type, false, 0, arg, false, iter, false); - } - } - BuiltinPtr builtin = BuiltinPtr::dynamicCast(value); - if(!(builtin && builtin->kind() == Builtin::KindObject) && !ClassDeclPtr::dynamicCast(value)) - { - out << nl << "" << v << ".put(__key, __value);"; - } - out << eb; - } -} - -void -Slice::JavaGenerator::writeStreamSequenceMarshalUnmarshalCode(Output& out, - const string& package, - const SequencePtr& seq, - const string& param, - bool marshal, - int& iter, - bool useHelper, - const StringList& metaData) -{ - string stream = marshal ? "__outS" : "__inS"; - string v = param; - - // - // If the sequence is a byte sequence, check if there's the serializable or protobuf metadata to - // get rid of these two easy cases first. - // - BuiltinPtr builtin = BuiltinPtr::dynamicCast(seq->type()); - if(builtin && builtin->kind() == Builtin::KindByte) - { - string meta; - static const string protobuf = "java:protobuf:"; - static const string serializable = "java:serializable:"; - if(seq->findMetaData(serializable, meta)) - { - if(marshal) - { - out << nl << stream << ".writeSerializable(" << v << ");"; - } - else - { - string type = typeToString(seq, TypeModeIn, package); - out << nl << v << " = (" << type << ")" << stream << ".readSerializable();"; - } - return; - } - else if(seq->findMetaData(protobuf, meta)) - { - if(marshal) - { - out << nl << "if(!" << v << ".isInitialized())"; - out << sb; - out << nl << "throw new Ice.MarshalException(\"type not fully initialized\");"; - out << eb; - out << nl << stream << ".writeByteSeq(" << v << ".toByteArray());"; - } - else - { - string type = meta.substr(protobuf.size()); - out << nl << "try"; - out << sb; - out << nl << v << " = " << type << ".parseFrom(" << stream << ".readByteSeq());"; - out << eb; - out << nl << "catch(com.google.protobuf.InvalidProtocolBufferException __ex)"; - out << sb; - out << nl << "Ice.MarshalException __mex = new Ice.MarshalException();"; - out << nl << "__mex.initCause(__ex);"; - out << nl << "throw __mex;"; - out << eb; - } - return; - } - } - - if(builtin && - (builtin->kind() == Builtin::KindByte || builtin->kind() == Builtin::KindShort || - builtin->kind() == Builtin::KindInt || builtin->kind() == Builtin::KindLong || - builtin->kind() == Builtin::KindFloat || builtin->kind() == Builtin::KindDouble)) - { - string meta; - static const string bytebuffer = "java:buffer"; - if(seq->findMetaData(bytebuffer, meta) || findMetaData(bytebuffer, metaData, meta)) - { - switch(builtin->kind()) - { - case Builtin::KindByte: - { - if(marshal) - { - out << nl << stream << ".writeByteBuffer(" << v << ");"; - } - else - { - out << nl << v << " = " << stream << ".readByteBuffer();"; - } - break; - } - case Builtin::KindShort: - { - if(marshal) - { - out << nl << stream << ".writeShortBuffer(" << v << ");"; - } - else - { - out << nl << v << " = " << stream << ".readShortBuffer();"; - } - break; - } - case Builtin::KindInt: - { - if(marshal) - { - out << nl << stream << ".writeIntBuffer(" << v << ");"; - } - else - { - out << nl << v << " = " << stream << ".readIntBuffer();"; - } - break; - } - case Builtin::KindLong: - { - if(marshal) - { - out << nl << stream << ".writeLongBuffer(" << v << ");"; - } - else - { - out << nl << v << " = " << stream << ".readLongBuffer();"; - } - break; - } - case Builtin::KindFloat: - { - if(marshal) - { - out << nl << stream << ".writeFloatBuffer(" << v << ");"; - } - else - { - out << nl << v << " = " << stream << ".readFloatBuffer();"; - } - break; - } - case Builtin::KindDouble: - { - if(marshal) - { - out << nl << stream << ".writeDoubleBuffer(" << v << ");"; - } - else - { - out << nl << v << " = " << stream << ".readDoubleBuffer();"; - } - break; - } - case Builtin::KindBool: - case Builtin::KindString: - case Builtin::KindObject: - case Builtin::KindObjectProxy: - case Builtin::KindLocalObject: - { - assert(false); - break; - } - } - return; - } - } - - // - // We have to determine whether it's possible to use the - // type's generated helper class for this marshal/unmarshal - // task. Since the user may have specified a custom type in - // metadata, it's possible that the helper class is not - // compatible and therefore we'll need to generate the code - // in-line instead. - // - // Specifically, there may be "local" metadata (i.e., from - // a data member or parameter definition) that overrides the - // original type. We'll compare the mapped types with and - // without local metadata to determine whether we can use - // the helper. - // - string instanceType, formalType; - bool customType = getSequenceTypes(seq, "", metaData, instanceType, formalType); - string origInstanceType, origFormalType; - getSequenceTypes(seq, "", StringList(), origInstanceType, origFormalType); - if((formalType != origFormalType) || (!marshal && instanceType != origInstanceType)) - { - useHelper = false; - } - - // - // If we can use the helper, it's easy. - // - if(useHelper) - { - string typeS = getAbsolute(seq, package); - if(marshal) - { - out << nl << typeS << "Helper.write(" << stream << ", " << v << ");"; - } - else - { - out << nl << v << " = " << typeS << "Helper.read(" << stream << ");"; - } - return; - } - - // - // Determine sequence depth - // - int depth = 0; - TypePtr origContent = seq->type(); - SequencePtr s = SequencePtr::dynamicCast(origContent); - while(s) - { - // - // Stop if the inner sequence type has a custom, serializable or protobuf type. - // - if(hasTypeMetaData(s)) - { - break; - } - depth++; - origContent = s->type(); - s = SequencePtr::dynamicCast(origContent); - } - string origContentS = typeToString(origContent, TypeModeIn, package); - - TypePtr type = seq->type(); - - if(customType) - { - // - // Marshal/unmarshal a custom sequence type. - // - BuiltinPtr b = BuiltinPtr::dynamicCast(type); - string typeS = getAbsolute(seq, package); - ostringstream o; - o << origContentS; - int d = depth; - while(d--) - { - o << "[]"; - } - string cont = o.str(); - if(marshal) - { - out << nl << "if(" << v << " == null)"; - out << sb; - out << nl << stream << ".writeSize(0);"; - out << eb; - out << nl << "else"; - out << sb; - out << nl << stream << ".writeSize(" << v << ".size());"; - string typeS = typeToString(type, TypeModeIn, package); - out << nl << "for(" << typeS << " __elem : " << v << ')'; - out << sb; - writeStreamMarshalUnmarshalCode(out, package, type, false, 0, "__elem", true, iter, false); - out << eb; - out << eb; // else - } - else - { - bool isObject = false; - ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type); - if((b && b->kind() == Builtin::KindObject) || cl) - { - isObject = true; - } - out << nl << v << " = new " << instanceType << "();"; - out << nl << "final int __len" << iter << " = " << stream << ".readAndCheckSeqSize(" << type->minWireSize() - << ");"; - if(isObject) - { - if(b) - { - out << nl << "final String __type" << iter << " = Ice.ObjectImpl.ice_staticId();"; - } - else - { - assert(cl); - if(cl->isInterface()) - { - out << nl << "final String __type" << iter << " = " - << getAbsolute(cl, package, "_", "Disp") << ".ice_staticId();"; - } - else - { - out << nl << "final String __type" << iter << " = " << origContentS << ".ice_staticId();"; - } - } - } - out << nl << "for(int __i" << iter << " = 0; __i" << iter << " < __len" << iter << "; __i" << iter - << "++)"; - out << sb; - if(isObject) - { - // - // Add a null value to the list as a placeholder for the element. - // - out << nl << v << ".add(null);"; - ostringstream patchParams; - patchParams << "new IceInternal.ListPatcher<" << origContentS << ">(" << v << ", " << origContentS - << ".class, __type" << iter << ", __i" << iter << ')'; - writeStreamMarshalUnmarshalCode(out, package, type, false, 0, "__elem", false, iter, false, - StringList(), patchParams.str()); - } - else - { - if(StructPtr::dynamicCast(type)) - { - out << nl << cont << " __elem = null;"; - } - else - { - out << nl << cont << " __elem;"; - } - writeStreamMarshalUnmarshalCode(out, package, type, false, 0, "__elem", false, iter, false); - } - if(!isObject) - { - out << nl << v << ".add(__elem);"; - } - out << eb; - iter++; - } - } - else - { - BuiltinPtr b = BuiltinPtr::dynamicCast(type); - if(b && b->kind() != Builtin::KindObject && b->kind() != Builtin::KindObjectProxy) - { - switch(b->kind()) - { - case Builtin::KindByte: - { - if(marshal) - { - out << nl << stream << ".writeByteSeq(" << v << ");"; - } - else - { - out << nl << v << " = " << stream << ".readByteSeq();"; - } - break; - } - case Builtin::KindBool: - { - if(marshal) - { - out << nl << stream << ".writeBoolSeq(" << v << ");"; - } - else - { - out << nl << v << " = " << stream << ".readBoolSeq();"; - } - break; - } - case Builtin::KindShort: - { - if(marshal) - { - out << nl << stream << ".writeShortSeq(" << v << ");"; - } - else - { - out << nl << v << " = " << stream << ".readShortSeq();"; - } - break; - } - case Builtin::KindInt: - { - if(marshal) - { - out << nl << stream << ".writeIntSeq(" << v << ");"; - } - else - { - out << nl << v << " = " << stream << ".readIntSeq();"; - } - break; - } - case Builtin::KindLong: - { - if(marshal) - { - out << nl << stream << ".writeLongSeq(" << v << ");"; - } - else - { - out << nl << v << " = " << stream << ".readLongSeq();"; - } - break; - } - case Builtin::KindFloat: - { - if(marshal) - { - out << nl << stream << ".writeFloatSeq(" << v << ");"; - } - else - { - out << nl << v << " = " << stream << ".readFloatSeq();"; - } - break; - } - case Builtin::KindDouble: - { - if(marshal) - { - out << nl << stream << ".writeDoubleSeq(" << v << ");"; - } - else - { - out << nl << v << " = " << stream << ".readDoubleSeq();"; - } - break; - } - case Builtin::KindString: - { - if(marshal) - { - out << nl << stream << ".writeStringSeq(" << v << ");"; - } - else - { - out << nl << v << " = " << stream << ".readStringSeq();"; - } - break; - } - case Builtin::KindObject: - case Builtin::KindObjectProxy: - case Builtin::KindLocalObject: - { - assert(false); - break; - } - } - } - else - { - if(marshal) - { - out << nl << "if(" << v << " == null)"; - out << sb; - out << nl << stream << ".writeSize(0);"; - out << eb; - out << nl << "else"; - out << sb; - out << nl << stream << ".writeSize(" << v << ".length);"; - out << nl << "for(int __i" << iter << " = 0; __i" << iter << " < " << v << ".length; __i" << iter - << "++)"; - out << sb; - ostringstream o; - o << v << "[__i" << iter << "]"; - iter++; - writeStreamMarshalUnmarshalCode(out, package, type, false, 0, o.str(), true, iter, false); - out << eb; - out << eb; - } - else - { - bool isObject = false; - ClassDeclPtr cl = ClassDeclPtr::dynamicCast(origContent); - if((b && b->kind() == Builtin::KindObject) || cl) - { - isObject = true; - } - out << nl << "final int __len" << iter << " = " << stream << ".readAndCheckSeqSize(" - << type->minWireSize() << ");"; - if(isObject) - { - if(b) - { - out << nl << "final String __type" << iter << " = Ice.ObjectImpl.ice_staticId();"; - } - else - { - assert(cl); - if(cl->isInterface()) - { - out << nl << "final String __type" << iter << " = " - << getAbsolute(cl, package, "_", "Disp") << ".ice_staticId();"; - } - else - { - out << nl << "final String __type" << iter << " = " << origContentS << ".ice_staticId();"; - } - } - } - // - // We cannot allocate an array of a generic type, such as - // - // arr = new Map<String, String>[sz]; - // - // Attempting to compile this code results in a "generic array creation" error - // message. This problem can occur when the sequence's element type is a - // dictionary, or when the element type is a nested sequence that uses a custom - // mapping. - // - // The solution is to rewrite the code as follows: - // - // arr = (Map<String, String>[])new Map[sz]; - // - // Unfortunately, this produces an unchecked warning during compilation. - // - // A simple test is to look for a "<" character in the content type, which - // indicates the use of a generic type. - // - string::size_type pos = origContentS.find('<'); - if(pos != string::npos) - { - string nonGenericType = origContentS.substr(0, pos); - out << nl << v << " = (" << origContentS << "[]"; - int d = depth; - while(d--) - { - out << "[]"; - } - out << ")new " << nonGenericType << "[__len" << iter << "]"; - } - else - { - out << nl << v << " = new " << origContentS << "[__len" << iter << "]"; - } - int d = depth; - while(d--) - { - out << "[]"; - } - out << ';'; - out << nl << "for(int __i" << iter << " = 0; __i" << iter << " < __len" << iter << "; __i" << iter - << "++)"; - out << sb; - ostringstream o; - o << v << "[__i" << iter << "]"; - ostringstream patchParams; - if(isObject) - { - patchParams << "new IceInternal.SequencePatcher(" << v << ", " << origContentS - << ".class, __type" << iter << ", __i" << iter << ')'; - writeStreamMarshalUnmarshalCode(out, package, type, false, 0, o.str(), false, iter, false, - StringList(), patchParams.str()); - } - else - { - writeStreamMarshalUnmarshalCode(out, package, type, false, 0, o.str(), false, iter, false); - } - out << eb; - iter++; - } - } - } -} - bool Slice::JavaGenerator::findMetaData(const string& prefix, const StringList& metaData, string& value) { @@ -4257,6 +3090,11 @@ Slice::JavaGenerator::MetaDataVisitor::getMetaData(const ContainedPtr& cont) emitWarning(cont->file(), cont->line(), "ignoring invalid metadata `" + s + "'"); } + else if(s == "delegate") + { + result.push_back(s); + continue; + } _history.insert(s); } @@ -4314,6 +3152,15 @@ Slice::JavaGenerator::MetaDataVisitor::validateType(const SyntaxTreeBasePtr& p, // emitWarning(file, line, "ignoring invalid metadata `" + *i + "'"); } + else if(i->find("delegate") == 0) + { + ClassDefPtr cl = ClassDefPtr::dynamicCast(p); + if(cl && cl->isDelegate()) + { + continue; + } + emitWarning(file, line, "ignoring invalid metadata `" + *i + "'"); + } } } diff --git a/cpp/src/Slice/Makefile.mak b/cpp/src/Slice/Makefile.mak deleted file mode 100644 index d6d9d238de4..00000000000 --- a/cpp/src/Slice/Makefile.mak +++ /dev/null @@ -1,87 +0,0 @@ -# ********************************************************************** -# -# Copyright (c) 2003-2016 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 = ..\.. - -LIBNAME = $(top_srcdir)\lib\slice$(LIBSUFFIX).lib -DLLNAME = $(top_srcdir)\bin\slice$(SOVERSION)$(LIBSUFFIX)$(COMPSUFFIX).dll - -TARGETS = $(LIBNAME) $(DLLNAME) - -BISON_FLEX_OBJS = .\Grammar.obj \ - .\Scanner.obj - -OBJS = .\Checksum.obj \ - .\CPlusPlusUtil.obj \ - .\CsUtil.obj \ - .\DotNetNames.obj \ - .\FileTracker.obj \ - .\JavaUtil.obj \ - .\MD5.obj \ - .\MD5I.obj \ - .\Parser.obj \ - .\PHPUtil.obj \ - .\Preprocessor.obj \ - .\PythonUtil.obj \ - .\Python.obj \ - .\RubyUtil.obj \ - .\Util.obj \ - .\Ruby.obj \ - $(BISON_FLEX_OBJS) - -!include $(top_srcdir)/config/Make.rules.mak - -$(OBJS) : $(MCPP_NUPKG) - -CPPFLAGS = -I.. $(CPPFLAGS) -DSLICE_API_EXPORTS -DWIN32_LEAN_AND_MEAN -BISONFLAGS = --name-prefix "slice_" $(BISONFLAGS) - -!if "$(GENERATE_PDB)" == "yes" -PDBFLAGS = /pdb:$(DLLNAME:.dll=.pdb) -!endif - -RES_FILE = Slice.res - -!if "$(STATICLIBS)" == "yes" - -$(DLLNAME): - -$(LIBNAME): $(OBJS) - $(AR) $(ARFLAGS) $(PDBFLAGS) $(OBJS) $(PREOUT)$@ - -!else - -$(LIBNAME): $(DLLNAME) - -$(DLLNAME): $(OBJS) Slice.res - $(LINK) $(BASE):0x21000000 $(LD_DLLFLAGS) $(MCPP_LDFLAGS) $(PDBFLAGS) $(OBJS) $(PREOUT)$@ $(PRELIBS)$(BASELIBS) $(MCPP_LIBS) \ - $(RES_FILE) - move $(DLLNAME:.dll=.lib) $(LIBNAME) - @if exist $@.manifest echo ^ ^ ^ Embedding manifest using $(MT) && \ - $(MT) -nologo -manifest $@.manifest -outputresource:$@;#2 && del /q $@.manifest - @if exist $(DLLNAME:.dll=.exp) del /q $(DLLNAME:.dll=.exp) - @if defined SIGN_CERTIFICATE echo ^ ^ ^ Signing $@ && \ - signtool sign /f "$(SIGN_CERTIFICATE)" /p $(SIGN_PASSWORD) /t $(SIGN_TIMESTAMPSERVER) $@ - -!endif - -clean:: - -del /q Slice.res - -install:: all - copy $(LIBNAME) "$(install_libdir)" - copy $(DLLNAME) "$(install_bindir)" - - -!if "$(GENERATE_PDB)" == "yes" - -install:: all - copy $(DLLNAME:.dll=.pdb) "$(install_bindir)" - -!endif diff --git a/cpp/src/Slice/ObjCUtil.cpp b/cpp/src/Slice/ObjCUtil.cpp index 2985138a41e..6c521dc46fa 100644 --- a/cpp/src/Slice/ObjCUtil.cpp +++ b/cpp/src/Slice/ObjCUtil.cpp @@ -263,7 +263,8 @@ Slice::ObjCGenerator::typeToString(const TypePtr& type) "NSString", "ICEObject", "id<ICEObjectPrx>", - "id" // Dummy--we don't support Slice local Object + "id", // Dummy--we don't support Slice local Object + "ICEObject" }; BuiltinPtr builtin = BuiltinPtr::dynamicCast(type); @@ -296,7 +297,11 @@ Slice::ObjCGenerator::typeToString(const TypePtr& type) { if(cl->isInterface()) { - if(cl->isLocal()) + if(cl->definition() && cl->definition()->isDelegate()) + { + return fixName(cl); + } + else if(cl->isLocal()) { return "id<" + fixName(cl) + ">"; } @@ -483,7 +488,7 @@ Slice::ObjCGenerator::mapsToPointerType(const TypePtr& type) ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type); if(cl && cl->isInterface()) { - if(cl->isLocal()) + if(cl->isLocal() || (cl->definition() && cl->definition()->isDelegate())) { return false; } @@ -633,6 +638,7 @@ Slice::ObjCGenerator::getOptionalFormat(const TypePtr& type) return "ICEOptionalFormatVSize"; } case Builtin::KindObject: + case Builtin::KindValue: { return "ICEOptionalFormatClass"; } @@ -1003,11 +1009,11 @@ Slice::ObjCGenerator::writeOptParamMarshalUnmarshalCode(Output &out, const TypeP out << nl; if(marshal) { - out << "[" << helper << " writeOpt:" << param << " stream:os_ tag:" << tag << "];"; + out << "[" << helper << " writeOptional:" << param << " stream:os_ tag:" << tag << "];"; } else { - out << "[" << helper << " readOpt:&" << param << " stream:is_ tag:" << tag << "];"; + out << "[" << helper << " readOptional:&" << param << " stream:is_ tag:" << tag << "];"; } return; } @@ -1015,11 +1021,11 @@ Slice::ObjCGenerator::writeOptParamMarshalUnmarshalCode(Output &out, const TypeP out << nl; if(marshal) { - out << "[" << helper << " writeOpt:" << param << " stream:os_ tag:" << tag << "];"; + out << "[" << helper << " writeOptional:" << param << " stream:os_ tag:" << tag << "];"; } else { - out << param << " = [" << helper << " readOpt:is_ tag:" << tag << "];"; + out << param << " = [" << helper << " readOptional:is_ tag:" << tag << "];"; } } diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp index 8ee39d6e8bb..68728049a89 100644 --- a/cpp/src/Slice/Parser.cpp +++ b/cpp/src/Slice/Parser.cpp @@ -258,6 +258,11 @@ Slice::Builtin::typeId() const return "::Ice::LocalObject"; break; } + case KindValue: + { + return "::Ice::Value"; + break; + } } assert(false); return ""; // Keep the compiler happy. @@ -266,7 +271,7 @@ Slice::Builtin::typeId() const bool Slice::Builtin::usesClasses() const { - return _kind == KindObject; + return _kind == KindObject || _kind == KindValue; } size_t @@ -283,7 +288,8 @@ Slice::Builtin::minWireSize() const 8, // KindDouble 1, // KindString: at least one byte for an empty string. 1, // KindObject: at least one byte (to marshal an index instead of an instance). - 2 // KindObjectProxy: at least an empty identity for a nil proxy, that is, 2 bytes. + 2, // KindObjectProxy: at least an empty identity for a nil proxy, that is, 2 bytes. + 1 // KindValue: at least one byte (to marshal an index instead of an instance). }; assert(_kind != KindLocalObject); @@ -293,7 +299,7 @@ Slice::Builtin::minWireSize() const bool Slice::Builtin::isVariableLength() const { - return _kind == KindString || _kind == KindObject || _kind == KindObjectProxy; + return _kind == KindString || _kind == KindObject || _kind == KindObjectProxy || _kind == KindValue; } Builtin::Kind @@ -320,7 +326,8 @@ const char* Slice::Builtin::builtinTable[] = "string", "Object", "Object*", - "LocalObject" + "LocalObject", + "Value" }; Slice::Builtin::Builtin(const UnitPtr& unit, Kind kind) : @@ -876,17 +883,6 @@ Slice::Container::createSequence(const string& name, const TypePtr& type, const { checkIdentifier(name); - if(_unit->profile() == IceE && !local) - { - BuiltinPtr builtin = BuiltinPtr::dynamicCast(type); - if((builtin && builtin->kind() == Builtin::KindObject) || ClassDeclPtr::dynamicCast(type)) - { - string msg = "Sequence `" + name + "' cannot contain object values."; - _unit->error(msg); - return 0; - } - } - ContainedList matches = _unit->findContents(thisScope() + name); if(!matches.empty()) { @@ -942,17 +938,6 @@ Slice::Container::createDictionary(const string& name, const TypePtr& keyType, c { checkIdentifier(name); - if(_unit->profile() == IceE && !local) - { - BuiltinPtr builtin = BuiltinPtr::dynamicCast(valueType); - if((builtin && builtin->kind() == Builtin::KindObject) || ClassDeclPtr::dynamicCast(valueType)) - { - string msg = "Dictionary `" + name + "' cannot contain object values."; - _unit->error(msg); - return 0; - } - } - ContainedList matches = _unit->findContents(thisScope() + name); if(!matches.empty()) { @@ -1178,16 +1163,8 @@ Slice::Container::lookupType(const string& scoped, bool printError) return lookupTypeNoBuiltin(scoped, printError); } -// -// TODO: Hack to keep binary compatibility with Ice 3.6.0, fix properly in Ice 3.7 -// -namespace -{ -bool ignoreUndefined = false; -} - TypeList -Slice::Container::lookupTypeNoBuiltin(const string& scoped, bool printError) +Slice::Container::lookupTypeNoBuiltin(const string& scoped, bool printError, bool ignoreUndefined) { // // Remove whitespace. @@ -1304,12 +1281,7 @@ Slice::Container::lookupTypeNoBuiltin(const string& scoped, bool printError) ContainedPtr contained = ContainedPtr::dynamicCast(this); if(contained) { - if(typeError) - { - ignoreUndefined = true; - } - results = contained->container()->lookupTypeNoBuiltin(sc, printError); - ignoreUndefined = false; + results = contained->container()->lookupTypeNoBuiltin(sc, printError, typeError || ignoreUndefined); } else if(!typeError) { @@ -1610,7 +1582,7 @@ Slice::Container::hasLocalClassDefsWithAsync() const ClassDefPtr cl = ClassDefPtr::dynamicCast(*p); if(cl && cl->isLocal()) { - if(cl->hasMetaData("async")) + if(cl->hasMetaData("async-oneway")) { return true; } @@ -1618,7 +1590,7 @@ Slice::Container::hasLocalClassDefsWithAsync() const OperationList ol = cl->operations(); for(OperationList::const_iterator q = ol.begin(); q != ol.end(); ++q) { - if((*q)->hasMetaData("async")) + if((*q)->hasMetaData("async-oneway")) { return true; } @@ -1775,6 +1747,66 @@ Slice::Container::hasClassDefs() const } bool +Slice::Container::hasLocalClassDefs() const +{ + for(ContainedList::const_iterator p = _contents.begin(); p != _contents.end(); ++p) + { + ClassDefPtr cl = ClassDefPtr::dynamicCast(*p); + if(cl && cl->isLocal()) + { + return true; + } + + ContainerPtr container = ContainerPtr::dynamicCast(*p); + if(container && container->hasLocalClassDefs()) + { + return true; + } + } + return false; +} + +bool +Slice::Container::hasNonLocalInterfaceDefs() const +{ + for(ContainedList::const_iterator p = _contents.begin(); p != _contents.end(); ++p) + { + ClassDefPtr cl = ClassDefPtr::dynamicCast(*p); + if(cl && !cl->isLocal() && (cl->isInterface() || !cl->allOperations().empty())) + { + return true; + } + + ContainerPtr container = ContainerPtr::dynamicCast(*p); + if(container && container->hasNonLocalInterfaceDefs()) + { + return true; + } + } + return false; +} + +bool +Slice::Container::hasValueDefs() const +{ + for(ContainedList::const_iterator p = _contents.begin(); p != _contents.end(); ++p) + { + ClassDefPtr cl = ClassDefPtr::dynamicCast(*p); + if(cl && !cl->isLocal() && !cl->isInterface()) + { + return true; + } + + ContainerPtr container = ContainerPtr::dynamicCast(*p); + if(container && container->hasValueDefs()) + { + return true; + } + } + return false; +} + +bool Slice::Container::hasOnlyClassDecls() const { for(ContainedList::const_iterator p = _contents.begin(); p != _contents.end(); ++p) @@ -2575,6 +2607,7 @@ Slice::Container::validateConstant(const string& name, const TypePtr& type, cons case Builtin::KindObject: case Builtin::KindObjectProxy: case Builtin::KindLocalObject: + case Builtin::KindValue: { assert(false); break; @@ -3199,28 +3232,6 @@ Slice::ClassDef::createDataMember(const string& name, const TypePtr& type, bool { checkIdentifier(name); - if(_unit->profile() == IceE) - { - if(!isLocal()) - { - BuiltinPtr builtin = BuiltinPtr::dynamicCast(type); - if((builtin && builtin->kind() == Builtin::KindObject)) - { - string msg = "Class data member `" + name + "' cannot be a value object."; - _unit->error(msg); - return 0; - } - - ClassDeclPtr classDecl = ClassDeclPtr::dynamicCast(type); - if(classDecl != 0 && !classDecl->isLocal()) - { - string msg = "Class data member `" + name + "' cannot be a value object."; - _unit->error(msg); - return 0; - } - } - } - assert(!isInterface()); ContainedList matches = _unit->findContents(thisScope() + name); if(!matches.empty()) @@ -3456,7 +3467,9 @@ Slice::ClassDef::classDataMembers() const if(q) { BuiltinPtr builtin = BuiltinPtr::dynamicCast(q->type()); - if((builtin && builtin->kind() == Builtin::KindObject) || ClassDeclPtr::dynamicCast(q->type())) + if((builtin && builtin->kind() == Builtin::KindObject) || + (builtin && builtin->kind() == Builtin::KindValue) || + ClassDeclPtr::dynamicCast(q->type())) { result.push_back(q); } @@ -3645,6 +3658,11 @@ Slice::ClassDef::compactId() const return _compactId; } +bool +Slice::ClassDef::isDelegate() const +{ + return isLocal() && isInterface() && hasMetaData("delegate") && allOperations().size() == 1; +} Slice::ClassDef::ClassDef(const ContainerPtr& container, const string& name, int id, bool intf, const ClassList& bases, bool local) : SyntaxTreeBase(container->unit()), @@ -3739,28 +3757,6 @@ Slice::Exception::createDataMember(const string& name, const TypePtr& type, bool { checkIdentifier(name); - if(_unit->profile() == IceE) - { - if(!isLocal()) - { - BuiltinPtr builtin = BuiltinPtr::dynamicCast(type); - if((builtin && builtin->kind() == Builtin::KindObject)) - { - string msg = "Exception data member `" + name + "' cannot be a value object."; - _unit->error(msg); - return 0; - } - - ClassDeclPtr classDecl = ClassDeclPtr::dynamicCast(type); - if(classDecl != 0 && !classDecl->isLocal()) - { - string msg = "Exception data member `" + name + "' cannot be a value object."; - _unit->error(msg); - return 0; - } - } - } - ContainedList matches = _unit->findContents(thisScope() + name); if(!matches.empty()) { @@ -3925,7 +3921,9 @@ Slice::Exception::classDataMembers() const if(q) { BuiltinPtr builtin = BuiltinPtr::dynamicCast(q->type()); - if((builtin && builtin->kind() == Builtin::KindObject) || ClassDeclPtr::dynamicCast(q->type())) + if((builtin && builtin->kind() == Builtin::KindObject) || + (builtin && builtin->kind() == Builtin::KindValue) || + ClassDeclPtr::dynamicCast(q->type())) { result.push_back(q); } @@ -4095,27 +4093,6 @@ Slice::Struct::createDataMember(const string& name, const TypePtr& type, bool op { checkIdentifier(name); - if(_unit->profile() == IceE) - { - if(!isLocal()) - { - BuiltinPtr builtin = BuiltinPtr::dynamicCast(type); - if((builtin && builtin->kind() == Builtin::KindObject)) - { - string msg = "Struct data member `" + name + "' cannot be a value object."; - _unit->error(msg); - return 0; - } - ClassDeclPtr classDecl = ClassDeclPtr::dynamicCast(type); - if(classDecl != 0 && !classDecl->isLocal()) - { - string msg = "Struct data member `" + name + "' cannot be a value object."; - _unit->error(msg); - return 0; - } - } - } - ContainedList matches = _unit->findContents(thisScope() + name); if(!matches.empty()) { @@ -4230,7 +4207,9 @@ Slice::Struct::classDataMembers() const if(q) { BuiltinPtr builtin = BuiltinPtr::dynamicCast(q->type()); - if((builtin && builtin->kind() == Builtin::KindObject) || ClassDeclPtr::dynamicCast(q->type())) + if((builtin && builtin->kind() == Builtin::KindObject) || + (builtin && builtin->kind() == Builtin::KindValue) || + ClassDeclPtr::dynamicCast(q->type())) { result.push_back(q); } @@ -4569,6 +4548,7 @@ Slice::Dictionary::legalKeyType(const TypePtr& type, bool& containsSequence) case Builtin::KindObject: case Builtin::KindObjectProxy: case Builtin::KindLocalObject: + case Builtin::KindValue: { return false; break; @@ -4946,29 +4926,6 @@ Slice::Operation::createParamDecl(const string& name, const TypePtr& type, bool { checkIdentifier(name); - if(_unit->profile() == IceE) - { - ClassDefPtr cl = ClassDefPtr::dynamicCast(this->container()); - assert(cl); - if(!cl->isLocal()) - { - BuiltinPtr builtin = BuiltinPtr::dynamicCast(type); - if((builtin && builtin->kind() == Builtin::KindObject)) - { - string msg = "Object `" + name + "' cannot be passed by value."; - _unit->error(msg); - return 0; - } - ClassDeclPtr classDecl = ClassDeclPtr::dynamicCast(type); - if(classDecl != 0 && !classDecl->isLocal()) - { - string msg = "Object `" + name + "' cannot be passed by value."; - _unit->error(msg); - return 0; - } - } - } - ContainedList matches = _unit->findContents(thisScope() + name); if(!matches.empty()) { @@ -5356,26 +5313,6 @@ Slice::Operation::Operation(const ContainerPtr& container, _returnTag(returnTag), _mode(mode) { - if(_unit->profile() == IceE) - { - ClassDefPtr cl = ClassDefPtr::dynamicCast(this->container()); - assert(cl); - if(!cl->isLocal()) - { - BuiltinPtr builtin = BuiltinPtr::dynamicCast(returnType); - if((builtin && builtin->kind() == Builtin::KindObject)) - { - string msg = "Method `" + name + "' cannot return an object by value."; - _unit->error(msg); - } - ClassDeclPtr classDecl = ClassDeclPtr::dynamicCast(returnType); - if(classDecl != 0 && !classDecl->isLocal()) - { - string msg = "Method `" + name + "' cannot return an object by value."; - _unit->error(msg); - } - } - } } // ---------------------------------------------------------------------- @@ -6038,6 +5975,11 @@ Slice::Unit::usesNonLocals() const return true; } + if(_builtins.find(Builtin::KindValue) != _builtins.end()) + { + return true; + } + return false; } diff --git a/cpp/src/Slice/PythonUtil.cpp b/cpp/src/Slice/PythonUtil.cpp index 220e521d85d..a3abf0de03a 100644 --- a/cpp/src/Slice/PythonUtil.cpp +++ b/cpp/src/Slice/PythonUtil.cpp @@ -1084,11 +1084,11 @@ Slice::Python::CodeVisitor::visitExceptionStart(const ExceptionPtr& p) _out << nl << "return IcePy.stringifyException(self)"; _out.dec(); _out << sp << nl << "__repr__ = __str__"; - + // - // _ice_name + // _ice_id // - _out << sp << nl << "_ice_name = '" << scoped.substr(2) << "'"; + _out << sp << nl << "_ice_id = '" << scoped << "'"; _out.dec(); @@ -1643,6 +1643,7 @@ Slice::Python::CodeVisitor::writeType(const TypePtr& p) break; } case Builtin::KindObject: + case Builtin::KindValue: { _out << "IcePy._t_Object"; break; @@ -1706,6 +1707,7 @@ Slice::Python::CodeVisitor::writeInitializer(const DataMemberPtr& m) _out << "''"; break; } + case Builtin::KindValue: case Builtin::KindObject: case Builtin::KindObjectProxy: case Builtin::KindLocalObject: @@ -1943,6 +1945,7 @@ Slice::Python::CodeVisitor::writeConstantValue(const TypePtr& type, const Syntax _out << "\""; // Closing " break; } + case Slice::Builtin::KindValue: case Slice::Builtin::KindObject: case Slice::Builtin::KindObjectProxy: case Slice::Builtin::KindLocalObject: diff --git a/cpp/src/Slice/RubyUtil.cpp b/cpp/src/Slice/RubyUtil.cpp index 3e6fe7557ac..0c9cfd49bd5 100644 --- a/cpp/src/Slice/RubyUtil.cpp +++ b/cpp/src/Slice/RubyUtil.cpp @@ -880,7 +880,7 @@ Slice::Ruby::CodeVisitor::visitExceptionStart(const ExceptionPtr& p) // _out << sp << nl << "def to_s"; _out.inc(); - _out << nl << "'" << scoped.substr(2) << "'"; + _out << nl << "'" << scoped << "'"; _out.dec(); _out << nl << "end"; @@ -1331,6 +1331,7 @@ Slice::Ruby::CodeVisitor::writeType(const TypePtr& p) _out << "::Ice::T_string"; break; } + case Builtin::KindValue: case Builtin::KindObject: { _out << "::Ice::T_Object"; @@ -1391,6 +1392,7 @@ Slice::Ruby::CodeVisitor::getInitializer(const DataMemberPtr& m) { return "''"; } + case Builtin::KindValue: case Builtin::KindObject: case Builtin::KindObjectProxy: case Builtin::KindLocalObject: @@ -1535,6 +1537,7 @@ Slice::Ruby::CodeVisitor::writeConstantValue(const TypePtr& type, const SyntaxTr break; } + case Slice::Builtin::KindValue: case Slice::Builtin::KindObject: case Slice::Builtin::KindObjectProxy: case Slice::Builtin::KindLocalObject: diff --git a/cpp/src/Slice/Scanner.cpp b/cpp/src/Slice/Scanner.cpp index 0a4fdad538d..a49c6c0433a 100644 --- a/cpp/src/Slice/Scanner.cpp +++ b/cpp/src/Slice/Scanner.cpp @@ -29,7 +29,7 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_SUBMINOR_VERSION 39 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -74,7 +74,6 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -105,6 +104,8 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#endif /* ! C99 */ + #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -161,7 +162,15 @@ typedef unsigned int flex_uint32_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -173,7 +182,12 @@ typedef unsigned int flex_uint32_t; typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif -extern int slice_leng; +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +extern yy_size_t slice_leng; extern FILE *slice_in, *slice_out; @@ -182,6 +196,7 @@ extern FILE *slice_in, *slice_out; #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ @@ -199,11 +214,6 @@ extern FILE *slice_in, *slice_out; #define unput(c) yyunput( c, (yytext_ptr) ) -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -221,7 +231,7 @@ struct yy_buffer_state /* Number of characters read into yy_ch_buf, not including EOB * characters. */ - int yy_n_chars; + yy_size_t yy_n_chars; /* Whether we "own" the buffer - i.e., we know we created it, * and can realloc() it to grow it, and should free() it to @@ -291,8 +301,8 @@ static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* yy_hold_char holds the character lost when slice_text is formed. */ static char yy_hold_char; -static int yy_n_chars; /* number of characters read into yy_ch_buf */ -int slice_leng; +static yy_size_t yy_n_chars; /* number of characters read into yy_ch_buf */ +yy_size_t slice_leng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; @@ -320,7 +330,7 @@ static void slice__init_buffer (YY_BUFFER_STATE b,FILE *file ); YY_BUFFER_STATE slice__scan_buffer (char *base,yy_size_t size ); YY_BUFFER_STATE slice__scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE slice__scan_bytes (yyconst char *bytes,int len ); +YY_BUFFER_STATE slice__scan_bytes (yyconst char *bytes,yy_size_t len ); void *slice_alloc (yy_size_t ); void *slice_realloc (void *,yy_size_t ); @@ -352,7 +362,7 @@ void slice_free (void * ); /* Begin user sect3 */ -#define slice_wrap(n) 1 +#define slice_wrap() 1 #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; @@ -554,7 +564,7 @@ char *slice_text; // // ********************************************************************** -#include <Slice/GrammarUtil.h> // Before Grammer.h, so that YYSTYPE is defined +#include <Slice/GrammarUtil.h> // Before Grammer.h, so that YYSTYPE is defined #include <Slice/Grammar.h> #include <IceUtil/InputUtil.h> @@ -595,7 +605,7 @@ char *slice_text; # define slice_wrap() 1 # endif # ifdef ICE_64 -# pragma error_messages(off,truncwarn) +# pragma error_messages(off,truncwarn) # endif #endif @@ -608,7 +618,7 @@ namespace Slice // // Definitions for the case-insensitive keyword-token map. // -typedef std::map<std::string, int, Slice::CICompare> StringTokenMap; +typedef std::map<std::string, int> StringTokenMap; static StringTokenMap keywordMap; void initScanner(); @@ -616,11 +626,11 @@ int checkKeyword(string&); } -#define YY_USER_INIT initScanner(); +#define YY_USER_INIT initScanner(); -#line 623 "lex.yy.c" +#line 633 "lex.yy.c" #define INITIAL 0 #define BOMSCAN 1 @@ -661,7 +671,7 @@ FILE *slice_get_out (void ); void slice_set_out (FILE * out_str ); -int slice_get_leng (void ); +yy_size_t slice_get_leng (void ); char *slice_get_text (void ); @@ -703,7 +713,12 @@ static int input (void ); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -722,7 +737,7 @@ static int input (void ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - unsigned n; \ + size_t n; \ for ( n = 0; n < max_size && \ (c = getc( slice_in )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -807,11 +822,6 @@ YY_DECL register char *yy_cp, *yy_bp; register int yy_act; -#line 92 "Scanner.l" - - -#line 813 "lex.yy.c" - if ( !(yy_init) ) { (yy_init) = 1; @@ -838,6 +848,12 @@ YY_DECL slice__load_buffer_state( ); } + { +#line 92 "Scanner.l" + + +#line 855 "lex.yy.c" + while ( 1 ) /* loops until end-of-file is reached */ { yy_cp = (yy_c_buf_p); @@ -855,7 +871,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { (yy_last_accepting_state) = yy_current_state; @@ -906,6 +922,7 @@ YY_RULE_SETUP case 2: /* rule 2 can match eol */ *yy_cp = (yy_hold_char); /* undo effects of setting up slice_text */ +YY_LINENO_REWIND_TO(yy_cp - 1); (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up slice_text again */ YY_RULE_SETUP @@ -933,6 +950,7 @@ YY_RULE_SETUP case 4: /* rule 4 can match eol */ *yy_cp = (yy_hold_char); /* undo effects of setting up slice_text */ +YY_LINENO_REWIND_TO(yy_cp - 1); (yy_c_buf_p) = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up slice_text again */ YY_RULE_SETUP @@ -953,11 +971,11 @@ YY_RULE_SETUP int c; do { - c = yyinput(); - if(c == '\n') - { - unit->nextLine(); - } + c = yyinput(); + if(c == '\n') + { + unit->nextLine(); + } } while(c != '\n' && c != EOF); } @@ -971,38 +989,38 @@ YY_RULE_SETUP string comment = slice_text + 2; while(true) { - int c = yyinput(); - if(c == '\n') - { - comment += static_cast<char>(c); - unit->nextLine(); - } - else if(c == '*') - { - int next = yyinput(); - if(next == '/') - { - break; - } - else - { - comment += static_cast<char>(c); - unput(next); - } - } - else if(c == EOF) - { - unit->warning("EOF in comment"); - break; - } - else - { - comment += static_cast<char>(c); - } + int c = yyinput(); + if(c == '\n') + { + comment += static_cast<char>(c); + unit->nextLine(); + } + else if(c == '*') + { + int next = yyinput(); + if(next == '/') + { + break; + } + else + { + comment += static_cast<char>(c); + unput(next); + } + } + else if(c == EOF) + { + unit->warning("EOF in comment"); + break; + } + else + { + comment += static_cast<char>(c); + } } if(!comment.empty() && comment[0] == '*') { - unit->setComment(comment); + unit->setComment(comment); } } YY_BREAK @@ -1095,156 +1113,149 @@ YY_RULE_SETUP str->literal = "\""; while(true) { - char c = static_cast<char>(yyinput()); + char c = static_cast<char>(yyinput()); str->literal += c; - if(c == '"') - { - break; - } - else if(c == EOF) - { - unit->error("EOF in string"); - break; - } - else if(c == '\n') - { - unit->error("newline in string"); - } - else if(c == '\\') - { - char next = static_cast<char>(yyinput()); + if(c == '"') + { + break; + } + else if(c == EOF) + { + unit->error("EOF in string"); + break; + } + else if(c == '\n') + { + unit->error("newline in string"); + } + else if(c == '\\') + { + char next = static_cast<char>(yyinput()); str->literal += next; - switch(next) - { - case '\\': - case '"': - case '\'': - { - str->v += next; - break; - } - - case 'n': - { - str->v += '\n'; - break; - } - - case 'r': - { - str->v += '\r'; - break; - } - - case 't': - { - str->v += '\t'; - break; - } - - case 'v': - { - str->v += '\v'; - break; - } - - case 'f': - { - str->v += '\f'; - break; - } - - case 'a': - { - str->v += '\a'; - break; - } - - case 'b': - { - str->v += '\b'; - break; - } - - case '?': - { - str->v += '\?'; - break; - } - - case '0': - case '1': - case '2': - case '3': - { - static string octalDigits = "01234567"; - unsigned short us = next - '0'; - if(octalDigits.find_first_of(next = static_cast<char>(yyinput())) != string::npos) - { + switch(next) + { + case '\\': + case '"': + case '\'': + { + str->v += next; + break; + } + case 'n': + { + str->v += '\n'; + break; + } + case 'r': + { + str->v += '\r'; + break; + } + case 't': + { + str->v += '\t'; + break; + } + case 'v': + { + str->v += '\v'; + break; + } + case 'f': + { + str->v += '\f'; + break; + } + + case 'a': + { + str->v += '\a'; + break; + } + + case 'b': + { + str->v += '\b'; + break; + } + + case '?': + { + str->v += '\?'; + break; + } + + case '0': + case '1': + case '2': + case '3': + { + static string octalDigits = "01234567"; + unsigned short us = next - '0'; + if(octalDigits.find_first_of(next = static_cast<char>(yyinput())) != string::npos) + { str->literal += next; - us = us * 8 + next - '0'; - if(octalDigits.find_first_of(next = static_cast<char>(yyinput())) != string::npos) - { - us = us * 8 + next - '0'; - } - else - { - unput(next); - } - } - else - { - unput(next); - } - if(us == 0) - { - unit->error("illegal NUL character in string constant"); - } - str->v += static_cast<char>(us); - break; - } - case 'x': - { - IceUtil::Int64 ull = 0; - while(isxdigit(static_cast<unsigned char>(next = static_cast<char>(yyinput())))) - { + us = us * 8 + next - '0'; + if(octalDigits.find_first_of(next = static_cast<char>(yyinput())) != string::npos) + { + us = us * 8 + next - '0'; + } + else + { + unput(next); + } + } + else + { + unput(next); + } + if(us == 0) + { + unit->error("illegal NUL character in string constant"); + } + str->v += static_cast<char>(us); + break; + } + case 'x': + { + IceUtil::Int64 ull = 0; + while(isxdigit(static_cast<unsigned char>(next = static_cast<char>(yyinput())))) + { str->literal += next; - ull *= 16; - if(isdigit(static_cast<unsigned char>(next))) - { - ull += next - '0'; - } - else if(islower(static_cast<unsigned char>(next))) - { - ull += next - 'a' + 10; - } - else - { - ull += next - 'A' + 10; - } - } - unput(next); - if(ull == 0) - { - unit->error("illegal NUL character in string constant"); - } - str->v += static_cast<char>(ull); - break; - } - - // TODO: add universal character names - - default: - { - str->v += c; - unput(next); - } - } - } - else - { - str->v += c; - } + ull *= 16; + if(isdigit(static_cast<unsigned char>(next))) + { + ull += next - '0'; + } + else if(islower(static_cast<unsigned char>(next))) + { + ull += next - 'a' + 10; + } + else + { + ull += next - 'A' + 10; + } + } + unput(next); + if(ull == 0) + { + unit->error("illegal NUL character in string constant"); + } + str->v += static_cast<char>(ull); + break; + } + // TODO: add universal character names + default: + { + str->v += c; + unput(next); + } + } + } + else + { + str->v += c; + } } *yylvalp = str; return ICE_STRING_LITERAL; @@ -1252,7 +1263,7 @@ YY_RULE_SETUP YY_BREAK case 15: YY_RULE_SETUP -#line 397 "Scanner.l" +#line 390 "Scanner.l" { BEGIN(MAINSCAN); IntegerTokPtr itp = new IntegerTok; @@ -1260,18 +1271,18 @@ YY_RULE_SETUP *yylvalp = itp; if(!IceUtilInternal::stringToInt64(string(slice_text), itp->v)) { - assert(itp->v != 0); - string msg = "integer constant `"; - msg += slice_text; - msg += "' out of range"; - unit->error(msg); + assert(itp->v != 0); + string msg = "integer constant `"; + msg += slice_text; + msg += "' out of range"; + unit->error(msg); } return ICE_INTEGER_LITERAL; } YY_BREAK case 16: YY_RULE_SETUP -#line 413 "Scanner.l" +#line 406 "Scanner.l" { BEGIN(MAINSCAN); errno = 0; @@ -1282,22 +1293,22 @@ YY_RULE_SETUP char lastChar = literal[literal.size() - 1]; if(lastChar == 'f' || lastChar == 'F') { - literal = literal.substr(0, literal.size() - 1); // Clobber trailing 'f' or 'F' suffix + literal = literal.substr(0, literal.size() - 1); // Clobber trailing 'f' or 'F' suffix } ftp->v = strtod(literal.c_str(), 0); if((ftp->v == HUGE_VAL || ftp->v == -HUGE_VAL) && errno == ERANGE) { - string msg = "floating-point constant `"; - msg += slice_text; - msg += "' too large (overflow)"; - unit->error(msg); + string msg = "floating-point constant `"; + msg += slice_text; + msg += "' too large (overflow)"; + unit->error(msg); } else if(ftp->v == 0 && errno == ERANGE) { - string msg = "floating-point constant `"; - msg += slice_text; - msg += "' too small (underflow)"; - unit->error(msg); + string msg = "floating-point constant `"; + msg += slice_text; + msg += "' too small (underflow)"; + unit->error(msg); } return ICE_FLOATING_POINT_LITERAL; } @@ -1305,54 +1316,54 @@ YY_RULE_SETUP case 17: /* rule 17 can match eol */ YY_RULE_SETUP -#line 443 "Scanner.l" +#line 436 "Scanner.l" { // Ignore white-space - + if(unit->currentLine() != 0) { BEGIN(MAINSCAN); } if(slice_text[0] == '\n') { - unit->nextLine(); + unit->nextLine(); } } YY_BREAK case 18: YY_RULE_SETUP -#line 456 "Scanner.l" +#line 449 "Scanner.l" { // Ignore UTF-8 BOM, rule only active when parsing start of file. - + BEGIN(MAINSCAN); } YY_BREAK case 19: YY_RULE_SETUP -#line 462 "Scanner.l" +#line 455 "Scanner.l" { BEGIN(MAINSCAN); if(slice_text[0] < 32 || slice_text[0] > 126) { - stringstream s; - s << "illegal input character: '\\"; - s.width(3); - s.fill('0'); - s << oct << static_cast<int>(static_cast<unsigned char>(slice_text[0])); - s << "'"; - unit->error(s.str()); - return BAD_CHAR; + stringstream s; + s << "illegal input character: '\\"; + s.width(3); + s.fill('0'); + s << oct << static_cast<int>(static_cast<unsigned char>(slice_text[0])); + s << "'"; + unit->error(s.str()); + return BAD_CHAR; } return slice_text[0]; } YY_BREAK case 20: YY_RULE_SETUP -#line 478 "Scanner.l" +#line 471 "Scanner.l" ECHO; YY_BREAK -#line 1355 "lex.yy.c" +#line 1366 "lex.yy.c" case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(BOMSCAN): case YY_STATE_EOF(MAINSCAN): @@ -1486,6 +1497,7 @@ case YY_STATE_EOF(MAINSCAN): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of slice_lex */ /* yy_get_next_buffer - try to read in a new buffer @@ -1541,21 +1553,21 @@ static int yy_get_next_buffer (void) else { - int num_to_read = + yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { - int new_size = b->yy_buf_size * 2; + yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -1586,7 +1598,7 @@ static int yy_get_next_buffer (void) /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), (size_t) num_to_read ); + (yy_n_chars), num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } @@ -1682,7 +1694,7 @@ static int yy_get_next_buffer (void) yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 72); - return yy_is_jam ? 0 : yy_current_state; + return yy_is_jam ? 0 : yy_current_state; } static void yyunput (int c, register char * yy_bp ) @@ -1697,7 +1709,7 @@ static int yy_get_next_buffer (void) if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register int number_to_move = (yy_n_chars) + 2; + register yy_size_t number_to_move = (yy_n_chars) + 2; register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; register char *source = @@ -1746,7 +1758,7 @@ static int yy_get_next_buffer (void) else { /* need more input */ - int offset = (yy_c_buf_p) - (yytext_ptr); + yy_size_t offset = (yy_c_buf_p) - (yytext_ptr); ++(yy_c_buf_p); switch ( yy_get_next_buffer( ) ) @@ -2020,7 +2032,7 @@ void slice_pop_buffer_state (void) */ static void slice_ensure_buffer_stack (void) { - int num_to_alloc; + yy_size_t num_to_alloc; if (!(yy_buffer_stack)) { @@ -2112,17 +2124,17 @@ YY_BUFFER_STATE slice__scan_string (yyconst char * yystr ) /** Setup the input buffer state to scan the given bytes. The next call to slice_lex() will * scan from a @e copy of @a bytes. - * @param bytes the byte buffer to scan - * @param len the number of bytes in the buffer pointed to by @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE slice__scan_bytes (yyconst char * yybytes, int _yybytes_len ) +YY_BUFFER_STATE slice__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len ) { YY_BUFFER_STATE b; char *buf; yy_size_t n; - int i; + yy_size_t i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; @@ -2204,7 +2216,7 @@ FILE *slice_get_out (void) /** Get the length of the current token. * */ -int slice_get_leng (void) +yy_size_t slice_get_leng (void) { return slice_leng; } @@ -2352,7 +2364,7 @@ void slice_free (void * ptr ) #define YYTABLES_NAME "yytables" -#line 478 "Scanner.l" +#line 470 "Scanner.l" @@ -2394,6 +2406,7 @@ initScanner() keywordMap["true"] = ICE_TRUE; keywordMap["idempotent"] = ICE_IDEMPOTENT; keywordMap["optional"] = ICE_OPTIONAL; + keywordMap["Value"] = ICE_VALUE; } // @@ -2409,15 +2422,15 @@ checkKeyword(string& id) StringTokenMap::const_iterator pos = keywordMap.find(id); if(pos != keywordMap.end()) { - if(pos->first != id) - { - string msg; - msg = "illegal identifier: `" + id + "' differs from keyword `"; - msg += pos->first + "' only in capitalization"; - unit->error(msg); - id = pos->first; - } - return pos->second; + if(pos->first != id) + { + string msg; + msg = "illegal identifier: `" + id + "' differs from keyword `"; + msg += pos->first + "' only in capitalization"; + unit->error(msg); + id = pos->first; + } + return pos->second; } return ICE_IDENTIFIER; } diff --git a/cpp/src/Slice/Scanner.l b/cpp/src/Slice/Scanner.l index a5f8d439a2d..190c00bcf5c 100644 --- a/cpp/src/Slice/Scanner.l +++ b/cpp/src/Slice/Scanner.l @@ -9,7 +9,7 @@ // // ********************************************************************** -#include <Slice/GrammarUtil.h> // Before Grammer.h, so that YYSTYPE is defined +#include <Slice/GrammarUtil.h> // Before Grammer.h, so that YYSTYPE is defined #include <Slice/Grammar.h> #include <IceUtil/InputUtil.h> @@ -50,7 +50,7 @@ # define slice_wrap() 1 # endif # ifdef ICE_64 -# pragma error_messages(off,truncwarn) +# pragma error_messages(off,truncwarn) # endif #endif @@ -63,7 +63,7 @@ namespace Slice // // Definitions for the case-insensitive keyword-token map. // -typedef std::map<std::string, int, Slice::CICompare> StringTokenMap; +typedef std::map<std::string, int> StringTokenMap; static StringTokenMap keywordMap; void initScanner(); @@ -71,7 +71,7 @@ int checkKeyword(string&); } -#define YY_USER_INIT initScanner(); +#define YY_USER_INIT initScanner(); %} @@ -80,11 +80,11 @@ int checkKeyword(string&); %option prefix="slice_" %option outfile="lex.yy.c" -identifier \\?[[:alpha:]_][[:alnum:]_]* -integer_constant (\+|-)?((0[0-7]+)|(0x[[:xdigit:]]+)|([[:digit:]]+)) -fractional_constant (\+|-)?(([[:digit:]]*\.[[:digit:]]+)|([[:digit:]]+\.)) -exponent_part (e|E)(\+|-)?[[:digit:]]+ -floating_literal (({fractional_constant}{exponent_part}?)|((\+|-)?[[:digit:]]+{exponent_part}))[fF]? +identifier \\?[[:alpha:]_][[:alnum:]_]* +integer_constant (\+|-)?((0[0-7]+)|(0x[[:xdigit:]]+)|([[:digit:]]+)) +fractional_constant (\+|-)?(([[:digit:]]*\.[[:digit:]]+)|([[:digit:]]+\.)) +exponent_part (e|E)(\+|-)?[[:digit:]]+ +floating_literal (({fractional_constant}{exponent_part}?)|((\+|-)?[[:digit:]]+{exponent_part}))[fF]? %s BOMSCAN %s MAINSCAN @@ -125,11 +125,11 @@ floating_literal (({fractional_constant}{exponent_part}?)|((\+|-)?[[:digit:]]+{e int c; do { - c = yyinput(); - if(c == '\n') - { - unit->nextLine(); - } + c = yyinput(); + if(c == '\n') + { + unit->nextLine(); + } } while(c != '\n' && c != EOF); } @@ -140,38 +140,38 @@ floating_literal (({fractional_constant}{exponent_part}?)|((\+|-)?[[:digit:]]+{e string comment = yytext + 2; while(true) { - int c = yyinput(); - if(c == '\n') - { - comment += static_cast<char>(c); - unit->nextLine(); - } - else if(c == '*') - { - int next = yyinput(); - if(next == '/') - { - break; - } - else - { - comment += static_cast<char>(c); - unput(next); - } - } - else if(c == EOF) - { - unit->warning("EOF in comment"); - break; - } - else - { - comment += static_cast<char>(c); - } + int c = yyinput(); + if(c == '\n') + { + comment += static_cast<char>(c); + unit->nextLine(); + } + else if(c == '*') + { + int next = yyinput(); + if(next == '/') + { + break; + } + else + { + comment += static_cast<char>(c); + unput(next); + } + } + else if(c == EOF) + { + unit->warning("EOF in comment"); + break; + } + else + { + comment += static_cast<char>(c); + } } if(!comment.empty() && comment[0] == '*') { - unit->setComment(comment); + unit->setComment(comment); } } @@ -239,156 +239,149 @@ floating_literal (({fractional_constant}{exponent_part}?)|((\+|-)?[[:digit:]]+{e str->literal = "\""; while(true) { - char c = static_cast<char>(yyinput()); + char c = static_cast<char>(yyinput()); str->literal += c; - if(c == '"') - { - break; - } - else if(c == EOF) - { - unit->error("EOF in string"); - break; - } - else if(c == '\n') - { - unit->error("newline in string"); - } - else if(c == '\\') - { - char next = static_cast<char>(yyinput()); + if(c == '"') + { + break; + } + else if(c == EOF) + { + unit->error("EOF in string"); + break; + } + else if(c == '\n') + { + unit->error("newline in string"); + } + else if(c == '\\') + { + char next = static_cast<char>(yyinput()); str->literal += next; - switch(next) - { - case '\\': - case '"': - case '\'': - { - str->v += next; - break; - } - - case 'n': - { - str->v += '\n'; - break; - } - - case 'r': - { - str->v += '\r'; - break; - } - - case 't': - { - str->v += '\t'; - break; - } - - case 'v': - { - str->v += '\v'; - break; - } - - case 'f': - { - str->v += '\f'; - break; - } - - case 'a': - { - str->v += '\a'; - break; - } - - case 'b': - { - str->v += '\b'; - break; - } - - case '?': - { - str->v += '\?'; - break; - } - - case '0': - case '1': - case '2': - case '3': - { - static string octalDigits = "01234567"; - unsigned short us = next - '0'; - if(octalDigits.find_first_of(next = static_cast<char>(yyinput())) != string::npos) - { + switch(next) + { + case '\\': + case '"': + case '\'': + { + str->v += next; + break; + } + case 'n': + { + str->v += '\n'; + break; + } + case 'r': + { + str->v += '\r'; + break; + } + case 't': + { + str->v += '\t'; + break; + } + case 'v': + { + str->v += '\v'; + break; + } + case 'f': + { + str->v += '\f'; + break; + } + + case 'a': + { + str->v += '\a'; + break; + } + + case 'b': + { + str->v += '\b'; + break; + } + + case '?': + { + str->v += '\?'; + break; + } + + case '0': + case '1': + case '2': + case '3': + { + static string octalDigits = "01234567"; + unsigned short us = next - '0'; + if(octalDigits.find_first_of(next = static_cast<char>(yyinput())) != string::npos) + { str->literal += next; - us = us * 8 + next - '0'; - if(octalDigits.find_first_of(next = static_cast<char>(yyinput())) != string::npos) - { - us = us * 8 + next - '0'; - } - else - { - unput(next); - } - } - else - { - unput(next); - } - if(us == 0) - { - unit->error("illegal NUL character in string constant"); - } - str->v += static_cast<char>(us); - break; - } - case 'x': - { - IceUtil::Int64 ull = 0; - while(isxdigit(static_cast<unsigned char>(next = static_cast<char>(yyinput())))) - { + us = us * 8 + next - '0'; + if(octalDigits.find_first_of(next = static_cast<char>(yyinput())) != string::npos) + { + us = us * 8 + next - '0'; + } + else + { + unput(next); + } + } + else + { + unput(next); + } + if(us == 0) + { + unit->error("illegal NUL character in string constant"); + } + str->v += static_cast<char>(us); + break; + } + case 'x': + { + IceUtil::Int64 ull = 0; + while(isxdigit(static_cast<unsigned char>(next = static_cast<char>(yyinput())))) + { str->literal += next; - ull *= 16; - if(isdigit(static_cast<unsigned char>(next))) - { - ull += next - '0'; - } - else if(islower(static_cast<unsigned char>(next))) - { - ull += next - 'a' + 10; - } - else - { - ull += next - 'A' + 10; - } - } - unput(next); - if(ull == 0) - { - unit->error("illegal NUL character in string constant"); - } - str->v += static_cast<char>(ull); - break; - } - - // TODO: add universal character names - - default: - { - str->v += c; - unput(next); - } - } - } - else - { - str->v += c; - } + ull *= 16; + if(isdigit(static_cast<unsigned char>(next))) + { + ull += next - '0'; + } + else if(islower(static_cast<unsigned char>(next))) + { + ull += next - 'a' + 10; + } + else + { + ull += next - 'A' + 10; + } + } + unput(next); + if(ull == 0) + { + unit->error("illegal NUL character in string constant"); + } + str->v += static_cast<char>(ull); + break; + } + // TODO: add universal character names + default: + { + str->v += c; + unput(next); + } + } + } + else + { + str->v += c; + } } *yylvalp = str; return ICE_STRING_LITERAL; @@ -401,11 +394,11 @@ floating_literal (({fractional_constant}{exponent_part}?)|((\+|-)?[[:digit:]]+{e *yylvalp = itp; if(!IceUtilInternal::stringToInt64(string(yytext), itp->v)) { - assert(itp->v != 0); - string msg = "integer constant `"; - msg += yytext; - msg += "' out of range"; - unit->error(msg); + assert(itp->v != 0); + string msg = "integer constant `"; + msg += yytext; + msg += "' out of range"; + unit->error(msg); } return ICE_INTEGER_LITERAL; } @@ -420,42 +413,42 @@ floating_literal (({fractional_constant}{exponent_part}?)|((\+|-)?[[:digit:]]+{e char lastChar = literal[literal.size() - 1]; if(lastChar == 'f' || lastChar == 'F') { - literal = literal.substr(0, literal.size() - 1); // Clobber trailing 'f' or 'F' suffix + literal = literal.substr(0, literal.size() - 1); // Clobber trailing 'f' or 'F' suffix } ftp->v = strtod(literal.c_str(), 0); if((ftp->v == HUGE_VAL || ftp->v == -HUGE_VAL) && errno == ERANGE) { - string msg = "floating-point constant `"; - msg += yytext; - msg += "' too large (overflow)"; - unit->error(msg); + string msg = "floating-point constant `"; + msg += yytext; + msg += "' too large (overflow)"; + unit->error(msg); } else if(ftp->v == 0 && errno == ERANGE) { - string msg = "floating-point constant `"; - msg += yytext; - msg += "' too small (underflow)"; - unit->error(msg); + string msg = "floating-point constant `"; + msg += yytext; + msg += "' too small (underflow)"; + unit->error(msg); } return ICE_FLOATING_POINT_LITERAL; } [[:space:]] { // Ignore white-space - + if(unit->currentLine() != 0) { BEGIN(MAINSCAN); } if(yytext[0] == '\n') { - unit->nextLine(); + unit->nextLine(); } } <BOMSCAN>^"\357\273\277" { // Ignore UTF-8 BOM, rule only active when parsing start of file. - + BEGIN(MAINSCAN); } @@ -463,14 +456,14 @@ floating_literal (({fractional_constant}{exponent_part}?)|((\+|-)?[[:digit:]]+{e BEGIN(MAINSCAN); if(yytext[0] < 32 || yytext[0] > 126) { - stringstream s; - s << "illegal input character: '\\"; - s.width(3); - s.fill('0'); - s << oct << static_cast<int>(static_cast<unsigned char>(yytext[0])); - s << "'"; - unit->error(s.str()); - return BAD_CHAR; + stringstream s; + s << "illegal input character: '\\"; + s.width(3); + s.fill('0'); + s << oct << static_cast<int>(static_cast<unsigned char>(yytext[0])); + s << "'"; + unit->error(s.str()); + return BAD_CHAR; } return yytext[0]; } @@ -515,6 +508,7 @@ initScanner() keywordMap["true"] = ICE_TRUE; keywordMap["idempotent"] = ICE_IDEMPOTENT; keywordMap["optional"] = ICE_OPTIONAL; + keywordMap["Value"] = ICE_VALUE; } // @@ -530,15 +524,15 @@ checkKeyword(string& id) StringTokenMap::const_iterator pos = keywordMap.find(id); if(pos != keywordMap.end()) { - if(pos->first != id) - { - string msg; - msg = "illegal identifier: `" + id + "' differs from keyword `"; - msg += pos->first + "' only in capitalization"; - unit->error(msg); - id = pos->first; - } - return pos->second; + if(pos->first != id) + { + string msg; + msg = "illegal identifier: `" + id + "' differs from keyword `"; + msg += pos->first + "' only in capitalization"; + unit->error(msg); + id = pos->first; + } + return pos->second; } return ICE_IDENTIFIER; } diff --git a/cpp/src/Slice/Slice.rc b/cpp/src/Slice/Slice.rc index 9b20c016126..ebb3e52b6da 100644 --- a/cpp/src/Slice/Slice.rc +++ b/cpp/src/Slice/Slice.rc @@ -1,17 +1,17 @@ #include "winver.h" VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,6,1,0 - PRODUCTVERSION 3,6,1,0 + FILEVERSION 3,7,0,0 + PRODUCTVERSION 3,7,0,0 FILEFLAGSMASK VS_FFI_FILEFLAGSMASK #ifdef _DEBUG FILEFLAGS VS_FF_DEBUG - #define INTERNALNAME "slice36d\0" - #define ORIGINALFILENAME "slice36d.dll\0" + #define INTERNALNAME "slice37d\0" + #define ORIGINALFILENAME "slice37d.dll\0" #else FILEFLAGS 0x0L - #define INTERNALNAME "slice36\0" - #define ORIGINALFILENAME "slice36.dll\0" + #define INTERNALNAME "slice37\0" + #define ORIGINALFILENAME "slice37.dll\0" #endif FILEOS 0x4L FILETYPE VFT_DLL @@ -23,12 +23,12 @@ BEGIN BEGIN VALUE "CompanyName", "ZeroC, Inc.\0" VALUE "FileDescription", "Slice C++ Library\0" - VALUE "FileVersion", "3.6.1\0" + VALUE "FileVersion", "3.7.0\0" VALUE "InternalName", INTERNALNAME VALUE "LegalCopyright", "\251 2003-2015 ZeroC, Inc.\0" VALUE "OriginalFilename", ORIGINALFILENAME VALUE "ProductName", "Ice\0" - VALUE "ProductVersion", "3.6.1\0" + VALUE "ProductVersion", "3.7.0\0" END END BLOCK "VarFileInfo" diff --git a/cpp/src/Slice/Util.cpp b/cpp/src/Slice/Util.cpp index 66d142b5897..e0c490fa937 100644 --- a/cpp/src/Slice/Util.cpp +++ b/cpp/src/Slice/Util.cpp @@ -154,8 +154,9 @@ Slice::fullPath(const string& path) } string -Slice::changeInclude(const string& path, const vector<string>& includePaths) +Slice::changeInclude(const string& p, const vector<string>& includePaths) { + string path = normalizePath(p); // // Compare each include path against the included file and select // the path that produces the shortest relative filename. diff --git a/cpp/src/Slice/log.txt b/cpp/src/Slice/log.txt new file mode 100644 index 00000000000..35716d9e051 --- /dev/null +++ b/cpp/src/Slice/log.txt @@ -0,0 +1,188 @@ + cl.exe /c -I.. -nologo -GR -EHsc -WX -W3 -wd4250 -wd4251 -wd4275 -D_CONSOLE -D_WIN32_WINNT=0x601 -MP -Zi -Od -D_DEBUG -MDd -RTC1 -I"..\..\include" -DSLICE_API_EXPORTS -DWIN32_LEAN_AND_MEAN Checksum.cpp CPlusPlusUtil.cpp CsUtil.cpp FileTracker.cpp JavaUtil.cpp Parser.cpp PHPUtil.cpp Preprocessor.cpp PythonUtil.cpp Python.cpp RubyUtil.cpp Util.cpp Ruby.cpp Grammar.cpp Scanner.cpp +Checksum.cpp +CPlusPlusUtil.cpp +CsUtil.cpp +FileTracker.cpp +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(68) : error C2220: warning treated as error - no 'object' file generated (Checksum.cpp) +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(68) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (Checksum.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(91) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (Checksum.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(116) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (Checksum.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(138) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (Checksum.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(162) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (Checksum.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(177) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (Checksum.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(68) : error C2220: warning treated as error - no 'object' file generated (CPlusPlusUtil.cpp) +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(68) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (CPlusPlusUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(91) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (CPlusPlusUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(116) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (CPlusPlusUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(138) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (CPlusPlusUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(162) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (CPlusPlusUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(177) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (CPlusPlusUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(68) : error C2220: warning treated as error - no 'object' file generated (FileTracker.cpp) +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(68) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (FileTracker.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(68) : error C2220: warning treated as error - no 'object' file generated (CsUtil.cpp) +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(68) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (CsUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(91) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (FileTracker.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(91) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (CsUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(116) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (FileTracker.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(116) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (CsUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(138) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (FileTracker.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(138) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (CsUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(162) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (FileTracker.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(162) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (CsUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(177) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (FileTracker.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(177) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (CsUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\Slice/FileTracker.h(36) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (FileTracker.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +JavaUtil.cpp +Parser.cpp +PHPUtil.cpp +Preprocessor.cpp +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(68) : error C2220: warning treated as error - no 'object' file generated (Parser.cpp) +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(68) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (Parser.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(91) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (Parser.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(116) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (Parser.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(138) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (Parser.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(162) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (Parser.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(177) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (Parser.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(68) : error C2220: warning treated as error - no 'object' file generated (PHPUtil.cpp) +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(68) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (PHPUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(91) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (PHPUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(116) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (PHPUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(138) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (PHPUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(162) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (PHPUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(177) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (PHPUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(68) : error C2220: warning treated as error - no 'object' file generated (Preprocessor.cpp) +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(68) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (Preprocessor.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(91) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (Preprocessor.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(116) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (Preprocessor.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(138) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (Preprocessor.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(162) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (Preprocessor.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(177) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (Preprocessor.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +PythonUtil.cpp +Python.cpp +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(68) : error C2220: warning treated as error - no 'object' file generated (PythonUtil.cpp) +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(68) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (PythonUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(91) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (PythonUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(116) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (PythonUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(138) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (PythonUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(162) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (PythonUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(177) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (PythonUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +RubyUtil.cpp +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/ThreadException.h(35) : warning C4996: 'IceUtil::SyscallException::ice_name': ice_name() is deprecated, use ice_id() instead. (PythonUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(128) : see declaration of 'IceUtil::SyscallException::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/ThreadException.h(53) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (PythonUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/ThreadException.h(71) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (PythonUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/ThreadException.h(89) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (PythonUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/ThreadException.h(107) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (PythonUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/ThreadException.h(127) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (PythonUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/CtrlCHandler.h(70) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (PythonUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +Util.cpp +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(68) : error C2220: warning treated as error - no 'object' file generated (RubyUtil.cpp) +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(68) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (RubyUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(91) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (RubyUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(116) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (RubyUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(138) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (RubyUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(162) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (RubyUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(177) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (RubyUtil.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(68) : error C2220: warning treated as error - no 'object' file generated (Util.cpp) +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(68) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (Util.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(91) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (Util.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(116) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (Util.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(138) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (Util.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(162) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (Util.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(177) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (Util.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +Ruby.cpp +Grammar.cpp +Scanner.cpp +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(68) : error C2220: warning treated as error - no 'object' file generated (Grammar.cpp) +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(68) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (Grammar.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(91) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (Grammar.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(116) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (Grammar.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(138) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (Grammar.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(162) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (Grammar.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(177) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (Grammar.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(68) : error C2220: warning treated as error - no 'object' file generated (Scanner.cpp) +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(68) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (Scanner.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(91) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (Scanner.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(116) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (Scanner.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(138) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (Scanner.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(162) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (Scanner.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' +C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(177) : warning C4996: 'IceUtil::Exception::ice_name': ice_name() is deprecated, use ice_id() instead. (Scanner.cpp) + C:\Users\pepe\Documents\ZeroC\ice\cpp\include\IceUtil/Exception.h(36) : see declaration of 'IceUtil::Exception::ice_name' diff --git a/cpp/src/Slice/msbuild/packages.config b/cpp/src/Slice/msbuild/packages.config new file mode 100644 index 00000000000..c12391e1a04 --- /dev/null +++ b/cpp/src/Slice/msbuild/packages.config @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<packages> + <package id="mcpp.v120" version="2.7.2.6" targetFramework="native" /> + <package id="mcpp.v140" version="2.7.2.6" targetFramework="native" /> +</packages>
\ No newline at end of file diff --git a/cpp/src/Slice/msbuild/slice.vcxproj b/cpp/src/Slice/msbuild/slice.vcxproj new file mode 100644 index 00000000000..6ad0a588a50 --- /dev/null +++ b/cpp/src/Slice/msbuild/slice.vcxproj @@ -0,0 +1,144 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{57CD6AC2-0C9D-4648-9E9D-5DF60C90F18A}</ProjectGuid> + <RootNamespace>Slice</RootNamespace> + <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <Import Project="$(MSBuildThisFileDirectory)\..\..\..\msbuild\ice.cpp98.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="Shared"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <PreprocessorDefinitions>SLICE_API_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <PreprocessorDefinitions>SLICE_API_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <PreprocessorDefinitions>SLICE_API_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <PreprocessorDefinitions>SLICE_API_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + </ItemDefinitionGroup> + <ItemGroup> + <ResourceCompile Include="..\Slice.rc" /> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\Checksum.cpp" /> + <ClCompile Include="..\CPlusPlusUtil.cpp" /> + <ClCompile Include="..\CsUtil.cpp" /> + <ClCompile Include="..\DotNetNames.cpp" /> + <ClCompile Include="..\FileTracker.cpp" /> + <ClCompile Include="..\Grammar.cpp" /> + <ClCompile Include="..\JavaUtil.cpp" /> + <ClCompile Include="..\MD5.cpp" /> + <ClCompile Include="..\MD5I.cpp" /> + <ClCompile Include="..\ObjCUtil.cpp" /> + <ClCompile Include="..\Parser.cpp" /> + <ClCompile Include="..\PHPUtil.cpp" /> + <ClCompile Include="..\Preprocessor.cpp" /> + <ClCompile Include="..\Python.cpp" /> + <ClCompile Include="..\PythonUtil.cpp" /> + <ClCompile Include="..\Ruby.cpp" /> + <ClCompile Include="..\RubyUtil.cpp" /> + <ClCompile Include="..\Scanner.cpp" /> + <ClCompile Include="..\Util.cpp" /> + </ItemGroup> + <ItemGroup> + <ClInclude Include="..\..\..\include\Slice\Checksum.h" /> + <ClInclude Include="..\..\..\include\Slice\CPlusPlusUtil.h" /> + <ClInclude Include="..\..\..\include\Slice\CsUtil.h" /> + <ClInclude Include="..\..\..\include\Slice\DotNetNames.h" /> + <ClInclude Include="..\..\..\include\Slice\FileTracker.h" /> + <ClInclude Include="..\..\..\include\Slice\JavaUtil.h" /> + <ClInclude Include="..\..\..\include\Slice\ObjCUtil.h" /> + <ClInclude Include="..\..\..\include\Slice\Parser.h" /> + <ClInclude Include="..\..\..\include\Slice\PHPUtil.h" /> + <ClInclude Include="..\..\..\include\Slice\Preprocessor.h" /> + <ClInclude Include="..\..\..\include\Slice\PythonUtil.h" /> + <ClInclude Include="..\..\..\include\Slice\RubyUtil.h" /> + <ClInclude Include="..\..\..\include\Slice\Util.h" /> + <ClInclude Include="..\Grammar.h" /> + <ClInclude Include="..\GrammarUtil.h" /> + <ClInclude Include="..\MD5.h" /> + <ClInclude Include="..\MD5I.h" /> + </ItemGroup> + <ItemGroup> + <None Include="packages.config" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + <Import Project="..\..\..\msbuild\packages\mcpp.v120.2.7.2.6\build\native\mcpp.v120.targets" Condition="Exists('..\..\..\msbuild\packages\mcpp.v120.2.7.2.6\build\native\mcpp.v120.targets')" /> + <Import Project="..\..\..\msbuild\packages\mcpp.v140.2.7.2.6\build\native\mcpp.v140.targets" Condition="Exists('..\..\..\msbuild\packages\mcpp.v140.2.7.2.6\build\native\mcpp.v140.targets')" /> + </ImportGroup> + <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> + <PropertyGroup> + <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> + </PropertyGroup> + <Error Condition="!Exists('..\..\..\msbuild\packages\mcpp.v120.2.7.2.6\build\native\mcpp.v120.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\msbuild\packages\mcpp.v120.2.7.2.6\build\native\mcpp.v120.targets'))" /> + <Error Condition="!Exists('..\..\..\msbuild\packages\mcpp.v140.2.7.2.6\build\native\mcpp.v140.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\msbuild\packages\mcpp.v140.2.7.2.6\build\native\mcpp.v140.targets'))" /> + </Target> +</Project> diff --git a/cpp/src/Slice/msbuild/slice.vcxproj.filters b/cpp/src/Slice/msbuild/slice.vcxproj.filters new file mode 100644 index 00000000000..1757a2aa8b9 --- /dev/null +++ b/cpp/src/Slice/msbuild/slice.vcxproj.filters @@ -0,0 +1,137 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <UniqueIdentifier>{86EEC4C6-451D-4E42-AC48-87773B310643}</UniqueIdentifier> + <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> + </Filter> + <Filter Include="Header Files"> + <UniqueIdentifier>{8A6EAD0B-649C-4B94-9B49-C2D08D61A8A5}</UniqueIdentifier> + <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions> + </Filter> + <Filter Include="Resource Files"> + <UniqueIdentifier>{F4629E6B-3ADA-4290-96D5-68BA0E7D068D}</UniqueIdentifier> + <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> + </Filter> + </ItemGroup> + <ItemGroup> + <ResourceCompile Include="..\Slice.rc"> + <Filter>Resource Files</Filter> + </ResourceCompile> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\Checksum.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\CPlusPlusUtil.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\CsUtil.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\DotNetNames.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\FileTracker.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\Grammar.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\JavaUtil.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\MD5.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\MD5I.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\ObjCUtil.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\Parser.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\PHPUtil.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\Preprocessor.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\Python.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\PythonUtil.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\Ruby.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\RubyUtil.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\Scanner.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\Util.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + </ItemGroup> + <ItemGroup> + <ClInclude Include="..\Grammar.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\GrammarUtil.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\MD5.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\MD5I.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\..\include\Slice\Checksum.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\..\include\Slice\CPlusPlusUtil.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\..\include\Slice\CsUtil.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\..\include\Slice\DotNetNames.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\..\include\Slice\FileTracker.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\..\include\Slice\JavaUtil.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\..\include\Slice\ObjCUtil.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\..\include\Slice\Parser.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\..\include\Slice\Preprocessor.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\..\include\Slice\RubyUtil.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\..\include\Slice\Util.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\..\include\Slice\PHPUtil.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="..\..\..\include\Slice\PythonUtil.h"> + <Filter>Header Files</Filter> + </ClInclude> + </ItemGroup> + <ItemGroup> + <None Include="packages.config" /> + </ItemGroup> +</Project>
\ No newline at end of file |