diff options
author | Michi Henning <michi@zeroc.com> | 2005-09-21 03:17:49 +0000 |
---|---|---|
committer | Michi Henning <michi@zeroc.com> | 2005-09-21 03:17:49 +0000 |
commit | c8c8274bf45e01e1b951c309df0e7565aec149c0 (patch) | |
tree | d83ad78d2a3ef5f9a3d27244b3608cf58a655115 /cpp/src | |
parent | Bug 467. (diff) | |
download | ice-c8c8274bf45e01e1b951c309df0e7565aec149c0.tar.bz2 ice-c8c8274bf45e01e1b951c309df0e7565aec149c0.tar.xz ice-c8c8274bf45e01e1b951c309df0e7565aec149c0.zip |
Bug 426.
Diffstat (limited to 'cpp/src')
-rwxr-xr-x | cpp/src/Slice/CsUtil.cpp | 158 | ||||
-rwxr-xr-x | cpp/src/Slice/DotNetNames.cpp | 5 | ||||
-rwxr-xr-x | cpp/src/Slice/VbUtil.cpp | 178 | ||||
-rwxr-xr-x | cpp/src/slice2cs/Gen.cpp | 894 | ||||
-rwxr-xr-x | cpp/src/slice2vb/Gen.cpp | 913 |
5 files changed, 1072 insertions, 1076 deletions
diff --git a/cpp/src/Slice/CsUtil.cpp b/cpp/src/Slice/CsUtil.cpp index 2aa48cb64b9..e1e48eff95f 100755 --- a/cpp/src/Slice/CsUtil.cpp +++ b/cpp/src/Slice/CsUtil.cpp @@ -227,11 +227,11 @@ Slice::CsGenerator::writeMarshalUnmarshalCode(Output &out, if(marshal) { - stream = streamingAPI ? "__outS" : "__os"; + stream = streamingAPI ? "outS__" : "os__"; } else { - stream = streamingAPI ? "__inS" : "__is"; + stream = streamingAPI ? "inS__" : "is__"; } BuiltinPtr builtin = BuiltinPtr::dynamicCast(type); @@ -361,7 +361,7 @@ Slice::CsGenerator::writeMarshalUnmarshalCode(Output &out, { out << "(Ice.ReadObjectCallback)"; } - out << "new __Patcher(" << patchParams << "));"; + out << "new Patcher__(" << patchParams << "));"; } } break; @@ -394,21 +394,21 @@ Slice::CsGenerator::writeMarshalUnmarshalCode(Output &out, string typeS = typeToString(type); if(marshal) { - out << nl << typeS << "Helper."; + out << nl << typeS << "Helper.write"; if(!streamingAPI) { out << "__"; } - out << "write(" << stream << ", " << param << ");"; + out << "(" << stream << ", " << param << ");"; } else { - out << nl << param << " = " << typeS << "Helper."; + out << nl << param << " = " << typeS << "Helper.read"; if(!streamingAPI) { out << "__"; } - out << "read(" << stream << ')' << ';'; + out << "(" << stream << ");"; } return; } @@ -440,7 +440,7 @@ Slice::CsGenerator::writeMarshalUnmarshalCode(Output &out, { out << "(Ice.ReadObjectCallback)"; } - out << "new __Patcher(" << patchParams << "));"; + out << "new Patcher__(" << patchParams << "));"; } } return; @@ -451,13 +451,13 @@ Slice::CsGenerator::writeMarshalUnmarshalCode(Output &out, { if(marshal) { - out << nl << param << ".__write(" << stream << ");"; + out << nl << param << ".write__(" << stream << ");"; } else { string typeS = typeToString(type); out << nl << param << " = new " << typeS << "();"; - out << nl << param << ".__read(" << stream << ");"; + out << nl << param << ".read__(" << stream << ");"; } return; } @@ -523,11 +523,11 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, string stream; if(marshal) { - stream = streamingAPI ? "__outS" : "__os"; + stream = streamingAPI ? "outS__" : "os__"; } else { - stream = streamingAPI ? "__inS" : "__is"; + stream = streamingAPI ? "inS__" : "is__"; } TypePtr type = seq->type(); @@ -553,26 +553,26 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, out << nl << "else"; out << sb; out << nl << stream << ".writeSize(" << param << '.' << limitID << ");"; - out << nl << "for(int __ix = 0; __ix < " << param << '.' << limitID << "; ++__ix)"; + out << nl << "for(int ix__ = 0; ix__ < " << param << '.' << limitID << "; ++ix__)"; out << sb; string func = builtin->kind() == Builtin::KindObject ? "writeObject" : "writeProxy"; - out << nl << stream << '.' << func << '(' << param << "[__ix]);"; + out << nl << stream << '.' << func << '(' << param << "[ix__]);"; out << eb; out << eb; } else { - out << nl << "int __lenx = " << stream << ".readSize();"; + out << nl << "int lenx__ = " << stream << ".readSize();"; if(!streamingAPI) { if(builtin->isVariableLength()) { - out << nl << stream << ".startSeq(__lenx, " + out << nl << stream << ".startSeq(lenx__, " << static_cast<unsigned>(builtin->minWireSize()) << ");"; } else { - out << nl << stream << ".checkFixedSeq(__lenx, " + out << nl << stream << ".checkFixedSeq(lenx__, " << static_cast<unsigned>(builtin->minWireSize()) << ");"; } } @@ -581,42 +581,42 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, { if(isArray) { - out << "Ice.Object[__lenx];"; + out << "Ice.Object[lenx__];"; } else { - out << typeToString(seq) << "(__lenx);"; + out << typeToString(seq) << "(lenx__);"; } - out << nl << "for(int __ix = 0; __ix < __lenx; ++__ix)"; + out << nl << "for(int ix__ = 0; ix__ < lenx__; ++ix__)"; out << sb; out << nl << stream << ".readObject("; if(streamingAPI) { out << "(ReadObjectCallback)"; } - out << "new IceInternal.SequencePatcher(" << param << ", typeof(Ice.Object), __ix));"; + out << "new IceInternal.SequencePatcher(" << param << ", typeof(Ice.Object), ix__));"; } else { if(isArray) { - out << "Ice.ObjectPrx[__lenx];"; + out << "Ice.ObjectPrx[lenx__];"; } else { - out << typeToString(seq) << "(__lenx);"; + out << typeToString(seq) << "(lenx__);"; } - out << nl << "for(int __ix = 0; __ix < __lenx; ++__ix)"; + out << nl << "for(int ix__ = 0; ix__ < lenx__; ++ix__)"; out << sb; if(isArray) { - out << nl << param << "[__ix] = " << stream << ".readProxy();"; + out << nl << param << "[ix__] = " << stream << ".readProxy();"; } else { - out << nl << "Ice.ObjectPrx __val = new Ice.ObjectPrxHelperBase();"; - out << nl << "__val = " << stream << ".readProxy();"; - out << nl << param << ".Add(__val);"; + out << nl << "Ice.ObjectPrx val__ = new Ice.ObjectPrxHelperBase();"; + out << nl << "val__ = " << stream << ".readProxy();"; + out << nl << param << ".Add(val__);"; } } if(!streamingAPI && builtin->isVariableLength()) @@ -627,7 +627,7 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, out << eb; if(!streamingAPI && builtin->isVariableLength()) { - out << nl << stream << ".endSeq(__lenx);"; + out << nl << stream << ".endSeq(lenx__);"; } } break; @@ -674,41 +674,41 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, out << nl << "else"; out << sb; out << nl << stream << ".writeSize(" << param << '.' << limitID << ");"; - out << nl << "for(int __ix = 0; __ix < " << param << '.' << limitID << "; ++__ix)"; + out << nl << "for(int ix__ = 0; ix__ < " << param << '.' << limitID << "; ++ix__)"; out << sb; - out << nl << stream << ".writeObject(" << param << "[__ix]);"; + out << nl << stream << ".writeObject(" << param << "[ix__]);"; out << eb; out << eb; } else { out << sb; - out << nl << "int __szx = " << stream << ".readSize();"; + out << nl << "int szx__ = " << stream << ".readSize();"; if(!streamingAPI) { if(type->isVariableLength()) { - out << nl << stream << ".startSeq(__szx, " << static_cast<unsigned>(type->minWireSize()) << ");"; + out << nl << stream << ".startSeq(szx__, " << static_cast<unsigned>(type->minWireSize()) << ");"; } else { - out << nl << stream << ".checkFixedSeq(__szx, " << static_cast<unsigned>(type->minWireSize()) << ");"; + out << nl << stream << ".checkFixedSeq(szx__, " << static_cast<unsigned>(type->minWireSize()) << ");"; } } out << nl << param << " = new "; if(isArray) { - out << toArrayAlloc(typeS + "[]", "__szx"); + out << toArrayAlloc(typeS + "[]", "szx__"); } else { - out << fixId(seq->scoped()) << "(__szx)"; + out << fixId(seq->scoped()) << "(szx__)"; } out << ';'; - out << nl << "for(int __i = 0; __i < __szx; ++__i)"; + out << nl << "for(int i__ = 0; i__ < szx__; ++i__)"; out << sb; out << nl << "IceInternal.SequencePatcher spx = new IceInternal.SequencePatcher(" - << param << ", " << "typeof(" << typeS << "), __i);"; + << param << ", " << "typeof(" << typeS << "), i__);"; out << nl << stream << ".readObject("; if(streamingAPI) { @@ -723,7 +723,7 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, out << eb; if(!streamingAPI && type->isVariableLength()) { - out << nl << stream << ".endSeq(__szx);"; + out << nl << stream << ".endSeq(szx__);"; } out << eb; } @@ -742,52 +742,52 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, out << nl << "else"; out << sb; out << nl << stream << ".writeSize(" << param << '.' << limitID << ");"; - out << nl << "for(int __ix = 0; __ix < " << param << '.' << limitID << "; ++__ix)"; + out << nl << "for(int ix__ = 0; ix__ < " << param << '.' << limitID << "; ++ix__)"; out << sb; - out << nl << param << "[__ix].__write(" << stream << ");"; + out << nl << param << "[ix__].write__(" << stream << ");"; out << eb; out << eb; } else { out << sb; - out << nl << "int __szx = " << stream << ".readSize();"; + out << nl << "int szx__ = " << stream << ".readSize();"; if(!streamingAPI) { if(type->isVariableLength()) { - out << nl << stream << ".startSeq(__szx, " << static_cast<unsigned>(type->minWireSize()) << ");"; + out << nl << stream << ".startSeq(szx__, " << static_cast<unsigned>(type->minWireSize()) << ");"; } else { - out << nl << stream << ".checkFixedSeq(__szx, " << static_cast<unsigned>(type->minWireSize()) << ");"; + out << nl << stream << ".checkFixedSeq(szx__, " << static_cast<unsigned>(type->minWireSize()) << ");"; } } out << nl << param << " = new "; if(isArray) { - out << toArrayAlloc(typeS + "[]", "__szx"); + out << toArrayAlloc(typeS + "[]", "szx__"); } else { - out << fixId(seq->scoped()) << "(__szx)"; + out << fixId(seq->scoped()) << "(szx__)"; } out << ';'; - out << nl << "for(int __ix = 0; __ix < __szx; ++__ix)"; + out << nl << "for(int ix__ = 0; ix__ < szx__; ++ix__)"; out << sb; if(isArray) { if(st->hasMetaData("clr:class")) { - out << nl << param << "[__ix] = new " << typeS << "();"; + out << nl << param << "[ix__] = new " << typeS << "();"; } - out << nl << param << "[__ix].__read(" << stream << ");"; + out << nl << param << "[ix__].read__(" << stream << ");"; } else { - out << nl << typeS << " __val = new " << typeS << "();"; - out << nl << "__val.__read(" << stream << ");"; - out << nl << param << ".Add(__val);"; + out << nl << typeS << " val__ = new " << typeS << "();"; + out << nl << "val__.read__(" << stream << ");"; + out << nl << param << ".Add(val__);"; } if(!streamingAPI && type->isVariableLength()) { @@ -797,7 +797,7 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, out << eb; if(!streamingAPI && type->isVariableLength()) { - out << nl << stream << ".endSeq(__szx);"; + out << nl << stream << ".endSeq(szx__);"; } out << eb; } @@ -816,35 +816,35 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, out << nl << "else"; out << sb; out << nl << stream << ".writeSize(" << param << '.'<< limitID << ");"; - out << nl << "for(int __ix = 0; __ix < " << param << '.' << limitID << "; ++__ix)"; + out << nl << "for(int ix__ = 0; ix__ < " << param << '.' << limitID << "; ++ix__)"; out << sb; - out << nl << stream << ".writeByte((byte)" << param << "[__ix]);"; + out << nl << stream << ".writeByte((byte)" << param << "[ix__]);"; out << eb; out << eb; } else { out << sb; - out << nl << "int __szx = " << stream << ".readSize();"; + out << nl << "int szx__ = " << stream << ".readSize();"; if(!streamingAPI) { - out << nl << stream << ".checkFixedSeq(__szx, " << static_cast<unsigned>(type->minWireSize()) << ");"; + out << nl << stream << ".checkFixedSeq(szx__, " << static_cast<unsigned>(type->minWireSize()) << ");"; } out << nl << param << " = new "; if(isArray) { - out << toArrayAlloc(typeS + "[]", "__szx"); + out << toArrayAlloc(typeS + "[]", "szx__"); } else { - out << fixId(seq->scoped()) << "(__szx)"; + out << fixId(seq->scoped()) << "(szx__)"; } out << ';'; - out << nl << "for(int __ix = 0; __ix < __szx; ++__ix)"; + out << nl << "for(int ix__ = 0; ix__ < szx__; ++ix__)"; out << sb; if(isArray) { - out << nl << param << "[__ix] = (" << typeS << ')' << stream << ".readByte();"; + out << nl << param << "[ix__] = (" << typeS << ')' << stream << ".readByte();"; } else { @@ -867,13 +867,13 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, } string func; - if(!streamingAPI && ProxyPtr::dynamicCast(type)) - { - func = "__"; - } if(marshal) { - func += "write"; + func = "write"; + if(!streamingAPI && ProxyPtr::dynamicCast(type)) + { + func += "__"; + } out << nl << "if(" << param << " == null)"; out << sb; out << nl << stream << ".writeSize(0);"; @@ -881,43 +881,47 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, out << nl << "else"; out << sb; out << nl << stream << ".writeSize(" << param << '.' << limitID << ");"; - out << nl << "for(int __ix = 0; __ix < " << param << '.' << limitID << "; ++__ix)"; + out << nl << "for(int ix__ = 0; ix__ < " << param << '.' << limitID << "; ++ix__)"; out << sb; - out << nl << helperName << '.' << func << '(' << stream << ", " << param << "[__ix]);"; + out << nl << helperName << '.' << func << '(' << stream << ", " << param << "[ix__]);"; out << eb; out << eb; } else { - func += "read"; + func = "read"; + if(!streamingAPI && ProxyPtr::dynamicCast(type)) + { + func += "__"; + } out << sb; - out << nl << "int __szx = " << stream << ".readSize();"; + out << nl << "int szx__ = " << stream << ".readSize();"; if(!streamingAPI) { if(type->isVariableLength()) { - out << nl << stream << ".startSeq(__szx, " << static_cast<unsigned>(type->minWireSize()) << ");"; + out << nl << stream << ".startSeq(szx__, " << static_cast<unsigned>(type->minWireSize()) << ");"; } else { - out << nl << stream << ".checkFixedSeq(__szx, " << static_cast<unsigned>(type->minWireSize()) << ");"; + out << nl << stream << ".checkFixedSeq(szx__, " << static_cast<unsigned>(type->minWireSize()) << ");"; } } out << nl << param << " = new "; if(isArray) { - out << toArrayAlloc(typeS + "[]", "__szx"); + out << toArrayAlloc(typeS + "[]", "szx__"); } else { - out << fixId(seq->scoped()) << "(__szx)"; + out << fixId(seq->scoped()) << "(szx__)"; } out << ';'; - out << nl << "for(int __ix = 0; __ix < __szx; ++__ix)"; + out << nl << "for(int ix__ = 0; ix__ < szx__; ++ix__)"; out << sb; if(isArray) { - out << nl << param << "[__ix] = " << helperName << '.' << func << '(' << stream << ");"; + out << nl << param << "[ix__] = " << helperName << '.' << func << '(' << stream << ");"; } else { @@ -934,7 +938,7 @@ Slice::CsGenerator::writeSequenceMarshalUnmarshalCode(Output& out, out << eb; if(!streamingAPI && type->isVariableLength()) { - out << nl << stream << ".endSeq(__szx);"; + out << nl << stream << ".endSeq(szx__);"; } out << eb; } diff --git a/cpp/src/Slice/DotNetNames.cpp b/cpp/src/Slice/DotNetNames.cpp index 379792ad671..58b42376ba3 100755 --- a/cpp/src/Slice/DotNetNames.cpp +++ b/cpp/src/Slice/DotNetNames.cpp @@ -104,7 +104,8 @@ ciEquals(const string& s, const char* p) return true; } -const char* manglePrefix = "_Ice_"; +const char* manglePrefix = "ice_"; +const char* mangleSuffix = "_"; static bool mangle(const string& s, const Node* np, string& newName) @@ -114,7 +115,7 @@ mangle(const string& s, const Node* np, string& newName) { if(ciEquals(s, *namep)) { - newName = manglePrefix + s; + newName = manglePrefix + s + mangleSuffix; return true; } ++namep; diff --git a/cpp/src/Slice/VbUtil.cpp b/cpp/src/Slice/VbUtil.cpp index 528d393c7c9..4a974119639 100755 --- a/cpp/src/Slice/VbUtil.cpp +++ b/cpp/src/Slice/VbUtil.cpp @@ -235,11 +235,11 @@ Slice::VbGenerator::writeMarshalUnmarshalCode(Output &out, if(marshal) { - stream = streamingAPI ? "__outS" : "__os"; + stream = streamingAPI ? "outS__" : "os__"; } else { - stream = streamingAPI ? "__inS" : "__is"; + stream = streamingAPI ? "inS__" : "is__"; } BuiltinPtr builtin = BuiltinPtr::dynamicCast(type); @@ -368,12 +368,12 @@ Slice::VbGenerator::writeMarshalUnmarshalCode(Output &out, { if(streamingAPI) { - out << nl << stream << ".readObject(CType(New __Patcher(" << patchParams + out << nl << stream << ".readObject(CType(New Patcher__(" << patchParams << ", Ice.ReadObjectCallback)))"; } else { - out << nl << stream << ".readObject(New __Patcher(" << patchParams << "))"; + out << nl << stream << ".readObject(New Patcher__(" << patchParams << "))"; } } } @@ -407,21 +407,21 @@ Slice::VbGenerator::writeMarshalUnmarshalCode(Output &out, string helperName = fixId((contained ? contained->scoped() : typeToString(type)) + "Helper"); if(marshal) { - out << nl << helperName << '.'; + out << nl << helperName << ".write"; if(!streamingAPI) { out << "__"; } - out << "write(" << stream << ", " << param << ')'; + out << '(' << stream << ", " << param << ')'; } else { - out << nl << param << " = " << helperName << '.'; + out << nl << param << " = " << helperName << ".read"; if(!streamingAPI) { out << "__"; } - out << "read(" << stream << ')'; + out << "(" << stream << ')'; } return; } @@ -453,12 +453,12 @@ Slice::VbGenerator::writeMarshalUnmarshalCode(Output &out, { if(streamingAPI) { - out << nl << stream << ".readObject(New __Patcher(CType(" << patchParams + out << nl << stream << ".readObject(New Patcher__(CType(" << patchParams << ", Ice.ReadObjectCallback)))"; } else { - out << nl << stream << ".readObject(New __Patcher(" << patchParams << "))"; + out << nl << stream << ".readObject(New Patcher__(" << patchParams << "))"; } } } @@ -470,13 +470,13 @@ Slice::VbGenerator::writeMarshalUnmarshalCode(Output &out, { if(marshal) { - out << nl << param << ".__write(" << stream << ')'; + out << nl << param << ".write__(" << stream << ')'; } else { string typeS = typeToString(type); out << nl << param << " = New " << typeS; - out << nl << param << ".__read(" << stream << ")"; + out << nl << param << ".read__(" << stream << ")"; } return; } @@ -542,11 +542,11 @@ Slice::VbGenerator::writeSequenceMarshalUnmarshalCode(Output& out, string stream; if(marshal) { - stream = streamingAPI ? "__outS" : "__os"; + stream = streamingAPI ? "outS__" : "os__"; } else { - stream = streamingAPI ? "__inS" : "__is"; + stream = streamingAPI ? "inS__" : "is__"; } TypePtr type = seq->type(); @@ -572,10 +572,10 @@ Slice::VbGenerator::writeSequenceMarshalUnmarshalCode(Output& out, out << nl << "Else"; out.inc(); out << nl << stream << ".writeSize(" << param << '.' << limitID << ")"; - out << nl << "For __ix As Integer = 0 To " << param << '.' << limitID << " - 1"; + out << nl << "For ix__ As Integer = 0 To " << param << '.' << limitID << " - 1"; out.inc(); string func = builtin->kind() == Builtin::KindObject ? "writeObject" : "writeProxy"; - out << nl << stream << '.' << func << '(' << param << "(__ix))"; + out << nl << stream << '.' << func << '(' << param << "(ix__))"; out.dec(); out << nl << "Next"; out.dec(); @@ -583,19 +583,19 @@ Slice::VbGenerator::writeSequenceMarshalUnmarshalCode(Output& out, } else { - out << nl << "For __block As Integer = 0 To 0"; + out << nl << "For block__ As Integer = 0 To 0"; out.inc(); - out << nl << "Dim __lenx As Integer = " << stream << ".readSize()"; + out << nl << "Dim lenx__ As Integer = " << stream << ".readSize()"; if(!streamingAPI) { if(builtin->isVariableLength()) { - out << nl << stream << ".startSeq(__lenx, " << static_cast<unsigned>(builtin->minWireSize()) + out << nl << stream << ".startSeq(lenx__, " << static_cast<unsigned>(builtin->minWireSize()) << ")"; } else { - out << nl << stream << ".checkFixedSeq(__lenx, " + out << nl << stream << ".checkFixedSeq(lenx__, " << static_cast<unsigned>(builtin->minWireSize()) << ")"; } } @@ -604,23 +604,23 @@ Slice::VbGenerator::writeSequenceMarshalUnmarshalCode(Output& out, { if(isArray) { - out << "Ice.Object(__lenx - 1) {}"; + out << "Ice.Object(lenx__ - 1) {}"; } else { out << typeToString(seq); } - out << nl << "For __ix As Integer = 0 To __lenx - 1"; + out << nl << "For ix__ As Integer = 0 To lenx__ - 1"; out.inc(); if(streamingAPI) { out << nl << stream << ".readObject(CType(New IceInternal.SequencePatcher(" - << param << ", GetType(Ice.Object), __ix), Ice.ReadObjectCallback))"; + << param << ", GetType(Ice.Object), ix__), Ice.ReadObjectCallback))"; } else { out << nl << stream << ".readObject(New IceInternal.SequencePatcher(" - << param << ", GetType(Ice.Object), __ix))"; + << param << ", GetType(Ice.Object), ix__))"; } out.dec(); out << nl << "Next"; @@ -629,23 +629,23 @@ Slice::VbGenerator::writeSequenceMarshalUnmarshalCode(Output& out, { if(isArray) { - out << "Ice.ObjectPrx(__lenx - 1) {}"; + out << "Ice.ObjectPrx(lenx__ - 1) {}"; } else { out << typeToString(seq); } - out << nl << "For __ix As Integer = 0 To __lenx - 1"; + out << nl << "For ix__ As Integer = 0 To lenx__ - 1"; out.inc(); if(isArray) { - out << nl << param << "(__ix) = " << stream << ".readProxy()"; + out << nl << param << "(ix__) = " << stream << ".readProxy()"; } else { - out << nl << "Dim __val As Ice.ObjectPrx = New Ice.ObjectPrxHelperBase"; - out << nl << "__val = " << stream << ".readProxy()"; - out << nl << param << ".Add(__val)"; + out << nl << "Dim val__ As Ice.ObjectPrx = New Ice.ObjectPrxHelperBase"; + out << nl << "val__ = " << stream << ".readProxy()"; + out << nl << param << ".Add(val__)"; } out.dec(); out << nl << "Next"; @@ -654,7 +654,7 @@ Slice::VbGenerator::writeSequenceMarshalUnmarshalCode(Output& out, { out << nl << stream << ".checkSeq()"; out << nl << stream << ".endElement()"; - out << nl << stream << ".endSeq(__lenx)"; + out << nl << stream << ".endSeq(lenx__)"; } out.dec(); out << nl << "Next"; @@ -695,7 +695,7 @@ Slice::VbGenerator::writeSequenceMarshalUnmarshalCode(Output& out, ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type); if(cl) { - out << nl << "For __block As Integer = 0 To 0"; + out << nl << "For block__ As Integer = 0 To 0"; out.inc(); if(marshal) { @@ -706,9 +706,9 @@ Slice::VbGenerator::writeSequenceMarshalUnmarshalCode(Output& out, out << nl << "Else"; out.inc(); out << nl << stream << ".writeSize(" << param << '.' << limitID << ")"; - out << nl << "For __ix As Integer = 0 To " << param << '.' << limitID << " - 1"; + out << nl << "For ix__ As Integer = 0 To " << param << '.' << limitID << " - 1"; out.inc(); - out << nl << stream << ".writeObject(" << param << "(__ix))"; + out << nl << stream << ".writeObject(" << param << "(ix__))"; out.dec(); out << nl << "Next"; out.dec(); @@ -716,38 +716,38 @@ Slice::VbGenerator::writeSequenceMarshalUnmarshalCode(Output& out, } else { - out << nl << "Dim __szx As Integer = " << stream << ".readSize()"; + out << nl << "Dim szx__ As Integer = " << stream << ".readSize()"; if(!streamingAPI) { if(type->isVariableLength()) { - out << nl << stream << ".startSeq(__szx, " << static_cast<unsigned>(type->minWireSize()) << ')'; + out << nl << stream << ".startSeq(szx__, " << static_cast<unsigned>(type->minWireSize()) << ')'; } else { - out << nl << stream << ".checkFixedSeq(__szx, " << static_cast<unsigned>(type->minWireSize()) << ')'; + out << nl << stream << ".checkFixedSeq(szx__, " << static_cast<unsigned>(type->minWireSize()) << ')'; } } out << nl << param << " = New "; if(isArray) { - out << toArrayAlloc(typeS + "()", "__szx - 1") << " {}"; + out << toArrayAlloc(typeS + "()", "szx__ - 1") << " {}"; } else { - out << fixId(seq->scoped()) << "(__szx)"; + out << fixId(seq->scoped()) << "(szx__)"; } - out << nl << "For __ix As Integer = 0 To __szx - 1"; + out << nl << "For ix__ As Integer = 0 To szx__ - 1"; out.inc(); - out << nl << "Dim __spx As IceInternal.SequencePatcher = New IceInternal.SequencePatcher(" - << param << ", " << "GetType(" << typeS << "), __ix)"; + out << nl << "Dim spx__ As IceInternal.SequencePatcher = New IceInternal.SequencePatcher(" + << param << ", " << "GetType(" << typeS << "), ix__)"; if(streamingAPI) { - out << nl << stream << ".readObject(CType(__spx, Ice.ReadObjectCallback))"; + out << nl << stream << ".readObject(CType(spx__, Ice.ReadObjectCallback))"; } else { - out << nl << stream << ".readObject(__spx)"; + out << nl << stream << ".readObject(spx__)"; } if(!streamingAPI && type->isVariableLength()) { @@ -758,7 +758,7 @@ Slice::VbGenerator::writeSequenceMarshalUnmarshalCode(Output& out, out << nl << "Next"; if(!streamingAPI && type->isVariableLength()) { - out << nl << stream << ".endSeq(__szx)"; + out << nl << stream << ".endSeq(szx__)"; } } out.dec(); @@ -769,7 +769,7 @@ Slice::VbGenerator::writeSequenceMarshalUnmarshalCode(Output& out, StructPtr st = StructPtr::dynamicCast(type); if(st) { - out << nl << "For __block As Integer = 0 To 0"; + out << nl << "For block__ As Integer = 0 To 0"; out.inc(); if(marshal) { @@ -780,9 +780,9 @@ Slice::VbGenerator::writeSequenceMarshalUnmarshalCode(Output& out, out << nl << "Else"; out.inc(); out << nl << stream << ".writeSize(" << param << '.' << limitID << ")"; - out << nl << "For __ix As Integer = 0 To " << param << '.' << limitID << " - 1"; + out << nl << "For ix__ As Integer = 0 To " << param << '.' << limitID << " - 1"; out.inc(); - out << nl << param << "(__ix).__write(" << stream << ")"; + out << nl << param << "(ix__).write__(" << stream << ")"; out.dec(); out << nl << "Next"; out.dec(); @@ -790,42 +790,42 @@ Slice::VbGenerator::writeSequenceMarshalUnmarshalCode(Output& out, } else { - out << nl << "Dim __szx As Integer = " << stream << ".readSize()"; + out << nl << "Dim szx__ As Integer = " << stream << ".readSize()"; if(!streamingAPI) { if(type->isVariableLength()) { - out << nl << stream << ".startSeq(__szx, " << static_cast<unsigned>(type->minWireSize()) << ')'; + out << nl << stream << ".startSeq(szx__, " << static_cast<unsigned>(type->minWireSize()) << ')'; } else { - out << nl << stream << ".checkFixedSeq(__szx, " << static_cast<unsigned>(type->minWireSize()) << ')'; + out << nl << stream << ".checkFixedSeq(szx__, " << static_cast<unsigned>(type->minWireSize()) << ')'; } } out << nl << param << " = New "; if(isArray) { - out << toArrayAlloc(typeS + "()", "__szx - 1") << " {}"; + out << toArrayAlloc(typeS + "()", "szx__ - 1") << " {}"; } else { - out << fixId(seq->scoped()) << "(__szx)"; + out << fixId(seq->scoped()) << "(szx__)"; } - out << nl << "For __ix As Integer = 0 To __szx - 1"; + out << nl << "For ix__ As Integer = 0 To szx__ - 1"; out.inc(); if(isArray) { if(st->hasMetaData("clr:class")) { - out << nl << param << "(__ix) = New " << typeS; + out << nl << param << "(ix__) = New " << typeS; } - out << nl << param << "(__ix).__read(" << stream << ")"; + out << nl << param << "(ix__).read__(" << stream << ")"; } else { - out << nl << "Dim __val As " << typeS << " = New " << typeS; - out << nl << "__val.__read(" << stream << ')'; - out << nl << param << ".Add(__val)"; + out << nl << "Dim val__ As " << typeS << " = New " << typeS; + out << nl << "val__.read__(" << stream << ')'; + out << nl << param << ".Add(val__)"; } if(!streamingAPI && type->isVariableLength()) { @@ -836,7 +836,7 @@ Slice::VbGenerator::writeSequenceMarshalUnmarshalCode(Output& out, out << nl << "Next"; if(!streamingAPI && type->isVariableLength()) { - out << nl << stream << ".endSeq(__szx)"; + out << nl << stream << ".endSeq(szx__)"; } } out.dec(); @@ -847,7 +847,7 @@ Slice::VbGenerator::writeSequenceMarshalUnmarshalCode(Output& out, EnumPtr en = EnumPtr::dynamicCast(type); if(en) { - out << nl << "For __block As Integer = 0 To 0"; + out << nl << "For block__ As Integer = 0 To 0"; out.inc(); if(marshal) { @@ -858,9 +858,9 @@ Slice::VbGenerator::writeSequenceMarshalUnmarshalCode(Output& out, out << nl << "Else"; out.inc(); out << nl << stream << ".writeSize(" << param << '.'<< limitID << ')'; - out << nl << "For __ix As Integer = 0 To " << param << '.' << limitID << " - 1"; + out << nl << "For ix__ As Integer = 0 To " << param << '.' << limitID << " - 1"; out.inc(); - out << nl << stream << ".writeByte(CType(" << param << "(__ix), Byte))"; + out << nl << stream << ".writeByte(CType(" << param << "(ix__), Byte))"; out.dec(); out << nl << "Next"; out.dec(); @@ -868,25 +868,25 @@ Slice::VbGenerator::writeSequenceMarshalUnmarshalCode(Output& out, } else { - out << nl << "Dim __szx As Integer = " << stream << ".readSize()"; + out << nl << "Dim szx__ As Integer = " << stream << ".readSize()"; if(!streamingAPI) { - out << nl << stream << ".checkFixedSeq(__szx, " << static_cast<unsigned>(type->minWireSize()) << ')'; + out << nl << stream << ".checkFixedSeq(szx__, " << static_cast<unsigned>(type->minWireSize()) << ')'; } out << nl << param << " = New "; if(isArray) { - out << toArrayAlloc(typeS + "()", "__szx - 1") << " {}"; + out << toArrayAlloc(typeS + "()", "szx__ - 1") << " {}"; } else { - out << fixId(seq->scoped()) << "(__szx)"; + out << fixId(seq->scoped()) << "(szx__)"; } - out << nl << "For __ix As Integer = 0 To __szx - 1"; + out << nl << "For ix__ As Integer = 0 To szx__ - 1"; out.inc(); if(isArray) { - out << nl << param << "(__ix) = CType(" << stream << ".readByte(), " << typeS << ')'; + out << nl << param << "(ix__) = CType(" << stream << ".readByte(), " << typeS << ')'; } else { @@ -911,13 +911,13 @@ Slice::VbGenerator::writeSequenceMarshalUnmarshalCode(Output& out, } string func; - if(!streamingAPI && ProxyPtr::dynamicCast(type)) - { - func = "__"; - } if(marshal) { - func += "write"; + func = "write"; + if(!streamingAPI && ProxyPtr::dynamicCast(type)) + { + func += "__"; + } out << nl << "If " << param << " Is Nothing"; out.inc(); out << nl << stream << ".writeSize(0)"; @@ -925,9 +925,9 @@ Slice::VbGenerator::writeSequenceMarshalUnmarshalCode(Output& out, out << nl << "Else"; out.inc(); out << nl << stream << ".writeSize(" << param << '.' << limitID << ")"; - out << nl << "For __ix As Integer = 0 To " << param << '.' << limitID << " - 1"; + out << nl << "For ix__ As Integer = 0 To " << param << '.' << limitID << " - 1"; out.inc(); - out << nl << helperName << '.' << func << '(' << stream << ", " << param << "(__ix))"; + out << nl << helperName << '.' << func << '(' << stream << ", " << param << "(ix__))"; out.dec(); out << nl << "Next"; out.dec(); @@ -935,36 +935,40 @@ Slice::VbGenerator::writeSequenceMarshalUnmarshalCode(Output& out, } else { - func += "read"; - out << nl << "For __block As Integer = 0 To 0"; + func = "read"; + if(!streamingAPI && ProxyPtr::dynamicCast(type)) + { + func += "__"; + } + out << nl << "For block__ As Integer = 0 To 0"; out.inc(); - string func = ProxyPtr::dynamicCast(type) ? "__read" : "read"; - out << nl << "Dim __szx As Integer = " << stream << ".readSize()"; + string func = ProxyPtr::dynamicCast(type) ? "read__" : "read"; + out << nl << "Dim szx__ As Integer = " << stream << ".readSize()"; if(!streamingAPI) { if(type->isVariableLength()) { - out << nl << stream << ".startSeq(__szx, " << static_cast<unsigned>(type->minWireSize()) << ")"; + out << nl << stream << ".startSeq(szx__, " << static_cast<unsigned>(type->minWireSize()) << ")"; } else { - out << nl << stream << ".checkFixedSeq(__szx, " << static_cast<unsigned>(type->minWireSize()) << ")"; + out << nl << stream << ".checkFixedSeq(szx__, " << static_cast<unsigned>(type->minWireSize()) << ")"; } } out << nl << param << " = New "; if(isArray) { - out << toArrayAlloc(typeS + "()", "__szx - 1") << " {}"; + out << toArrayAlloc(typeS + "()", "szx__ - 1") << " {}"; } else { - out << fixId(seq->scoped()) << "(__szx)"; + out << fixId(seq->scoped()) << "(szx__)"; } - out << nl << "For __ix As Integer = 0 To __szx - 1"; + out << nl << "For ix__ As Integer = 0 To szx__ - 1"; out.inc(); if(isArray) { - out << nl << param << "(__ix) = " << helperName << '.' << func << '(' << stream << ")"; + out << nl << param << "(ix__) = " << helperName << '.' << func << '(' << stream << ")"; } else { @@ -982,7 +986,7 @@ Slice::VbGenerator::writeSequenceMarshalUnmarshalCode(Output& out, out << nl << "Next"; if(!streamingAPI && type->isVariableLength()) { - out << nl << stream << ".endSeq(__szx)"; + out << nl << stream << ".endSeq(szx__)"; } out.dec(); out << nl << "Next"; diff --git a/cpp/src/slice2cs/Gen.cpp b/cpp/src/slice2cs/Gen.cpp index bd9132b0fe2..0660a73e3f4 100755 --- a/cpp/src/slice2cs/Gen.cpp +++ b/cpp/src/slice2cs/Gen.cpp @@ -120,7 +120,7 @@ Slice::CsVisitor::writeInheritedOperations(const ClassDefPtr& p) _out << sp << nl << "public abstract " << retS << ' ' << name << spar << params; if(!containingClass->isLocal()) { - _out << "Ice.Current __current"; + _out << "Ice.Current current__"; } _out << epar << ';'; } @@ -135,7 +135,7 @@ Slice::CsVisitor::writeInheritedOperations(const ClassDefPtr& p) _out << eb; _out << sp << nl << "public abstract void " << name << "_async" - << spar << params << "Ice.Current __current" << epar << ';'; + << spar << params << "Ice.Current current__" << epar << ';'; } } @@ -186,7 +186,7 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) _out << sp << nl << "#region Slice type-related members"; - _out << sp << nl << "public static new string[] __ids = "; + _out << sp << nl << "public static new string[] ids__ = "; _out << sb; StringList::const_iterator q = ids.begin(); @@ -205,20 +205,20 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) // // TODO: Remove linear search for Mono once this bug is fixed. // - _out << nl << "if(IceInternal.AssemblyUtil._runtime == IceInternal.AssemblyUtil.Runtime.Mono)"; + _out << nl << "if(IceInternal.AssemblyUtil.runtime_ == IceInternal.AssemblyUtil.Runtime.Mono)"; _out << sb; _out << nl << "// Mono bug: System.Array.BinarySearch() uses the wrong collation sequence,"; _out << nl << "// so we do a linear search for the time being"; _out << nl << "int pos = 0;"; - _out << nl << "while(pos < __ids.Length)"; + _out << nl << "while(pos < ids__.Length)"; _out << sb; - _out << nl << "if(__ids[pos] == s)"; + _out << nl << "if(ids__[pos] == s)"; _out << sb; _out << nl << "break;"; _out << eb; _out << nl << "++pos;"; _out << eb; - _out << nl << "if(pos == __ids.Length)"; + _out << nl << "if(pos == ids__.Length)"; _out << sb; _out << nl << "pos = -1;"; _out << eb; @@ -226,29 +226,29 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) _out << eb; _out << nl << "else"; _out << sb; - _out << nl << "return _System.Array.BinarySearch(__ids, s, _System.Collections.Comparer.DefaultInvariant) >= 0;"; + _out << nl << "return _System.Array.BinarySearch(ids__, s, _System.Collections.Comparer.DefaultInvariant) >= 0;"; _out << eb; _out << eb; - _out << sp << nl << "public override bool ice_isA(string s, Ice.Current __current)"; + _out << sp << nl << "public override bool ice_isA(string s, Ice.Current current__)"; _out << sb; // // TODO: Remove linear search for Mono once this bug is fixed. // - _out << nl << "if(IceInternal.AssemblyUtil._runtime == IceInternal.AssemblyUtil.Runtime.Mono)"; + _out << nl << "if(IceInternal.AssemblyUtil.runtime_ == IceInternal.AssemblyUtil.Runtime.Mono)"; _out << sb; _out << nl << "// Mono bug: System.Array.BinarySearch() uses the wrong collation sequence,"; _out << nl << "// so we do a linear search for the time being"; _out << nl << "int pos = 0;"; - _out << nl << "while(pos < __ids.Length)"; + _out << nl << "while(pos < ids__.Length)"; _out << sb; - _out << nl << "if(__ids[pos] == s)"; + _out << nl << "if(ids__[pos] == s)"; _out << sb; _out << nl << "break;"; _out << eb; _out << nl << "++pos;"; _out << eb; - _out << nl << "if(pos == __ids.Length)"; + _out << nl << "if(pos == ids__.Length)"; _out << sb; _out << nl << "pos = -1;"; _out << eb; @@ -256,33 +256,33 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) _out << eb; _out << nl << "else"; _out << sb; - _out << nl << "return _System.Array.BinarySearch(__ids, s, _System.Collections.Comparer.DefaultInvariant) >= 0;"; + _out << nl << "return _System.Array.BinarySearch(ids__, s, _System.Collections.Comparer.DefaultInvariant) >= 0;"; _out << eb; _out << eb; _out << sp << nl << "public override string[] ice_ids()"; _out << sb; - _out << nl << "return __ids;"; + _out << nl << "return ids__;"; _out << eb; - _out << sp << nl << "public override string[] ice_ids(Ice.Current __current)"; + _out << sp << nl << "public override string[] ice_ids(Ice.Current current__)"; _out << sb; - _out << nl << "return __ids;"; + _out << nl << "return ids__;"; _out << eb; _out << sp << nl << "public override string ice_id()"; _out << sb; - _out << nl << "return __ids[" << scopedPos << "];"; + _out << nl << "return ids__[" << scopedPos << "];"; _out << eb; - _out << sp << nl << "public override string ice_id(Ice.Current __current)"; + _out << sp << nl << "public override string ice_id(Ice.Current current__)"; _out << sb; - _out << nl << "return __ids[" << scopedPos << "];"; + _out << nl << "return ids__[" << scopedPos << "];"; _out << eb; _out << sp << nl << "public static new string ice_staticId()"; _out << sb; - _out << nl << "return __ids[" << scopedPos << "];"; + _out << nl << "return ids__[" << scopedPos << "];"; _out << eb; _out << sp << nl << "#endregion"; // Slice type-related members @@ -302,8 +302,8 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) assert(cl); string opName = op->name(); - _out << sp << nl << "public static IceInternal.DispatchStatus ___" << opName << '(' << name - << " __obj, IceInternal.Incoming __inS, Ice.Current __current)"; + _out << sp << nl << "public static IceInternal.DispatchStatus " << opName << "___(" << name + << " obj__, IceInternal.Incoming inS__, Ice.Current current__)"; _out << sb; bool amd = p->hasMetaData("amd") || op->hasMetaData("amd"); @@ -344,14 +344,14 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) TypeStringList::const_iterator q; - _out << nl << "__checkMode(" << sliceModeToIceMode(op) << ", __current.mode);";
+ _out << nl << "checkMode__(" << sliceModeToIceMode(op) << ", current__.mode);";
if(!inParams.empty()) { - _out << nl << "IceInternal.BasicStream __is = __inS.istr();"; + _out << nl << "IceInternal.BasicStream is__ = inS__.istr();"; } if(!outParams.empty() || ret || !throws.empty()) { - _out << nl << "IceInternal.BasicStream __os = __inS.ostr();"; + _out << nl << "IceInternal.BasicStream os__ = inS__.ostr();"; } // @@ -372,7 +372,7 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) } if(op->sendsClasses()) { - _out << nl << "__is.readPendingObjects();"; + _out << nl << "is__.readPendingObjects();"; } for(q = inParams.begin(); q != inParams.end(); ++q) { @@ -380,7 +380,7 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) bool patchStruct = st && !st->hasMetaData("clr:class") && st->classDataMembers().size() != 0; if(patchStruct) { - _out << nl << fixId(q->second) << ".__patch();"; + _out << nl << fixId(q->second) << ".patch__();"; } } @@ -402,9 +402,9 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) if(ret) { string retS = typeToString(ret); - _out << retS << " __ret = "; + _out << retS << " ret__ = "; } - _out << "__obj." << fixId(opName, DotNet::ICloneable, true) << spar; + _out << "obj__." << fixId(opName, DotNet::ICloneable, true) << spar; for(q = inParams.begin(); q != inParams.end(); ++q) { BuiltinPtr builtin = BuiltinPtr::dynamicCast(q->first); @@ -427,7 +427,7 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) { _out << "out " + fixId(q->second); } - _out << "__current" << epar << ';'; + _out << "current__" << epar << ';'; // // Marshal 'out' parameters and return value. @@ -438,11 +438,11 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) } if(ret) { - writeMarshalUnmarshalCode(_out, ret, "__ret", true, false, true, ""); + writeMarshalUnmarshalCode(_out, ret, "ret__", true, false, true, ""); } if(op->returnsClasses()) { - _out << nl << "__os.writePendingObjects();"; + _out << nl << "os__.writePendingObjects();"; } _out << nl << "return IceInternal.DispatchStatus.DispatchOK;"; @@ -458,7 +458,7 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) string exS = fixId((*t)->scoped()); _out << nl << "catch(" << exS << " ex)"; _out << sb; - _out << nl << "__os.writeUserException(ex);"; + _out << nl << "os__.writeUserException(ex);"; _out << nl << "return IceInternal.DispatchStatus.DispatchUserException;"; _out << eb; } @@ -479,11 +479,11 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) } TypeStringList::const_iterator q; - _out << nl << "__checkMode(" << sliceModeToIceMode(op) << ", __current.mode);";
+ _out << nl << "checkMode__(" << sliceModeToIceMode(op) << ", current__.mode);";
if(!inParams.empty()) { - _out << nl << "IceInternal.BasicStream __is = __inS.istr();"; + _out << nl << "IceInternal.BasicStream is__ = inS__.istr();"; } // @@ -502,7 +502,7 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) } if(op->sendsClasses()) { - _out << nl << "__is.readPendingObjects();"; + _out << nl << "is__.readPendingObjects();"; } for(q = inParams.begin(); q != inParams.end(); ++q) { @@ -510,7 +510,7 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) bool patchStruct = st && !st->hasMetaData("clr:class") && st->classDataMembers().size() != 0; if(patchStruct) { - _out << nl << fixId(q->second) << ".__patch();"; + _out << nl << fixId(q->second) << ".patch__();"; } } @@ -518,11 +518,11 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) // Call on the servant. // string classNameAMD = "AMD_" + p->name(); - _out << nl << classNameAMD << '_' << opName << " __cb = new _" << classNameAMD << '_' << opName - << "(__inS);"; + _out << nl << classNameAMD << '_' << opName << " cb__ = new _" << classNameAMD << '_' << opName + << "(inS__);"; _out << nl << "try"; _out << sb; - _out << nl << "__obj."; + _out << nl << "obj__."; if(amd) { _out << opName << "_async"; @@ -534,7 +534,7 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) _out << spar; if(amd) { - _out << "__cb"; + _out << "cb__"; } for(q = inParams.begin(); q != inParams.end(); ++q) { @@ -553,11 +553,11 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) } _out << arg; } - _out << "__current" << epar << ';'; + _out << "current__" << epar << ';'; _out << eb; _out << nl << "catch(_System.Exception ex)"; _out << sb; - _out << nl << "__cb.ice_exception(ex);"; + _out << nl << "cb__.ice_exception(ex);"; _out << eb; _out << nl << "return IceInternal.DispatchStatus.DispatchAsync;"; @@ -596,7 +596,7 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) StringList::const_iterator q; - _out << sp << nl << "private static string[] __all ="; + _out << sp << nl << "private static string[] all__ ="; _out << sb; q = allOpNames.begin(); while(q != allOpNames.end()) @@ -610,33 +610,33 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) _out << eb << ';'; _out << sp << nl << "public override IceInternal.DispatchStatus " - << "__dispatch(IceInternal.Incoming __inS, Ice.Current __current)"; + << "dispatch__(IceInternal.Incoming inS__, Ice.Current current__)"; _out << sb; _out << nl << "int pos;"; // // TODO: Remove linear search for Mono once this bug is fixed. // - _out << nl << "if(IceInternal.AssemblyUtil._runtime == IceInternal.AssemblyUtil.Runtime.Mono)"; + _out << nl << "if(IceInternal.AssemblyUtil.runtime_ == IceInternal.AssemblyUtil.Runtime.Mono)"; _out << sb; _out << nl << "// Mono bug: System.Array.BinarySearch() uses the wrong collation sequence,"; _out << nl << "// so we do a linear search for the time being"; _out << nl << "pos = 0;"; - _out << nl << "while(pos < __all.Length)"; + _out << nl << "while(pos < all__.Length)"; _out << sb; - _out << nl << "if(__all[pos] == __current.operation)"; + _out << nl << "if(all__[pos] == current__.operation)"; _out << sb; _out << nl << "break;"; _out << eb; _out << nl << "++pos;"; _out << eb; - _out << nl << "if(pos == __all.Length)"; + _out << nl << "if(pos == all__.Length)"; _out << sb; _out << nl << "pos = -1;"; _out << eb; _out << eb; _out << nl << "else"; _out << sb; - _out << nl << "pos = _System.Array.BinarySearch(__all, __current.operation, " + _out << nl << "pos = _System.Array.BinarySearch(all__, current__.operation, " << "_System.Collections.Comparer.DefaultInvariant);"; _out << eb; _out << nl << "if(pos < 0)"; @@ -654,19 +654,19 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) _out << sb; if(opName == "ice_id") { - _out << nl << "return ___ice_id(this, __inS, __current);"; + _out << nl << "return ice_id___(this, inS__, current__);"; } else if(opName == "ice_ids") { - _out << nl << "return ___ice_ids(this, __inS, __current);"; + _out << nl << "return ice_ids___(this, inS__, current__);"; } else if(opName == "ice_isA") { - _out << nl << "return ___ice_isA(this, __inS, __current);"; + _out << nl << "return ice_isA___(this, inS__, current__);"; } else if(opName == "ice_ping") { - _out << nl << "return ___ice_ping(this, __inS, __current);"; + _out << nl << "return ice_ping___(this, inS__, current__);"; } else { @@ -682,19 +682,16 @@ Slice::CsVisitor::writeDispatch(const ClassDefPtr& p) assert(cl); if(cl->scoped() == p->scoped()) { - _out << nl << "return ___" << opName << "(this, __inS, __current);"; + _out << nl << "return " << opName << "___(this, inS__, current__);"; } else { string base = cl->scoped(); if(cl->isInterface()) { - string::size_type pos = base.rfind("::"); - assert(pos != string::npos); - base = base.insert(pos + 2, "_"); - base += "Disp"; + base += "Disp_"; } - _out << nl << "return " << fixId(base) << ".___" << opName << "(this, __inS, __current);"; + _out << nl << "return " << fixId(base) << "." << opName << "___(this, inS__, current__);"; } break; } @@ -757,7 +754,7 @@ Slice::CsVisitor::getParamsAsync(const OperationPtr& op, bool amd) ContainerPtr container = op->container(); ClassDefPtr cl = ClassDefPtr::dynamicCast(container); // Get the class containing the op. string scope = fixId(cl->scope()); - params.push_back(scope + (amd ? "AMD_" : "AMI_") + cl->name() + '_' + op->name() + " __cb"); + params.push_back(scope + (amd ? "AMD_" : "AMI_") + cl->name() + '_' + op->name() + " cb__"); ParamDeclList paramList = op->parameters(); for(ParamDeclList::const_iterator q = paramList.begin(); q != paramList.end(); ++q) @@ -778,7 +775,7 @@ Slice::CsVisitor::getParamsAsyncCB(const OperationPtr& op) TypePtr ret = op->returnType(); if(ret) { - params.push_back(typeToString(ret) + " __ret"); + params.push_back(typeToString(ret) + " ret__"); } ParamDeclList paramList = op->parameters(); @@ -815,7 +812,7 @@ Slice::CsVisitor::getArgsAsync(const OperationPtr& op) { vector<string> args; - args.push_back("__cb"); + args.push_back("cb__"); ParamDeclList paramList = op->parameters(); for(ParamDeclList::const_iterator q = paramList.begin(); q != paramList.end(); ++q) @@ -836,7 +833,7 @@ Slice::CsVisitor::getArgsAsyncCB(const OperationPtr& op) TypePtr ret = op->returnType(); if(ret) { - args.push_back("__ret"); + args.push_back("ret__"); } ParamDeclList paramList = op->parameters(); @@ -1152,15 +1149,15 @@ Slice::Gen::TypesVisitor::visitClassDefStart(const ClassDefPtr& p) _out << sp << nl << "public sealed class " << name << "Helper"; _out << sb; - _out << sp << nl << "public " << name << "Helper(Ice.InputStream __inS)"; + _out << sp << nl << "public " << name << "Helper(Ice.InputStream inS__)"; _out << sb; - _out << nl << "_in = __inS;"; + _out << nl << "_in = inS__;"; _out << nl << "_pp = new IceInternal.ParamPatcher(typeof(" << scoped << "));"; _out << eb; - _out << sp << nl << "public static void write(Ice.OutputStream __outS, " << fixId(name) << " __v)"; + _out << sp << nl << "public static void write(Ice.OutputStream outS__, " << fixId(name) << " v__)"; _out << sb; - _out << nl << "__outS.writeObject(__v);"; + _out << nl << "outS__.writeObject(v__);"; _out << eb; _out << sp << nl << "public void read()"; @@ -1195,12 +1192,12 @@ Slice::Gen::TypesVisitor::visitClassDefStart(const ClassDefPtr& p) { _out << "Ice.Object"; } - _out << ", _" << name; + _out << ", " << name; if(!p->isLocal()) { - _out << "Operations, _" << name; + _out << "Operations_, " << name; } - _out << "OperationsNC"; + _out << "OperationsNC_"; if(!bases.empty()) { ClassList::const_iterator q = bases.begin(); @@ -1240,9 +1237,9 @@ Slice::Gen::TypesVisitor::visitClassDefStart(const ClassDefPtr& p) { if(!p->isLocal()) { - _out << ", _" << name << "Operations"; + _out << ", " << name << "Operations_"; } - _out << ", _" << name << "OperationsNC"; + _out << ", " << name << "OperationsNC_"; } for(ClassList::const_iterator q = bases.begin(); q != bases.end(); ++q) { @@ -1359,10 +1356,10 @@ Slice::Gen::TypesVisitor::visitClassDefEnd(const ClassDefPtr& p) _out << sp << nl << "#region Marshaling support"; - _out << sp << nl << "public override void __write(IceInternal.BasicStream __os)"; + _out << sp << nl << "public override void write__(IceInternal.BasicStream os__)"; _out << sb; - _out << nl << "__os.writeTypeId(ice_staticId());"; - _out << nl << "__os.startWriteSlice();"; + _out << nl << "os__.writeTypeId(ice_staticId());"; + _out << nl << "os__.startWriteSlice();"; for(d = members.begin(); d != members.end(); ++d) { StringList metaData = (*d)->getMetaData(); @@ -1370,8 +1367,8 @@ Slice::Gen::TypesVisitor::visitClassDefEnd(const ClassDefPtr& p) fixId((*d)->name(), DotNet::ICloneable, true), true, false, false); } - _out << nl << "__os.endWriteSlice();"; - _out << nl << "base.__write(__os);"; + _out << nl << "os__.endWriteSlice();"; + _out << nl << "base.write__(os__);"; _out << eb; if(allClassMembers.size() != 0) @@ -1381,9 +1378,9 @@ Slice::Gen::TypesVisitor::visitClassDefEnd(const ClassDefPtr& p) { _out << "new "; } - _out << "class __Patcher : IceInternal.Patcher"; + _out << "class Patcher__ : IceInternal.Patcher"; _out << sb; - _out << sp << nl << "internal __Patcher(Ice.ObjectImpl instance"; + _out << sp << nl << "internal Patcher__(Ice.ObjectImpl instance"; if(allClassMembers.size() > 1) { _out << ", int member"; @@ -1415,7 +1412,7 @@ Slice::Gen::TypesVisitor::visitClassDefEnd(const ClassDefPtr& p) } string memberName = fixId((*d)->name(), DotNet::ICloneable, true); string memberType = typeToString((*d)->type()); - _out << nl << "_type = typeof(" << memberType << ");"; + _out << nl << "type_ = typeof(" << memberType << ");"; _out << nl << "_instance." << memberName << " = (" << memberType << ")v;"; if(allClassMembers.size() > 1) { @@ -1437,13 +1434,13 @@ Slice::Gen::TypesVisitor::visitClassDefEnd(const ClassDefPtr& p) _out << eb; } - _out << sp << nl << "public override void __read(IceInternal.BasicStream __is, bool __rid)"; + _out << sp << nl << "public override void read__(IceInternal.BasicStream is__, bool rid__)"; _out << sb; - _out << nl << "if(__rid)"; + _out << nl << "if(rid__)"; _out << sb; - _out << nl << "/* string myId = */ __is.readTypeId();"; + _out << nl << "/* string myId = */ is__.readTypeId();"; _out << eb; - _out << nl << "__is.startReadSlice();"; + _out << nl << "is__.startReadSlice();"; int classMemberCount = static_cast<int>(allClassMembers.size() - classMembers.size()); for(d = members.begin(); d != members.end(); ++d) { @@ -1462,8 +1459,8 @@ Slice::Gen::TypesVisitor::visitClassDefEnd(const ClassDefPtr& p) fixId((*d)->name(), DotNet::ICloneable, true), false, false, false, patchParams.str()); } - _out << nl << "__is.endReadSlice();"; - _out << nl << "base.__read(__is, true);"; + _out << nl << "is__.endReadSlice();"; + _out << nl << "base.read__(is__, true);"; _out << eb; // @@ -1471,10 +1468,10 @@ Slice::Gen::TypesVisitor::visitClassDefEnd(const ClassDefPtr& p) // if(_stream) { - _out << sp << nl << "public override void __write(Ice.OutputStream __outS)"; + _out << sp << nl << "public override void write__(Ice.OutputStream outS__)"; _out << sb; - _out << nl << "__outS.writeTypeId(ice_staticId());"; - _out << nl << "__outS.startSlice();"; + _out << nl << "outS__.writeTypeId(ice_staticId());"; + _out << nl << "outS__.startSlice();"; for(d = members.begin(); d != members.end(); ++d) { StringList metaData = (*d)->getMetaData(); @@ -1482,17 +1479,17 @@ Slice::Gen::TypesVisitor::visitClassDefEnd(const ClassDefPtr& p) fixId((*d)->name(), DotNet::ICloneable, true), true, true, false); } - _out << nl << "__outS.endSlice();"; - _out << nl << "base.__write(__outS);"; + _out << nl << "outS__.endSlice();"; + _out << nl << "base.write__(outS__);"; _out << eb; - _out << sp << nl << "public override void __read(Ice.InputStream __inS, bool __rid)"; + _out << sp << nl << "public override void read__(Ice.InputStream inS__, bool rid__)"; _out << sb; - _out << nl << "if(__rid)"; + _out << nl << "if(rid__)"; _out << sb; - _out << nl << "/* string myId = */ __inS.readTypeId();"; + _out << nl << "/* string myId = */ inS__.readTypeId();"; _out << eb; - _out << nl << "__inS.startSlice();"; + _out << nl << "inS__.startSlice();"; for(d = members.begin(); d != members.end(); ++d) { StringList metaData = (*d)->getMetaData(); @@ -1510,8 +1507,8 @@ Slice::Gen::TypesVisitor::visitClassDefEnd(const ClassDefPtr& p) fixId((*d)->name(), DotNet::ICloneable, true), false, true, false, patchParams.str()); } - _out << nl << "__inS.endSlice();"; - _out << nl << "base.__read(__inS, true);"; + _out << nl << "inS__.endSlice();"; + _out << nl << "base.read__(inS__, true);"; _out << eb; } else @@ -1520,14 +1517,14 @@ Slice::Gen::TypesVisitor::visitClassDefEnd(const ClassDefPtr& p) // Emit placeholder functions to catch errors. // string scoped = p->scoped(); - _out << sp << nl << "public override void __write(Ice.OutputStream __outS)"; + _out << sp << nl << "public override void write__(Ice.OutputStream outS__)"; _out << sb; _out << nl << "Ice.MarshalException ex = new Ice.MarshalException();"; _out << nl << "ex.reason = \"type " << scoped.substr(2) << " was not generated with stream support\";"; _out << nl << "throw ex;"; _out << eb; - _out << sp << nl << "public override void __read(Ice.InputStream __inS, bool __rid)"; + _out << sp << nl << "public override void read__(Ice.InputStream inS__, bool rid__)"; _out << sb; _out << nl << "Ice.MarshalException ex = new Ice.MarshalException();"; _out << nl << "ex.reason = \"type " << scoped.substr(2) << " was not generated with stream support\";"; @@ -1602,7 +1599,7 @@ Slice::Gen::TypesVisitor::visitOperation(const OperationPtr& p) if(!isLocal) { _out << nl << "public abstract " << retS << " " << name - << spar << params << "Ice.Current __current" << epar << ';'; + << spar << params << "Ice.Current current__" << epar << ';'; } } @@ -1638,49 +1635,49 @@ Slice::Gen::TypesVisitor::visitSequence(const SequencePtr& p) _out << nl << "InnerList.Capacity = capacity;"; _out << eb; - _out << sp << nl << "public " << name << "(" << s << "[] __a)"; + _out << sp << nl << "public " << name << "(" << s << "[] a__)"; _out << sb; - _out << nl << "InnerList.AddRange(__a);"; + _out << nl << "InnerList.AddRange(a__);"; _out << eb; _out << sp << nl << "#endregion"; // Constructors _out << sp << nl << "#region Array copy and conversion"; - _out << sp << nl << "public void CopyTo(" << s << "[] __a)"; + _out << sp << nl << "public void CopyTo(" << s << "[] a__)"; _out << sb; - _out << nl << "InnerList.CopyTo(__a);"; + _out << nl << "InnerList.CopyTo(a__);"; _out << eb; - _out << sp << nl << "public void CopyTo(" << s << "[] __a, int __i)"; + _out << sp << nl << "public void CopyTo(" << s << "[] a__, int i__)"; _out << sb; - _out << nl << "InnerList.CopyTo(__a, __i);"; + _out << nl << "InnerList.CopyTo(a__, i__);"; _out << eb; - _out << sp << nl << "public void CopyTo(int __i, " << s << "[] __a, int __ai, int __c)"; + _out << sp << nl << "public void CopyTo(int i__, " << s << "[] a__, int ai__, int c__)"; _out << sb; - _out << nl << "InnerList.CopyTo(__i, __a, __ai, __c);"; + _out << nl << "InnerList.CopyTo(i__, a__, ai__, c__);"; _out << eb; _out << sp << nl << "public " << s << "[] ToArray()"; _out << sb; - _out << nl << s << "[] __a = new " << toArrayAlloc(s + "[]", "InnerList.Count") << ';'; - _out << nl << "InnerList.CopyTo(__a, 0);"; - _out << nl << "return __a;"; + _out << nl << s << "[] a__ = new " << toArrayAlloc(s + "[]", "InnerList.Count") << ';'; + _out << nl << "InnerList.CopyTo(a__, 0);"; + _out << nl << "return a__;"; _out << eb; _out << sp << nl << "#endregion"; // Array copy and conversion _out << sp << nl << "#region AddRange members"; - _out << sp << nl << "public void AddRange(" << name << " __s)"; + _out << sp << nl << "public void AddRange(" << name << " s__)"; _out << sb; - _out << nl << "InnerList.AddRange(__s);"; + _out << nl << "InnerList.AddRange(s__);"; _out << eb; - _out << sp << nl << "public void AddRange(" << s << "[] __a)"; + _out << sp << nl << "public void AddRange(" << s << "[] a__)"; _out << sb; - _out << nl << "InnerList.AddRange(__a);"; + _out << nl << "InnerList.AddRange(a__);"; _out << eb; _out << sp << nl << "#endregion"; // AddRange members @@ -1815,16 +1812,16 @@ Slice::Gen::TypesVisitor::visitSequence(const SequencePtr& p) _out << sb; _out << nl << "return false;"; _out << eb; - _out << nl << "for(int __i = 0; __i < Count; ++__i)"; + _out << nl << "for(int i__ = 0; i__ < Count; ++i__)"; _out << sb; if(!isValue) { - _out << nl << "if(InnerList[__i] == null && ((" << name << ")other)[__i] != null)"; + _out << nl << "if(InnerList[i__] == null && ((" << name << ")other)[i__] != null)"; _out << sb; _out << nl << "return false;"; _out << eb; } - _out << nl << "if(!((" << s << ")(InnerList[__i])).Equals(((" << name << ")other)[__i]))"; + _out << nl << "if(!((" << s << ")(InnerList[i__])).Equals(((" << name << ")other)[i__]))"; _out << sb; _out << nl << "return false;"; _out << eb; @@ -1836,21 +1833,21 @@ Slice::Gen::TypesVisitor::visitSequence(const SequencePtr& p) _out << sp << nl << "#region Comparison members"; - _out << sp << nl << "public static bool Equals(" << name << " __lhs, " << name << " __rhs)"; + _out << sp << nl << "public static bool Equals(" << name << " lhs__, " << name << " rhs__)"; _out << sb; - _out << nl << "return object.ReferenceEquals(__lhs, null)"; - _out << nl << " ? object.ReferenceEquals(__rhs, null)"; - _out << nl << " : __lhs.Equals(__rhs);"; + _out << nl << "return object.ReferenceEquals(lhs__, null)"; + _out << nl << " ? object.ReferenceEquals(rhs__, null)"; + _out << nl << " : lhs__.Equals(rhs__);"; _out << eb; - _out << sp << nl << "public static bool operator==(" << name << " __lhs, " << name << " __rhs)"; + _out << sp << nl << "public static bool operator==(" << name << " lhs__, " << name << " rhs__)"; _out << sb; - _out << nl << "return Equals(__lhs, __rhs);"; + _out << nl << "return Equals(lhs__, rhs__);"; _out << eb; - _out << sp << nl << "public static bool operator!=(" << name << " __lhs, " << name << " __rhs)"; + _out << sp << nl << "public static bool operator!=(" << name << " lhs__, " << name << " rhs__)"; _out << sb; - _out << nl << "return !Equals(__lhs, __rhs);"; + _out << nl << "return !Equals(lhs__, rhs__);"; _out << eb; _out << sp << nl << "#endregion"; // Comparison members @@ -1907,15 +1904,15 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) _out << sb; _out << eb; - _out << sp << nl << "public " << name << "(string __m) : base(__m)"; + _out << sp << nl << "public " << name << "(string m__) : base(m__)"; _out << sb; _out << eb; - _out << sp << nl << "public " << name << "(_System.Exception __ex) : base(_dflt, __ex)"; + _out << sp << nl << "public " << name << "(_System.Exception ex__) : base(_dflt, ex__)"; _out << sb; _out << eb; - _out << sp << nl << "public " << name << "(string __m, _System.Exception __ex) : base(__m, __ex)"; + _out << sp << nl << "public " << name << "(string m__, _System.Exception ex__) : base(m__, ex__)"; _out << sb; _out << eb; @@ -1925,7 +1922,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) _out << sp << nl << "public override int GetHashCode()"; _out << sb; - _out << nl << "int __h = 0;"; + _out << nl << "int h__ = 0;"; for(q = dataMembers.begin(); q != dataMembers.end(); ++q) { string memberName = fixId((*q)->name(), DotNet::ApplicationException); @@ -1935,33 +1932,33 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) _out << nl << "if((object)" << memberName << " != null)"; _out << sb; } - _out << nl << "__h = 5 * __h + " << memberName << ".GetHashCode();"; + _out << nl << "h__ = 5 * h__ + " << memberName << ".GetHashCode();"; if(!isValue) { _out << eb; } } - _out << nl << "return __h;"; + _out << nl << "return h__;"; _out << eb; - _out << sp << nl << "public override bool Equals(object __other)"; + _out << sp << nl << "public override bool Equals(object other__)"; _out << sb; - _out << nl << "if(__other == null)"; + _out << nl << "if(other__ == null)"; _out << sb; _out << nl << "return false;"; _out << eb; - _out << nl << "if(object.ReferenceEquals(this, __other))"; + _out << nl << "if(object.ReferenceEquals(this, other__))"; _out << sb; _out << nl << "return true;"; _out << eb; - _out << nl << "if(!(__other is " << name << "))"; + _out << nl << "if(!(other__ is " << name << "))"; _out << sb; - _out << nl << "throw new _System.ArgumentException(\"expected argument of type `" << name << "'\", \"__other\");"; + _out << nl << "throw new _System.ArgumentException(\"expected argument of type `" << name << "'\", \"other__\");"; _out << eb; for(q = dataMembers.begin(); q != dataMembers.end(); ++q) { string memberName = fixId((*q)->name(), DotNet::ApplicationException); - _out << nl << "if(!" << memberName << ".Equals(((" << name << ")__other)." << memberName << "))"; + _out << nl << "if(!" << memberName << ".Equals(((" << name << ")other__)." << memberName << "))"; _out << sb; _out << nl << "return false;"; _out << eb; @@ -1973,21 +1970,21 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) _out << sp << nl << "#region Comparison members"; - _out << sp << nl << "public static bool Equals(" << name << " __lhs, " << name << " __rhs)"; + _out << sp << nl << "public static bool Equals(" << name << " lhs__, " << name << " rhs__)"; _out << sb; - _out << nl << "return object.ReferenceEquals(__lhs, null)"; - _out << nl << " ? object.ReferenceEquals(__rhs, null)"; - _out << nl << " : __lhs.Equals(__rhs);"; + _out << nl << "return object.ReferenceEquals(lhs__, null)"; + _out << nl << " ? object.ReferenceEquals(rhs__, null)"; + _out << nl << " : lhs__.Equals(rhs__);"; _out << eb; - _out << sp << nl << "public static bool operator==(" << name << " __lhs, " << name << " __rhs)"; + _out << sp << nl << "public static bool operator==(" << name << " lhs__, " << name << " rhs__)"; _out << sb; - _out << nl << "return Equals(__lhs, __rhs);"; + _out << nl << "return Equals(lhs__, rhs__);"; _out << eb; - _out << sp << nl << "public static bool operator!=(" << name << " __lhs, " << name << " __rhs)"; + _out << sp << nl << "public static bool operator!=(" << name << " lhs__, " << name << " rhs__)"; _out << sb; - _out << nl << "return !Equals(__lhs, __rhs);"; + _out << nl << "return !Equals(lhs__, rhs__);"; _out << eb; _out << sp << nl << "#endregion"; // Comparison members @@ -2000,20 +1997,20 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) ExceptionPtr base = p->base(); - _out << sp << nl << "public override void __write(IceInternal.BasicStream __os)"; + _out << sp << nl << "public override void write__(IceInternal.BasicStream os__)"; _out << sb; - _out << nl << "__os.writeString(\"" << scoped << "\");"; - _out << nl << "__os.startWriteSlice();"; + _out << nl << "os__.writeString(\"" << scoped << "\");"; + _out << nl << "os__.startWriteSlice();"; for(q = dataMembers.begin(); q != dataMembers.end(); ++q) { writeMarshalUnmarshalCode(_out, (*q)->type(), fixId((*q)->name(), DotNet::ApplicationException), true, false, false); } - _out << nl << "__os.endWriteSlice();"; + _out << nl << "os__.endWriteSlice();"; if(base) { - _out << nl << "base.__write(__os);"; + _out << nl << "base.write__(os__);"; } _out << eb; @@ -2025,9 +2022,9 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) { _out << "new "; } - _out << "class __Patcher : IceInternal.Patcher"; + _out << "class Patcher__ : IceInternal.Patcher"; _out << sb; - _out << sp << nl << "internal __Patcher(Ice.Exception instance"; + _out << sp << nl << "internal Patcher__(Ice.Exception instance"; if(allClassMembers.size() > 1) { _out << ", int member"; @@ -2059,7 +2056,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) } string memberName = fixId((*q)->name(), DotNet::ApplicationException); string memberType = typeToString((*q)->type()); - _out << nl << "_type = typeof(" << memberType << ");"; + _out << nl << "type_ = typeof(" << memberType << ");"; _out << nl << "_instance." << memberName << " = (" << memberType << ")v;"; if(allClassMembers.size() > 1) { @@ -2081,13 +2078,13 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) _out << eb; } - _out << sp << nl << "public override void __read(IceInternal.BasicStream __is, bool __rid)"; + _out << sp << nl << "public override void read__(IceInternal.BasicStream is__, bool rid__)"; _out << sb; - _out << nl << "if(__rid)"; + _out << nl << "if(rid__)"; _out << sb; - _out << nl << "/* string myId = */ __is.readString();"; + _out << nl << "/* string myId = */ is__.readString();"; _out << eb; - _out << nl << "__is.startReadSlice();"; + _out << nl << "is__.startReadSlice();"; DataMemberList classMembers = p->classDataMembers(); int classMemberCount = static_cast<int>(allClassMembers.size() - classMembers.size()); for(q = dataMembers.begin(); q != dataMembers.end(); ++q) @@ -2106,39 +2103,39 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) fixId((*q)->name(), DotNet::ApplicationException), false, false, false, patchParams.str()); } - _out << nl << "__is.endReadSlice();"; + _out << nl << "is__.endReadSlice();"; if(base) { - _out << nl << "base.__read(__is, true);"; + _out << nl << "base.read__(is__, true);"; } _out << eb; if(_stream) { - _out << sp << nl << "public override void __write(Ice.OutputStream __outS)"; + _out << sp << nl << "public override void write__(Ice.OutputStream outS__)"; _out << sb; - _out << nl << "__outS.writeString(\"" << scoped << "\");"; - _out << nl << "__outS.startSlice();"; + _out << nl << "outS__.writeString(\"" << scoped << "\");"; + _out << nl << "outS__.startSlice();"; for(q = dataMembers.begin(); q != dataMembers.end(); ++q) { writeMarshalUnmarshalCode(_out, (*q)->type(), fixId((*q)->name(), DotNet::ApplicationException), true, true, false); } - _out << nl << "__outS.endSlice();"; + _out << nl << "outS__.endSlice();"; if(base) { - _out << nl << "base.__write(__outS);"; + _out << nl << "base.write__(outS__);"; } _out << eb; - _out << sp << nl << "public override void __read(Ice.InputStream __inS, bool __rid)"; + _out << sp << nl << "public override void read__(Ice.InputStream inS__, bool rid__)"; _out << sb; - _out << nl << "if(__rid)"; + _out << nl << "if(rid__)"; _out << sb; - _out << nl << "/* string myId = */ __inS.readString();"; + _out << nl << "/* string myId = */ inS__.readString();"; _out << eb; - _out << nl << "__inS.startSlice();"; + _out << nl << "inS__.startSlice();"; classMemberCount = static_cast<int>(allClassMembers.size() - classMembers.size()); for(q = dataMembers.begin(); q != dataMembers.end(); ++q) { @@ -2156,10 +2153,10 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) fixId((*q)->name(), DotNet::ApplicationException), false, true, false, patchParams.str()); } - _out << nl << "__inS.endSlice();"; + _out << nl << "inS__.endSlice();"; if(base) { - _out << nl << "base.__read(__inS, true);"; + _out << nl << "base.read__(inS__, true);"; } _out << eb; } @@ -2169,14 +2166,14 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) // Emit placeholder functions to catch errors. // string scoped = p->scoped(); - _out << sp << nl << "public override void __write(Ice.OutputStream __outS)"; + _out << sp << nl << "public override void write__(Ice.OutputStream outS__)"; _out << sb; _out << nl << "Ice.MarshalException ex = new Ice.MarshalException();"; _out << nl << "ex.reason = \"exception " << scoped.substr(2) << " was not generated with stream support\";"; _out << nl << "throw ex;"; _out << eb; - _out << sp << nl << "public override void __read(Ice.InputStream __inS, bool __rid)"; + _out << sp << nl << "public override void read__(Ice.InputStream inS__, bool rid__)"; _out << sb; _out << nl << "Ice.MarshalException ex = new Ice.MarshalException();"; _out << nl << "ex.reason = \"exception " << scoped.substr(2) << " was not generated with stream support\";"; @@ -2186,7 +2183,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) if(!base || base && !base->usesClasses()) { - _out << sp << nl << "public override bool __usesClasses()"; + _out << sp << nl << "public override bool usesClasses__()"; _out << sb; _out << nl << "return true;"; _out << eb; @@ -2208,16 +2205,16 @@ Slice::Gen::TypesVisitor::visitStructStart(const StructPtr& p) _out << sp << nl << "public sealed class " << p->name() << "Helper"; _out << sb; - _out << sp << nl << "public static void write(Ice.OutputStream __outS, " << name << " __v)"; + _out << sp << nl << "public static void write(Ice.OutputStream outS__, " << name << " v__)"; _out << sb; - _out << nl << "__v.__write(__outS);"; + _out << nl << "v__.write__(outS__);"; _out << eb; - _out << sp << nl << "public static " << name << " read(Ice.InputStream __inS)"; + _out << sp << nl << "public static " << name << " read(Ice.InputStream inS__)"; _out << sb; - _out << nl << name << " __v = new " << name << "();"; - _out << nl << "__v.__read(__inS);"; - _out << nl << "return __v;"; + _out << nl << name << " v__ = new " << name << "();"; + _out << nl << "v__.read__(inS__);"; + _out << nl << "return v__;"; _out << eb; _out << eb; @@ -2281,7 +2278,7 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) bool patchStruct = !isClass && classMembers.size() != 0; if(!p->isLocal() && patchStruct) { - _out << nl << "_pm = null;"; + _out << nl << "pm_ = null;"; } _out << eb; @@ -2303,7 +2300,7 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) _out << sp << nl << "public override int GetHashCode()"; _out << sb; - _out << nl << "int __h = 0;"; + _out << nl << "int h__ = 0;"; for(q = dataMembers.begin(); q != dataMembers.end(); ++q) { string memberName = fixId((*q)->name(), isClass ? DotNet::ICloneable : 0); @@ -2313,22 +2310,22 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) _out << nl << "if(" << memberName << " != null)"; _out << sb; } - _out << nl << "__h = 5 * __h + " << memberName << ".GetHashCode();"; + _out << nl << "h__ = 5 * h__ + " << memberName << ".GetHashCode();"; if(!isValue) { _out << eb; } } - _out << nl << "return __h;"; + _out << nl << "return h__;"; _out << eb; - _out << sp << nl << "public override bool Equals(object __other)"; + _out << sp << nl << "public override bool Equals(object other__)"; _out << sb; - _out << nl << "if(object.ReferenceEquals(this, __other))"; + _out << nl << "if(object.ReferenceEquals(this, other__))"; _out << sb; _out << nl << "return true;"; _out << eb; - _out << nl << "if(!(__other is " << name << "))"; + _out << nl << "if(!(other__ is " << name << "))"; _out << sb; _out << nl << "return false;"; _out << eb; @@ -2339,14 +2336,14 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) { _out << nl << "if(" << memberName << " == null)"; _out << sb; - _out << nl << "if(((" << name << ")__other)." << memberName << " != null)"; + _out << nl << "if(((" << name << ")other__)." << memberName << " != null)"; _out << sb; _out << nl << "return false;"; _out << eb; _out << eb; _out << nl << "else"; _out << sb; - _out << nl << "if(!(" << memberName << ".Equals(((" << name << ")__other)." << memberName << ")))"; + _out << nl << "if(!(" << memberName << ".Equals(((" << name << ")other__)." << memberName << ")))"; _out << sb; _out << nl << "return false;"; _out << eb; @@ -2354,7 +2351,7 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) } else { - _out << nl << "if(!(" << memberName << ".Equals(((" << name << ")__other)." << memberName << ")))"; + _out << nl << "if(!(" << memberName << ".Equals(((" << name << ")other__)." << memberName << ")))"; _out << sb; _out << nl << "return false;"; _out << eb; @@ -2367,21 +2364,21 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) _out << sp << nl << "#region Comparison members"; - _out << sp << nl << "public static bool Equals(" << name << " __lhs, " << name << " __rhs)"; + _out << sp << nl << "public static bool Equals(" << name << " lhs__, " << name << " rhs__)"; _out << sb; - _out << nl << "return object.ReferenceEquals(__lhs, null)"; - _out << nl << " ? object.ReferenceEquals(__rhs, null)"; - _out << nl << " : __lhs.Equals(__rhs);"; + _out << nl << "return object.ReferenceEquals(lhs__, null)"; + _out << nl << " ? object.ReferenceEquals(rhs__, null)"; + _out << nl << " : lhs__.Equals(rhs__);"; _out << eb; - _out << sp << nl << "public static bool operator==(" << name << " __lhs, " << name << " __rhs)"; + _out << sp << nl << "public static bool operator==(" << name << " lhs__, " << name << " rhs__)"; _out << sb; - _out << nl << "return Equals(__lhs, __rhs);"; + _out << nl << "return Equals(lhs__, rhs__);"; _out << eb; - _out << sp << nl << "public static bool operator!=(" << name << " __lhs, " << name << " __rhs)"; + _out << sp << nl << "public static bool operator!=(" << name << " lhs__, " << name << " rhs__)"; _out << sb; - _out << nl << "return !Equals(__lhs, __rhs);"; + _out << nl << "return !Equals(lhs__, rhs__);"; _out << eb; _out << sp << nl << "#endregion"; // Comparison members @@ -2390,7 +2387,7 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) { _out << sp << nl << "#region Marshalling support"; - _out << sp << nl << "public void __write(IceInternal.BasicStream __os)"; + _out << sp << nl << "public void write__(IceInternal.BasicStream os__)"; _out << sb; for(q = dataMembers.begin(); q != dataMembers.end(); ++q) { @@ -2403,12 +2400,12 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) if(classMembers.size() != 0) { - _out << sp << nl << "public sealed class __Patcher : IceInternal.Patcher"; + _out << sp << nl << "public sealed class Patcher__ : IceInternal.Patcher"; _out << sb; - _out << sp << nl << "internal __Patcher(" << name; + _out << sp << nl << "internal Patcher__(" << name; if(patchStruct) { - _out << ".__PatchMembers"; + _out << ".PatchMembers__"; } _out << " instance"; if(classMembers.size() > 1) @@ -2442,7 +2439,7 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) } string memberType = typeToString((*q)->type()); string memberName = fixId((*q)->name(), isClass ? DotNet::ICloneable : 0); - _out << nl << "_type = typeof(" << memberType << ");"; + _out << nl << "type_ = typeof(" << memberType << ");"; _out << nl << "_instance." << memberName << " = (" << memberType << ")v;"; if(classMembers.size() > 1) { @@ -2459,7 +2456,7 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) _out << sp << nl << "private " << name; if(patchStruct) { - _out << ".__PatchMembers"; + _out << ".PatchMembers__"; } _out << " _instance;"; if(classMembers.size() > 1) @@ -2470,7 +2467,7 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) if(patchStruct) { - _out << sp << nl << "internal class __PatchMembers"; + _out << sp << nl << "internal class PatchMembers__"; _out << sb; for(q = classMembers.begin(); q != classMembers.end(); ++q) { @@ -2480,33 +2477,33 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) } _out << eb; - _out << sp << nl << "private __PatchMembers _pm;"; + _out << sp << nl << "private PatchMembers__ pm_;"; - _out << sp << nl << "public void __patch()"; + _out << sp << nl << "public void patch__()"; _out << sb; for(q = classMembers.begin(); q != classMembers.end(); ++q) { string memberName = fixId((*q)->name(), isClass ? DotNet::ICloneable : 0); - _out << nl << memberName << " = _pm." << memberName << ';'; + _out << nl << memberName << " = pm_." << memberName << ';'; } _out << eb; } } - _out << sp << nl << "public void __read(IceInternal.BasicStream __is)"; + _out << sp << nl << "public void read__(IceInternal.BasicStream is__)"; _out << sb; if(patchStruct) { - _out << nl << "if(_pm == null)"; + _out << nl << "if(pm_ == null)"; _out << sb; - _out << nl << "_pm = new __PatchMembers();"; + _out << nl << "pm_ = new PatchMembers__();"; _out << eb; } int classMemberCount = 0; for(q = dataMembers.begin(); q != dataMembers.end(); ++q) { ostringstream patchParams; - patchParams << (patchStruct ? "_pm" : "this"); + patchParams << (patchStruct ? "pm_" : "this"); BuiltinPtr builtin = BuiltinPtr::dynamicCast((*q)->type()); if((builtin && builtin->kind() == Builtin::KindObject) || ClassDeclPtr::dynamicCast((*q)->type())) { @@ -2523,7 +2520,7 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) if(_stream) { - _out << sp << nl << "public void __write(Ice.OutputStream __outS)"; + _out << sp << nl << "public void write__(Ice.OutputStream outS__)"; _out << sb; for(q = dataMembers.begin(); q != dataMembers.end(); ++q) { @@ -2533,20 +2530,20 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) } _out << eb; - _out << sp << nl << "public void __read(Ice.InputStream __inS)"; + _out << sp << nl << "public void read__(Ice.InputStream inS__)"; _out << sb; if(patchStruct) { - _out << nl << "if(_pm == null)"; + _out << nl << "if(pm_ == null)"; _out << sb; - _out << nl << "_pm = new __PatchMembers();"; + _out << nl << "pm_ = new _PatchMembers_();"; _out << eb; } classMemberCount = 0; for(q = dataMembers.begin(); q != dataMembers.end(); ++q) { ostringstream patchParams; - patchParams << (patchStruct ? "_pm" : "this"); + patchParams << (patchStruct ? "pm_" : "this"); BuiltinPtr builtin = BuiltinPtr::dynamicCast((*q)->type()); if((builtin && builtin->kind() == Builtin::KindObject) || ClassDeclPtr::dynamicCast((*q)->type())) { @@ -2584,9 +2581,9 @@ Slice::Gen::TypesVisitor::visitDictionary(const DictionaryPtr& p) _out << sp << nl << "#region " << name << " members"; - _out << sp << nl << "public void AddRange(" << name << " __d)"; + _out << sp << nl << "public void AddRange(" << name << " d__)"; _out << sb; - _out << nl << "foreach(_System.Collections.DictionaryEntry e in __d)"; + _out << nl << "foreach(_System.Collections.DictionaryEntry e in d__)"; _out << sb; _out << nl << "try"; _out << sb; @@ -2734,15 +2731,15 @@ Slice::Gen::TypesVisitor::visitDictionary(const DictionaryPtr& p) _out << sb; _out << nl << "return false;"; _out << eb; - _out << nl << ks << "[] __klhs = new " << ks << "[Count];"; - _out << nl << "Keys.CopyTo(__klhs, 0);"; - _out << nl << "_System.Array.Sort(__klhs);"; - _out << nl << ks << "[] __krhs = new " << ks << "[((" << name << ")other).Count];"; - _out << nl << "((" << name << ")other).Keys.CopyTo(__krhs, 0);"; - _out << nl << "_System.Array.Sort(__krhs);"; + _out << nl << ks << "[] klhs__ = new " << ks << "[Count];"; + _out << nl << "Keys.CopyTo(klhs__, 0);"; + _out << nl << "_System.Array.Sort(klhs__);"; + _out << nl << ks << "[] krhs__ = new " << ks << "[((" << name << ")other).Count];"; + _out << nl << "((" << name << ")other).Keys.CopyTo(krhs__, 0);"; + _out << nl << "_System.Array.Sort(krhs__);"; _out << nl << "for(int i = 0; i < Count; ++i)"; _out << sb; - _out << nl << "if(!__klhs[i].Equals(__krhs[i]))"; + _out << nl << "if(!klhs__[i].Equals(krhs__[i]))"; _out << sb; _out << nl << "return false;"; _out << eb; @@ -2751,35 +2748,35 @@ Slice::Gen::TypesVisitor::visitDictionary(const DictionaryPtr& p) bool valueIsArray = seq && !seq->hasMetaData("clr:collection"); if(valueIsArray) { - _out << nl << vs << "[] __vlhs = new " << toArrayAlloc(vs + "[]", "Count") << ';'; + _out << nl << vs << "[] vlhs__ = new " << toArrayAlloc(vs + "[]", "Count") << ';'; } else { - _out << nl << vs << "[] __vlhs = new " << vs << "[Count];"; + _out << nl << vs << "[] vlhs__ = new " << vs << "[Count];"; } - _out << nl << "Values.CopyTo(__vlhs, 0);"; - _out << nl << "_System.Array.Sort(__vlhs);"; + _out << nl << "Values.CopyTo(vlhs__, 0);"; + _out << nl << "_System.Array.Sort(vlhs__);"; string vrhsCount = "((" + name + ")other).Count"; if(valueIsArray) { - _out << nl << vs << "[] __vrhs = new " << toArrayAlloc(vs + "[]", vrhsCount) << ';'; + _out << nl << vs << "[] vrhs__ = new " << toArrayAlloc(vs + "[]", vrhsCount) << ';'; } else { - _out << nl << vs << "[] __vrhs = new " << vs << '[' << vrhsCount << "];"; + _out << nl << vs << "[] vrhs__ = new " << vs << '[' << vrhsCount << "];"; } - _out << nl << "((" << name << ")other).Values.CopyTo(__vrhs, 0);"; - _out << nl << "_System.Array.Sort(__vrhs);"; + _out << nl << "((" << name << ")other).Values.CopyTo(vrhs__, 0);"; + _out << nl << "_System.Array.Sort(vrhs__);"; _out << nl << "for(int i = 0; i < Count; ++i)"; _out << sb; if(!valueIsValue) { - _out << nl << "if(__vlhs[i] == null && __vrhs[i] != null)"; + _out << nl << "if(vlhs__[i] == null && vrhs__[i] != null)"; _out << sb; _out << nl << "return false;"; _out << eb; } - _out << nl << "if(!__vlhs[i].Equals(__vrhs[i]))"; + _out << nl << "if(!vlhs__[i].Equals(vrhs__[i]))"; _out << sb; _out << nl << "return false;"; _out << eb; @@ -2791,21 +2788,21 @@ Slice::Gen::TypesVisitor::visitDictionary(const DictionaryPtr& p) _out << sp << nl << "#region Comparison members"; - _out << sp << nl << "public static bool Equals(" << name << " __lhs, " << name << " __rhs)"; + _out << sp << nl << "public static bool Equals(" << name << " lhs__, " << name << " rhs__)"; _out << sb; - _out << nl << "return object.ReferenceEquals(__lhs, null)"; - _out << nl << " ? object.ReferenceEquals(__rhs, null)"; - _out << nl << " : __lhs.Equals(__rhs);"; + _out << nl << "return object.ReferenceEquals(lhs__, null)"; + _out << nl << " ? object.ReferenceEquals(rhs__, null)"; + _out << nl << " : lhs__.Equals(rhs__);"; _out << eb; - _out << sp << nl << "public static bool operator==(" << name << " __lhs, " << name << " __rhs)"; + _out << sp << nl << "public static bool operator==(" << name << " lhs__, " << name << " rhs__)"; _out << sb; - _out << nl << "return Equals(__lhs, __rhs);"; + _out << nl << "return Equals(lhs__, rhs__);"; _out << eb; - _out << sp << nl << "public static bool operator!=(" << name << " __lhs, " << name << " __rhs)"; + _out << sp << nl << "public static bool operator!=(" << name << " lhs__, " << name << " rhs__)"; _out << sb; - _out << nl << "return !Equals(__lhs, __rhs);"; + _out << nl << "return !Equals(lhs__, rhs__);"; _out << eb; _out << sp << nl << "#endregion"; // Comparison members @@ -2839,16 +2836,16 @@ Slice::Gen::TypesVisitor::visitEnum(const EnumPtr& p) _out << sp << nl << "public sealed class " << name << "Helper"; _out << sb; - _out << sp << nl << "public static void write(Ice.OutputStream __outS, " << scoped << " __v)"; + _out << sp << nl << "public static void write(Ice.OutputStream outS__, " << scoped << " v__)"; _out << sb; - writeMarshalUnmarshalCode(_out, p, "__v", true, true, false); + writeMarshalUnmarshalCode(_out, p, "v__", true, true, false); _out << eb; - _out << sp << nl << "public static " << scoped << " read(Ice.InputStream __inS)"; + _out << sp << nl << "public static " << scoped << " read(Ice.InputStream inS__)"; _out << sb; - _out << nl << scoped << " __v;"; - writeMarshalUnmarshalCode(_out, p, "__v", false, true, false); - _out << nl << "return __v;"; + _out << nl << scoped << " v__;"; + writeMarshalUnmarshalCode(_out, p, "v__", false, true, false); + _out << nl << "return v__;"; _out << eb; _out << eb; @@ -3024,7 +3021,7 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p) _out << sp << nl << typeToString(p->returnType()) << " " << name << spar << params << epar << ';'; _out << nl << typeToString(p->returnType()) << " " << name - << spar << params << "Ice.Context __context" << epar << ';'; + << spar << params << "Ice.Context context__" << epar << ';'; if(cl->hasMetaData("ami") || p->hasMetaData("ami")) { @@ -3036,7 +3033,7 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p) // _out << sp; _out << nl << "void " << p->name() << "_async" << spar << paramsAMI << epar << ';'; - _out << nl << "void " << p->name() << "_async" << spar << paramsAMI << "Ice.Context __ctx" << epar << ';'; + _out << nl << "void " << p->name() << "_async" << spar << paramsAMI << "Ice.Context ctx__" << epar << ';'; } } @@ -3096,7 +3093,7 @@ Slice::Gen::OpsVisitor::writeOperations(const ClassDefPtr& p, bool noCurrent) opIntfName += "NC"; } - _out << sp << nl << "public interface _" << name << opIntfName; + _out << sp << nl << "public interface " << name << opIntfName << '_'; if((bases.size() == 1 && bases.front()->isAbstract()) || bases.size() > 1) { _out << " : "; @@ -3115,15 +3112,12 @@ Slice::Gen::OpsVisitor::writeOperations(const ClassDefPtr& p, bool noCurrent) first = false; } string s = (*q)->scoped(); - string::size_type pos = s.rfind("::"); - assert(pos != string::npos); - s.insert(pos + 2, "_"); s += "Operations"; if(noCurrent) { s += "NC"; } - _out << fixId(s); + _out << fixId(s) << '_'; } ++q; } @@ -3159,7 +3153,7 @@ Slice::Gen::OpsVisitor::writeOperations(const ClassDefPtr& p, bool noCurrent) _out << retS << ' ' << name << spar << params; if(!noCurrent && !p->isLocal()) { - _out << "Ice.Current __current"; + _out << "Ice.Current current__"; } _out << epar << ';'; } @@ -3228,48 +3222,48 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) { _out << "return "; } - _out << opName << spar << args << "__defaultContext()" << epar << ';'; + _out << opName << spar << args << "defaultContext__()" << epar << ';'; _out << eb; - _out << sp << nl << "public " << retS << " " << opName << spar << params << "Ice.Context __context" << epar; + _out << sp << nl << "public " << retS << " " << opName << spar << params << "Ice.Context context__" << epar; _out << sb; - _out << nl << "int __cnt = 0;"; + _out << nl << "int cnt__ = 0;"; _out << nl << "while(true)"; _out << sb; _out << nl << "try"; _out << sb; if(op->returnsData()) { - _out << nl << "__checkTwowayOnly(\"" << op->name() << "\");"; + _out << nl << "checkTwowayOnly__(\"" << op->name() << "\");"; } - _out << nl << "Ice._ObjectDel __delBase = __getDelegate();"; - _out << nl << '_' << name << "Del __del = (_" << name << "Del)__delBase;"; + _out << nl << "Ice.ObjectDel_ delBase__ = getDelegate__();"; + _out << nl << name << "Del_ del__ = (" << name << "Del_)delBase__;"; _out << nl; if(ret) { _out << "return "; } - _out << "__del." << opName << spar << args << "__context" << epar << ';'; + _out << "del__." << opName << spar << args << "context__" << epar << ';'; if(!ret) { _out << nl << "return;"; } _out << eb; - _out << nl << "catch(IceInternal.NonRepeatable __ex)"; + _out << nl << "catch(IceInternal.NonRepeatable ex__)"; _out << sb; if(op->mode() == Operation::Idempotent || op->mode() == Operation::Nonmutating) { - _out << nl << "__cnt = __handleException(__ex.get(), __cnt);"; + _out << nl << "cnt__ = handleException__(ex__.get(), cnt__);"; } else { - _out << nl << "__rethrowException(__ex.get());"; + _out << nl << "rethrowException__(ex__.get());"; } _out << eb; - _out << nl << "catch(Ice.LocalException __ex)"; + _out << nl << "catch(Ice.LocalException ex__)"; _out << sb; - _out << nl << "__cnt = __handleException(__ex, __cnt);"; + _out << nl << "cnt__ = handleException__(ex__, cnt__);"; _out << eb; _out << eb; @@ -3307,13 +3301,13 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) _out << sp; _out << nl << "public void " << opName << "_async" << spar << paramsAMI << epar; _out << sb; - _out << nl << opName << "_async" << spar << argsAMI << "__defaultContext()" << epar << ';'; + _out << nl << opName << "_async" << spar << argsAMI << "defaultContext__()" << epar << ';'; _out << eb; - _out << nl << "public void " << opName << "_async" << spar << paramsAMI << "Ice.Context __ctx" << epar; + _out << nl << "public void " << opName << "_async" << spar << paramsAMI << "Ice.Context ctx__" << epar; _out << sb; - _out << nl << "__checkTwowayOnly(\"" << p->name() << "\");"; - _out << nl << "__cb.__invoke" << spar << "this" << argsAMI << "__ctx" << epar << ';'; + _out << nl << "checkTwowayOnly__(\"" << p->name() << "\");"; + _out << nl << "cb__.invoke__" << spar << "this" << argsAMI << "ctx__" << epar << ';'; _out << eb; } } @@ -3338,7 +3332,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) _out << nl << "if(b.ice_isA(\"" << p->scoped() << "\"))"; _out << sb; _out << nl << name << "PrxHelper h = new " << name << "PrxHelper();"; - _out << nl << "h.__copyFrom(b);"; + _out << nl << "h.copyFrom__(b);"; _out << nl << "return h;"; _out << eb; _out << nl << "return null;"; @@ -3357,7 +3351,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) _out << nl << "if(b.ice_isA(\"" << p->scoped() << "\", ctx))"; _out << sb; _out << nl << name << "PrxHelper h = new " << name << "PrxHelper();"; - _out << nl << "h.__copyFrom(b);"; + _out << nl << "h.copyFrom__(b);"; _out << nl << "return h;"; _out << eb; _out << nl << "return null;"; @@ -3375,7 +3369,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) _out << nl << "if(bb.ice_isA(\"" << p->scoped() << "\"))"; _out << sb; _out << nl << name << "PrxHelper h = new " << name << "PrxHelper();"; - _out << nl << "h.__copyFrom(bb);"; + _out << nl << "h.copyFrom__(bb);"; _out << nl << "return h;"; _out << eb; _out << eb; @@ -3397,7 +3391,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) _out << nl << "if(bb.ice_isA(\"" << p->scoped() << "\", ctx))"; _out << sb; _out << nl << name << "PrxHelper h = new " << name << "PrxHelper();"; - _out << nl << "h.__copyFrom(bb);"; + _out << nl << "h.copyFrom__(bb);"; _out << nl << "return h;"; _out << eb; _out << eb; @@ -3414,7 +3408,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) _out << nl << "return null;"; _out << eb; _out << nl << name << "PrxHelper h = new " << name << "PrxHelper();"; - _out << nl << "h.__copyFrom(b);"; + _out << nl << "h.copyFrom__(b);"; _out << nl << "return h;"; _out << eb; @@ -3426,7 +3420,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) _out << eb; _out << nl << "Ice.ObjectPrx bb = b.ice_newFacet(f);"; _out << nl << name << "PrxHelper h = new " << name << "PrxHelper();"; - _out << nl << "h.__copyFrom(bb);"; + _out << nl << "h.copyFrom__(bb);"; _out << nl << "return h;"; _out << eb; @@ -3434,28 +3428,28 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) _out << sp << nl << "#region Marshaling support"; - _out << sp << nl << "protected override Ice._ObjectDelM __createDelegateM()"; + _out << sp << nl << "protected override Ice.ObjectDelM_ createDelegateM__()"; _out << sb; - _out << nl << "return new _" << name << "DelM();"; + _out << nl << "return new " << name << "DelM_();"; _out << eb; - _out << sp << nl << "protected override Ice._ObjectDelD __createDelegateD()"; + _out << sp << nl << "protected override Ice.ObjectDelD_ createDelegateD__()"; _out << sb; - _out << nl << "return new _" << name << "DelD();"; + _out << nl << "return new " << name << "DelD_();"; _out << eb; - _out << sp << nl << "public static void __write(IceInternal.BasicStream __os, " << name << "Prx __v)"; + _out << sp << nl << "public static void write__(IceInternal.BasicStream os__, " << name << "Prx v__)"; _out << sb; - _out << nl << "__os.writeProxy(__v);"; + _out << nl << "os__.writeProxy(v__);"; _out << eb; - _out << sp << nl << "public static " << name << "Prx __read(IceInternal.BasicStream __is)"; + _out << sp << nl << "public static " << name << "Prx read__(IceInternal.BasicStream is__)"; _out << sb; - _out << nl << "Ice.ObjectPrx proxy = __is.readProxy();"; + _out << nl << "Ice.ObjectPrx proxy = is__.readProxy();"; _out << nl << "if(proxy != null)"; _out << sb; _out << nl << name << "PrxHelper result = new " << name << "PrxHelper();"; - _out << nl << "result.__copyFrom(proxy);"; + _out << nl << "result.copyFrom__(proxy);"; _out << nl << "return result;"; _out << eb; _out << nl << "return null;"; @@ -3463,18 +3457,18 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) if(_stream) { - _out << sp << nl << "public static void write(Ice.OutputStream __outS, " << name << "Prx __v)"; + _out << sp << nl << "public static void write(Ice.OutputStream outS__, " << name << "Prx v__)"; _out << sb; - _out << nl << "__outS.writeProxy(__v);"; + _out << nl << "outS__.writeProxy(v__);"; _out << eb; - _out << sp << nl << "public static " << name << "Prx read(Ice.InputStream __inS)"; + _out << sp << nl << "public static " << name << "Prx read(Ice.InputStream inS__)"; _out << sb; - _out << nl << "Ice.ObjectPrx proxy = __inS.readProxy();"; + _out << nl << "Ice.ObjectPrx proxy = inS__.readProxy();"; _out << nl << "if(proxy != null)"; _out << sb; _out << nl << name << "PrxHelper result = new " << name << "PrxHelper();"; - _out << nl << "result.__copyFrom(proxy);"; + _out << nl << "result.copyFrom__(proxy);"; _out << nl << "return result;"; _out << eb; _out << nl << "return null;"; @@ -3509,30 +3503,30 @@ Slice::Gen::HelperVisitor::visitSequence(const SequencePtr& p) _out << sp << nl << "public sealed class " << name << "Helper"; _out << sb; - _out << nl << "public static void write(IceInternal.BasicStream __os, " << typeS << " __v)"; + _out << nl << "public static void write(IceInternal.BasicStream os__, " << typeS << " v__)"; _out << sb; - writeSequenceMarshalUnmarshalCode(_out, p, "__v", true, false); + writeSequenceMarshalUnmarshalCode(_out, p, "v__", true, false); _out << eb; - _out << sp << nl << "public static " << typeS << " read(IceInternal.BasicStream __is)"; + _out << sp << nl << "public static " << typeS << " read(IceInternal.BasicStream is__)"; _out << sb; - _out << nl << typeS << " __v;"; - writeSequenceMarshalUnmarshalCode(_out, p, "__v", false, false); - _out << nl << "return __v;"; + _out << nl << typeS << " v__;"; + writeSequenceMarshalUnmarshalCode(_out, p, "v__", false, false); + _out << nl << "return v__;"; _out << eb; if(_stream) { - _out << sp << nl << "public static void write(Ice.OutputStream __outS, " << typeS << " __v)"; + _out << sp << nl << "public static void write(Ice.OutputStream outS__, " << typeS << " v__)"; _out << sb; - writeSequenceMarshalUnmarshalCode(_out, p, "__v", true, true); + writeSequenceMarshalUnmarshalCode(_out, p, "v__", true, true); _out << eb; - _out << sp << nl << "public static " << typeS << " read(Ice.InputStream __inS)"; + _out << sp << nl << "public static " << typeS << " read(Ice.InputStream inS__)"; _out << sb; - _out << nl << typeS << " __v;"; - writeSequenceMarshalUnmarshalCode(_out, p, "__v", false, true); - _out << nl << "return __v;"; + _out << nl << typeS << " v__;"; + writeSequenceMarshalUnmarshalCode(_out, p, "v__", false, true); + _out << nl << "return v__;"; _out << eb; } @@ -3560,20 +3554,20 @@ Slice::Gen::HelperVisitor::visitDictionary(const DictionaryPtr& p) _out << sp << nl << "public sealed class " << name << "Helper"; _out << sb; - _out << nl << "public static void write(IceInternal.BasicStream __os, " << name << " __v)"; + _out << nl << "public static void write(IceInternal.BasicStream os__, " << name << " v__)"; _out << sb; - _out << nl << "if(__v == null)"; + _out << nl << "if(v__ == null)"; _out << sb; - _out << nl << "__os.writeSize(0);"; + _out << nl << "os__.writeSize(0);"; _out << eb; _out << nl << "else"; _out << sb; - _out << nl << "__os.writeSize(__v.Count);"; - _out << nl << "foreach(_System.Collections.DictionaryEntry __e in __v)"; + _out << nl << "os__.writeSize(v__.Count);"; + _out << nl << "foreach(_System.Collections.DictionaryEntry e__ in v__)"; _out << sb; - string keyArg = "((" + keyS + ")__e.Key)"; + string keyArg = "((" + keyS + ")e__.Key)"; writeMarshalUnmarshalCode(_out, key, keyArg, true, false, false); - string valueArg = "((" + valueS + ")__e.Value)"; + string valueArg = "((" + valueS + ")e__.Value)"; writeMarshalUnmarshalCode(_out, value, valueArg, true, false, false); _out << eb; _out << eb; @@ -3583,9 +3577,9 @@ Slice::Gen::HelperVisitor::visitDictionary(const DictionaryPtr& p) bool hasClassValue = (builtin && builtin->kind() == Builtin::KindObject) || ClassDeclPtr::dynamicCast(value); if(hasClassValue) { - _out << sp << nl << "public sealed class __Patcher : IceInternal.Patcher"; + _out << sp << nl << "public sealed class Patcher__ : IceInternal.Patcher"; _out << sb; - _out << sp << nl << "internal __Patcher(" << name << " m, " << keyS << " key)"; + _out << sp << nl << "internal Patcher__(" << name << " m, " << keyS << " key)"; _out << sb; _out << nl << "_m = m;"; _out << nl << "_key = key;"; @@ -3593,7 +3587,7 @@ Slice::Gen::HelperVisitor::visitDictionary(const DictionaryPtr& p) _out << sp << nl << "public override void" << nl << "patch(Ice.Object v)"; _out << sb; - _out << nl << "_type = typeof(" << typeToString(p->valueType()) << ");"; + _out << nl << "type_ = typeof(" << typeToString(p->valueType()) << ");"; _out << nl << "_m[_key] = (" << valueS << ")v;"; _out << eb; @@ -3602,39 +3596,39 @@ Slice::Gen::HelperVisitor::visitDictionary(const DictionaryPtr& p) _out << eb; } - _out << sp << nl << "public static " << name << " read(IceInternal.BasicStream __is)"; + _out << sp << nl << "public static " << name << " read(IceInternal.BasicStream is__)"; _out << sb; - _out << nl << "int __sz = __is.readSize();"; - _out << nl << name << " __r = new " << name << "();"; - _out << nl << "for(int __i = 0; __i < __sz; ++__i)"; + _out << nl << "int sz__ = is__.readSize();"; + _out << nl << name << " r__ = new " << name << "();"; + _out << nl << "for(int i__ = 0; i__ < sz__; ++i__)"; _out << sb; - _out << nl << keyS << " __k;"; - writeMarshalUnmarshalCode(_out, key, "__k", false, false, false); + _out << nl << keyS << " k__;"; + writeMarshalUnmarshalCode(_out, key, "k__", false, false, false); if(!hasClassValue) { - _out << nl << valueS << " __v;"; + _out << nl << valueS << " v__;"; } - writeMarshalUnmarshalCode(_out, value, "__v", false, false, false, "__r, __k"); + writeMarshalUnmarshalCode(_out, value, "v__", false, false, false, "r__, k__"); if(!hasClassValue) { - _out << nl << "__r[__k] = __v;"; + _out << nl << "r__[k__] = v__;"; } _out << eb; - _out << nl << "return __r;"; + _out << nl << "return r__;"; _out << eb; if(_stream) { - _out << sp << nl << "public static void write(Ice.OutputStream __outS, " << name << " __v)"; + _out << sp << nl << "public static void write(Ice.OutputStream outS__, " << name << " v__)"; _out << sb; - _out << nl << "if(__v == null)"; + _out << nl << "if(v__ == null)"; _out << sb; - _out << nl << "__outS.writeSize(0);"; + _out << nl << "outS__.writeSize(0);"; _out << eb; _out << nl << "else"; _out << sb; - _out << nl << "__outS.writeSize(__v.Count);"; - _out << nl << "foreach(_System.Collections.DictionaryEntry __e in __v)"; + _out << nl << "outS__.writeSize(v__.Count);"; + _out << nl << "foreach(_System.Collections.DictionaryEntry e__ in v__)"; _out << sb; writeMarshalUnmarshalCode(_out, key, keyArg, true, true, false); writeMarshalUnmarshalCode(_out, value, valueArg, true, true, false); @@ -3642,25 +3636,25 @@ Slice::Gen::HelperVisitor::visitDictionary(const DictionaryPtr& p) _out << eb; _out << eb; - _out << sp << nl << "public static " << name << " read(Ice.InputStream __inS)"; + _out << sp << nl << "public static " << name << " read(Ice.InputStream inS__)"; _out << sb; - _out << nl << "int __sz = __inS.readSize();"; - _out << nl << name << " __r = new " << name << "();"; - _out << nl << "for(int __i = 0; __i < __sz; ++__i)"; + _out << nl << "int sz__ = inS__.readSize();"; + _out << nl << name << " r__ = new " << name << "();"; + _out << nl << "for(int i__ = 0; i__ < sz__; ++i__)"; _out << sb; - _out << nl << keyS << " __k;"; - writeMarshalUnmarshalCode(_out, key, "__k", false, true, false); + _out << nl << keyS << " k__;"; + writeMarshalUnmarshalCode(_out, key, "k__", false, true, false); if(!hasClassValue) { - _out << nl << valueS << " __v;"; + _out << nl << valueS << " v__;"; } - writeMarshalUnmarshalCode(_out, value, "__v", false, true, false, "__r, __k"); + writeMarshalUnmarshalCode(_out, value, "v__", false, true, false, "r__, k__"); if(!hasClassValue) { - _out << nl << "__r[__k] = __v;"; + _out << nl << "r__[k__] = v__;"; } _out << eb; - _out << nl << "return __r;"; + _out << nl << "return r__;"; _out << eb; } @@ -3702,10 +3696,10 @@ Slice::Gen::DelegateVisitor::visitClassDefStart(const ClassDefPtr& p) string name = p->name(); ClassList bases = p->bases(); - _out << sp << nl << "public interface _" << name << "Del : "; + _out << sp << nl << "public interface " << name << "Del_ : "; if(bases.empty()) { - _out << "Ice._ObjectDel"; + _out << "Ice.ObjectDel_"; } else { @@ -3713,10 +3707,7 @@ Slice::Gen::DelegateVisitor::visitClassDefStart(const ClassDefPtr& p) while(q != bases.end()) { string s = (*q)->scoped(); - string::size_type pos = s.rfind("::"); - assert(pos != string::npos); - s = s.insert(pos + 2, "_"); - s += "Del"; + s += "Del_"; _out << fixId(s); if(++q != bases.end()) { @@ -3738,7 +3729,7 @@ Slice::Gen::DelegateVisitor::visitClassDefStart(const ClassDefPtr& p) string retS = typeToString(ret); vector<string> params = getParams(op); - _out << sp << nl << retS << ' ' << opName << spar << params << "Ice.Context __context" << epar << ';'; + _out << sp << nl << retS << ' ' << opName << spar << params << "Ice.Context context__" << epar << ';'; } return true; @@ -3785,7 +3776,7 @@ Slice::Gen::DelegateMVisitor::visitClassDefStart(const ClassDefPtr& p) string name = p->name(); ClassList bases = p->bases(); - _out << sp << nl << "public sealed class _" << name << "DelM : Ice._ObjectDelM, _" << name << "Del"; + _out << sp << nl << "public sealed class " << name << "DelM_ : Ice.ObjectDelM_, " << name << "Del_"; _out << sb; OperationList ops = p->allOperations(); @@ -3833,37 +3824,37 @@ Slice::Gen::DelegateMVisitor::visitClassDefStart(const ClassDefPtr& p) vector<string> params = getParams(op); - _out << sp << nl << "public " << retS << ' ' << opName << spar << params << "Ice.Context __context" << epar; + _out << sp << nl << "public " << retS << ' ' << opName << spar << params << "Ice.Context context__" << epar; _out << sb; - _out << nl << "IceInternal.Outgoing __og = getOutgoing(\"" << op->name() << "\", " << sliceModeToIceMode(op) - << ", __context);"; + _out << nl << "IceInternal.Outgoing og__ = getOutgoing(\"" << op->name() << "\", " << sliceModeToIceMode(op) + << ", context__);"; _out << nl << "try"; _out << sb; if(!inParams.empty()) { _out << nl << "try"; _out << sb; - _out << nl << "IceInternal.BasicStream __os = __og.ostr();"; + _out << nl << "IceInternal.BasicStream os__ = og__.ostr();"; for(q = inParams.begin(); q != inParams.end(); ++q) { writeMarshalUnmarshalCode(_out, q->first, fixId(q->second), true, false, false); } if(op->sendsClasses()) { - _out << nl << "__os.writePendingObjects();"; + _out << nl << "os__.writePendingObjects();"; } _out << eb; - _out << nl << "catch(Ice.LocalException __ex)"; + _out << nl << "catch(Ice.LocalException ex__)"; _out << sb; - _out << nl << "__og.abort(__ex);"; + _out << nl << "og__.abort(ex__);"; _out << eb; } - _out << nl << "bool __ok = __og.invoke();"; + _out << nl << "bool ok__ = og__.invoke();"; _out << nl << "try"; _out << sb; - _out << nl << "IceInternal.BasicStream __is = __og.istr();"; - _out << nl << "if(!__ok)"; + _out << nl << "IceInternal.BasicStream is__ = og__.istr();"; + _out << nl << "if(!ok__)"; _out << sb; // // The try/catch block is necessary because throwException() @@ -3871,7 +3862,7 @@ Slice::Gen::DelegateMVisitor::visitClassDefStart(const ClassDefPtr& p) // _out << nl << "try"; _out << sb; - _out << nl << "__is.throwException();"; + _out << nl << "is__.throwException();"; _out << eb; for(ExceptionList::const_iterator t = throws.begin(); t != throws.end(); ++t) { @@ -3894,20 +3885,20 @@ Slice::Gen::DelegateMVisitor::visitClassDefStart(const ClassDefPtr& p) BuiltinPtr builtin = BuiltinPtr::dynamicCast(ret); if((builtin && builtin->kind() == Builtin::KindObject) || ClassDeclPtr::dynamicCast(ret)) { - _out << nl << retS << " __ret;"; - _out << nl << "IceInternal.ParamPatcher __ret_PP = new IceInternal.ParamPatcher(typeof(" + _out << nl << retS << " ret__;"; + _out << nl << "IceInternal.ParamPatcher ret___PP = new IceInternal.ParamPatcher(typeof(" << retS << "));"; - _out << nl << "__is.readObject(__ret_PP);"; + _out << nl << "is__.readObject(ret___PP);"; } else { - _out << nl << retS << " __ret;"; - writeMarshalUnmarshalCode(_out, ret, "__ret", false, false, true, ""); + _out << nl << retS << " ret__;"; + writeMarshalUnmarshalCode(_out, ret, "ret__", false, false, true, ""); } } if(op->returnsClasses()) { - _out << nl << "__is.readPendingObjects();"; + _out << nl << "is__.readPendingObjects();"; for(q = outParams.begin(); q != outParams.end(); ++q) { string param = fixId(q->second); @@ -3923,7 +3914,7 @@ Slice::Gen::DelegateMVisitor::visitClassDefStart(const ClassDefPtr& p) bool patchStruct = st && !st->hasMetaData("clr:class") && st->classDataMembers().size() != 0; if(patchStruct) { - _out << nl << param << ".__patch();"; + _out << nl << param << ".patch__();"; } } } @@ -3933,7 +3924,7 @@ Slice::Gen::DelegateMVisitor::visitClassDefStart(const ClassDefPtr& p) BuiltinPtr builtin = BuiltinPtr::dynamicCast(ret); if((builtin && builtin->kind() == Builtin::KindObject) || ClassDeclPtr::dynamicCast(ret)) { - _out << nl << "__ret = (" << retS << ")__ret_PP.value;"; + _out << nl << "ret__ = (" << retS << ")ret___PP.value;"; } else { @@ -3941,20 +3932,20 @@ Slice::Gen::DelegateMVisitor::visitClassDefStart(const ClassDefPtr& p) bool patchStruct = st && !st->hasMetaData("clr:class") && st->classDataMembers().size() != 0; if(patchStruct) { - _out << nl << "__ret.__patch();"; + _out << nl << "ret__.patch__();"; } } - _out << nl << "return __ret;"; + _out << nl << "return ret__;"; } _out << eb; - _out << nl << "catch(Ice.LocalException __ex)"; + _out << nl << "catch(Ice.LocalException ex__)"; _out << sb; - _out << nl << "throw new IceInternal.NonRepeatable(__ex);"; + _out << nl << "throw new IceInternal.NonRepeatable(ex__);"; _out << eb; _out << eb; _out << nl << "finally"; _out << sb; - _out << nl << "reclaimOutgoing(__og);"; + _out << nl << "reclaimOutgoing(og__);"; _out << eb; _out << eb; } @@ -4003,7 +3994,7 @@ Slice::Gen::DelegateDVisitor::visitClassDefStart(const ClassDefPtr& p) string name = p->name(); ClassList bases = p->bases(); - _out << sp << nl << "public sealed class _" << name << "DelD : Ice._ObjectDelD, _" << name << "Del"; + _out << sp << nl << "public sealed class " << name << "DelD_ : Ice.ObjectDelD_, " << name << "Del_"; _out << sb; OperationList ops = p->allOperations(); @@ -4021,7 +4012,7 @@ Slice::Gen::DelegateDVisitor::visitClassDefStart(const ClassDefPtr& p) vector<string> args = getArgs(op); _out << sp; - _out << nl << "public " << retS << ' ' << opName << spar << params << "Ice.Context __context" << epar; + _out << nl << "public " << retS << ' ' << opName << spar << params << "Ice.Context context__" << epar; _out << sb; if(containingClass->hasMetaData("amd") || op->hasMetaData("amd")) { @@ -4029,14 +4020,14 @@ Slice::Gen::DelegateDVisitor::visitClassDefStart(const ClassDefPtr& p) } else { - _out << nl << "Ice.Current __current = new Ice.Current();"; - _out << nl << "__initCurrent(ref __current, \"" << op->name() << "\", " << sliceModeToIceMode(op) - << ", __context);"; + _out << nl << "Ice.Current current__ = new Ice.Current();"; + _out << nl << "initCurrent__(ref current__, \"" << op->name() << "\", " << sliceModeToIceMode(op) + << ", context__);"; _out << nl << "while(true)"; _out << sb; - _out << nl << "IceInternal.Direct __direct = new IceInternal.Direct(__current);"; - _out << nl << "object __servant = __direct.servant();"; - _out << nl << "if(__servant is " << fixId(name) << ")"; + _out << nl << "IceInternal.Direct direct__ = new IceInternal.Direct(current__);"; + _out << nl << "object servant__ = direct__.servant();"; + _out << nl << "if(servant__ is " << fixId(name) << ")"; _out << sb; _out << nl << "try"; _out << sb; @@ -4045,30 +4036,30 @@ Slice::Gen::DelegateDVisitor::visitClassDefStart(const ClassDefPtr& p) { _out << "return "; } - _out << "((" << fixId(containingClass->scoped()) << ")__servant)." - << opName << spar << args << "__current" << epar << ';'; + _out << "((" << fixId(containingClass->scoped()) << ")servant__)." + << opName << spar << args << "current__" << epar << ';'; if(!ret) { _out << nl << "return;"; } _out << eb; - _out << nl << "catch(Ice.LocalException __ex)"; + _out << nl << "catch(Ice.LocalException ex__)"; _out << sb; - _out << nl << "throw new IceInternal.NonRepeatable(__ex);"; + _out << nl << "throw new IceInternal.NonRepeatable(ex__);"; _out << eb; _out << nl << "finally"; _out << sb; - _out << nl << "__direct.destroy();"; + _out << nl << "direct__.destroy();"; _out << eb; _out << eb; _out << nl << "else"; _out << sb; - _out << nl << "__direct.destroy();"; - _out << nl << "Ice.OperationNotExistException __opEx = new Ice.OperationNotExistException();"; - _out << nl << "__opEx.id = __current.id;"; - _out << nl << "__opEx.facet = __current.facet;"; - _out << nl << "__opEx.operation = __current.operation;"; - _out << nl << "throw __opEx;"; + _out << nl << "direct__.destroy();"; + _out << nl << "Ice.OperationNotExistException opEx__ = new Ice.OperationNotExistException();"; + _out << nl << "opEx__.id = current__.id;"; + _out << nl << "opEx__.facet = current__.facet;"; + _out << nl << "opEx__.operation = current__.operation;"; + _out << nl << "throw opEx__;"; _out << eb; _out << eb; } @@ -4118,7 +4109,7 @@ Slice::Gen::DispatcherVisitor::visitClassDefStart(const ClassDefPtr& p) string name = p->name(); - _out << sp << nl << "public abstract class _" << name << "Disp : Ice.ObjectImpl, " << fixId(name); + _out << sp << nl << "public abstract class " << name << "Disp_ : Ice.ObjectImpl, " << fixId(name); _out << sb; OperationList ops = p->operations(); @@ -4162,7 +4153,7 @@ Slice::Gen::DispatcherVisitor::visitClassDefStart(const ClassDefPtr& p) _out << sp << nl << "public abstract " << typeToString(ret) << " " << name << spar << params; if(!p->isLocal()) { - _out << "Ice.Current __current"; + _out << "Ice.Current current__"; } _out << epar << ';'; } @@ -4279,12 +4270,12 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p) _out << sp; _out << nl << "public abstract void ice_response" << spar << params << epar << ';'; - _out << sp << nl << "public void __invoke" << spar << "Ice.ObjectPrx __prx" - << paramsInvoke << "Ice.Context __ctx" << epar; + _out << sp << nl << "public void invoke__" << spar << "Ice.ObjectPrx prx__" + << paramsInvoke << "Ice.Context ctx__" << epar; _out << sb; _out << nl << "try"; _out << sb; - _out << nl << "__prepare(__prx, \"" << name << "\", " << sliceModeToIceMode(p) << ", __ctx);"; + _out << nl << "prepare__(prx__, \"" << name << "\", " << sliceModeToIceMode(p) << ", ctx__);"; for(q = inParams.begin(); q != inParams.end(); ++q) { string typeS = typeToString(q->first); @@ -4292,19 +4283,19 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p) } if(p->sendsClasses()) { - _out << nl << "__os.writePendingObjects();"; + _out << nl << "os__.writePendingObjects();"; } - _out << nl << "__os.endWriteEncaps();"; + _out << nl << "os__.endWriteEncaps();"; _out << eb; - _out << nl << "catch(Ice.LocalException __ex)"; + _out << nl << "catch(Ice.LocalException ex__)"; _out << sb; - _out << nl << "__finished(__ex);"; + _out << nl << "finished__(ex__);"; _out << nl << "return;"; _out << eb; - _out << nl << "__send();"; + _out << nl << "send__();"; _out << eb; - _out << sp << nl << "protected override void __response(bool __ok)"; + _out << sp << nl << "protected override void response__(bool ok__)"; _out << sb; for(q = outParams.begin(); q != outParams.end(); ++q) { @@ -4312,21 +4303,21 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p) } if(ret) { - _out << nl << retS << " __ret;"; + _out << nl << retS << " ret__;"; } _out << nl << "try"; _out << sb; - _out << nl << "if(!__ok)"; + _out << nl << "if(!ok__)"; _out << sb; _out << nl << "try"; _out << sb; - _out << nl << "__is.throwException();"; + _out << nl << "is__.throwException();"; _out << eb; for(ExceptionList::const_iterator r = throws.begin(); r != throws.end(); ++r) { - _out << nl << "catch(" << fixId((*r)->scoped()) << " __ex)"; + _out << nl << "catch(" << fixId((*r)->scoped()) << " ex__)"; _out << sb; - _out << nl << "throw __ex;"; + _out << nl << "throw ex__;"; _out << eb; } _out << nl << "catch(Ice.UserException)"; @@ -4340,11 +4331,11 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p) } if(ret) { - writeMarshalUnmarshalCode(_out, ret, "__ret", false, false, true); + writeMarshalUnmarshalCode(_out, ret, "ret__", false, false, true); } if(p->returnsClasses()) { - _out << nl << "__is.readPendingObjects();"; + _out << nl << "is__.readPendingObjects();"; } for(q = outParams.begin(); q != outParams.end(); ++q) { @@ -4361,7 +4352,7 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p) bool patchStruct = st && !st->hasMetaData("clr:class") && st->classDataMembers().size() != 0; if(patchStruct) { - _out << nl << param << ".__patch();"; + _out << nl << param << ".patch__();"; } } } @@ -4371,7 +4362,7 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p) if((builtin && builtin->kind() == Builtin::KindObject) || ClassDeclPtr::dynamicCast(ret)) { string type = typeToString(ret); - _out << nl << "__ret = (" << retS << ")__ret_PP.value;"; + _out << nl << "ret__ = (" << retS << ")ret___PP.value;"; } else { @@ -4379,21 +4370,21 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p) bool patchStruct = st && !st->hasMetaData("clr:class") && st->classDataMembers().size() != 0; if(patchStruct) { - _out << nl << "__ret.__patch();"; + _out << nl << "ret__.patch__();"; } } } _out << eb; - _out << nl << "catch(Ice.LocalException __ex)"; + _out << nl << "catch(Ice.LocalException ex__)"; _out << sb; - _out << nl << "__finished(__ex);"; + _out << nl << "finished__(ex__);"; _out << nl << "return;"; _out << eb; if(!throws.empty()) { - _out << nl << "catch(Ice.UserException __ex)"; + _out << nl << "catch(Ice.UserException ex__)"; _out << sb; - _out << nl << "ice_exception(__ex);"; + _out << nl << "ice_exception(ex__);"; _out << nl << "return;"; _out << eb; } @@ -4458,7 +4449,7 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p) { _out << nl << "try"; _out << sb; - _out << nl << "IceInternal.BasicStream __os = this.__os();"; + _out << nl << "IceInternal.BasicStream os__ = this.os__();"; for(q = outParams.begin(); q != outParams.end(); ++q) { string typeS = typeToString(q->first); @@ -4467,26 +4458,26 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p) if(ret) { string retS = typeToString(ret); - writeMarshalUnmarshalCode(_out, ret, "__ret", true, false, false); + writeMarshalUnmarshalCode(_out, ret, "ret__", true, false, false); } if(p->returnsClasses()) { - _out << nl << "__os.writePendingObjects();"; + _out << nl << "os__.writePendingObjects();"; } _out << eb; - _out << nl << "catch(Ice.LocalException __ex)"; + _out << nl << "catch(Ice.LocalException ex__)"; _out << sb; - _out << nl << "ice_exception(__ex);"; + _out << nl << "ice_exception(ex__);"; _out << eb; } - _out << nl << "__response(true);"; + _out << nl << "response__(true);"; _out << eb; _out << sp << nl << "public void ice_exception(_System.Exception ex)"; _out << sb; if(throws.empty()) { - _out << nl << "__exception(ex);"; + _out << nl << "exception__(ex);"; } else { @@ -4498,15 +4489,15 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p) for(r = throws.begin(); r != throws.end(); ++r) { string exS = fixId((*r)->scoped()); - _out << nl << "catch(" << exS << " __ex)"; + _out << nl << "catch(" << exS << " ex__)"; _out << sb; - _out << nl << "__os().writeUserException(__ex);"; - _out << nl << "__response(false);"; + _out << nl << "os__().writeUserException(ex__);"; + _out << nl << "response__(false);"; _out << eb; } - _out << nl << "catch(_System.Exception __ex)"; + _out << nl << "catch(_System.Exception ex__)"; _out << sb; - _out << nl << "__exception(__ex);"; + _out << nl << "exception__(ex__);"; _out << eb; } _out << eb; @@ -4555,7 +4546,7 @@ Slice::Gen::TieVisitor::visitClassDefStart(const ClassDefPtr& p) opIntfName += "NC"; } - _out << sp << nl << "public class _" << name << "Tie : "; + _out << sp << nl << "public class " << name << "Tie_ : "; if(p->isInterface()) { if(p->isLocal()) @@ -4564,7 +4555,7 @@ Slice::Gen::TieVisitor::visitClassDefStart(const ClassDefPtr& p) } else { - _out << '_' << name << "Disp, Ice.TieBase"; + _out << name << "Disp_, Ice.TieBase"; } } else @@ -4573,11 +4564,11 @@ Slice::Gen::TieVisitor::visitClassDefStart(const ClassDefPtr& p) } _out << sb; - _out << sp << nl << "public _" << name << "Tie()"; + _out << sp << nl << "public " << name << "Tie_()"; _out << sb; _out << eb; - _out << sp << nl << "public _" << name << "Tie(_" << name << opIntfName << " del)"; + _out << sp << nl << "public " << name << "Tie_(" << name << opIntfName << "_ del)"; _out << sb; _out << nl << "_ice_delegate = del;"; _out << eb; @@ -4589,7 +4580,7 @@ Slice::Gen::TieVisitor::visitClassDefStart(const ClassDefPtr& p) _out << sp << nl << "public void ice_delegate(object del)"; _out << sb; - _out << nl << "_ice_delegate = (_" << name << opIntfName << ")del;"; + _out << nl << "_ice_delegate = (" << name << opIntfName << "_)del;"; _out << eb; _out << sp << nl << "public "; @@ -4614,15 +4605,15 @@ Slice::Gen::TieVisitor::visitClassDefStart(const ClassDefPtr& p) _out << sb; _out << nl << "return true;"; _out << eb; - _out << nl << "if(!(rhs is _" << name << "Tie))"; + _out << nl << "if(!(rhs is " << name << "Tie_))"; _out << sb; _out << nl << "return false;"; _out << eb; _out << nl << "if(_ice_delegate == null)"; _out << sb; - _out << nl << "return ((_" << name << "Tie)rhs)._ice_delegate == null;"; + _out << nl << "return ((" << name << "Tie_)rhs)._ice_delegate == null;"; _out << eb; - _out << nl << "return _ice_delegate.Equals(((_" << name << "Tie)rhs)._ice_delegate);"; + _out << nl << "return _ice_delegate.Equals(((" << name << "Tie_)rhs)._ice_delegate);"; _out << eb; OperationList ops = p->operations(); @@ -4656,7 +4647,7 @@ Slice::Gen::TieVisitor::visitClassDefStart(const ClassDefPtr& p) _out << (hasAMD ? "void" : retS) << ' ' << opName << spar << params; if(!p->isLocal()) { - _out << "Ice.Current __current"; + _out << "Ice.Current current__"; } _out << epar; _out << sb; @@ -4668,7 +4659,7 @@ Slice::Gen::TieVisitor::visitClassDefStart(const ClassDefPtr& p) _out << "_ice_delegate." << opName << spar << args; if(!p->isLocal()) { - _out << "__current"; + _out << "current__"; } _out << epar << ';'; _out << eb; @@ -4681,7 +4672,7 @@ Slice::Gen::TieVisitor::visitClassDefStart(const ClassDefPtr& p) writeInheritedOperationsWithOpNames(*i, opNames); } - _out << sp << nl << "private _" << name << opIntfName << " _ice_delegate;"; + _out << sp << nl << "private " << name << opIntfName << "_ _ice_delegate;"; return true; } @@ -4731,7 +4722,7 @@ Slice::Gen::TieVisitor::writeInheritedOperationsWithOpNames(const ClassDefPtr& p _out << (hasAMD ? "void" : retS) << ' ' << opName << spar << params; if(!p->isLocal()) { - _out << "Ice.Current __current"; + _out << "Ice.Current current__"; } _out << epar; _out << sb; @@ -4743,7 +4734,7 @@ Slice::Gen::TieVisitor::writeInheritedOperationsWithOpNames(const ClassDefPtr& p _out << "_ice_delegate." << opName << spar << args; if(!p->isLocal()) { - _out << "__current"; + _out << "current__"; } _out << epar << ';'; _out << eb; @@ -4789,7 +4780,7 @@ Slice::Gen::BaseImplVisitor::writeOperation(const OperationPtr& op, bool comment { _out << "override "; } - _out << "void " << opName << "_async" << spar << pDecl << "Ice.Current __current" << epar; + _out << "void " << opName << "_async" << spar << pDecl << "Ice.Current current__" << epar; if(comment) { @@ -4800,7 +4791,7 @@ Slice::Gen::BaseImplVisitor::writeOperation(const OperationPtr& op, bool comment _out << sb; if(ret) { - _out << nl << typeToString(ret) << " __ret = " << writeValue(ret) << ';'; + _out << nl << typeToString(ret) << " ret__ = " << writeValue(ret) << ';'; } for(i = params.begin(); i != params.end(); ++i) { @@ -4811,10 +4802,10 @@ Slice::Gen::BaseImplVisitor::writeOperation(const OperationPtr& op, bool comment _out << nl << typeToString(type) << ' ' << name << " = " << writeValue(type) << ';'; } } - _out << nl << "__cb.ice_response" << spar; + _out << nl << "cb__.ice_response" << spar; if(ret) { - _out << "__ret"; + _out << "ret__"; } for(i = params.begin(); i != params.end(); ++i) { @@ -4838,7 +4829,7 @@ Slice::Gen::BaseImplVisitor::writeOperation(const OperationPtr& op, bool comment _out << retS << ' ' << fixId(opName, DotNet::ICloneable, true) << spar << pDecls; if(!cl->isLocal()) { - _out << "Ice.Current __current"; + _out << "Ice.Current current__"; } _out << epar; if(comment) @@ -4964,7 +4955,7 @@ Slice::Gen::ImplVisitor::visitClassDefStart(const ClassDefPtr& p) } else { - _out << " : _" << name << "Disp"; + _out << " : " << name << "Disp_"; } } else @@ -5046,11 +5037,12 @@ Slice::Gen::ImplTieVisitor::visitClassDefStart(const ClassDefPtr& p) } _out << ", "; } - _out << '_' << name << "Operations"; + _out << name << "Operations"; if(p->isLocal()) { _out << "NC"; } + _out << '_'; _out << sb; _out << nl << "public " << name << "I()"; diff --git a/cpp/src/slice2vb/Gen.cpp b/cpp/src/slice2vb/Gen.cpp index dac5a51e307..2bdd310e052 100755 --- a/cpp/src/slice2vb/Gen.cpp +++ b/cpp/src/slice2vb/Gen.cpp @@ -116,8 +116,8 @@ Slice::VbVisitor::writeInheritedOperations(const ClassDefPtr& p) { _out << " As " << retS; } - _out << " Implements " << fixId(containingClass->scope()) << "_" << containingClass->name() - << "OperationsNC." << fixId(name, DotNet::ICloneable, true); + _out << " Implements " << fixId(containingClass->scoped() + "OperationsNC_.") + << fixId(name, DotNet::ICloneable, true); _out.inc(); _out << nl; if((*op)->returnType()) @@ -133,15 +133,15 @@ Slice::VbVisitor::writeInheritedOperations(const ClassDefPtr& p) << spar << params; if(!containingClass->isLocal()) { - _out << "ByVal __current As Ice.Current"; + _out << "ByVal current__ As Ice.Current"; } _out << epar; if(ret) { _out << " As " << retS; } - _out << " Implements " << fixId(containingClass->scope()) << "_" << containingClass->name() - << "Operations." << fixId(name, DotNet::ICloneable, true); + _out << " Implements " << fixId(containingClass->scoped() + "Operations_.") + << fixId(name, DotNet::ICloneable, true); } else { @@ -149,17 +149,17 @@ Slice::VbVisitor::writeInheritedOperations(const ClassDefPtr& p) vector<string> args = getArgsAsync(*op); _out << sp << nl << "Public Sub " << ' ' << name << "_async" << spar << params << epar - << " Implements " << fixId(containingClass->scope()) << "_" << containingClass->name() - << "OperationsNC." << name << "_async"; + << " Implements " << fixId(containingClass->scoped() + "OperationsNC_.") + << name << "_async"; _out.inc(); _out << nl << name << "_async" << spar << args << epar; _out.dec(); _out << nl << "End Sub"; _out << sp << nl << "Public MustOverride Sub " << name << "_async" - << spar << params << "ByVal __current As Ice.Current" << epar - << " Implements " << fixId(containingClass->scope()) << "_" << containingClass->name() - << "Operations." << name << "_async"; + << spar << params << "ByVal current__ As Ice.Current" << epar + << " Implements " << fixId(containingClass->scoped() + "Operations_.") + << name << "_async"; } } @@ -214,7 +214,7 @@ Slice::VbVisitor::writeDispatch(const ClassDefPtr& p) _out << sp << nl << "#Region \"Slice type-related members\""; _out.restoreIndent(); - _out << sp << nl << "Public Shared Shadows __ids As String() = New String() _"; + _out << sp << nl << "Public Shared Shadows ids__ As String() = New String() _"; _out.inc(); _out << nl << "{ _"; _out.inc(); @@ -235,44 +235,44 @@ Slice::VbVisitor::writeDispatch(const ClassDefPtr& p) _out << sp << nl << "Public Overloads Overrides Function ice_isA(ByVal s As String) As Boolean"; _out.inc(); - _out << nl << "Return _System.Array.BinarySearch(__ids, s, _System.Collections.Comparer.DefaultInvariant) >= 0"; + _out << nl << "Return _System.Array.BinarySearch(ids__, s, _System.Collections.Comparer.DefaultInvariant) >= 0"; _out.dec(); _out << nl << "End Function"; - _out << sp << nl << "Public Overloads Overrides Function ice_isA(ByVal s As String, Byval __current As Ice.Current)" + _out << sp << nl << "Public Overloads Overrides Function ice_isA(ByVal s As String, Byval current__ As Ice.Current)" " As Boolean"; _out.inc(); - _out << nl << "Return _System.Array.BinarySearch(__ids, s, _System.Collections.Comparer.DefaultInvariant) >= 0"; + _out << nl << "Return _System.Array.BinarySearch(ids__, s, _System.Collections.Comparer.DefaultInvariant) >= 0"; _out.dec(); _out << nl << "End Function"; _out << sp << nl << "Public Overloads Overrides Function ice_ids() As String()"; _out.inc(); - _out << nl << "Return __ids"; + _out << nl << "Return ids__"; _out.dec(); _out << nl << "End Function"; - _out << sp << nl << "Public Overloads Overrides Function ice_ids(ByVal __current As Ice.Current) As String()"; + _out << sp << nl << "Public Overloads Overrides Function ice_ids(ByVal current__ As Ice.Current) As String()"; _out.inc(); - _out << nl << "Return __ids"; + _out << nl << "Return ids__"; _out.dec(); _out << nl << "End Function"; _out << sp << nl << "Public Overloads Overrides Function ice_id() As String"; _out.inc(); - _out << nl << "Return __ids(" << scopedPos << ")"; + _out << nl << "Return ids__(" << scopedPos << ")"; _out.dec(); _out << nl << "End Function"; - _out << sp << nl << "Public Overloads Overrides Function ice_id(ByVal __current As Ice.Current) As String"; + _out << sp << nl << "Public Overloads Overrides Function ice_id(ByVal current__ As Ice.Current) As String"; _out.inc(); - _out << nl << "Return __ids(" << scopedPos << ")"; + _out << nl << "Return ids__(" << scopedPos << ")"; _out.dec(); _out << nl << "End Function"; _out << sp << nl << "Public Overloads Shared Function ice_staticId() As String"; _out.inc(); - _out << nl << "Return __ids(" << scopedPos << ")"; + _out << nl << "Return ids__(" << scopedPos << ")"; _out.dec(); _out << nl << "End Function"; @@ -297,12 +297,12 @@ Slice::VbVisitor::writeDispatch(const ClassDefPtr& p) assert(cl); string opName = op->name(); - _out << sp << nl << "Public Shared Function ___" << opName << "( _"; + _out << sp << nl << "Public Shared Function "<< opName << "___( _"; _out.inc(); _out.inc(); - _out << nl << "ByVal __obj As _" << p->name() << "Operations, _"; - _out << nl << "ByVal __inS As IceInternal.Incoming, _"; - _out << nl << "ByVal __current As Ice.Current) As IceInternal.DispatchStatus"; + _out << nl << "ByVal obj__ As " << p->name() << "Operations_, _"; + _out << nl << "ByVal inS__ As IceInternal.Incoming, _"; + _out << nl << "ByVal current__ As Ice.Current) As IceInternal.DispatchStatus"; _out.dec(); bool amd = p->hasMetaData("amd") || op->hasMetaData("amd"); @@ -342,14 +342,14 @@ Slice::VbVisitor::writeDispatch(const ClassDefPtr& p) #endif TypeStringList::const_iterator q; - _out << nl << "__checkMode(" << sliceModeToIceMode(op) << ", __current.mode)";
+ _out << nl << "checkMode__(" << sliceModeToIceMode(op) << ", current__.mode)"; if(!inParams.empty()) { - _out << nl << "Dim __is As IceInternal.BasicStream = __inS.istr()"; + _out << nl << "Dim is__ As IceInternal.BasicStream = inS__.istr()"; } if(!outParams.empty() || ret || !throws.empty()) { - _out << nl << "Dim __os As IceInternal.BasicStream = __inS.ostr()"; + _out << nl << "Dim os__ As IceInternal.BasicStream = inS__.ostr()"; } // @@ -370,7 +370,7 @@ Slice::VbVisitor::writeDispatch(const ClassDefPtr& p) } if(op->sendsClasses()) { - _out << nl << "__is.readPendingObjects()"; + _out << nl << "is__.readPendingObjects()"; } for(q = inParams.begin(); q != inParams.end(); ++q) { @@ -378,7 +378,7 @@ Slice::VbVisitor::writeDispatch(const ClassDefPtr& p) bool patchStruct = st && !st->hasMetaData("clr:class") && st->classDataMembers().size() != 0; if(patchStruct) { - _out << nl << fixId(q->second) << ".__patch()"; + _out << nl << fixId(q->second) << ".patch__()"; } } @@ -400,9 +400,9 @@ Slice::VbVisitor::writeDispatch(const ClassDefPtr& p) if(ret) { string retS = typeToString(ret); - _out << "Dim __ret As " << retS << " = "; + _out << "Dim ret__ As " << retS << " = "; } - _out << "__obj." << fixId(opName, DotNet::ICloneable, true) << spar; + _out << "obj__." << fixId(opName, DotNet::ICloneable, true) << spar; for(q = inParams.begin(); q != inParams.end(); ++q) { BuiltinPtr builtin = BuiltinPtr::dynamicCast(q->first); @@ -422,7 +422,7 @@ Slice::VbVisitor::writeDispatch(const ClassDefPtr& p) { _out << fixId(q->second); } - _out << "__current" << epar; + _out << "current__" << epar; // // Marshal 'out' parameters and return value. @@ -433,11 +433,11 @@ Slice::VbVisitor::writeDispatch(const ClassDefPtr& p) } if(ret) { - writeMarshalUnmarshalCode(_out, ret, "__ret", true, false, true, ""); + writeMarshalUnmarshalCode(_out, ret, "ret__", true, false, true, ""); } if(op->returnsClasses()) { - _out << nl << "__os.writePendingObjects()"; + _out << nl << "os__.writePendingObjects()"; } _out << nl << "Return IceInternal.DispatchStatus.DispatchOK"; @@ -453,7 +453,7 @@ Slice::VbVisitor::writeDispatch(const ClassDefPtr& p) string exS = fixId((*t)->scoped()); _out << nl << "Catch ex As " << exS; _out.inc(); - _out << nl << "__os.writeUserException(ex)"; + _out << nl << "os__.writeUserException(ex)"; _out << nl << "Return IceInternal.DispatchStatus.DispatchUserException"; _out.dec(); _out << nl << "End Try"; @@ -476,9 +476,10 @@ Slice::VbVisitor::writeDispatch(const ClassDefPtr& p) } TypeStringList::const_iterator q; - _out << nl << "__checkMode(" << sliceModeToIceMode(op) << ", __current.mode)";
if(!inParams.empty()) + _out << nl << "checkMode__(" << sliceModeToIceMode(op) << ", current__.mode)"; + if(!inParams.empty()) { - _out << nl << "Dim __is As IceInternal.BasicStream = __inS.istr()"; + _out << nl << "Dim is__ As IceInternal.BasicStream = inS__.istr()"; } // @@ -497,7 +498,7 @@ Slice::VbVisitor::writeDispatch(const ClassDefPtr& p) } if(op->sendsClasses()) { - _out << nl << "__is.readPendingObjects()"; + _out << nl << "is__.readPendingObjects()"; } for(q = inParams.begin(); q != inParams.end(); ++q) { @@ -505,7 +506,7 @@ Slice::VbVisitor::writeDispatch(const ClassDefPtr& p) bool patchStruct = st && !st->hasMetaData("clr:class") && st->classDataMembers().size() != 0; if(patchStruct) { - _out << nl << fixId(q->second) << ".__patch()"; + _out << nl << fixId(q->second) << ".patch__()"; } } @@ -513,11 +514,11 @@ Slice::VbVisitor::writeDispatch(const ClassDefPtr& p) // Call on the servant. // string classNameAMD = "AMD_" + p->name(); - _out << nl << "Dim __cb As " << classNameAMD << '_' << op->name() << " = new _" - << classNameAMD << '_' << op->name() << "(__inS)"; + _out << nl << "Dim cb__ As " << classNameAMD << '_' << op->name() << " = new _" + << classNameAMD << '_' << op->name() << "(inS__)"; _out << nl << "Try"; _out.inc(); - _out << nl << "__obj."; + _out << nl << "obj__."; if(amd) { _out << opName << "_async"; @@ -529,7 +530,7 @@ Slice::VbVisitor::writeDispatch(const ClassDefPtr& p) _out << spar; if(amd) { - _out << "__cb"; + _out << "cb__"; } for(q = inParams.begin(); q != inParams.end(); ++q) { @@ -545,11 +546,11 @@ Slice::VbVisitor::writeDispatch(const ClassDefPtr& p) _out << fixId(q->second); } } - _out << "__current" << epar; + _out << "current__" << epar; _out.dec(); _out << nl << "Catch ex As _System.Exception"; _out.inc(); - _out << nl << "__cb.ice_exception(ex)"; + _out << nl << "cb__.ice_exception(ex)"; _out.dec(); _out << nl << "End Try"; _out << nl << "Return IceInternal.DispatchStatus.DispatchAsync"; @@ -590,7 +591,7 @@ Slice::VbVisitor::writeDispatch(const ClassDefPtr& p) StringList::const_iterator q; - _out << sp << nl << "Public Shared Shadows __all As String() = New String() _"; + _out << sp << nl << "Public Shared Shadows all__ As String() = New String() _"; _out.inc(); _out << nl << "{ _"; _out.inc(); @@ -609,14 +610,14 @@ Slice::VbVisitor::writeDispatch(const ClassDefPtr& p) _out << nl << '}'; _out.dec(); - _out << sp << nl << "Public Overloads Overrides Function __dispatch( _"; + _out << sp << nl << "Public Overloads Overrides Function dispatch__( _"; _out.inc(); _out.inc(); - _out << nl << "ByVal __inS As IceInternal.Incoming, _"; - _out << nl << "ByVal __current As Ice.Current) As IceInternal.DispatchStatus"; + _out << nl << "ByVal inS__ As IceInternal.Incoming, _"; + _out << nl << "ByVal current__ As Ice.Current) As IceInternal.DispatchStatus"; _out.dec(); _out << nl << "Dim pos As Integer"; - _out << nl << "pos = _System.Array.BinarySearch(__all, __current.operation, " + _out << nl << "pos = _System.Array.BinarySearch(all__, current__.operation, " << "_System.Collections.Comparer.DefaultInvariant)"; _out << nl << "If pos < 0 Then"; _out.inc(); @@ -634,19 +635,19 @@ Slice::VbVisitor::writeDispatch(const ClassDefPtr& p) _out.inc(); if(opName == "ice_id") { - _out << nl << "Return ___ice_id(Me, __inS, __current)"; + _out << nl << "Return ice_id___(Me, inS__, current__)"; } else if(opName == "ice_ids") { - _out << nl << "Return ___ice_ids(Me, __inS, __current)"; + _out << nl << "Return ice_ids___(Me, inS__, current__)"; } else if(opName == "ice_isA") { - _out << nl << "Return ___ice_isA(Me, __inS, __current)"; + _out << nl << "Return ice_isA___(Me, inS__, current__)"; } else if(opName == "ice_ping") { - _out << nl << "Return ___ice_ping(Me, __inS, __current)"; + _out << nl << "Return ice_ping___(Me, inS__, current__)"; } else { @@ -662,19 +663,16 @@ Slice::VbVisitor::writeDispatch(const ClassDefPtr& p) assert(cl); if(cl->scoped() == p->scoped()) { - _out << nl << "Return ___" << opName << "(Me, __inS, __current)"; + _out << nl << "Return " << opName << "___(Me, inS__, current__)"; } else { string base = cl->scoped(); if(cl->isInterface()) { - string::size_type pos = base.rfind("::"); - assert(pos != string::npos); - base = base.insert(pos + 2, "_"); - base += "Disp"; + base += "Disp_"; } - _out << nl << "Return " << fixId(base) << ".___" << opName << "(Me, __inS, __current)"; + _out << nl << "Return " << fixId(base) << "." << opName << "___(Me, inS__, current__)"; } break; } @@ -737,7 +735,7 @@ Slice::VbVisitor::getParamsAsync(const OperationPtr& op, bool amd) string name = op->name(); ContainerPtr container = op->container(); ClassDefPtr cl = ClassDefPtr::dynamicCast(container); // Get the class containing the op. - string param = "ByVal __cb As "; + string param = "ByVal cb__ As "; string scope = fixId(cl->scope()); param += scope + (amd ? "AMD_" : "AMI_") + cl->name() + "_" + op->name(); params.push_back(param); @@ -762,7 +760,7 @@ Slice::VbVisitor::getParamsAsyncCB(const OperationPtr& op) TypePtr ret = op->returnType(); if(ret) { - params.push_back("ByVal __ret As " + typeToString(ret)); + params.push_back("ByVal ret__ As " + typeToString(ret)); } ParamDeclList paramList = op->parameters(); @@ -796,7 +794,7 @@ Slice::VbVisitor::getArgsAsync(const OperationPtr& op) { vector<string> args; - args.push_back("__cb"); + args.push_back("cb__"); ParamDeclList paramList = op->parameters(); for(ParamDeclList::const_iterator q = paramList.begin(); q != paramList.end(); ++q) @@ -817,7 +815,7 @@ Slice::VbVisitor::getArgsAsyncCB(const OperationPtr& op) TypePtr ret = op->returnType(); if(ret) { - args.push_back("__ret"); + args.push_back("ret__"); } ParamDeclList paramList = op->parameters(); @@ -1139,17 +1137,17 @@ Slice::Gen::TypesVisitor::visitClassDefStart(const ClassDefPtr& p) _out << sp << nl << "Public NotInheritable Class " << p->name() << "Helper"; _out.inc(); - _out << sp << nl << "Public Sub New(ByVal __inS As Ice.InputStream)"; + _out << sp << nl << "Public Sub New(ByVal inS__ As Ice.InputStream)"; _out.inc(); - _out << nl << "_in = __inS"; + _out << nl << "_in = inS__"; _out << nl << "_pp = New IceInternal.ParamPatcher(GetType(" << scoped << "))"; _out.dec(); _out << nl << "End Sub"; - _out << sp << nl << "Public Shared Sub write(ByVal __outS As Ice.OutputStream, ByVal __v As " + _out << sp << nl << "Public Shared Sub write(ByVal outS__ As Ice.OutputStream, ByVal v__ As " << fixId(name) << ')'; _out.inc(); - _out << nl << "__outS.writeObject(__v)"; + _out << nl << "outS__.writeObject(v__)"; _out.dec(); _out << nl << "End Sub"; @@ -1190,12 +1188,12 @@ Slice::Gen::TypesVisitor::visitClassDefStart(const ClassDefPtr& p) { _out << nl << "Inherits Ice.Object"; } - _out << ", _" << p->name(); + _out << ", " << p->name(); if(!p->isLocal()) { - _out << "Operations, _" << p->name(); + _out << "Operations_, " << p->name(); } - _out << "OperationsNC"; + _out << "OperationsNC_"; if(!bases.empty()) { ClassList::const_iterator q = bases.begin(); @@ -1234,12 +1232,12 @@ Slice::Gen::TypesVisitor::visitClassDefStart(const ClassDefPtr& p) } if(p->isAbstract()) { - _out << nl << "Implements _" << p->name(); + _out << nl << "Implements " << p->name(); if(!p->isLocal()) { - _out << "Operations, _" << p->name(); + _out << "Operations_, " << p->name(); } - _out << "OperationsNC"; + _out << "OperationsNC_"; } for(ClassList::const_iterator q = bases.begin(); q != bases.end(); ++q) { @@ -1365,24 +1363,24 @@ Slice::Gen::TypesVisitor::visitClassDefEnd(const ClassDefPtr& p) _out << sp << nl << "#Region \"Marshaling support\""; _out.restoreIndent(); - _out << sp << nl << "Public Overloads Overrides Sub __write(ByVal __os As IceInternal.BasicStream)"; + _out << sp << nl << "Public Overloads Overrides Sub write__(ByVal os__ As IceInternal.BasicStream)"; _out.inc(); - _out << nl << "__os.writeTypeId(ice_staticId())"; - _out << nl << "__os.startWriteSlice()"; + _out << nl << "os__.writeTypeId(ice_staticId())"; + _out << nl << "os__.startWriteSlice()"; for(d = members.begin(); d != members.end(); ++d) { StringList metaData = (*d)->getMetaData(); writeMarshalUnmarshalCode(_out, (*d)->type(), fixId((*d)->name(), DotNet::ICloneable, true), true, false, false); } - _out << nl << "__os.endWriteSlice()"; - _out << nl << "MyBase.__write(__os)"; + _out << nl << "os__.endWriteSlice()"; + _out << nl << "MyBase.write__(os__)"; _out.dec(); _out << nl << "End Sub"; DataMemberList allClassMembers = p->allClassDataMembers(); if(allClassMembers.size() != 0) { - _out << sp << nl << "Public NotInheritable Class __Patcher"; + _out << sp << nl << "Public NotInheritable Class Patcher__"; _out.inc(); _out << nl << "Inherits IceInternal.Patcher"; _out << sp << nl << "Friend Sub New(ByVal instance As Ice.ObjectImpl"; @@ -1417,7 +1415,7 @@ Slice::Gen::TypesVisitor::visitClassDefEnd(const ClassDefPtr& p) } string memberName = fixId((*d)->name(), DotNet::ICloneable, true); string memberType = typeToString((*d)->type()); - _out << nl << "_type = GetType(" << memberType << ')'; + _out << nl << "type_ = GetType(" << memberType << ')'; _out << nl << "_instance." << memberName << " = CType(v, " << memberType << ')'; if(allClassMembers.size() > 1) { @@ -1442,15 +1440,15 @@ Slice::Gen::TypesVisitor::visitClassDefEnd(const ClassDefPtr& p) _out << nl << "End Class"; } - _out << sp << nl << "Public Overloads Overrides Sub __read(ByVal __is As IceInternal.BasicStream, " - "ByVal __rid As Boolean)"; + _out << sp << nl << "Public Overloads Overrides Sub read__(ByVal is__ As IceInternal.BasicStream, " + "ByVal rid__ As Boolean)"; _out.inc(); - _out << nl << "If __rid Then"; + _out << nl << "If rid__ Then"; _out.inc(); - _out << nl << "Dim myId As String = __is.readTypeId()"; + _out << nl << "Dim myId As String = is__.readTypeId()"; _out.dec(); _out << nl << "End If"; - _out << nl << "__is.startReadSlice()"; + _out << nl << "is__.startReadSlice()"; DataMemberList classMembers = p->classDataMembers(); int classMemberCount = static_cast<int>(allClassMembers.size() - classMembers.size()); for(d = members.begin(); d != members.end(); ++d) @@ -1470,8 +1468,8 @@ Slice::Gen::TypesVisitor::visitClassDefEnd(const ClassDefPtr& p) fixId((*d)->name(), DotNet::ICloneable, true), false, false, false, patchParams.str()); } - _out << nl << "__is.endReadSlice()"; - _out << nl << "MyBase.__read(__is, true)"; + _out << nl << "is__.endReadSlice()"; + _out << nl << "MyBase.read__(is__, true)"; _out.dec(); _out << nl << "End Sub"; @@ -1480,10 +1478,10 @@ Slice::Gen::TypesVisitor::visitClassDefEnd(const ClassDefPtr& p) // if(_stream) { - _out << sp << nl << "Public Overloads Overrides Sub __write(ByVal __outS As Ice.OutputStream)"; + _out << sp << nl << "Public Overloads Overrides Sub write__(ByVal outS__ As Ice.OutputStream)"; _out.inc(); - _out << nl << "__outS.writeTypeId(ice_staticId())"; - _out << nl << "__outS.startSlice()"; + _out << nl << "outS__.writeTypeId(ice_staticId())"; + _out << nl << "outS__.startSlice()"; for(d = members.begin(); d != members.end(); ++d) { StringList metaData = (*d)->getMetaData(); @@ -1491,20 +1489,20 @@ Slice::Gen::TypesVisitor::visitClassDefEnd(const ClassDefPtr& p) fixId((*d)->name(), DotNet::ICloneable, true), true, true, false); } - _out << nl << "__outS.endSlice()"; - _out << nl << "MyBase.__write(__outS)"; + _out << nl << "outS__.endSlice()"; + _out << nl << "MyBase.write__(outS__)"; _out.dec(); _out << nl << "End Sub"; - _out << sp << nl << "Public Overloads Overrides Sub __read" - << "(ByVal __inS As Ice.InputStream, ByVal __rid As Boolean)"; + _out << sp << nl << "Public Overloads Overrides Sub read__" + << "(ByVal inS__ As Ice.InputStream, ByVal rid__ As Boolean)"; _out.inc(); - _out << nl << "If __rid Then"; + _out << nl << "If rid__ Then"; _out.inc(); - _out << nl << "Dim myId As String = __inS.readTypeId()"; + _out << nl << "Dim myId As String = inS__.readTypeId()"; _out.dec(); _out << nl << "End If"; - _out << nl << "__inS.startSlice()"; + _out << nl << "inS__.startSlice()"; for(d = members.begin(); d != members.end(); ++d) { StringList metaData = (*d)->getMetaData(); @@ -1522,8 +1520,8 @@ Slice::Gen::TypesVisitor::visitClassDefEnd(const ClassDefPtr& p) fixId((*d)->name(), DotNet::ICloneable, true), false, true, false, patchParams.str()); } - _out << nl << "__inS.endSlice()"; - _out << nl << "MyBase.__read(__inS, True)"; + _out << nl << "inS__.endSlice()"; + _out << nl << "MyBase.read__(inS__, True)"; _out.dec(); _out << nl << "End Sub"; } @@ -1533,7 +1531,7 @@ Slice::Gen::TypesVisitor::visitClassDefEnd(const ClassDefPtr& p) // Emit placeholder functions to catch errors. // string scoped = p->scoped(); - _out << sp << nl << "Public Overloads Overrides Sub __write(ByVal __outS As Ice.OutputStream)"; + _out << sp << nl << "Public Overloads Overrides Sub write__(ByVal outS__ As Ice.OutputStream)"; _out.inc(); _out << nl << "Dim ex As Ice.MarshalException = New Ice.MarshalException"; _out << nl << "ex.reason = \"type " << scoped.substr(2) << " was not generated with stream support\""; @@ -1541,8 +1539,8 @@ Slice::Gen::TypesVisitor::visitClassDefEnd(const ClassDefPtr& p) _out.dec(); _out << nl << "End Sub"; - _out << sp << nl << "Public Overloads Overrides Sub __read" - << "(ByVal __inS As Ice.InputStream, ByVal __rid As Boolean)"; + _out << sp << nl << "Public Overloads Overrides Sub read__" + << "(ByVal inS__ As Ice.InputStream, ByVal rid__ As Boolean)"; _out.inc(); _out << nl << "Dim ex As Ice.MarshalException = New Ice.MarshalException"; _out << nl << "ex.reason = \"type " << scoped.substr(2) << " was not generated with stream support\""; @@ -1609,7 +1607,7 @@ Slice::Gen::TypesVisitor::visitOperation(const OperationPtr& p) { _out << " As " << retS; } - _out << " Implements _" << classDef->name() << "OperationsNC." << name; + _out << " Implements " << classDef->name() << "OperationsNC_." << name; if(!isLocal) { _out.inc(); @@ -1626,12 +1624,12 @@ Slice::Gen::TypesVisitor::visitOperation(const OperationPtr& p) if(!isLocal) { _out << sp << nl << "Public MustOverride " << vbOp << ' ' << name - << spar << params << "ByVal __current As Ice.Current" << epar; + << spar << params << "ByVal current__ As Ice.Current" << epar; if(ret) { _out << " As " << retS; } - _out << " Implements _" << classDef->name() << "Operations." << name; + _out << " Implements " << classDef->name() << "Operations_." << name; } } @@ -1670,9 +1668,9 @@ Slice::Gen::TypesVisitor::visitSequence(const SequencePtr& p) _out.dec(); _out << nl << "End Sub"; - _out << sp << nl << "Public Sub New(ByVal __a As " << s << "())"; + _out << sp << nl << "Public Sub New(ByVal a__ As " << s << "())"; _out.inc(); - _out << nl << "InnerList.AddRange(__a)"; + _out << nl << "InnerList.AddRange(a__)"; _out.dec(); _out << nl << "End Sub"; @@ -1682,30 +1680,30 @@ Slice::Gen::TypesVisitor::visitSequence(const SequencePtr& p) _out << sp << nl << "#Region \"Array copy and conversion\""; _out.restoreIndent(); - _out << sp << nl << "Public Sub CopyTo(ByVal __a As " << s << "())"; + _out << sp << nl << "Public Sub CopyTo(ByVal a__ As " << s << "())"; _out.inc(); - _out << nl << "InnerList.CopyTo(__a)"; + _out << nl << "InnerList.CopyTo(a__)"; _out.dec(); _out << nl << "End Sub"; - _out << sp << nl << "Public Sub CopyTo(ByVal __a As " << s << "(), ByVal __i As Integer)"; + _out << sp << nl << "Public Sub CopyTo(ByVal a__ As " << s << "(), ByVal i__ As Integer)"; _out.inc(); - _out << nl << "InnerList.CopyTo(__a, __i)"; + _out << nl << "InnerList.CopyTo(a__, i__)"; _out.dec(); _out << nl << "End Sub"; - _out << sp << nl << "Public Sub CopyTo(ByVal __i As Integer, ByVal __a As " << s << "(), " - "ByVal __ai As Integer, ByVal __c As Integer)"; + _out << sp << nl << "Public Sub CopyTo(ByVal i__ As Integer, ByVal a__ As " << s << "(), " + "ByVal ai__ As Integer, ByVal c__ As Integer)"; _out.inc(); - _out << nl << "InnerList.CopyTo(__i, __a, __ai, __c)"; + _out << nl << "InnerList.CopyTo(i__, a__, ai__, c__)"; _out.dec(); _out << nl << "End Sub"; _out << sp << nl << "Public Function ToArray() As " << s << "()"; _out.inc(); - _out << nl << "Dim __a As " << s << "() = New " << toArrayAlloc(s + "()", "InnerList.Count - 1") << " {}"; - _out << nl << "InnerList.CopyTo(__a)"; - _out << nl << "Return __a"; + _out << nl << "Dim a__ As " << s << "() = New " << toArrayAlloc(s + "()", "InnerList.Count - 1") << " {}"; + _out << nl << "InnerList.CopyTo(a__)"; + _out << nl << "Return a__"; _out.dec(); _out << nl << "End Function"; @@ -1715,15 +1713,15 @@ Slice::Gen::TypesVisitor::visitSequence(const SequencePtr& p) _out << sp << nl << "#Region \"AddRange members\""; _out.restoreIndent(); - _out << sp << nl << "Public Sub AddRange(ByVal __s As " << name << ')'; + _out << sp << nl << "Public Sub AddRange(ByVal s__ As " << name << ')'; _out.inc(); - _out << nl << "InnerList.AddRange(__s)"; + _out << nl << "InnerList.AddRange(s__)"; _out.dec(); _out << nl << "End Sub"; - _out << sp << nl << "Public Sub AddRange(ByVal __a As " << s << "())"; + _out << sp << nl << "Public Sub AddRange(ByVal a__ As " << s << "())"; _out.inc(); - _out << nl << "InnerList.AddRange(__a)"; + _out << nl << "InnerList.AddRange(a__)"; _out.dec(); _out << nl << "End Sub"; @@ -1896,17 +1894,17 @@ Slice::Gen::TypesVisitor::visitSequence(const SequencePtr& p) _out << nl << "Return False"; _out.dec(); _out << nl << "End If"; - _out << nl << "For __i As Integer = 0 To Count - 1"; + _out << nl << "For i__ As Integer = 0 To Count - 1"; _out.inc(); if(!isValue) { - _out << nl << "If InnerList(__i) Is Nothing And Not CType(other, " << name << ")(__i) Is Nothing Then"; + _out << nl << "If InnerList(i__) Is Nothing And Not CType(other, " << name << ")(i__) Is Nothing Then"; _out.inc(); _out << nl << "Return False"; _out.dec(); _out << nl << "End If"; } - _out << nl << "If Not CType(InnerList(__i), Integer).Equals(CType(other, " << name << ")(__i)) Then"; + _out << nl << "If Not CType(InnerList(i__), Integer).Equals(CType(other, " << name << ")(i__)) Then"; _out.inc(); _out << nl << "Return False"; _out.dec(); @@ -1923,16 +1921,16 @@ Slice::Gen::TypesVisitor::visitSequence(const SequencePtr& p) _out << sp << nl << "#Region \"Shared Equals\""; _out.restoreIndent(); - _out << sp << nl << "Public Overloads Shared Function Equals(ByVal __lhs As " << name - << ", ByVal __rhs As " << name << ") As Boolean"; + _out << sp << nl << "Public Overloads Shared Function Equals(ByVal lhs__ As " << name + << ", ByVal rhs__ As " << name << ") As Boolean"; _out.inc(); - _out << nl << "If Object.ReferenceEquals(__rhs, Nothing) Then"; + _out << nl << "If Object.ReferenceEquals(rhs__, Nothing) Then"; _out.inc(); - _out << nl << "Return Object.ReferenceEquals(__rhs, Nothing)"; + _out << nl << "Return Object.ReferenceEquals(rhs__, Nothing)"; _out.dec(); _out << nl << "Else"; _out.inc(); - _out << nl << "Return __lhs.Equals(__rhs)"; + _out << nl << "Return lhs__.Equals(rhs__)"; _out.dec(); _out << nl << "End If"; _out.dec(); @@ -2002,21 +2000,21 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) _out.dec(); _out << nl << "End Sub"; - _out << sp << nl << "Public Sub New(ByVal __m As String)"; + _out << sp << nl << "Public Sub New(ByVal m__ As String)"; _out.inc(); - _out << nl << "MyBase.New(__m)"; + _out << nl << "MyBase.New(m__)"; _out.dec(); _out << nl << "End Sub"; - _out << sp << nl << "Public Sub New(ByVal __ex As _System.Exception)"; + _out << sp << nl << "Public Sub New(ByVal ex__ As _System.Exception)"; _out.inc(); - _out << nl << "MyBase.New(_dflt, __ex)"; + _out << nl << "MyBase.New(_dflt, ex__)"; _out.dec(); _out << nl << "End Sub"; - _out << sp << nl << "Public Sub New(ByVal __m As String, ByVal __ex As _System.Exception)"; + _out << sp << nl << "Public Sub New(ByVal m__ As String, ByVal ex__ As _System.Exception)"; _out.inc(); - _out << nl << "MyBase.New(__m, __ex)"; + _out << nl << "MyBase.New(m__, ex__)"; _out.dec(); _out << nl << "End Sub"; @@ -2028,7 +2026,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) _out << sp << nl << "Public Overrides Function GetHashCode() As Integer"; _out.inc(); - _out << nl << "Dim __h As Integer = 0"; + _out << nl << "Dim h__ As Integer = 0"; for(q = dataMembers.begin(); q != dataMembers.end(); ++q) { string memberName = fixId((*q)->name(), DotNet::ApplicationException); @@ -2042,17 +2040,17 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) if(cl && cl->isInterface()) // Bug in VB 7.1: cast should not be necessary. { _out << nl << "' Bug in VB 7.1: cast to Object should not be necessary."; - _out << nl << "__h = 5 * __h + CType(" << memberName << ", Object).GetHashCode()"; + _out << nl << "h__ = 5 * h__ + CType(" << memberName << ", Object).GetHashCode()"; } else if(ProxyPtr::dynamicCast((*q)->type())) { _out << nl << "' Bug in VB 7.1: cast should not be necessary."; - _out << nl << "__h = 5 * __h + CType(" << memberName << ", " + _out << nl << "h__ = 5 * h__ + CType(" << memberName << ", " << typeToString((*q)->type()) << "Helper).GetHashCode()"; } else { - _out << nl << "__h = 5 * __h + " << memberName << ".GetHashCode()"; + _out << nl << "h__ = 5 * h__ + " << memberName << ".GetHashCode()"; } if(!isValue) { @@ -2060,26 +2058,26 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) _out << nl << "End If"; } } - _out << nl << "Return __h"; + _out << nl << "Return h__"; _out.dec(); _out << nl << "End Function"; - _out << sp << nl << "Public Overloads Overrides Function Equals(ByVal __other As Object) As Boolean"; + _out << sp << nl << "Public Overloads Overrides Function Equals(ByVal other__ As Object) As Boolean"; _out.inc(); - _out << nl << "If __other Is Nothing Then"; + _out << nl << "If other__ Is Nothing Then"; _out.inc(); _out << nl << "Return False"; _out.dec(); _out << nl << "End If"; - _out << nl << "If Object.ReferenceEquals(Me, __other) Then"; + _out << nl << "If Object.ReferenceEquals(Me, other__) Then"; _out.inc(); _out << nl << "Return True"; _out.dec(); _out << nl << "End If"; - _out << nl << "If Not TypeOf __other Is " << name << " Then"; + _out << nl << "If Not TypeOf other__ Is " << name << " Then"; _out.inc(); _out << nl << "Throw New _System.ArgumentException(\"expected argument of type `" << p->name() - << "'\", \"__other\")"; + << "'\", \"other__\")"; _out.dec(); _out << nl << "End If"; for(q = dataMembers.begin(); q != dataMembers.end(); ++q) @@ -2090,18 +2088,18 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) if(cl && cl->isInterface()) // Bug in VB 7.1: cast should not be necessary. { _out << nl << "' Bug in VB 7.1: cast to Object should not be necessary."; - _out << nl << "If Not CType(" << memberName << ", Object).Equals(CType(__other, " + _out << nl << "If Not CType(" << memberName << ", Object).Equals(CType(other__, " << name << ")." << memberName << ") Then"; } else if(ProxyPtr::dynamicCast((*q)->type())) { _out << nl << "' Bug in VB 7.1: cast should not be necessary."; _out << nl << "If Not CType(" << memberName << ", " << typeToString((*q)->type()) - << "Helper).Equals(CType(__other, " << name << ")." << memberName << ") Then"; + << "Helper).Equals(CType(other__, " << name << ")." << memberName << ") Then"; } else { - _out << nl << "If Not " << memberName << ".Equals(CType(__other, " << name << ")." + _out << nl << "If Not " << memberName << ".Equals(CType(other__, " << name << ")." << memberName << ") Then"; } _out.inc(); @@ -2119,17 +2117,17 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) _out << sp << nl << "#Region \"Shared Equals\""; _out.restoreIndent(); - _out << sp << nl << "Public Overloads Shared Function Equals(ByVal __lhs As " << name - << ", ByVal __rhs As " << name << ") As Boolean"; + _out << sp << nl << "Public Overloads Shared Function Equals(ByVal lhs__ As " << name + << ", ByVal rhs__ As " << name << ") As Boolean"; _out.inc(); - _out << nl << "If Object.ReferenceEquals(__rhs, Nothing) Then"; + _out << nl << "If Object.ReferenceEquals(rhs__, Nothing) Then"; _out.inc(); - _out << nl << "Return Object.ReferenceEquals(__rhs, Nothing)"; + _out << nl << "Return Object.ReferenceEquals(rhs__, Nothing)"; _out.dec(); _out << nl << "Else"; _out.inc(); - _out << nl << "Return __lhs.Equals(__rhs)"; + _out << nl << "Return lhs__.Equals(rhs__)"; _out.dec(); _out << nl << "End If"; _out.dec(); @@ -2149,20 +2147,20 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) ExceptionPtr base = p->base(); - _out << sp << nl << "Public Overloads Overrides Sub __write(ByVal __os As IceInternal.BasicStream)"; + _out << sp << nl << "Public Overloads Overrides Sub write__(ByVal os__ As IceInternal.BasicStream)"; _out.inc(); - _out << nl << "__os.writeString(\"" << scoped << "\")"; - _out << nl << "__os.startWriteSlice()"; + _out << nl << "os__.writeString(\"" << scoped << "\")"; + _out << nl << "os__.startWriteSlice()"; for(q = dataMembers.begin(); q != dataMembers.end(); ++q) { writeMarshalUnmarshalCode(_out, (*q)->type(), fixId((*q)->name(), DotNet::ApplicationException), true, false, false); } - _out << nl << "__os.endWriteSlice()"; + _out << nl << "os__.endWriteSlice()"; if(base) { - _out << nl << "MyBase.__write(__os)"; + _out << nl << "MyBase.write__(os__)"; } _out.dec(); _out << nl << "End Sub"; @@ -2170,7 +2168,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) DataMemberList allClassMembers = p->allClassDataMembers(); if(allClassMembers.size() != 0) { - _out << sp << nl << "Public NotInheritable Class __Patcher"; + _out << sp << nl << "Public NotInheritable Class Patcher__"; _out.inc(); _out << nl << "Inherits IceInternal.Patcher"; _out << sp << nl << "Friend Sub New(ByVal instance As Ice.Exception"; @@ -2205,7 +2203,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) } string memberName = fixId((*q)->name(), DotNet::ApplicationException); string memberType = typeToString((*q)->type()); - _out << nl << "_type = GetType(" << memberType << ')'; + _out << nl << "type_ = GetType(" << memberType << ')'; _out << nl << "_instance." << memberName << " = CType(v, " << memberType << ')'; if(allClassMembers.size() > 1) { @@ -2229,15 +2227,15 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) _out.dec(); _out << nl << "End Class"; } - _out << sp << nl << "Public Overloads Overrides Sub __read(ByVal __is As IceInternal.BasicStream, " - "ByVal __rid As Boolean)"; + _out << sp << nl << "Public Overloads Overrides Sub read__(ByVal is__ As IceInternal.BasicStream, " + "ByVal rid__ As Boolean)"; _out.inc(); - _out << nl << "If __rid Then"; + _out << nl << "If rid__ Then"; _out.inc(); - _out << nl << "Dim myId As String = __is.readString()"; + _out << nl << "Dim myId As String = is__.readString()"; _out.dec(); _out << nl << "End If"; - _out << nl << "__is.startReadSlice()"; + _out << nl << "is__.startReadSlice()"; DataMemberList classMembers = p->classDataMembers(); int classMemberCount = static_cast<int>(allClassMembers.size() - classMembers.size()); for(q = dataMembers.begin(); q != dataMembers.end(); ++q) @@ -2256,43 +2254,43 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) fixId((*q)->name(), DotNet::ApplicationException), false, false, false, patchParams.str()); } - _out << nl << "__is.endReadSlice()"; + _out << nl << "is__.endReadSlice()"; if(base) { - _out << nl << "MyBase.__read(__is, true)"; + _out << nl << "MyBase.read__(is__, true)"; } _out.dec(); _out << nl << "End Sub"; if(_stream) { - _out << sp << nl << "Public Overloads Overrides Sub __write(ByVal __outS As Ice.OutputStream)"; + _out << sp << nl << "Public Overloads Overrides Sub write__(ByVal outS__ As Ice.OutputStream)"; _out.inc(); - _out << nl << "__outS.writeString(\"" << scoped << "\")"; - _out << nl << "__outS.startSlice()"; + _out << nl << "outS__.writeString(\"" << scoped << "\")"; + _out << nl << "outS__.startSlice()"; for(q = dataMembers.begin(); q != dataMembers.end(); ++q) { writeMarshalUnmarshalCode(_out, (*q)->type(), fixId((*q)->name(), DotNet::ApplicationException), true, true, false); } - _out << nl << "__outS.endSlice()"; + _out << nl << "outS__.endSlice()"; if(base) { - _out << nl << "MyBase.__write(__outS)"; + _out << nl << "MyBase.write__(outS__)"; } _out.dec(); _out << nl << "End Sub"; - _out << sp << nl << "Public Overloads Overrides Sub __read(ByVal __inS As Ice.InputStream, " - << "ByVal __rid As Boolean)"; + _out << sp << nl << "Public Overloads Overrides Sub read__(ByVal inS__ As Ice.InputStream, " + << "ByVal rid__ As Boolean)"; _out.inc(); - _out << nl << "If __rid Then"; + _out << nl << "If rid__ Then"; _out.inc(); - _out << nl << "Dim myId As String = __inS.readString()"; + _out << nl << "Dim myId As String = inS__.readString()"; _out.dec(); _out << nl << "End If"; - _out << nl << "__inS.startSlice()"; + _out << nl << "inS__.startSlice()"; classMemberCount = static_cast<int>(allClassMembers.size() - classMembers.size()); for(q = dataMembers.begin(); q != dataMembers.end(); ++q) { @@ -2310,10 +2308,10 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) fixId((*q)->name(), DotNet::ApplicationException), false, true, false, patchParams.str()); } - _out << nl << "__inS.endSlice()"; + _out << nl << "inS__.endSlice()"; if(base) { - _out << nl << "MyBase.__read(__inS, true)"; + _out << nl << "MyBase.read__(inS__, true)"; } _out.dec(); _out << nl << "End Sub"; @@ -2324,7 +2322,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) // Emit placeholder functions to catch errors. // string scoped = p->scoped(); - _out << sp << nl << "Public Overloads Overrides Sub __write(ByVal __outS As Ice.OutputStream)"; + _out << sp << nl << "Public Overloads Overrides Sub write__(ByVal outS__ As Ice.OutputStream)"; _out.inc(); _out << nl << "Dim ex As Ice.MarshalException = New Ice.MarshalException"; _out << nl << "ex.reason = \"type " << scoped.substr(2) << " was not generated with stream support\""; @@ -2332,8 +2330,8 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) _out.dec(); _out << nl << "End Sub"; - _out << sp << nl << "Public Overloads Overrides Sub __read" - << "(ByVal __inS As Ice.InputStream, ByVal __rid As Boolean)"; + _out << sp << nl << "Public Overloads Overrides Sub read__" + << "(ByVal inS__ As Ice.InputStream, ByVal rid__ As Boolean)"; _out.inc(); _out << nl << "Dim ex As Ice.MarshalException = New Ice.MarshalException"; _out << nl << "ex.reason = \"type " << scoped.substr(2) << " was not generated with stream support\""; @@ -2344,7 +2342,7 @@ Slice::Gen::TypesVisitor::visitExceptionEnd(const ExceptionPtr& p) if(!base || base && !base->usesClasses()) { - _out << sp << nl << "Public Overrides Function __usesClasses() As Boolean"; + _out << sp << nl << "Public Overrides Function usesClasses__() As Boolean"; _out.inc(); _out << nl << "Return True"; _out.dec(); @@ -2370,17 +2368,17 @@ Slice::Gen::TypesVisitor::visitStructStart(const StructPtr& p) _out << sp << nl << "Public NotInheritable Class " << p->name() << "Helper"; _out.inc(); - _out << sp << nl << "Public Shared Sub write(ByVal __outS As Ice.OutputStream, ByVal __v As " << name << ')'; + _out << sp << nl << "Public Shared Sub write(ByVal outS__ As Ice.OutputStream, ByVal v__ As " << name << ')'; _out.inc(); - _out << nl << "__v.__write(__outS)"; + _out << nl << "v__.write__(outS__)"; _out.dec(); _out << nl << "End Sub"; - _out << sp << nl << "Public Shared Function read(ByVal __inS As Ice.InputStream) As " << name; + _out << sp << nl << "Public Shared Function read(ByVal inS__ As Ice.InputStream) As " << name; _out.inc(); - _out << nl << "Dim __v As " << name << " = New " << name; - _out << nl << "__v.__read(__inS)"; - _out << nl << "Return __v"; + _out << nl << "Dim v__ As " << name << " = New " << name; + _out << nl << "v__.read__(inS__)"; + _out << nl << "Return v__"; _out.dec(); _out << nl << "End Function"; @@ -2454,7 +2452,7 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) bool patchStruct = !isClass && classMembers.size() != 0; if(!p->isLocal() && patchStruct) { - _out << nl << "_pm = Nothing"; + _out << nl << "pm_ = Nothing"; } _out.dec(); _out << nl << "End Sub"; @@ -2486,7 +2484,7 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) _out << sp << nl << "Public Overrides Function GetHashCode() As Integer"; _out.inc(); - _out << nl << "Dim __h As Integer = 0"; + _out << nl << "Dim h__ As Integer = 0"; for(q = dataMembers.begin(); q != dataMembers.end(); ++q) { string memberName = fixId((*q)->name(), isClass ? DotNet::ICloneable : 0); @@ -2500,17 +2498,17 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) if(cl && cl->isInterface()) // Bug in VB 7.1: cast should not be necessary. { _out << nl << "' Bug in VB 7.1: cast to Object should not be necessary."; - _out << nl << "__h = 5 * __h + CType(" << memberName << ", Object).GetHashCode()"; + _out << nl << "h__ = 5 * h__ + CType(" << memberName << ", Object).GetHashCode()"; } else if(ProxyPtr::dynamicCast((*q)->type())) { _out << nl << "' Bug in VB 7.1: cast should not be necessary."; - _out << nl << "__h = 5 * __h + CType(" << memberName << ", " + _out << nl << "h__ = 5 * h__ + CType(" << memberName << ", " << typeToString((*q)->type()) << "Helper).GetHashCode()"; } else { - _out << nl << "__h = 5 * __h + " << memberName << ".GetHashCode()"; + _out << nl << "h__ = 5 * h__ + " << memberName << ".GetHashCode()"; } if(!isValue) { @@ -2518,18 +2516,18 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) _out << nl << "End If"; } } - _out << nl << "Return __h"; + _out << nl << "Return h__"; _out.dec(); _out << nl << "End Function"; - _out << sp << nl << "Public Overloads Overrides Function Equals(ByVal __other As Object) As Boolean"; + _out << sp << nl << "Public Overloads Overrides Function Equals(ByVal other__ As Object) As Boolean"; _out.inc(); - _out << nl << "If Object.ReferenceEquals(Me, __other) Then"; + _out << nl << "If Object.ReferenceEquals(Me, other__) Then"; _out.inc(); _out << nl << "Return True"; _out.dec(); _out << nl << "End If"; - _out << nl << "If Not TypeOf __other Is " << name << " Then"; + _out << nl << "If Not TypeOf other__ Is " << name << " Then"; _out.inc(); _out << nl << "Return False"; _out.dec(); @@ -2541,7 +2539,7 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) { _out << nl << "If " << memberName << " Is Nothing Then"; _out.inc(); - _out << nl << "If Not CType(__other, " << name << ")." << memberName << " Is Nothing Then"; + _out << nl << "If Not CType(other__, " << name << ")." << memberName << " Is Nothing Then"; _out.inc(); _out << nl << "Return False"; _out.dec(); @@ -2553,18 +2551,18 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) if(cl && cl->isInterface()) // Bug in VB 7.1: cast should not be necessary. { _out << nl << "' Bug in VB 7.1: cast to Object should not be necessary."; - _out << nl << "If Not CType(" << memberName << ", Object).Equals(CType(__other, " + _out << nl << "If Not CType(" << memberName << ", Object).Equals(CType(other__, " << name << ")." << memberName << ") Then"; } else if(ProxyPtr::dynamicCast((*q)->type())) { _out << nl << "' Bug in VB 7.1: cast should not be necessary."; _out << nl << "If Not CType(" << memberName << ", " << typeToString((*q)->type()) - << "Helper).Equals(CType(__other, " << name << ")." << memberName << ") Then"; + << "Helper).Equals(CType(other__, " << name << ")." << memberName << ") Then"; } else { - _out << nl << "If Not " << memberName << ".Equals(CType(__other, " << name << ")." + _out << nl << "If Not " << memberName << ".Equals(CType(other__, " << name << ")." << memberName << ") Then"; } _out.inc(); @@ -2576,7 +2574,7 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) } else { - _out << nl << "If Not " << memberName << ".Equals(CType(__other, " << name << ")." + _out << nl << "If Not " << memberName << ".Equals(CType(other__, " << name << ")." << memberName << ") Then"; _out.inc(); _out << nl << "Return False"; @@ -2594,17 +2592,17 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) _out << sp << nl << "#Region \"Shared Equals\""; _out.restoreIndent(); - _out << sp << nl << "Public Overloads Shared Function Equals(ByVal __lhs As " << name - << ", ByVal __rhs As " << name << ") As Boolean"; + _out << sp << nl << "Public Overloads Shared Function Equals(ByVal lhs__ As " << name + << ", ByVal rhs__ As " << name << ") As Boolean"; _out.inc(); - _out << nl << "If Object.ReferenceEquals(__rhs, Nothing) Then"; + _out << nl << "If Object.ReferenceEquals(rhs__, Nothing) Then"; _out.inc(); - _out << nl << "Return Object.ReferenceEquals(__rhs, Nothing)"; + _out << nl << "Return Object.ReferenceEquals(rhs__, Nothing)"; _out.dec(); _out << nl << "Else"; _out.inc(); - _out << nl << "Return __lhs.Equals(__rhs)"; + _out << nl << "Return lhs__.Equals(rhs__)"; _out.dec(); _out << nl << "End If"; _out.dec(); @@ -2620,7 +2618,7 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) _out << sp << nl << "#Region \"Marshalling support\""; _out.restoreIndent(); - _out << sp << nl << "Public Sub __write(ByVal __os As IceInternal.BasicStream)"; + _out << sp << nl << "Public Sub write__(ByVal os__ As IceInternal.BasicStream)"; _out.inc(); for(q = dataMembers.begin(); q != dataMembers.end(); ++q) { @@ -2634,13 +2632,13 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) if(classMembers.size() != 0) { - _out << sp << nl << "Public NotInheritable Class __Patcher"; + _out << sp << nl << "Public NotInheritable Class Patcher__"; _out.inc(); _out << nl << "Inherits IceInternal.Patcher"; _out << sp << nl << "Friend Sub New(ByVal instance As " << name; if(patchStruct) { - _out << ".__PatchMembers"; + _out << ".PatchMembers__"; } if(classMembers.size() > 1) { @@ -2673,7 +2671,7 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) } string memberType = typeToString((*q)->type()); string memberName = fixId((*q)->name(), isClass ? DotNet::ICloneable : 0); - _out << nl << "_type = GetType(" << memberType << ')'; + _out << nl << "type_ = GetType(" << memberType << ')'; _out << nl << "_instance." << memberName << " = CType(v, " << memberType << ')'; if(classMembers.size() > 1) { @@ -2692,7 +2690,7 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) _out << sp << nl << "Private _instance As " << name; if(patchStruct) { - _out << ".__PatchMembers"; + _out << ".PatchMembers__"; } if(classMembers.size() > 1) { @@ -2703,7 +2701,7 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) if(patchStruct) { - _out << sp << nl << "Friend Class __PatchMembers"; + _out << sp << nl << "Friend Class PatchMembers__"; _out.inc(); for(q = classMembers.begin(); q != classMembers.end(); ++q) { @@ -2714,27 +2712,27 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) _out.dec(); _out << nl << "End Class"; - _out << sp << nl << "Private _pm As __PatchMembers"; + _out << sp << nl << "Private pm_ As PatchMembers__"; - _out << sp << nl << "Public Sub __patch()"; + _out << sp << nl << "Public Sub patch__()"; _out.inc(); for(q = classMembers.begin(); q != classMembers.end(); ++q) { string memberName = fixId((*q)->name(), isClass ? DotNet::ICloneable : 0); - _out << nl << memberName << " = _pm." << memberName; + _out << nl << memberName << " = pm_." << memberName; } _out.dec(); _out << nl << "End Sub"; } } - _out << sp << nl << "Public Sub __read(ByVal __is As IceInternal.BasicStream)"; + _out << sp << nl << "Public Sub read__(ByVal is__ As IceInternal.BasicStream)"; _out.inc(); if(patchStruct) { - _out << nl << "If _pm Is Nothing Then"; + _out << nl << "If pm_ Is Nothing Then"; _out.inc(); - _out << nl << "_pm = new __PatchMembers()"; + _out << nl << "pm_ = new PatchMembers__()"; _out.dec(); _out << nl << "End If"; } @@ -2742,7 +2740,7 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) for(q = dataMembers.begin(); q != dataMembers.end(); ++q) { ostringstream patchParams; - patchParams << (patchStruct ? "_pm" : "Me"); + patchParams << (patchStruct ? "pm_" : "Me"); BuiltinPtr builtin = BuiltinPtr::dynamicCast((*q)->type()); if((builtin && builtin->kind() == Builtin::KindObject) || ClassDeclPtr::dynamicCast((*q)->type())) { @@ -2760,7 +2758,7 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) if(_stream) { - _out << sp << nl << "Public Sub __write(ByVal __outS As Ice.OutputStream)"; + _out << sp << nl << "Public Sub write__(ByVal outS__ As Ice.OutputStream)"; _out.inc(); for(q = dataMembers.begin(); q != dataMembers.end(); ++q) { @@ -2771,13 +2769,13 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) _out.dec(); _out << nl << "End Sub"; - _out << sp << nl << "Public Sub __read(ByVal __inS As Ice.InputStream)"; + _out << sp << nl << "Public Sub read__(ByVal inS__ As Ice.InputStream)"; _out.inc(); if(patchStruct) { - _out << nl << "If _pm Is Nothing"; + _out << nl << "If pm_ Is Nothing"; _out.inc(); - _out << nl << "_pm = New __PatchMembers"; + _out << nl << "pm_ = New PatchMembers__"; _out.dec(); _out << nl << "End If"; } @@ -2785,7 +2783,7 @@ Slice::Gen::TypesVisitor::visitStructEnd(const StructPtr& p) for(q = dataMembers.begin(); q != dataMembers.end(); ++q) { ostringstream patchParams; - patchParams << (patchStruct ? "_pm" : "Me"); + patchParams << (patchStruct ? "pm_" : "Me"); BuiltinPtr builtin = BuiltinPtr::dynamicCast((*q)->type()); if((builtin && builtin->kind() == Builtin::KindObject) || ClassDeclPtr::dynamicCast((*q)->type())) { @@ -2830,9 +2828,9 @@ Slice::Gen::TypesVisitor::visitDictionary(const DictionaryPtr& p) _out << sp << nl << "#Region \"" << name << " members\""; _out.restoreIndent(); - _out << sp << nl << "Public Sub AddRange(ByVal __d As " << name << ')'; + _out << sp << nl << "Public Sub AddRange(ByVal d__ As " << name << ')'; _out.inc(); - _out << nl << "For Each e As _System.Collections.DictionaryEntry in __d"; + _out << nl << "For Each e As _System.Collections.DictionaryEntry in d__"; _out.inc(); _out << nl << "Try"; _out.inc(); @@ -3020,15 +3018,15 @@ Slice::Gen::TypesVisitor::visitDictionary(const DictionaryPtr& p) _out << nl << "Return False"; _out.dec(); _out << nl << "End If"; - _out << nl << "Dim __klhs() As " << ks << " = New " << ks << "(Count - 1) {}"; - _out << nl << "Keys.CopyTo(__klhs, 0)"; - _out << nl << "_System.Array.Sort(__klhs)"; - _out << nl << "Dim __krhs() As " << ks << " = New " << ks << "(CType(other, " << name << ").Count - 1) {}"; - _out << nl << "CType(other, " << name << ").Keys.CopyTo(__krhs, 0)"; - _out << nl << "_System.Array.Sort(__krhs)"; + _out << nl << "Dim klhs__() As " << ks << " = New " << ks << "(Count - 1) {}"; + _out << nl << "Keys.CopyTo(klhs__, 0)"; + _out << nl << "_System.Array.Sort(klhs__)"; + _out << nl << "Dim krsh__() As " << ks << " = New " << ks << "(CType(other, " << name << ").Count - 1) {}"; + _out << nl << "CType(other, " << name << ").Keys.CopyTo(krsh__, 0)"; + _out << nl << "_System.Array.Sort(krsh__)"; _out << nl << "For i As Integer = 0 To Count - 1"; _out.inc(); - _out << nl << "If Not __klhs(i).Equals(__krhs(i))"; + _out << nl << "If Not klhs__(i).Equals(krsh__(i))"; _out.inc(); _out << nl << "Return False"; _out.dec(); @@ -3039,30 +3037,30 @@ Slice::Gen::TypesVisitor::visitDictionary(const DictionaryPtr& p) bool valueIsArray = seq && !seq->hasMetaData("clr:collection"); if(valueIsArray) { - _out << nl << "Dim __vlhs As " << vs << "() = New " << toArrayAlloc(vs + "()", "Count - 1") << " {}"; + _out << nl << "Dim vlhs__ As " << vs << "() = New " << toArrayAlloc(vs + "()", "Count - 1") << " {}"; } else { - _out << nl << "Dim __vlhs As " << vs << "() = New " << vs << "(Count - 1) {}"; + _out << nl << "Dim vlhs__ As " << vs << "() = New " << vs << "(Count - 1) {}"; } - _out << nl << "Values.CopyTo(__vlhs, 0)"; - _out << nl << "_System.Array.Sort(__vlhs)"; + _out << nl << "Values.CopyTo(vlhs__, 0)"; + _out << nl << "_System.Array.Sort(vlhs__)"; string vrhsCount = "Ctype(other, " + name + ").Count - 1"; if(valueIsArray) { - _out << nl << "Dim __vrhs As " << vs << "() = New " << toArrayAlloc(vs + "()", vrhsCount) << " {}"; + _out << nl << "Dim vrhs__ As " << vs << "() = New " << toArrayAlloc(vs + "()", vrhsCount) << " {}"; } else { - _out << nl << "Dim __vrhs As " << vs << "() = New " << vs << '(' << vrhsCount << ") {}"; + _out << nl << "Dim vrhs__ As " << vs << "() = New " << vs << '(' << vrhsCount << ") {}"; } - _out << nl << "CType(other, " << name << ").Values.CopyTo(__vrhs, 0)"; - _out << nl << "_System.Array.Sort(__vrhs)"; + _out << nl << "CType(other, " << name << ").Values.CopyTo(vrhs__, 0)"; + _out << nl << "_System.Array.Sort(vrhs__)"; _out << nl << "For i As Integer = 0 To Count - 1"; _out.inc(); if(!valueIsValue) { - _out << nl << "If __vlhs(i) Is Nothing And Not __vrhs(i) Is Nothing"; + _out << nl << "If vlhs__(i) Is Nothing And Not vrhs__(i) Is Nothing"; _out.inc(); _out << nl << "Return False"; _out.dec(); @@ -3072,16 +3070,16 @@ Slice::Gen::TypesVisitor::visitDictionary(const DictionaryPtr& p) if(cl && cl->isInterface()) // Bug in VB 7.1: cast should not be necessary. { _out << nl << "' Bug in VB 7.1: cast to Object should not be necessary."; - _out << nl << "If Not CType(__vlhs(i), Object).Equals(__vrhs(i))"; + _out << nl << "If Not CType(vlhs__(i), Object).Equals(vrhs__(i))"; } else if(ProxyPtr::dynamicCast(p->valueType())) { _out << nl << "' Bug in VB 7.1: cast should not be necessary."; - _out << nl << "If Not CType(__vlhs(i), " << typeToString(p->valueType()) << "Helper).Equals(__vrhs(i))"; + _out << nl << "If Not CType(vlhs__(i), " << typeToString(p->valueType()) << "Helper).Equals(vrhs__(i))"; } else { - _out << nl << "If Not __vlhs(i).Equals(__vrhs(i))"; + _out << nl << "If Not vlhs__(i).Equals(vrhs__(i))"; } _out.inc(); _out << nl << "Return False"; @@ -3099,16 +3097,16 @@ Slice::Gen::TypesVisitor::visitDictionary(const DictionaryPtr& p) _out << sp << nl << "#Region \"Shared Equals\""; _out.restoreIndent(); - _out << sp << nl << "Public Overloads Shared Function Equals(ByVal __lhs As " << name - << ", ByVal __rhs As " << name << ") As Boolean"; + _out << sp << nl << "Public Overloads Shared Function Equals(ByVal lhs__ As " << name + << ", ByVal rhs__ As " << name << ") As Boolean"; _out.inc(); - _out << nl << "If Object.ReferenceEquals(__rhs, Nothing) Then"; + _out << nl << "If Object.ReferenceEquals(rhs__, Nothing) Then"; _out.inc(); - _out << nl << "Return Object.ReferenceEquals(__rhs, Nothing)"; + _out << nl << "Return Object.ReferenceEquals(rhs__, Nothing)"; _out.dec(); _out << nl << "Else"; _out.inc(); - _out << nl << "Return __lhs.Equals(__rhs)"; + _out << nl << "Return lhs__.Equals(rhs__)"; _out.dec(); _out << nl << "End If"; _out.dec(); @@ -3144,17 +3142,17 @@ Slice::Gen::TypesVisitor::visitEnum(const EnumPtr& p) _out << sp << nl << "Public NotInheritable Class " << name << "Helper"; _out.inc(); - _out << sp << nl << "Public Shared Sub write(ByVal __outS As Ice.OutputStream, ByVal __v As " << scoped << ')'; + _out << sp << nl << "Public Shared Sub write(ByVal outS__ As Ice.OutputStream, ByVal v__ As " << scoped << ')'; _out.inc(); - writeMarshalUnmarshalCode(_out, p, "__v", true, true, false); + writeMarshalUnmarshalCode(_out, p, "v__", true, true, false); _out.dec(); _out << nl << "End Sub"; - _out << sp << nl << "Public Shared Function read(ByVal __inS As Ice.InputStream) As " << scoped; + _out << sp << nl << "Public Shared Function read(ByVal inS__ As Ice.InputStream) As " << scoped; _out.inc(); - _out << nl << "Dim __v As " << scoped; - writeMarshalUnmarshalCode(_out, p, "__v", false, true, false); - _out << nl << "Return __v"; + _out << nl << "Dim v__ As " << scoped; + writeMarshalUnmarshalCode(_out, p, "v__", false, true, false); + _out << nl << "Return v__"; _out.dec(); _out << nl << "End Function"; @@ -3391,7 +3389,7 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p) _out << " As " << retS; } - _out << nl << vbOp << ' ' << name << spar << params << "ByVal __context As Ice.Context" << epar; + _out << nl << vbOp << ' ' << name << spar << params << "ByVal context__ As Ice.Context" << epar; if(ret) { _out << " As " << retS; @@ -3408,7 +3406,7 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p) // _out << sp; _out << nl << "Sub " << p->name() << "_async" << spar << paramsAMI << epar; - _out << nl << "Sub " << p->name() << "_async" << spar << paramsAMI << "ByVal __ctx As Ice.Context" << epar; + _out << nl << "Sub " << p->name() << "_async" << spar << paramsAMI << "ByVal ctx__ As Ice.Context" << epar; } } @@ -3469,7 +3467,7 @@ Slice::Gen::OpsVisitor::writeOperations(const ClassDefPtr& p, bool noCurrent) opIntfName += "NC"; } - _out << sp << nl << "Public Interface _" << name << opIntfName; + _out << sp << nl << "Public Interface " << name << opIntfName << '_'; _out.inc(); if((bases.size() == 1 && bases.front()->isAbstract()) || bases.size() > 1) { @@ -3489,14 +3487,12 @@ Slice::Gen::OpsVisitor::writeOperations(const ClassDefPtr& p, bool noCurrent) first = false; } string s = (*q)->scoped(); - string::size_type pos = s.rfind("::"); - assert(pos != string::npos); - s.insert(pos + 2, "_"); s += "Operations"; if(noCurrent) { s += "NC"; } + s += "_"; _out << fixId(s); } ++q; @@ -3531,7 +3527,7 @@ Slice::Gen::OpsVisitor::writeOperations(const ClassDefPtr& p, bool noCurrent) _out << vbOp << ' ' << name << spar << params; if(!noCurrent && !p->isLocal()) { - _out << "ByVal __current As Ice.Current"; + _out << "ByVal current__ As Ice.Current"; } _out << epar; if(ret) @@ -3617,54 +3613,54 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) { _out << "Return "; } - _out << opName << spar << args << "__defaultContext()" << epar; + _out << opName << spar << args << "defaultContext__()" << epar; _out.dec(); _out << nl << "End " << vbOp; _out << sp << nl << "Public " << vbOp << ' ' << opName << spar << params - << "ByVal __context As Ice.Context" << epar; + << "ByVal context__ As Ice.Context" << epar; if(ret) { _out << " As " << retS; } _out << " Implements " << name << "Prx." << opName; // TODO: should be containing class? _out.inc(); - _out << nl << "Dim __cnt As Integer = 0"; + _out << nl << "Dim cnt__ As Integer = 0"; _out << nl << "While True"; _out.inc(); _out << nl << "Try"; _out.inc(); if(op->returnsData()) { - _out << nl << "__checkTwowayOnly(\"" << op->name() << "\")"; + _out << nl << "checkTwowayOnly__(\"" << op->name() << "\")"; } - _out << nl << "Dim __delBase As Ice._ObjectDel = __getDelegate()"; - _out << nl << "Dim __del As _" << name << "Del = CType(__delBase, _" << name << "Del)"; + _out << nl << "Dim delBase__ As Ice.ObjectDel_ = getDelegate__()"; + _out << nl << "Dim del__ As _" << name << "Del = CType(delBase__, _" << name << "Del)"; _out << nl; if(ret) { _out << "Return "; } - _out << "__del." << opName << spar << args << "__context" << epar; + _out << "del__." << opName << spar << args << "context__" << epar; if(!ret) { _out << nl << "Return"; } _out.dec(); - _out << nl << "Catch __ex As IceInternal.NonRepeatable"; + _out << nl << "Catch ex__ As IceInternal.NonRepeatable"; _out.inc(); if(op->mode() == Operation::Idempotent || op->mode() == Operation::Nonmutating) { - _out << nl << "__cnt = __handleException(__ex.get(), __cnt)"; + _out << nl << "cnt__ = handleException__(ex__.get(), cnt__)"; } else { - _out << nl << "__rethrowException(__ex.get())"; + _out << nl << "rethrowException__(ex__.get())"; } _out.dec(); - _out << nl << "Catch __ex As Ice.LocalException"; + _out << nl << "Catch ex__ As Ice.LocalException"; _out.inc(); - _out << nl << "__cnt = __handleException(__ex, __cnt)"; + _out << nl << "cnt__ = handleException__(ex__, cnt__)"; _out.dec(); _out << nl << "End Try"; _out.dec(); @@ -3709,16 +3705,16 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) _out << sp << nl << "Public Sub " << opName << "_async" << spar << paramsAMI << epar << " Implements " << name << "Prx." << opName << "_async"; // TODO: should be containing class? _out.inc(); - _out << nl << opName << "_async" << spar << argsAMI << "__defaultContext()" << epar; + _out << nl << opName << "_async" << spar << argsAMI << "defaultContext__()" << epar; _out.dec(); _out << nl << "End Sub"; _out << sp << nl << "Public Sub " << opName << "_async" << spar << paramsAMI - << "ByVal __ctx As Ice.Context" << epar + << "ByVal ctx__ As Ice.Context" << epar << " Implements " << name << "Prx." << opName << "_async"; // TODO: should be containing class? _out.inc(); - _out << nl << "__checkTwowayOnly(\"" << p->name() << "\")"; - _out << nl << "__cb.__invoke" << spar << "Me" << argsAMI << "__ctx" << epar; + _out << nl << "checkTwowayOnly__(\"" << p->name() << "\")"; + _out << nl << "cb__.invoke__" << spar << "Me" << argsAMI << "ctx__" << epar; _out.dec(); _out << nl << "End Sub"; } @@ -3750,7 +3746,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) _out << nl << "If b.ice_isA(\"" << p->scoped() << "\") Then"; _out.inc(); _out << nl << "Dim h As " << name << "PrxHelper = New " << name << "PrxHelper"; - _out << nl << "h.__copyFrom(b)"; + _out << nl << "h.copyFrom__(b)"; _out << nl << "Return h"; _out.dec(); _out << nl << "End If"; @@ -3774,7 +3770,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) _out << nl << "If b.ice_isA(\"" << p->scoped() << "\", ctx) Then"; _out.inc(); _out << nl << "Dim h As " << name << "PrxHelper = New " << name << "PrxHelper"; - _out << nl << "h.__copyFrom(b)"; + _out << nl << "h.copyFrom__(b)"; _out << nl << "Return h"; _out.dec(); _out << nl << "End If"; @@ -3797,12 +3793,12 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) _out << nl << "If bb.ice_isA(\"" << p->scoped() << "\") Then"; _out.inc(); _out << nl << "Dim h As " << name << "PrxHelper = new " << name << "PrxHelper()"; - _out << nl << "h.__copyFrom(bb)"; + _out << nl << "h.copyFrom__(bb)"; _out << nl << "Return h"; _out.dec(); _out << nl << "End If"; _out.dec(); - _out << nl << "Catch __ex As Ice.FacetNotExistException"; + _out << nl << "Catch ex__ As Ice.FacetNotExistException"; _out << nl << "End Try"; _out << nl << "Return Nothing"; _out.dec(); @@ -3822,12 +3818,12 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) _out << nl << "If bb.ice_isA(\"" << p->scoped() << "\", ctx) Then"; _out.inc(); _out << nl << "Dim h As " << name << "PrxHelper = new " << name << "PrxHelper()"; - _out << nl << "h.__copyFrom(bb)"; + _out << nl << "h.copyFrom__(bb)"; _out << nl << "Return h"; _out.dec(); _out << nl << "End If"; _out.dec(); - _out << nl << "Catch __ex As Ice.FacetNotExistException"; + _out << nl << "Catch ex__ As Ice.FacetNotExistException"; _out << nl << "End Try"; _out << nl << "Return Nothing"; _out.dec(); @@ -3841,7 +3837,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) _out.dec(); _out << nl << "End If"; _out << nl << "Dim h As " << name << "PrxHelper = new " << name << "PrxHelper()"; - _out << nl << "h.__copyFrom(b)"; + _out << nl << "h.copyFrom__(b)"; _out << nl << "Return h"; _out.dec(); _out << nl << "End Function"; @@ -3856,7 +3852,7 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) _out << nl << "End If"; _out << nl << "Dim bb As Ice.ObjectPrx = b.ice_newFacet(f)"; _out << nl << "Dim h As " << name << "PrxHelper = new " << name << "PrxHelper()"; - _out << nl << "h.__copyFrom(bb)"; + _out << nl << "h.copyFrom__(bb)"; _out << nl << "Return h"; _out.dec(); _out << nl << "End Function"; @@ -3867,32 +3863,32 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) _out << sp << nl << "#Region \"Marshaling support\""; _out.restoreIndent(); - _out << sp << nl << "Protected Overrides Function __createDelegateM() As Ice._ObjectDelM"; + _out << sp << nl << "Protected Overrides Function createDelegateM__() As Ice.ObjectDelM_"; _out.inc(); _out << nl << "Return New _" << name << "DelM()"; _out.dec(); _out << nl << "End Function"; - _out << sp << nl << "Protected Overrides Function __createDelegateD() As Ice._ObjectDelD"; + _out << sp << nl << "Protected Overrides Function createDelegateD__() As Ice.ObjectDelD_"; _out.inc(); _out << nl << "Return New _" << name << "DelD()"; _out.dec(); _out << nl << "End Function"; - _out << sp << nl << "Public Shared Sub __write(ByVal __os As IceInternal.BasicStream, ByVal __v As " + _out << sp << nl << "Public Shared Sub write__(ByVal os__ As IceInternal.BasicStream, ByVal v__ As " << name << "Prx)"; _out.inc(); - _out << nl << "__os.writeProxy(__v)"; + _out << nl << "os__.writeProxy(v__)"; _out.dec(); _out << nl << "End Sub"; - _out << sp << nl << "Public Shared Function __read(ByVal __is As IceInternal.BasicStream) As " << name << "Prx"; + _out << sp << nl << "Public Shared Function read__(ByVal is__ As IceInternal.BasicStream) As " << name << "Prx"; _out.inc(); - _out << nl << "Dim proxy As Ice.ObjectPrx = __is.readProxy()"; + _out << nl << "Dim proxy As Ice.ObjectPrx = is__.readProxy()"; _out << nl << "If Not proxy Is Nothing Then"; _out.inc(); _out << nl << "Dim result As " << name << "PrxHelper = New " << name << "PrxHelper"; - _out << nl << "result.__copyFrom(proxy)"; + _out << nl << "result.copyFrom__(proxy)"; _out << nl << "Return result"; _out.dec(); _out << nl << "End If"; @@ -3902,19 +3898,19 @@ Slice::Gen::HelperVisitor::visitClassDefStart(const ClassDefPtr& p) if(_stream) { - _out << sp << nl << "Public Shared Sub write(ByVal __outS As Ice.OutputStream, ByVal __v As " << name << "Prx)"; + _out << sp << nl << "Public Shared Sub write(ByVal outS__ As Ice.OutputStream, ByVal v__ As " << name << "Prx)"; _out.inc(); - _out << nl << "__outS.writeProxy(__v)"; + _out << nl << "outS__.writeProxy(v__)"; _out.dec(); _out << nl << "End Sub"; - _out << sp << nl << "Public Shared Function read(ByVal __inS As Ice.InputStream) As " << name << "Prx"; + _out << sp << nl << "Public Shared Function read(ByVal inS__ As Ice.InputStream) As " << name << "Prx"; _out.inc(); - _out << nl << "Dim proxy As Ice.ObjectPrx = __inS.readProxy()"; + _out << nl << "Dim proxy As Ice.ObjectPrx = inS__.readProxy()"; _out << nl << "If Not proxy Is Nothing"; _out.inc(); _out << nl << "Dim result As " << name << "PrxHelper = New " << name << "PrxHelper"; - _out << nl << "result.__copyFrom(proxy)"; + _out << nl << "result.copyFrom__(proxy)"; _out << nl << "Return result"; _out.dec(); _out << nl << "End If"; @@ -3954,33 +3950,33 @@ Slice::Gen::HelperVisitor::visitSequence(const SequencePtr& p) _out << sp << nl << "Public NotInheritable Class " << p->name() << "Helper"; _out.inc(); - _out << sp << nl << "Public Shared Sub write(ByVal __os As IceInternal.BasicStream, ByVal __v As " << typeS << ')'; + _out << sp << nl << "Public Shared Sub write(ByVal os__ As IceInternal.BasicStream, ByVal v__ As " << typeS << ')'; _out.inc(); - writeSequenceMarshalUnmarshalCode(_out, p, "__v", true, false); + writeSequenceMarshalUnmarshalCode(_out, p, "v__", true, false); _out.dec(); _out << nl << "End Sub"; - _out << sp << nl << "Public Shared Function read(ByVal __is As IceInternal.BasicStream) As " << typeS; + _out << sp << nl << "Public Shared Function read(ByVal is__ As IceInternal.BasicStream) As " << typeS; _out.inc(); - _out << nl << "Dim __v As " << typeS; - writeSequenceMarshalUnmarshalCode(_out, p, "__v", false, false); - _out << nl << "Return __v"; + _out << nl << "Dim v__ As " << typeS; + writeSequenceMarshalUnmarshalCode(_out, p, "v__", false, false); + _out << nl << "Return v__"; _out.dec(); _out << nl << "End Function"; if(_stream) { - _out << sp << nl << "Public Shared Sub write(ByVal __outS As Ice.OutputStream, ByVal __v As " << typeS << ')'; + _out << sp << nl << "Public Shared Sub write(ByVal outS__ As Ice.OutputStream, ByVal v__ As " << typeS << ')'; _out.inc(); - writeSequenceMarshalUnmarshalCode(_out, p, "__v", true, true); + writeSequenceMarshalUnmarshalCode(_out, p, "v__", true, true); _out.dec(); _out << nl << "End Sub"; - _out << sp << nl << "Public Shared Function read(ByVal __inS As Ice.InputStream) As " << typeS; + _out << sp << nl << "Public Shared Function read(ByVal inS__ As Ice.InputStream) As " << typeS; _out.inc(); - _out << nl << "Dim __v As " << typeS; - writeSequenceMarshalUnmarshalCode(_out, p, "__v", false, true); - _out << nl << "Return __v"; + _out << nl << "Dim v__ As " << typeS; + writeSequenceMarshalUnmarshalCode(_out, p, "v__", false, true); + _out << nl << "Return v__"; _out.dec(); _out << nl << "End Function"; } @@ -4010,21 +4006,21 @@ Slice::Gen::HelperVisitor::visitDictionary(const DictionaryPtr& p) _out << sp << nl << "Public NotInheritable Class " << p->name() << "Helper"; _out.inc(); - _out << sp << nl << "Public Shared Sub write(ByVal __os As IceInternal.BasicStream, ByVal __v As " + _out << sp << nl << "Public Shared Sub write(ByVal os__ As IceInternal.BasicStream, ByVal v__ As " << name << ')'; _out.inc(); - _out << nl << "If __v Is Nothing Then"; + _out << nl << "If v__ Is Nothing Then"; _out.inc(); - _out << nl << "__os.writeSize(0)"; + _out << nl << "os__.writeSize(0)"; _out.dec(); _out << nl << "Else"; _out.inc(); - _out << nl << "__os.writeSize(__v.Count)"; - _out << nl << "For Each __e As _System.Collections.DictionaryEntry In __v"; + _out << nl << "os__.writeSize(v__.Count)"; + _out << nl << "For Each e__ As _System.Collections.DictionaryEntry In v__"; _out.inc(); - string keyArg = "CType(__e.Key, " + keyS + ")"; + string keyArg = "CType(e__.Key, " + keyS + ")"; writeMarshalUnmarshalCode(_out, key, keyArg, true, false, false); - string valueArg = "__e.Value"; + string valueArg = "e__.Value"; writeMarshalUnmarshalCode(_out, value, valueArg, true, false, false); _out.dec(); _out << nl << "Next"; @@ -4037,7 +4033,7 @@ Slice::Gen::HelperVisitor::visitDictionary(const DictionaryPtr& p) bool hasClassValue = (builtin && builtin->kind() == Builtin::KindObject) || ClassDeclPtr::dynamicCast(value); if(hasClassValue) { - _out << sp << nl << "Public NotInheritable Class __Patcher"; + _out << sp << nl << "Public NotInheritable Class Patcher__"; _out.inc(); _out << nl << "Inherits IceInternal.Patcher"; _out << sp << nl << "Friend Sub New(ByVal m As " << name << ", ByVal key As " << keyS << ')'; @@ -4049,7 +4045,7 @@ Slice::Gen::HelperVisitor::visitDictionary(const DictionaryPtr& p) _out << sp << nl << "Public Overrides Sub patch(ByVal v As Ice.Object)"; _out.inc(); - _out << nl << "_type = GetType(" << typeToString(p->valueType()) << ')'; + _out << nl << "type_ = GetType(" << typeToString(p->valueType()) << ')'; _out << nl << "_m(_key) = CType(v, " << valueS << ')'; _out.dec(); _out << nl << "End Sub"; @@ -4060,44 +4056,44 @@ Slice::Gen::HelperVisitor::visitDictionary(const DictionaryPtr& p) _out << sp << nl << "End Class"; } - _out << sp << nl << "Public Shared Function " << " read(ByVal __is As IceInternal.BasicStream) As " << name; + _out << sp << nl << "Public Shared Function " << " read(ByVal is__ As IceInternal.BasicStream) As " << name; _out.inc(); - _out << nl << "Dim __sz As Integer = __is.readSize()"; - _out << nl << "Dim __r As " << name << " = New " << name; - _out << nl << "For __i As Integer = 0 To __sz - 1"; + _out << nl << "Dim sz__ As Integer = is__.readSize()"; + _out << nl << "Dim r__ As " << name << " = New " << name; + _out << nl << "For i__ As Integer = 0 To sz__ - 1"; _out.inc(); - _out << nl << "Dim __k As " << keyS; - writeMarshalUnmarshalCode(_out, key, "__k", false, false, false); + _out << nl << "Dim k__ As " << keyS; + writeMarshalUnmarshalCode(_out, key, "k__", false, false, false); if(!hasClassValue) { - _out << nl << "Dim __v As " << valueS; + _out << nl << "Dim v__ As " << valueS; } - writeMarshalUnmarshalCode(_out, value, "__v", false, false, false, "__r, __k"); + writeMarshalUnmarshalCode(_out, value, "v__", false, false, false, "r__, k__"); if(!hasClassValue) { - _out << nl << "__r(__k) = __v"; + _out << nl << "r__(k__) = v__"; } _out.dec(); _out << nl << "Next"; - _out << nl << "Return __r"; + _out << nl << "Return r__"; _out.dec(); _out << nl << "End Function"; if(_stream) { - _out << nl << "Public Shared Sub write(ByVal __outS As Ice.OutputStream, ByVal __v As " << name << ')'; + _out << nl << "Public Shared Sub write(ByVal outS__ As Ice.OutputStream, ByVal v__ As " << name << ')'; _out.inc(); - _out << nl << "If __v Is Nothing Then"; + _out << nl << "If v__ Is Nothing Then"; _out.inc(); - _out << nl << "__outS.writeSize(0)"; + _out << nl << "outS__.writeSize(0)"; _out.dec(); _out << nl << "Else"; _out.inc(); - _out << nl << "__outS.writeSize(__v.Count)"; - _out << nl << "For Each __e As _System.Collections.DictionaryEntry In __v"; + _out << nl << "outS__.writeSize(v__.Count)"; + _out << nl << "For Each e__ As _System.Collections.DictionaryEntry In v__"; _out.inc(); writeMarshalUnmarshalCode(_out, key, keyArg, true, true, false); writeMarshalUnmarshalCode(_out, value, valueArg, true, true, false); @@ -4108,26 +4104,26 @@ Slice::Gen::HelperVisitor::visitDictionary(const DictionaryPtr& p) _out.dec(); _out << nl << "End Sub"; - _out << sp << nl << "Public Shared Function read(ByVal __inS As Ice.InputStream) As " << name; + _out << sp << nl << "Public Shared Function read(ByVal inS__ As Ice.InputStream) As " << name; _out.inc(); - _out << nl << "Dim __sz As Integer = __inS.readSize()"; - _out << nl << "Dim __r As " << name << " = New " << name; - _out << nl << "For __i As Integer = 0 To __sz - 1"; + _out << nl << "Dim sz__ As Integer = inS__.readSize()"; + _out << nl << "Dim r__ As " << name << " = New " << name; + _out << nl << "For i__ As Integer = 0 To sz__ - 1"; _out.inc(); - _out << nl << "Dim __k As " << keyS; - writeMarshalUnmarshalCode(_out, key, "__k", false, true, false); + _out << nl << "Dim k__ As " << keyS; + writeMarshalUnmarshalCode(_out, key, "k__", false, true, false); if(!hasClassValue) { - _out << nl << "Dim __v As " << valueS; + _out << nl << "Dim v__ As " << valueS; } - writeMarshalUnmarshalCode(_out, value, "__v", false, true, false, "__r, __k"); + writeMarshalUnmarshalCode(_out, value, "v__", false, true, false, "r__, k__"); if(!hasClassValue) { - _out << nl << "__r(__k) = __v"; + _out << nl << "r__(k__) = v__"; } _out.dec(); _out << nl << "Next"; - _out << nl << "Return __r"; + _out << nl << "Return r__"; _out.dec(); _out << nl << "End Function"; } @@ -4177,7 +4173,7 @@ Slice::Gen::DelegateVisitor::visitClassDefStart(const ClassDefPtr& p) _out << nl << "Inherits "; if(bases.empty()) { - _out << "Ice._ObjectDel"; + _out << "Ice.ObjectDel_"; } else { @@ -4209,7 +4205,7 @@ Slice::Gen::DelegateVisitor::visitClassDefStart(const ClassDefPtr& p) vector<string> params = getParams(op); string vbOp = ret ? "Function" : "Sub"; - _out << sp << nl << vbOp << ' ' << opName << spar << params << "ByVal __context As Ice.Context" << epar; + _out << sp << nl << vbOp << ' ' << opName << spar << params << "ByVal context__ As Ice.Context" << epar; if(ret) { _out << " As " << retS; @@ -4264,7 +4260,7 @@ Slice::Gen::DelegateMVisitor::visitClassDefStart(const ClassDefPtr& p) _out << sp << nl << "Public NotInheritable class _" << name << "DelM"; _out.inc(); - _out << nl << "Inherits Ice._ObjectDelM"; + _out << nl << "Inherits Ice.ObjectDelM_"; _out << nl << "Implements _" << name << "Del"; OperationList ops = p->allOperations(); @@ -4315,7 +4311,7 @@ Slice::Gen::DelegateMVisitor::visitClassDefStart(const ClassDefPtr& p) string vbOp = ret ? "Function" : "Sub"; _out << sp << nl << "Public " << vbOp << ' ' << opName << spar << params - << "ByVal __context As Ice.Context" << epar; + << "ByVal context__ As Ice.Context" << epar; if(ret) { _out << " As " << retS; @@ -4323,35 +4319,35 @@ Slice::Gen::DelegateMVisitor::visitClassDefStart(const ClassDefPtr& p) _out << " Implements _" << name << "Del." << opName; // TODO: should be containing class? _out.inc(); - _out << nl << "Dim __og As IceInternal.Outgoing = getOutgoing(\"" - << op->name() << "\", " << sliceModeToIceMode(op) << ", __context)"; + _out << nl << "Dim og__ As IceInternal.Outgoing = getOutgoing(\"" + << op->name() << "\", " << sliceModeToIceMode(op) << ", context__)"; _out << nl << "Try"; _out.inc(); if(!inParams.empty()) { _out << nl << "Try"; _out.inc(); - _out << nl << "Dim __os As IceInternal.BasicStream = __og.ostr()"; + _out << nl << "Dim os__ As IceInternal.BasicStream = og__.ostr()"; for(q = inParams.begin(); q != inParams.end(); ++q) { writeMarshalUnmarshalCode(_out, q->first, fixId(q->second), true, false, false); } if(op->sendsClasses()) { - _out << nl << "__os.writePendingObjects()"; + _out << nl << "os__.writePendingObjects()"; } _out.dec(); - _out << nl << "Catch __ex As Ice.LocalException"; + _out << nl << "Catch ex__ As Ice.LocalException"; _out.inc(); - _out << nl << "__og.abort(__ex)"; + _out << nl << "og__.abort(ex__)"; _out.dec(); _out << nl << "End Try"; } - _out << nl << "Dim __ok As Boolean = __og.invoke()"; + _out << nl << "Dim ok__ As Boolean = og__.invoke()"; _out << nl << "Try"; _out.inc(); - _out << nl << "Dim __is As IceInternal.BasicStream = __og.istr()"; - _out << nl << "If Not __ok Then"; + _out << nl << "Dim is__ As IceInternal.BasicStream = og__.istr()"; + _out << nl << "If Not ok__ Then"; _out.inc(); // // The try/catch block is necessary because throwException() @@ -4359,16 +4355,16 @@ Slice::Gen::DelegateMVisitor::visitClassDefStart(const ClassDefPtr& p) // _out << nl << "Try"; _out.inc(); - _out << nl << "__is.throwException()"; + _out << nl << "is__.throwException()"; _out.dec(); for(ExceptionList::const_iterator t = throws.begin(); t != throws.end(); ++t) { - _out << nl << "Catch __ex As " << fixId((*t)->scoped()); + _out << nl << "Catch ex__ As " << fixId((*t)->scoped()); _out.inc(); _out << nl << "Throw"; _out.dec(); } - _out << nl << "Catch __ex As Ice.UserException"; + _out << nl << "Catch ex__ As Ice.UserException"; _out.inc(); _out << nl << "Throw New Ice.UnknownUserException()"; _out.dec(); @@ -4384,20 +4380,20 @@ Slice::Gen::DelegateMVisitor::visitClassDefStart(const ClassDefPtr& p) BuiltinPtr builtin = BuiltinPtr::dynamicCast(ret); if((builtin && builtin->kind() == Builtin::KindObject) || ClassDeclPtr::dynamicCast(ret)) { - _out << nl << "Dim __ret As " << retS; - _out << nl << "Dim __ret_PP As IceInternal.ParamPatcher = New IceInternal.ParamPatcher(GetType(" + _out << nl << "Dim ret__ As " << retS; + _out << nl << "Dim ret___PP As IceInternal.ParamPatcher = New IceInternal.ParamPatcher(GetType(" << retS << "))"; - _out << nl << "__is.readObject(__ret_PP)"; + _out << nl << "is__.readObject(ret___PP)"; } else { - _out << nl << "Dim __ret As " << retS; - writeMarshalUnmarshalCode(_out, ret, "__ret", false, false, true, ""); + _out << nl << "Dim ret__ As " << retS; + writeMarshalUnmarshalCode(_out, ret, "ret__", false, false, true, ""); } } if(op->returnsClasses()) { - _out << nl << "__is.readPendingObjects()"; + _out << nl << "is__.readPendingObjects()"; for(q = outParams.begin(); q != outParams.end(); ++q) { string param = fixId(q->second); @@ -4413,7 +4409,7 @@ Slice::Gen::DelegateMVisitor::visitClassDefStart(const ClassDefPtr& p) bool patchStruct = st && !st->hasMetaData("clr:class") && st->classDataMembers().size() != 0; if(patchStruct) { - _out << nl << param << ".__patch()"; + _out << nl << param << ".patch__()"; } } } @@ -4423,7 +4419,7 @@ Slice::Gen::DelegateMVisitor::visitClassDefStart(const ClassDefPtr& p) BuiltinPtr builtin = BuiltinPtr::dynamicCast(ret); if((builtin && builtin->kind() == Builtin::KindObject) || ClassDeclPtr::dynamicCast(ret)) { - _out << nl << "__ret = CType(__ret_PP.value, " << retS << ')'; + _out << nl << "ret__ = CType(ret___PP.value, " << retS << ')'; } else { @@ -4431,21 +4427,21 @@ Slice::Gen::DelegateMVisitor::visitClassDefStart(const ClassDefPtr& p) bool patchStruct = st && !st->hasMetaData("clr:class") && st->classDataMembers().size() != 0; if(patchStruct) { - _out << nl << "__ret.__patch()"; + _out << nl << "ret__.patch__()"; } } - _out << nl << "Return __ret"; + _out << nl << "Return ret__"; } _out.dec(); - _out << nl << "Catch __ex As Ice.LocalException"; + _out << nl << "Catch ex__ As Ice.LocalException"; _out.inc(); - _out << nl << "throw New IceInternal.NonRepeatable(__ex)"; + _out << nl << "throw New IceInternal.NonRepeatable(ex__)"; _out.dec(); _out << nl << "End Try"; _out.dec(); _out << nl << "Finally"; _out.inc(); - _out << nl << "reclaimOutgoing(__og)"; + _out << nl << "reclaimOutgoing(og__)"; _out.dec(); _out << nl << "End Try"; @@ -4501,7 +4497,7 @@ Slice::Gen::DelegateDVisitor::visitClassDefStart(const ClassDefPtr& p) _out << sp << nl << "Public NotInheritable class _" << name << "DelD"; _out.inc(); - _out << nl << "Inherits Ice._ObjectDelD"; + _out << nl << "Inherits Ice.ObjectDelD_"; _out << nl << "Implements _" << name << "Del"; OperationList ops = p->allOperations(); @@ -4520,7 +4516,7 @@ Slice::Gen::DelegateDVisitor::visitClassDefStart(const ClassDefPtr& p) vector<string> args = getArgs(op); _out << sp; - _out << nl << "Public " << vbOp << ' ' << opName << spar << params << "ByVal __context As Ice.Context" << epar; + _out << nl << "Public " << vbOp << ' ' << opName << spar << params << "ByVal context__ As Ice.Context" << epar; if(ret) { _out << " As " << retS; @@ -4533,14 +4529,14 @@ Slice::Gen::DelegateDVisitor::visitClassDefStart(const ClassDefPtr& p) } else { - _out << nl << "Dim __current As Ice.Current = New Ice.Current"; - _out << nl << "__initCurrent(__current, \"" << op->name() << "\", " << sliceModeToIceMode(op) - << ", __context)"; + _out << nl << "Dim current__ As Ice.Current = New Ice.Current"; + _out << nl << "initCurrent__(current__, \"" << op->name() << "\", " << sliceModeToIceMode(op) + << ", context__)"; _out << nl << "While True"; _out.inc(); - _out << nl << "Dim __direct As IceInternal.Direct = New IceInternal.Direct(__current)"; - _out << nl << "Dim __servant As Object = __direct.servant()"; - _out << nl << "If TypeOf __servant Is " << fixId(name) << " Then"; + _out << nl << "Dim direct__ As IceInternal.Direct = New IceInternal.Direct(current__)"; + _out << nl << "Dim servant__ As Object = direct__.servant()"; + _out << nl << "If TypeOf servant__ Is " << fixId(name) << " Then"; _out.inc(); _out << nl << "Try"; _out.inc(); @@ -4549,32 +4545,31 @@ Slice::Gen::DelegateDVisitor::visitClassDefStart(const ClassDefPtr& p) { _out << "Return "; } - _out << "CType(__servant, " << fixId(containingClass->scope()) - << '_' << containingClass->name() << "Operations" << ")." - << opName << spar << args << "__current" << epar; + _out << "CType(servant__, " << fixId(containingClass->scoped() + "Operations_") + << ")." << opName << spar << args << "current__" << epar; if(!ret) { _out << nl << "Return"; } _out.dec(); - _out << nl << "Catch __ex As Ice.LocalException"; + _out << nl << "Catch ex__ As Ice.LocalException"; _out.inc(); - _out << nl << "Throw New IceInternal.NonRepeatable(__ex)"; + _out << nl << "Throw New IceInternal.NonRepeatable(ex__)"; _out.dec(); _out << nl << "Finally"; _out.inc(); - _out << nl << "__direct.destroy()"; + _out << nl << "direct__.destroy()"; _out.dec(); _out << nl << "End Try"; _out.dec(); _out << nl << "Else"; _out.inc(); - _out << nl << "__direct.destroy()"; - _out << nl << "Dim __opEx As Ice.OperationNotExistException = new Ice.OperationNotExistException()"; - _out << nl << "__opEx.id = __current.id"; - _out << nl << "__opEx.facet = __current.facet"; - _out << nl << "__opEx.operation = __current.operation"; - _out << nl << "Throw __opEx"; + _out << nl << "direct__.destroy()"; + _out << nl << "Dim opEx__ As Ice.OperationNotExistException = new Ice.OperationNotExistException()"; + _out << nl << "opEx__.id = current__.id"; + _out << nl << "opEx__.facet = current__.facet"; + _out << nl << "opEx__.operation = current__.operation"; + _out << nl << "Throw opEx__"; _out.dec(); _out << nl << "End If"; _out.dec(); @@ -4627,7 +4622,7 @@ Slice::Gen::DispatcherVisitor::visitClassDefStart(const ClassDefPtr& p) return false; } - _out << sp << nl << "Public MustInherit class _" << p->name() << "Disp"; + _out << sp << nl << "Public MustInherit Class " << p->name() << "Disp_"; _out.inc(); _out << nl << "Inherits Ice.ObjectImpl"; _out << nl << "Implements " << fixId(p->name()); @@ -4670,7 +4665,7 @@ Slice::Gen::DispatcherVisitor::visitClassDefStart(const ClassDefPtr& p) { _out << " As " << typeToString(ret); } - _out << " Implements _" << p->name() << "OperationsNC" << '.' << name; // TODO: should be containing class? + _out << " Implements " << p->name() << "OperationsNC_" << '.' << name; // TODO: should be containing class? _out.inc(); _out << nl; if(ret) @@ -4684,14 +4679,14 @@ Slice::Gen::DispatcherVisitor::visitClassDefStart(const ClassDefPtr& p) _out << sp << nl << "Public MustOverride " << vbOp << ' ' << name << spar << params; if(!p->isLocal()) { - _out << "ByVal __current As Ice.Current"; + _out << "ByVal current__ As Ice.Current"; } _out << epar; if(ret) { _out << " As " << typeToString(ret); } - _out << " Implements _" << p->name() << "Operations" << '.' << name; // TODO: should be containing class? + _out << " Implements " << p->name() << "Operations_" << '.' << name; // TODO: should be containing class? } if(!ops.empty()) @@ -4810,12 +4805,12 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p) _out << sp; _out << nl << "Public MustOverride Sub ice_response" << spar << params << epar; - _out << sp << nl << "Public Sub __invoke" << spar << "ByVal __prx As Ice.ObjectPrx" - << paramsInvoke << "ByVal __ctx As Ice.Context" << epar; + _out << sp << nl << "Public Sub invoke__" << spar << "ByVal prx__ As Ice.ObjectPrx" + << paramsInvoke << "ByVal ctx__ As Ice.Context" << epar; _out.inc(); _out << nl << "Try"; _out.inc(); - _out << nl << "__prepare(__prx, \"" << p->name() << "\", " << sliceModeToIceMode(p) << ", __ctx)"; + _out << nl << "prepare__(prx__, \"" << p->name() << "\", " << sliceModeToIceMode(p) << ", ctx__)"; for(q = inParams.begin(); q != inParams.end(); ++q) { string typeS = typeToString(q->first); @@ -4823,21 +4818,21 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p) } if(p->sendsClasses()) { - _out << nl << "__os.writePendingObjects()"; + _out << nl << "os__.writePendingObjects()"; } - _out << nl << "__os.endWriteEncaps()"; + _out << nl << "os__.endWriteEncaps()"; _out.dec(); - _out << nl << "Catch __ex As Ice.LocalException"; + _out << nl << "Catch ex__ As Ice.LocalException"; _out.inc(); - _out << nl << "__finished(__ex)"; + _out << nl << "finished__(ex__)"; _out << nl << "Return"; _out.dec(); _out << nl << "End Try"; - _out << nl << "__send()"; + _out << nl << "send__()"; _out.dec(); _out << nl << "End Sub"; - _out << sp << nl << "Protected Overrides Sub __response(__ok As Boolean) As Boolean"; + _out << sp << nl << "Protected Overrides Sub response__(ok__ As Boolean) As Boolean"; _out.inc(); for(q = outParams.begin(); q != outParams.end(); ++q) { @@ -4845,24 +4840,24 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p) } if(ret) { - _out << nl << "Dim __ret As " << retS; + _out << nl << "Dim ret__ As " << retS; } _out << nl << "Try"; _out.inc(); - _out << nl << "If Not __ok Then"; + _out << nl << "If Not ok__ Then"; _out.inc(); _out << nl << "Try"; _out.inc(); - _out << nl << "__is.throwException()"; + _out << nl << "is__.throwException()"; _out.dec(); for(ExceptionList::const_iterator r = throws.begin(); r != throws.end(); ++r) { - _out << nl << "Catch __ex As " << fixId((*r)->scoped()); + _out << nl << "Catch ex__ As " << fixId((*r)->scoped()); _out.inc(); - _out << nl << "Throw __ex"; + _out << nl << "Throw ex__"; _out.dec(); } - _out << nl << "Catch __ex As Ice.UserException"; + _out << nl << "Catch ex__ As Ice.UserException"; _out.inc(); _out << nl << "Throw New Ice.UnknownUserException()"; _out.dec(); @@ -4875,11 +4870,11 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p) } if(ret) { - writeMarshalUnmarshalCode(_out, ret, "__ret", false, false, true); + writeMarshalUnmarshalCode(_out, ret, "ret__", false, false, true); } if(p->returnsClasses()) { - _out << nl << "__is.readPendingObjects()"; + _out << nl << "is__.readPendingObjects()"; } for(q = outParams.begin(); q != outParams.end(); ++q) { @@ -4896,7 +4891,7 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p) bool patchStruct = st && !st->hasMetaData("clr:class") && st->classDataMembers().size() != 0; if(patchStruct) { - _out << nl << param << ".__patch()"; + _out << nl << param << ".patch__()"; } } } @@ -4906,7 +4901,7 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p) if((builtin && builtin->kind() == Builtin::KindObject) || ClassDeclPtr::dynamicCast(ret)) { string type = typeToString(ret); - _out << nl << "__ret = CType(__ret_PP.value, " << retS << ')'; + _out << nl << "ret__ = CType(ret___PP.value, " << retS << ')'; } else { @@ -4914,20 +4909,20 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p) bool patchStruct = st && !st->hasMetaData("clr:class") && st->classDataMembers().size() != 0; if(patchStruct) { - _out << nl << "__ret.__patch()"; + _out << nl << "ret__.patch__()"; } } } _out.dec(); - _out << nl << "Catch __ex As Ice.LocalException"; + _out << nl << "Catch ex__ As Ice.LocalException"; _out.inc(); - _out << nl << "Return __finished(__ex)"; + _out << nl << "Return finished__(ex__)"; _out.dec(); if(!throws.empty()) { - _out << nl << "Catch __ex As Ice.UserException"; + _out << nl << "Catch ex__ As Ice.UserException"; _out.inc(); - _out << nl << "ice_exception(__ex)"; + _out << nl << "ice_exception(ex__)"; _out << nl << "Return False"; _out.dec(); } @@ -5001,7 +4996,7 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p) { _out << nl << "Try"; _out.inc(); - _out << nl << "Dim __os As IceInternal.BasicStream = Me.__os()"; + _out << nl << "Dim os__ As IceInternal.BasicStream = Me.os__()"; for(q = outParams.begin(); q != outParams.end(); ++q) { string typeS = typeToString(q->first); @@ -5010,20 +5005,20 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p) if(ret) { string retS = typeToString(ret); - writeMarshalUnmarshalCode(_out, ret, "__ret", true, false, false); + writeMarshalUnmarshalCode(_out, ret, "ret__", true, false, false); } if(p->returnsClasses()) { - _out << nl << "__os.writePendingObjects()"; + _out << nl << "os__.writePendingObjects()"; } _out.dec(); - _out << nl << "Catch __ex As Ice.LocalException"; + _out << nl << "Catch ex__ As Ice.LocalException"; _out.inc(); - _out << nl << "ice_exception(__ex)"; + _out << nl << "ice_exception(ex__)"; _out.dec(); _out << nl << "End Try"; } - _out << nl << "__response(true)"; + _out << nl << "response__(true)"; _out.dec(); _out << nl << "End Sub"; @@ -5032,7 +5027,7 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p) _out.inc(); if(throws.empty()) { - _out << nl << "__exception(ex)"; + _out << nl << "exception__(ex)"; } else { @@ -5044,15 +5039,15 @@ Slice::Gen::AsyncVisitor::visitOperation(const OperationPtr& p) for(r = throws.begin(); r != throws.end(); ++r) { string exS = fixId((*r)->scoped()); - _out << nl << "Catch __ex As " << exS; + _out << nl << "Catch ex__ As " << exS; _out.inc(); - _out << nl << "__os().writeUserException(__ex)"; - _out << nl << "__response(false)"; + _out << nl << "os__().writeUserException(ex__)"; + _out << nl << "response__(false)"; _out.dec(); } - _out << nl << "Catch __ex As _System.Exception"; + _out << nl << "Catch ex__ As _System.Exception"; _out.inc(); - _out << nl << "__exception(__ex)"; + _out << nl << "exception__(ex__)"; _out.dec(); _out << nl << "End Try"; } @@ -5105,7 +5100,7 @@ Slice::Gen::TieVisitor::visitClassDefStart(const ClassDefPtr& p) opIntfName += "NC"; } - _out << sp << nl << "Public Class _" << name << "Tie"; + _out << sp << nl << "Public Class " << name << "Tie_"; _out.inc(); _out << nl << "Inherits "; if(p->isInterface()) @@ -5116,7 +5111,7 @@ Slice::Gen::TieVisitor::visitClassDefStart(const ClassDefPtr& p) } else { - _out << '_' << name << "Disp"; + _out << name << "Disp_"; } } else @@ -5128,7 +5123,7 @@ Slice::Gen::TieVisitor::visitClassDefStart(const ClassDefPtr& p) _out << sp << nl << "Public Sub New()"; _out << nl << "End Sub"; - _out << sp << nl << "Public Sub New(ByVal del As _" << name << opIntfName << ")"; + _out << sp << nl << "Public Sub New(ByVal del As " << name << opIntfName << "_)"; _out.inc(); _out << nl << "_ice_delegate = del"; _out.dec(); @@ -5142,7 +5137,7 @@ Slice::Gen::TieVisitor::visitClassDefStart(const ClassDefPtr& p) _out << sp << nl << "Public Sub ice_delegate(ByVal del As Object) Implements Ice.TieBase.ice_delegate"; _out.inc(); - _out << nl << "_ice_delegate = CType(del, _" << name << opIntfName << ")"; + _out << nl << "_ice_delegate = CType(del, " << name << opIntfName << "_)"; _out.dec(); _out << nl << "End Sub"; @@ -5180,18 +5175,18 @@ Slice::Gen::TieVisitor::visitClassDefStart(const ClassDefPtr& p) _out << nl << "Return true"; _out.dec(); _out << nl << "End If"; - _out << nl << "If Not TypeOf rhs Is _" << name << "Tie Then"; + _out << nl << "If Not TypeOf rhs Is " << name << "Tie_ Then"; _out.inc(); _out << nl << "Return False"; _out.dec(); _out << nl << "End If"; _out << nl << "If _ice_delegate Is Nothing Then"; _out.inc(); - _out << nl << "Return CType(rhs, _" << name << "Tie)._ice_delegate Is Nothing"; + _out << nl << "Return CType(rhs, " << name << "Tie_)._ice_delegate Is Nothing"; _out.dec(); _out << nl << "End If"; _out << nl << "' Bug in VB 7.1: cast to Object should not be necessary."; - _out << nl << "Return CType(_ice_delegate, Object).Equals(CType(rhs, _" << name << "Tie)._ice_delegate)"; + _out << nl << "Return CType(_ice_delegate, Object).Equals(CType(rhs, " << name << "Tie_)._ice_delegate)"; _out.dec(); _out << nl << "End Function"; @@ -5227,7 +5222,7 @@ Slice::Gen::TieVisitor::visitClassDefStart(const ClassDefPtr& p) _out << vbOp << ' ' << opName << spar << params; if(!p->isLocal()) { - _out << "ByVal __current As Ice.Current"; + _out << "ByVal current__ As Ice.Current"; } _out << epar; if(ret && !hasAMD) @@ -5243,7 +5238,7 @@ Slice::Gen::TieVisitor::visitClassDefStart(const ClassDefPtr& p) _out << "_ice_delegate." << opName << spar << args; if(!p->isLocal()) { - _out << "__current"; + _out << "current__"; } _out << epar; _out.dec(); @@ -5257,7 +5252,7 @@ Slice::Gen::TieVisitor::visitClassDefStart(const ClassDefPtr& p) writeInheritedOperationsWithOpNames(*i, opNames); } - _out << sp << nl << "Private _ice_delegate As _" << name << opIntfName; + _out << sp << nl << "Private _ice_delegate As " << name << opIntfName << '_'; return true; } @@ -5309,7 +5304,7 @@ Slice::Gen::TieVisitor::writeInheritedOperationsWithOpNames(const ClassDefPtr& p _out << vbOp << ' ' << opName << spar << params; if(!p->isLocal()) { - _out << "ByVal __current As Ice.Current"; + _out << "ByVal current__ As Ice.Current"; } _out << epar; if(ret && !hasAMD) @@ -5325,7 +5320,7 @@ Slice::Gen::TieVisitor::writeInheritedOperationsWithOpNames(const ClassDefPtr& p _out << "_ice_delegate." << opName << spar << args; if(!p->isLocal()) { - _out << "__current"; + _out << "current__"; } _out << epar; _out.dec(); @@ -5372,7 +5367,7 @@ Slice::Gen::BaseImplVisitor::writeOperation(const OperationPtr& op, bool comment { _out << "Overrides "; } - _out << "Sub " << opName << "_async" << spar << pDecl << "ByVal __current As Ice.Current" << epar; + _out << "Sub " << opName << "_async" << spar << pDecl << "ByVal current__ As Ice.Current" << epar; if(comment) { @@ -5382,14 +5377,14 @@ Slice::Gen::BaseImplVisitor::writeOperation(const OperationPtr& op, bool comment { if(forTie) { - _out << " Implements _" << cl->name() << "Operations." << opName << "_async"; // TODO: should be containing class? + _out << " Implements " << cl->name() << "Operations_." << opName << "_async"; // TODO: should be containing class? } } _out.inc(); if(ret) { - _out << nl << "Dim __ret As " << typeToString(ret) << " = " << writeValue(ret); + _out << nl << "Dim ret__ As " << typeToString(ret) << " = " << writeValue(ret); } for(i = params.begin(); i != params.end(); ++i) { @@ -5400,10 +5395,10 @@ Slice::Gen::BaseImplVisitor::writeOperation(const OperationPtr& op, bool comment _out << nl << "Dim " << name << " As " << typeToString(type) << " = " << writeValue(type); } } - _out << nl << "__cb.ice_response" << spar; + _out << nl << "cb__.ice_response" << spar; if(ret) { - _out << "__ret"; + _out << "ret__"; } for(i = params.begin(); i != params.end(); ++i) { @@ -5429,7 +5424,7 @@ Slice::Gen::BaseImplVisitor::writeOperation(const OperationPtr& op, bool comment _out << vbOp << ' ' << fixId(opName, DotNet::ICloneable, true) << spar << pDecls; if(!cl->isLocal()) { - _out << "ByVal __current As Ice.Current"; + _out << "ByVal current__ As Ice.Current"; } _out << epar; if(ret) @@ -5444,7 +5439,7 @@ Slice::Gen::BaseImplVisitor::writeOperation(const OperationPtr& op, bool comment { if(forTie) { - _out << " Implements _" << cl->name() << "Operations." << fixId(opName, DotNet::ICloneable, true); // TODO: should be containing class? + _out << " Implements " << cl->name() << "Operations_." << fixId(opName, DotNet::ICloneable, true); // TODO: should be containing class? } } _out.inc(); @@ -5569,7 +5564,7 @@ Slice::Gen::ImplVisitor::visitClassDefStart(const ClassDefPtr& p) } else { - _out << "Inherits _" << name << "Disp"; + _out << "Inherits " << name << "Disp_"; } } else @@ -5654,7 +5649,7 @@ Slice::Gen::ImplTieVisitor::visitClassDefStart(const ClassDefPtr& p) _out << fixId(bases.front()->name()); } } - _out << nl << "Implements _" << name << "Operations"; + _out << nl << "Implements " << name << "Operations_"; _out << sp << nl << "Public Sub New()"; _out << nl << "End Sub"; |