diff options
author | Marc Laukien <marc@zeroc.com> | 2001-07-26 19:44:07 +0000 |
---|---|---|
committer | Marc Laukien <marc@zeroc.com> | 2001-07-26 19:44:07 +0000 |
commit | 80d16826358ff9f0ec8911713873842480f642c3 (patch) | |
tree | 9b96543df3da9ad9b37c556daa392550458fd7f7 /cpp/src | |
parent | sorry, missed one (diff) | |
download | ice-80d16826358ff9f0ec8911713873842480f642c3.tar.bz2 ice-80d16826358ff9f0ec8911713873842480f642c3.tar.xz ice-80d16826358ff9f0ec8911713873842480f642c3.zip |
started code style conversion
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/Slice/Grammer.y | 176 | ||||
-rw-r--r-- | cpp/src/Slice/GrammerUtil.cpp | 24 | ||||
-rw-r--r-- | cpp/src/Slice/GrammerUtil.h | 14 | ||||
-rw-r--r-- | cpp/src/Slice/OutputUtil.cpp | 82 | ||||
-rw-r--r-- | cpp/src/Slice/OutputUtil.h | 12 | ||||
-rw-r--r-- | cpp/src/Slice/Parser.cpp | 674 | ||||
-rw-r--r-- | cpp/src/Slice/Parser.h | 234 | ||||
-rw-r--r-- | cpp/src/Slice/Scanner.l | 4 | ||||
-rw-r--r-- | cpp/src/slice2cpp/Gen.cpp | 483 | ||||
-rw-r--r-- | cpp/src/slice2cpp/Gen.h | 144 | ||||
-rw-r--r-- | cpp/src/slice2cpp/GenUtil.cpp | 136 | ||||
-rw-r--r-- | cpp/src/slice2cpp/GenUtil.h | 24 | ||||
-rw-r--r-- | cpp/src/slice2cpp/Main.cpp | 2 | ||||
-rw-r--r-- | cpp/src/slice2docbook/Gen.cpp | 50 | ||||
-rw-r--r-- | cpp/src/slice2docbook/Gen.h | 26 | ||||
-rw-r--r-- | cpp/src/slice2docbook/GenUtil.cpp | 26 | ||||
-rw-r--r-- | cpp/src/slice2docbook/GenUtil.h | 4 | ||||
-rw-r--r-- | cpp/src/slice2docbook/Main.cpp | 2 |
18 files changed, 1056 insertions, 1061 deletions
diff --git a/cpp/src/Slice/Grammer.y b/cpp/src/Slice/Grammer.y index 78228e729e7..a94cd0bd53e 100644 --- a/cpp/src/Slice/Grammer.y +++ b/cpp/src/Slice/Grammer.y @@ -167,9 +167,9 @@ module_def // ---------------------------------------------------------------------- : ICE_MODULE ICE_IDENTIFIER { - StringTok_ptr ident = StringTok_ptr::dynamicCast($2); - Container_ptr cont = unit -> currentContainer(); - Module_ptr module = cont -> createModule(ident -> v); + StringTokPtr ident = StringTokPtr::dynamicCast($2); + ContainerPtr cont = unit -> currentContainer(); + ModulePtr module = cont -> createModule(ident -> v); if(!module) YYERROR; // Can't continue, jump to next yyerrok unit -> pushContainer(module); @@ -185,13 +185,13 @@ local // ---------------------------------------------------------------------- : ICE_LOCAL { - BoolTok_ptr local = new BoolTok; + BoolTokPtr local = new BoolTok; local -> v = true; $$ = local; } | { - BoolTok_ptr local = new BoolTok; + BoolTokPtr local = new BoolTok; local -> v = false; $$ = local; } @@ -202,10 +202,10 @@ class_decl // ---------------------------------------------------------------------- : local ICE_CLASS ICE_IDENTIFIER { - BoolTok_ptr local = BoolTok_ptr::dynamicCast($1); - StringTok_ptr ident = StringTok_ptr::dynamicCast($3); - Container_ptr cont = unit -> currentContainer(); - ClassDecl_ptr cl = cont -> createClassDecl(ident -> v, + BoolTokPtr local = BoolTokPtr::dynamicCast($1); + StringTokPtr ident = StringTokPtr::dynamicCast($3); + ContainerPtr cont = unit -> currentContainer(); + ClassDeclPtr cl = cont -> createClassDecl(ident -> v, local -> v, false); } @@ -216,14 +216,14 @@ class_def // ---------------------------------------------------------------------- : local ICE_CLASS ICE_IDENTIFIER class_extends implements { - BoolTok_ptr local = BoolTok_ptr::dynamicCast($1); - StringTok_ptr ident = StringTok_ptr::dynamicCast($3); - Container_ptr cont = unit -> currentContainer(); - ClassDef_ptr base = ClassDef_ptr::dynamicCast($4); - ClassListTok_ptr bases = ClassListTok_ptr::dynamicCast($5); + BoolTokPtr local = BoolTokPtr::dynamicCast($1); + StringTokPtr ident = StringTokPtr::dynamicCast($3); + ContainerPtr cont = unit -> currentContainer(); + ClassDefPtr base = ClassDefPtr::dynamicCast($4); + ClassListTokPtr bases = ClassListTokPtr::dynamicCast($5); if(base) bases -> v.push_front(base); - ClassDef_ptr cl = cont -> createClassDef(ident -> v, + ClassDefPtr cl = cont -> createClassDef(ident -> v, local -> v, false, bases -> v); @@ -242,13 +242,13 @@ class_extends // ---------------------------------------------------------------------- : ICE_EXTENDS scoped_name { - StringTok_ptr scoped = StringTok_ptr::dynamicCast($2); - Container_ptr cont = unit -> currentContainer(); - list<Type_ptr> types = cont -> lookupType(scoped -> v); + StringTokPtr scoped = StringTokPtr::dynamicCast($2); + ContainerPtr cont = unit -> currentContainer(); + list<TypePtr> types = cont -> lookupType(scoped -> v); $$ = 0; if(!types.empty()) { - ClassDecl_ptr cl = ClassDecl_ptr::dynamicCast(types.front()); + ClassDeclPtr cl = ClassDeclPtr::dynamicCast(types.front()); if(!cl) { string msg = "`"; @@ -258,7 +258,7 @@ class_extends } else { - ClassDef_ptr def = cl -> definition(); + ClassDefPtr def = cl -> definition(); if(!def) { string msg = "`"; @@ -297,10 +297,10 @@ interface_decl // ---------------------------------------------------------------------- : local ICE_INTERFACE ICE_IDENTIFIER { - BoolTok_ptr local = BoolTok_ptr::dynamicCast($1); - StringTok_ptr ident = StringTok_ptr::dynamicCast($3); - Container_ptr cont = unit -> currentContainer(); - ClassDecl_ptr cl = cont -> createClassDecl(ident -> v, + BoolTokPtr local = BoolTokPtr::dynamicCast($1); + StringTokPtr ident = StringTokPtr::dynamicCast($3); + ContainerPtr cont = unit -> currentContainer(); + ClassDeclPtr cl = cont -> createClassDecl(ident -> v, local -> v, true); } @@ -311,11 +311,11 @@ interface_def // ---------------------------------------------------------------------- : local ICE_INTERFACE ICE_IDENTIFIER interface_extends { - BoolTok_ptr local = BoolTok_ptr::dynamicCast($1); - StringTok_ptr ident = StringTok_ptr::dynamicCast($3); - Container_ptr cont = unit -> currentContainer(); - ClassListTok_ptr bases = ClassListTok_ptr::dynamicCast($4); - ClassDef_ptr cl = cont -> createClassDef(ident -> v, + BoolTokPtr local = BoolTokPtr::dynamicCast($1); + StringTokPtr ident = StringTokPtr::dynamicCast($3); + ContainerPtr cont = unit -> currentContainer(); + ClassListTokPtr bases = ClassListTokPtr::dynamicCast($4); + ClassDefPtr cl = cont -> createClassDef(ident -> v, local -> v, true, bases -> v); @@ -334,14 +334,14 @@ interface_list // ---------------------------------------------------------------------- : scoped_name ',' interface_list { - ClassListTok_ptr intfs = ClassListTok_ptr::dynamicCast($3); + ClassListTokPtr intfs = ClassListTokPtr::dynamicCast($3); $$ = intfs; - StringTok_ptr scoped = StringTok_ptr::dynamicCast($1); - Container_ptr cont = unit -> currentContainer(); - list<Type_ptr> types = cont -> lookupType(scoped -> v); + StringTokPtr scoped = StringTokPtr::dynamicCast($1); + ContainerPtr cont = unit -> currentContainer(); + list<TypePtr> types = cont -> lookupType(scoped -> v); if(!types.empty()) { - ClassDecl_ptr cl = ClassDecl_ptr::dynamicCast(types.front()); + ClassDeclPtr cl = ClassDeclPtr::dynamicCast(types.front()); if(!cl || !cl -> isInterface()) { string msg = "`"; @@ -351,7 +351,7 @@ interface_list } else { - ClassDef_ptr def = cl -> definition(); + ClassDefPtr def = cl -> definition(); if(!def) { string msg = "`"; @@ -368,14 +368,14 @@ interface_list } | scoped_name { - ClassListTok_ptr intfs = new ClassListTok; + ClassListTokPtr intfs = new ClassListTok; $$ = intfs; - StringTok_ptr scoped = StringTok_ptr::dynamicCast($1); - Container_ptr cont = unit -> currentContainer(); - list<Type_ptr> types = cont -> lookupType(scoped -> v); + StringTokPtr scoped = StringTokPtr::dynamicCast($1); + ContainerPtr cont = unit -> currentContainer(); + list<TypePtr> types = cont -> lookupType(scoped -> v); if(!types.empty()) { - ClassDecl_ptr cl = ClassDecl_ptr::dynamicCast(types.front()); + ClassDeclPtr cl = ClassDeclPtr::dynamicCast(types.front()); if(!cl || !cl -> isInterface()) { string msg = "`"; @@ -385,7 +385,7 @@ interface_list } else { - ClassDef_ptr def = cl -> definition(); + ClassDefPtr def = cl -> definition(); if(!def) { string msg = "`"; @@ -420,12 +420,12 @@ operation // ---------------------------------------------------------------------- : return_type ICE_OP_IDENTIFIER parameters output_parameters ')' throws { - Type_ptr returnType = Type_ptr::dynamicCast($1); - StringTok_ptr name = StringTok_ptr::dynamicCast($2); - TypeStringListTok_ptr inParms = TypeStringListTok_ptr::dynamicCast($3); - TypeStringListTok_ptr outParms = TypeStringListTok_ptr::dynamicCast($4); - TypeListTok_ptr throws = TypeListTok_ptr::dynamicCast($6); - ClassDef_ptr cl = ClassDef_ptr::dynamicCast(unit -> currentContainer()); + TypePtr returnType = TypePtr::dynamicCast($1); + StringTokPtr name = StringTokPtr::dynamicCast($2); + TypeStringListTokPtr inParms = TypeStringListTokPtr::dynamicCast($3); + TypeStringListTokPtr outParms = TypeStringListTokPtr::dynamicCast($4); + TypeListTokPtr throws = TypeListTokPtr::dynamicCast($6); + ClassDefPtr cl = ClassDefPtr::dynamicCast(unit -> currentContainer()); cl -> createOperation(name -> v, returnType, inParms -> v, outParms -> v, throws -> v); } @@ -435,17 +435,17 @@ parameters // ---------------------------------------------------------------------- : type ICE_IDENTIFIER ',' parameters { - Type_ptr type = Type_ptr::dynamicCast($1); - StringTok_ptr ident = StringTok_ptr::dynamicCast($2); - TypeStringListTok_ptr parms = TypeStringListTok_ptr::dynamicCast($4); + TypePtr type = TypePtr::dynamicCast($1); + StringTokPtr ident = StringTokPtr::dynamicCast($2); + TypeStringListTokPtr parms = TypeStringListTokPtr::dynamicCast($4); parms -> v.push_front(make_pair(type, ident -> v)); $$ = parms; } | type ICE_IDENTIFIER { - Type_ptr type = Type_ptr::dynamicCast($1); - StringTok_ptr ident = StringTok_ptr::dynamicCast($2); - TypeStringListTok_ptr parms = new TypeStringListTok; + TypePtr type = TypePtr::dynamicCast($1); + StringTokPtr ident = StringTokPtr::dynamicCast($2); + TypeStringListTokPtr parms = new TypeStringListTok; parms -> v.push_front(make_pair(type, ident -> v)); $$ = parms; } @@ -485,9 +485,9 @@ data_member // ---------------------------------------------------------------------- : type ICE_IDENTIFIER { - Type_ptr type = Type_ptr::dynamicCast($1); - StringTok_ptr ident = StringTok_ptr::dynamicCast($2); - ClassDef_ptr cl = ClassDef_ptr::dynamicCast(unit -> currentContainer()); + TypePtr type = TypePtr::dynamicCast($1); + StringTokPtr ident = StringTokPtr::dynamicCast($2); + ClassDefPtr cl = ClassDefPtr::dynamicCast(unit -> currentContainer()); assert(!cl -> isInterface()); cl -> createDataMember(ident -> v, type); } @@ -546,25 +546,25 @@ type } | scoped_name { - StringTok_ptr scoped = StringTok_ptr::dynamicCast($1); - Container_ptr cont = unit -> currentContainer(); - list<Type_ptr> types = cont -> lookupType(scoped -> v); + StringTokPtr scoped = StringTokPtr::dynamicCast($1); + ContainerPtr cont = unit -> currentContainer(); + list<TypePtr> types = cont -> lookupType(scoped -> v); if(types.empty()) YYERROR; // Can't continue, jump to next yyerrok $$ = types.front(); } | scoped_name '*' { - StringTok_ptr scoped = StringTok_ptr::dynamicCast($1); - Container_ptr cont = unit -> currentContainer(); - list<Type_ptr> types = cont -> lookupType(scoped -> v); + StringTokPtr scoped = StringTokPtr::dynamicCast($1); + ContainerPtr cont = unit -> currentContainer(); + list<TypePtr> types = cont -> lookupType(scoped -> v); if(types.empty()) YYERROR; // Can't continue, jump to next yyerrok - for(list<Type_ptr>::iterator p = types.begin(); + for(list<TypePtr>::iterator p = types.begin(); p != types.end(); ++p) { - ClassDecl_ptr cl = ClassDecl_ptr::dynamicCast(*p); + ClassDeclPtr cl = ClassDeclPtr::dynamicCast(*p); if(!cl) { string msg = "`"; @@ -584,15 +584,15 @@ type_list // ---------------------------------------------------------------------- : type ',' type_list { - Type_ptr type = Type_ptr::dynamicCast($1); - TypeListTok_ptr typeList = TypeListTok_ptr::dynamicCast($3); + TypePtr type = TypePtr::dynamicCast($1); + TypeListTokPtr typeList = TypeListTokPtr::dynamicCast($3); typeList -> v.push_front(type); $$ = typeList; } | type { - Type_ptr type = Type_ptr::dynamicCast($1); - TypeListTok_ptr typeList = new TypeListTok; + TypePtr type = TypePtr::dynamicCast($1); + TypeListTokPtr typeList = new TypeListTok; typeList -> v.push_front(type); $$ = typeList; } @@ -616,8 +616,8 @@ native_def // ---------------------------------------------------------------------- : ICE_NATIVE ICE_IDENTIFIER { - StringTok_ptr ident = StringTok_ptr::dynamicCast($2); - Container_ptr cont = unit -> currentContainer(); + StringTokPtr ident = StringTokPtr::dynamicCast($2); + ContainerPtr cont = unit -> currentContainer(); cont -> createNative(ident -> v); } ; @@ -627,9 +627,9 @@ vector_def // ---------------------------------------------------------------------- : ICE_VECTOR '<' type '>' ICE_IDENTIFIER { - StringTok_ptr ident = StringTok_ptr::dynamicCast($5); - Type_ptr type = Type_ptr::dynamicCast($3); - Container_ptr cont = unit -> currentContainer(); + StringTokPtr ident = StringTokPtr::dynamicCast($5); + TypePtr type = TypePtr::dynamicCast($3); + ContainerPtr cont = unit -> currentContainer(); cont -> createVector(ident -> v, type); } ; @@ -639,10 +639,10 @@ enum_def // ---------------------------------------------------------------------- : ICE_ENUM ICE_IDENTIFIER '{' identifier_list '}' { - StringTok_ptr ident = StringTok_ptr::dynamicCast($2); - StringListTok_ptr enumerators = StringListTok_ptr::dynamicCast($4); - Container_ptr cont = unit -> currentContainer(); - Enum_ptr en = cont -> createEnum(ident -> v, enumerators -> v); + StringTokPtr ident = StringTokPtr::dynamicCast($2); + StringListTokPtr enumerators = StringListTokPtr::dynamicCast($4); + ContainerPtr cont = unit -> currentContainer(); + EnumPtr en = cont -> createEnum(ident -> v, enumerators -> v); } ; @@ -651,21 +651,21 @@ identifier_list // ---------------------------------------------------------------------- : ICE_IDENTIFIER ',' identifier_list { - StringTok_ptr ident = StringTok_ptr::dynamicCast($1); - StringListTok_ptr ens = StringListTok_ptr::dynamicCast($3); + StringTokPtr ident = StringTokPtr::dynamicCast($1); + StringListTokPtr ens = StringListTokPtr::dynamicCast($3); $$ = ens; - Container_ptr cont = unit -> currentContainer(); - Enumerator_ptr en = cont -> createEnumerator(ident -> v); + ContainerPtr cont = unit -> currentContainer(); + EnumeratorPtr en = cont -> createEnumerator(ident -> v); if(en) ens -> v.push_front(ident -> v); } | ICE_IDENTIFIER { - StringTok_ptr ident = StringTok_ptr::dynamicCast($1); - StringListTok_ptr ens = new StringListTok; + StringTokPtr ident = StringTokPtr::dynamicCast($1); + StringListTokPtr ens = new StringListTok; $$ = ens; - Container_ptr cont = unit -> currentContainer(); - Enumerator_ptr en = cont -> createEnumerator(ident -> v); + ContainerPtr cont = unit -> currentContainer(); + EnumeratorPtr en = cont -> createEnumerator(ident -> v); if(en) ens -> v.push_front(ident -> v); } @@ -680,14 +680,14 @@ scoped_name } | ICE_SCOPE_DELIMITOR ICE_IDENTIFIER { - StringTok_ptr ident = StringTok_ptr::dynamicCast($2); + StringTokPtr ident = StringTokPtr::dynamicCast($2); ident -> v = "::" + ident -> v; $$ = ident; } | scoped_name ICE_SCOPE_DELIMITOR ICE_IDENTIFIER { - StringTok_ptr scoped = StringTok_ptr::dynamicCast($1); - StringTok_ptr ident = StringTok_ptr::dynamicCast($3); + StringTokPtr scoped = StringTokPtr::dynamicCast($1); + StringTokPtr ident = StringTokPtr::dynamicCast($3); scoped -> v += "::"; scoped -> v += ident -> v; $$ = scoped; diff --git a/cpp/src/Slice/GrammerUtil.cpp b/cpp/src/Slice/GrammerUtil.cpp index ba935a0a2e9..fed434f56f9 100644 --- a/cpp/src/Slice/GrammerUtil.cpp +++ b/cpp/src/Slice/GrammerUtil.cpp @@ -13,15 +13,15 @@ using namespace std; using namespace Slice; -void __Ice::incRef(StringTok* p) { p -> __incRef(); } -void __Ice::decRef(StringTok* p) { p -> __decRef(); } -void __Ice::incRef(TypeStringListTok* p) { p -> __incRef(); } -void __Ice::decRef(TypeStringListTok* p) { p -> __decRef(); } -void __Ice::incRef(StringListTok* p) { p -> __incRef(); } -void __Ice::decRef(StringListTok* p) { p -> __decRef(); } -void __Ice::incRef(BoolTok* p) { p -> __incRef(); } -void __Ice::decRef(BoolTok* p) { p -> __decRef(); } -void __Ice::incRef(TypeListTok* p) { p -> __incRef(); } -void __Ice::decRef(TypeListTok* p) { p -> __decRef(); } -void __Ice::incRef(ClassListTok* p) { p -> __incRef(); } -void __Ice::decRef(ClassListTok* p) { p -> __decRef(); } +void IceInternal::incRef(StringTok* p) { p -> __incRef(); } +void IceInternal::decRef(StringTok* p) { p -> __decRef(); } +void IceInternal::incRef(TypeStringListTok* p) { p -> __incRef(); } +void IceInternal::decRef(TypeStringListTok* p) { p -> __decRef(); } +void IceInternal::incRef(StringListTok* p) { p -> __incRef(); } +void IceInternal::decRef(StringListTok* p) { p -> __decRef(); } +void IceInternal::incRef(BoolTok* p) { p -> __incRef(); } +void IceInternal::decRef(BoolTok* p) { p -> __decRef(); } +void IceInternal::incRef(TypeListTok* p) { p -> __incRef(); } +void IceInternal::decRef(TypeListTok* p) { p -> __decRef(); } +void IceInternal::incRef(ClassListTok* p) { p -> __incRef(); } +void IceInternal::decRef(ClassListTok* p) { p -> __decRef(); } diff --git a/cpp/src/Slice/GrammerUtil.h b/cpp/src/Slice/GrammerUtil.h index 827919f38f2..8ab1d42a131 100644 --- a/cpp/src/Slice/GrammerUtil.h +++ b/cpp/src/Slice/GrammerUtil.h @@ -25,7 +25,7 @@ class ClassListTok; } -namespace __Ice +namespace IceInternal { void ICE_API incRef(::Slice::StringTok*); @@ -46,12 +46,12 @@ void ICE_API decRef(::Slice::ClassListTok*); namespace Slice { -typedef ::__Ice::Handle<StringTok> StringTok_ptr; -typedef ::__Ice::Handle<TypeStringListTok> TypeStringListTok_ptr; -typedef ::__Ice::Handle<StringListTok> StringListTok_ptr; -typedef ::__Ice::Handle<BoolTok> BoolTok_ptr; -typedef ::__Ice::Handle<TypeListTok> TypeListTok_ptr; -typedef ::__Ice::Handle<ClassListTok> ClassListTok_ptr; +typedef ::IceInternal::Handle<StringTok> StringTokPtr; +typedef ::IceInternal::Handle<TypeStringListTok> TypeStringListTokPtr; +typedef ::IceInternal::Handle<StringListTok> StringListTokPtr; +typedef ::IceInternal::Handle<BoolTok> BoolTokPtr; +typedef ::IceInternal::Handle<TypeListTok> TypeListTokPtr; +typedef ::IceInternal::Handle<ClassListTok> ClassListTokPtr; } diff --git a/cpp/src/Slice/OutputUtil.cpp b/cpp/src/Slice/OutputUtil.cpp index 62087791327..7e2c6ade881 100644 --- a/cpp/src/Slice/OutputUtil.cpp +++ b/cpp/src/Slice/OutputUtil.cpp @@ -29,9 +29,9 @@ Separator sp; // ---------------------------------------------------------------------- Slice::Output::Output() - : pos_(0), - indent_(0), - separator_(true),
+ : _pos(0), + _indent(0), + _separator(true),
_blockStart("{"),
_blockEnd("}"),
_useTab(true),
@@ -40,9 +40,9 @@ Slice::Output::Output() } Slice::Output::Output(const char* s) - : pos_(0), - indent_(0), - separator_(true),
+ : _pos(0), + _indent(0), + _separator(true),
_blockStart("{"),
_blockEnd("}"),
_useTab(true),
@@ -54,7 +54,7 @@ Slice::Output::Output(const char* s) void Slice::Output::open(const char* s) { - out_.open(s); + _out.open(s); } void @@ -63,49 +63,49 @@ Slice::Output::print(const char* s) for(unsigned int i = 0; i < strlen(s); ++i) { if(s[i] == '\n') - pos_ = 0; + _pos = 0; else - ++pos_; + ++_pos; } - out_ << s; + _out << s; } void Slice::Output::inc() { - indent_ += _indentSize; - separator_ = true; + _indent += _indentSize; + _separator = true; } void Slice::Output::dec() { - assert(indent_ >= _indentSize); - indent_ -= _indentSize; - separator_ = true; + assert(_indent >= _indentSize); + _indent -= _indentSize; + _separator = true; } void Slice::Output::useCurrentPosAsIndent() { - indentSave_.push(indent_); - indent_ = pos_; + _indentSave.push(_indent); + _indent = _pos; } void Slice::Output::zeroIndent() { - indentSave_.push(indent_); - indent_ = 0; + _indentSave.push(_indent); + _indent = 0; } void Slice::Output::restoreIndent() { - assert(!indentSave_.empty()); - indent_ = indentSave_.top(); - indentSave_.pop(); + assert(!_indentSave.empty()); + _indent = _indentSave.top(); + _indentSave.pop(); } void
@@ -135,19 +135,19 @@ Slice::Output::setUseTab(bool useTab) void Slice::Output::nl() { - out_ << '\n'; - pos_ = 0; - separator_ = true; + _out << '\n'; + _pos = 0; + _separator = true; - int indent = indent_; + int indent = _indent; if (_useTab)
{
while(indent >= 8)
{
indent -= 8;
- out_ << '\t';
- pos_ += 8;
+ _out << '\t';
+ _pos += 8;
}
}
else
@@ -155,29 +155,29 @@ Slice::Output::nl() while(indent >= _indentSize) { indent -= _indentSize; - out_ << " "; - pos_ += _indentSize; + _out << " "; + _pos += _indentSize; } }
while(indent > 0) { --indent; - out_ << ' '; - ++pos_; + _out << ' '; + ++_pos; } - out_.flush(); + _out.flush(); } void Slice::Output::sb() { nl(); - out_ << _blockStart; - ++pos_; + _out << _blockStart; + ++_pos; inc(); - separator_ = false; + _separator = false; } void @@ -185,21 +185,21 @@ Slice::Output::eb() { dec(); nl(); - out_ << _blockEnd; - --pos_; + _out << _blockEnd; + --_pos; } void Slice::Output::sp() { - if(separator_) - out_ << '\n'; + if(_separator) + _out << '\n'; } bool Slice::Output::operator!() const { - return !out_; + return !_out; } Output& diff --git a/cpp/src/Slice/OutputUtil.h b/cpp/src/Slice/OutputUtil.h index f4f634d5981..1d0c477fc4d 100644 --- a/cpp/src/Slice/OutputUtil.h +++ b/cpp/src/Slice/OutputUtil.h @@ -32,7 +32,7 @@ extern ICE_API Separator sp; // Indent // ---------------------------------------------------------------------- -class ICE_API Output : ::__Ice::noncopyable +class ICE_API Output : ::IceInternal::noncopyable { public: @@ -64,11 +64,11 @@ public: private: - std::ofstream out_; - int pos_; - int indent_; - std::stack<int> indentSave_; - bool separator_;
+ std::ofstream _out; + int _pos; + int _indent; + std::stack<int> _indentSave; + bool _separator;
std::string _blockStart;
std::string _blockEnd;
diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp index 0136ff47565..f5d8325ba27 100644 --- a/cpp/src/Slice/Parser.cpp +++ b/cpp/src/Slice/Parser.cpp @@ -21,42 +21,42 @@ Unit* unit; } -void __Ice::incRef(GrammerBase* p) { p -> __incRef(); } -void __Ice::decRef(GrammerBase* p) { p -> __decRef(); } -void __Ice::incRef(SyntaxTreeBase* p) { p -> __incRef(); } -void __Ice::decRef(SyntaxTreeBase* p) { p -> __decRef(); } -void __Ice::incRef(Type* p) { p -> __incRef(); } -void __Ice::decRef(Type* p) { p -> __decRef(); } -void __Ice::incRef(Builtin* p) { p -> __incRef(); } -void __Ice::decRef(Builtin* p) { p -> __decRef(); } -void __Ice::incRef(Contained* p) { p -> __incRef(); } -void __Ice::decRef(Contained* p) { p -> __decRef(); } -void __Ice::incRef(Container* p) { p -> __incRef(); } -void __Ice::decRef(Container* p) { p -> __decRef(); } -void __Ice::incRef(Module* p) { p -> __incRef(); } -void __Ice::decRef(Module* p) { p -> __decRef(); } -void __Ice::incRef(Constructed* p) { p -> __incRef(); } -void __Ice::decRef(Constructed* p) { p -> __decRef(); } -void __Ice::incRef(ClassDecl* p) { p -> __incRef(); } -void __Ice::decRef(ClassDecl* p) { p -> __decRef(); } -void __Ice::incRef(ClassDef* p) { p -> __incRef(); } -void __Ice::decRef(ClassDef* p) { p -> __decRef(); } -void __Ice::incRef(Proxy* p) { p -> __incRef(); } -void __Ice::decRef(Proxy* p) { p -> __decRef(); } -void __Ice::incRef(Operation* p) { p -> __incRef(); } -void __Ice::decRef(Operation* p) { p -> __decRef(); } -void __Ice::incRef(DataMember* p) { p -> __incRef(); } -void __Ice::decRef(DataMember* p) { p -> __decRef(); } -void __Ice::incRef(Vector* p) { p -> __incRef(); } -void __Ice::decRef(Vector* p) { p -> __decRef(); } -void __Ice::incRef(Enum* p) { p -> __incRef(); } -void __Ice::decRef(Enum* p) { p -> __decRef(); } -void __Ice::incRef(Enumerator* p) { p -> __incRef(); } -void __Ice::decRef(Enumerator* p) { p -> __decRef(); } -void __Ice::incRef(Native* p) { p -> __incRef(); } -void __Ice::decRef(Native* p) { p -> __decRef(); } -void __Ice::incRef(Unit* p) { p -> __incRef(); } -void __Ice::decRef(Unit* p) { p -> __decRef(); } +void IceInternal::incRef(GrammerBase* p) { p -> __incRef(); } +void IceInternal::decRef(GrammerBase* p) { p -> __decRef(); } +void IceInternal::incRef(SyntaxTreeBase* p) { p -> __incRef(); } +void IceInternal::decRef(SyntaxTreeBase* p) { p -> __decRef(); } +void IceInternal::incRef(Type* p) { p -> __incRef(); } +void IceInternal::decRef(Type* p) { p -> __decRef(); } +void IceInternal::incRef(Builtin* p) { p -> __incRef(); } +void IceInternal::decRef(Builtin* p) { p -> __decRef(); } +void IceInternal::incRef(Contained* p) { p -> __incRef(); } +void IceInternal::decRef(Contained* p) { p -> __decRef(); } +void IceInternal::incRef(Container* p) { p -> __incRef(); } +void IceInternal::decRef(Container* p) { p -> __decRef(); } +void IceInternal::incRef(Module* p) { p -> __incRef(); } +void IceInternal::decRef(Module* p) { p -> __decRef(); } +void IceInternal::incRef(Constructed* p) { p -> __incRef(); } +void IceInternal::decRef(Constructed* p) { p -> __decRef(); } +void IceInternal::incRef(ClassDecl* p) { p -> __incRef(); } +void IceInternal::decRef(ClassDecl* p) { p -> __decRef(); } +void IceInternal::incRef(ClassDef* p) { p -> __incRef(); } +void IceInternal::decRef(ClassDef* p) { p -> __decRef(); } +void IceInternal::incRef(Proxy* p) { p -> __incRef(); } +void IceInternal::decRef(Proxy* p) { p -> __decRef(); } +void IceInternal::incRef(Operation* p) { p -> __incRef(); } +void IceInternal::decRef(Operation* p) { p -> __decRef(); } +void IceInternal::incRef(DataMember* p) { p -> __incRef(); } +void IceInternal::decRef(DataMember* p) { p -> __decRef(); } +void IceInternal::incRef(Vector* p) { p -> __incRef(); } +void IceInternal::decRef(Vector* p) { p -> __decRef(); } +void IceInternal::incRef(Enum* p) { p -> __incRef(); } +void IceInternal::decRef(Enum* p) { p -> __decRef(); } +void IceInternal::incRef(Enumerator* p) { p -> __incRef(); } +void IceInternal::decRef(Enumerator* p) { p -> __decRef(); } +void IceInternal::incRef(Native* p) { p -> __incRef(); } +void IceInternal::decRef(Native* p) { p -> __decRef(); } +void IceInternal::incRef(Unit* p) { p -> __incRef(); } +void IceInternal::decRef(Unit* p) { p -> __decRef(); } // ---------------------------------------------------------------------- // SyntaxTreeBase @@ -65,13 +65,13 @@ void __Ice::decRef(Unit* p) { p -> __decRef(); } void Slice::SyntaxTreeBase::destroy() { - unit_ = 0; + _unit = 0; } -Unit_ptr +UnitPtr Slice::SyntaxTreeBase::unit() { - return unit_; + return _unit; } void @@ -79,8 +79,8 @@ Slice::SyntaxTreeBase::visit(ParserVisitor*) { } -Slice::SyntaxTreeBase::SyntaxTreeBase(const Unit_ptr& unit) - : unit_(unit) +Slice::SyntaxTreeBase::SyntaxTreeBase(const UnitPtr& unit) + : _unit(unit) { } @@ -88,7 +88,7 @@ Slice::SyntaxTreeBase::SyntaxTreeBase(const Unit_ptr& unit) // Type // ---------------------------------------------------------------------- -Slice::Type::Type(const Unit_ptr& unit) +Slice::Type::Type(const UnitPtr& unit) : SyntaxTreeBase(unit) { } @@ -100,13 +100,13 @@ Slice::Type::Type(const Unit_ptr& unit) Slice::Builtin::Kind Slice::Builtin::kind() { - return kind_; + return _kind; } -Slice::Builtin::Builtin(const Unit_ptr& unit, Kind kind) +Slice::Builtin::Builtin(const UnitPtr& unit, Kind kind) : Type(unit), SyntaxTreeBase(unit), - kind_(kind) + _kind(kind) { } @@ -114,52 +114,52 @@ Slice::Builtin::Builtin(const Unit_ptr& unit, Kind kind) // Contained // ---------------------------------------------------------------------- -Container_ptr +ContainerPtr Slice::Contained::container() { - return container_; + return _container; } string Slice::Contained::name() { - return name_; + return _name; } string Slice::Contained::scoped() { - return scoped_; + return _scoped; } string Slice::Contained::scope() { - string::size_type idx = scoped_.rfind("::"); + string::size_type idx = _scoped.rfind("::"); assert(idx != string::npos); - return string(scoped_, 0, idx); + return string(_scoped, 0, idx); } string Slice::Contained::comment() { - return comment_; + return _comment; } -Slice::Contained::Contained(const Container_ptr& container, +Slice::Contained::Contained(const ContainerPtr& container, const string& name) : SyntaxTreeBase(container -> unit()), - container_(container), - name_(name) + _container(container), + _name(name) { - Contained_ptr cont = Contained_ptr::dynamicCast(container_); + ContainedPtr cont = ContainedPtr::dynamicCast(_container); if(cont) - scoped_ = cont -> scoped(); - scoped_ += "::" + name_; - if(unit_) + _scoped = cont -> scoped(); + _scoped += "::" + _name; + if(_unit) { - unit_ -> addContent(this); - comment_ = unit_ -> currentComment(); + _unit -> addContent(this); + _comment = _unit -> currentComment(); } } @@ -186,46 +186,46 @@ Slice::operator==(Contained& l, Contained& r) void Slice::Container::destroy() { - for_each(contents_.begin(), contents_.end(), + for_each(_contents.begin(), _contents.end(), ::Ice::voidMemFun(&Contained::destroy)); - contents_.clear(); + _contents.clear(); SyntaxTreeBase::destroy(); } -Module_ptr +ModulePtr Slice::Container::createModule(const string& name) { - ContainedList matches = unit_ -> findContents(thisScope() + name); + ContainedList matches = _unit -> findContents(thisScope() + name); for(ContainedList::iterator p = matches.begin(); p != matches.end(); ++p) { - Module_ptr module = Module_ptr::dynamicCast(*p); + ModulePtr module = ModulePtr::dynamicCast(*p); if(module) continue; // Reopening modules is permissible string msg = "redefinition of `"; msg += name; msg += "' as module"; - unit_ -> error(msg); + _unit -> error(msg); return 0; } - Module_ptr q = new Module(this, name); - contents_.push_back(q); + ModulePtr q = new Module(this, name); + _contents.push_back(q); return q; } -ClassDef_ptr +ClassDefPtr Slice::Container::createClassDef(const string& name, bool local, bool intf, const ClassList& bases) { - ContainedList matches = unit_ -> findContents(thisScope() + name); + ContainedList matches = _unit -> findContents(thisScope() + name); for(ContainedList::iterator p = matches.begin(); p != matches.end(); ++p) { - ClassDecl_ptr cl = ClassDecl_ptr::dynamicCast(*p); + ClassDeclPtr cl = ClassDeclPtr::dynamicCast(*p); if(cl) { if(checkInterfaceAndLocal(name, false, @@ -236,10 +236,10 @@ Slice::Container::createClassDef(const string& name, bool local, bool intf, return 0; } - ClassDef_ptr def = ClassDef_ptr::dynamicCast(*p); + ClassDefPtr def = ClassDefPtr::dynamicCast(*p); if(def) { - if(unit_ -> ignRedefs()) + if(_unit -> ignRedefs()) return def; string msg = "redefinition of "; @@ -250,7 +250,7 @@ Slice::Container::createClassDef(const string& name, bool local, bool intf, msg += " `"; msg += name; msg += "'"; - unit_ -> error(msg); + _unit -> error(msg); return 0; } @@ -261,19 +261,19 @@ Slice::Container::createClassDef(const string& name, bool local, bool intf, msg += "interface"; else msg += "class"; - unit_ -> error(msg); + _unit -> error(msg); return 0; } - ClassDef_ptr def = new ClassDef(this, name, local, intf, bases); - contents_.push_back(def); + ClassDefPtr def = new ClassDef(this, name, local, intf, bases); + _contents.push_back(def); for(ContainedList::iterator q = matches.begin(); q != matches.end(); ++q) { - ClassDecl_ptr cl = ClassDecl_ptr::dynamicCast(*q); - cl -> definition_ = def; + ClassDeclPtr cl = ClassDeclPtr::dynamicCast(*q); + cl -> _definition = def; } // @@ -286,17 +286,17 @@ Slice::Container::createClassDef(const string& name, bool local, bool intf, return def; } -ClassDecl_ptr +ClassDeclPtr Slice::Container::createClassDecl(const string& name, bool local, bool intf) { - ClassDef_ptr def; + ClassDefPtr def; - ContainedList matches = unit_ -> findContents(thisScope() + name); + ContainedList matches = _unit -> findContents(thisScope() + name); for(ContainedList::iterator p = matches.begin(); p != matches.end(); ++p) { - ClassDef_ptr clDef = ClassDef_ptr::dynamicCast(*p); + ClassDefPtr clDef = ClassDefPtr::dynamicCast(*p); if(clDef) { if(checkInterfaceAndLocal(name, true, @@ -311,7 +311,7 @@ Slice::Container::createClassDecl(const string& name, bool local, bool intf) return 0; } - ClassDecl_ptr clDecl = ClassDecl_ptr::dynamicCast(*p); + ClassDeclPtr clDecl = ClassDeclPtr::dynamicCast(*p); if(clDecl) { if(checkInterfaceAndLocal(name, false, @@ -329,7 +329,7 @@ Slice::Container::createClassDecl(const string& name, bool local, bool intf) msg += "interface"; else msg += "class"; - unit_ -> error(msg); + _unit -> error(msg); return 0; } @@ -338,150 +338,150 @@ Slice::Container::createClassDecl(const string& name, bool local, bool intf) // have a declaration for the class in this container, we don't // create another one. // - for(ContainedList::iterator q = contents_.begin(); - q != contents_.end(); + for(ContainedList::iterator q = _contents.begin(); + q != _contents.end(); ++q) { if((*q) -> name() == name) { - ClassDecl_ptr cl = ClassDecl_ptr::dynamicCast(*q); + ClassDeclPtr cl = ClassDeclPtr::dynamicCast(*q); if(cl) return cl; - assert(ClassDef_ptr::dynamicCast(*q)); + assert(ClassDefPtr::dynamicCast(*q)); } } - ClassDecl_ptr cl = new ClassDecl(this, name, local, intf); - contents_.push_back(cl); + ClassDeclPtr cl = new ClassDecl(this, name, local, intf); + _contents.push_back(cl); if(def) - cl -> definition_ = def; + cl -> _definition = def; return cl; } -Vector_ptr -Slice::Container::createVector(const string& name, const Type_ptr& type) +VectorPtr +Slice::Container::createVector(const string& name, const TypePtr& type) { - ContainedList matches = unit_ -> findContents(thisScope() + name); + ContainedList matches = _unit -> findContents(thisScope() + name); if(!matches.empty()) { - Vector_ptr p = Vector_ptr::dynamicCast(matches.front()); + VectorPtr p = VectorPtr::dynamicCast(matches.front()); if(p) { - if(unit_ -> ignRedefs()) + if(_unit -> ignRedefs()) return p; string msg = "redefinition of vector `"; msg += name; msg += "'"; - unit_ -> error(msg); + _unit -> error(msg); return 0; } string msg = "redefinition of `"; msg += name; msg += "' as vector"; - unit_ -> error(msg); + _unit -> error(msg); return 0; } - Vector_ptr p = new Vector(this, name, type); - contents_.push_back(p); + VectorPtr p = new Vector(this, name, type); + _contents.push_back(p); return p; } -Enum_ptr +EnumPtr Slice::Container::createEnum(const string& name, const StringList& enumerators) { - ContainedList matches = unit_ -> findContents(thisScope() + name); + ContainedList matches = _unit -> findContents(thisScope() + name); if(!matches.empty()) { - Enum_ptr p = Enum_ptr::dynamicCast(matches.front()); + EnumPtr p = EnumPtr::dynamicCast(matches.front()); if(p) { - if(unit_ -> ignRedefs()) + if(_unit -> ignRedefs()) return p; string msg = "redefinition of enum `"; msg += name; msg += "'"; - unit_ -> error(msg); + _unit -> error(msg); return 0; } string msg = "redefinition of `"; msg += name; msg += "' as enum"; - unit_ -> error(msg); + _unit -> error(msg); return 0; } - Enum_ptr p = new Enum(this, name, enumerators); - contents_.push_back(p); + EnumPtr p = new Enum(this, name, enumerators); + _contents.push_back(p); return p; } -Enumerator_ptr +EnumeratorPtr Slice::Container::createEnumerator(const std::string& name) { - ContainedList matches = unit_ -> findContents(thisScope() + name); + ContainedList matches = _unit -> findContents(thisScope() + name); if(!matches.empty()) { - Enumerator_ptr p = Enumerator_ptr::dynamicCast(matches.front()); + EnumeratorPtr p = EnumeratorPtr::dynamicCast(matches.front()); if(p) { - if(unit_ -> ignRedefs()) + if(_unit -> ignRedefs()) return p; string msg = "redefinition of enumerator `"; msg += name; msg += "'"; - unit_ -> error(msg); + _unit -> error(msg); return 0; } string msg = "redefinition of `"; msg += name; msg += "' as enumerator"; - unit_ -> error(msg); + _unit -> error(msg); return 0; } - Enumerator_ptr p = new Enumerator(this, name); - contents_.push_back(p); + EnumeratorPtr p = new Enumerator(this, name); + _contents.push_back(p); return p; } -Native_ptr +NativePtr Slice::Container::createNative(const string& name) { - ContainedList matches = unit_ -> findContents(thisScope() + name); + ContainedList matches = _unit -> findContents(thisScope() + name); if(!matches.empty()) { - Native_ptr p = Native_ptr::dynamicCast(matches.front()); + NativePtr p = NativePtr::dynamicCast(matches.front()); if(p) { - if(unit_ -> ignRedefs()) + if(_unit -> ignRedefs()) return p; string msg = "redefinition of native `"; msg += name; msg += "'"; - unit_ -> error(msg); + _unit -> error(msg); return 0; } string msg = "redefinition of `"; msg += name; msg += "' as native"; - unit_ -> error(msg); + _unit -> error(msg); return 0; } - Native_ptr p = new Native(this, name); - contents_.push_back(p); + NativePtr p = new Native(this, name); + _contents.push_back(p); return p; } @@ -513,7 +513,7 @@ Slice::Container::lookupType(const string& scoped, bool printError) if(scoped == builtinTable[i]) { TypeList result; - result.push_back(unit_ -> builtin(static_cast<Builtin::Kind>(i))); + result.push_back(_unit -> builtin(static_cast<Builtin::Kind>(i))); return result; } } @@ -527,13 +527,13 @@ Slice::Container::lookupTypeNoBuiltin(const string& scoped, bool printError) assert(!scoped.empty()); if(scoped[0] == ':') - return unit_ -> lookupTypeNoBuiltin(scoped.substr(2), printError); + return _unit -> lookupTypeNoBuiltin(scoped.substr(2), printError); ContainedList matches = - unit_ -> findContents(thisScope() + scoped); + _unit -> findContents(thisScope() + scoped); if(matches.empty()) { - Contained_ptr contained = Contained_ptr::dynamicCast(this); + ContainedPtr contained = ContainedPtr::dynamicCast(this); if(!contained) { if(printError) @@ -541,7 +541,7 @@ Slice::Container::lookupTypeNoBuiltin(const string& scoped, bool printError) string msg = "`"; msg += scoped; msg += "' is not defined"; - unit_ -> error(msg); + _unit -> error(msg); } return TypeList(); } @@ -555,11 +555,11 @@ Slice::Container::lookupTypeNoBuiltin(const string& scoped, bool printError) p != matches.end(); ++p) { - ClassDef_ptr cl = ClassDef_ptr::dynamicCast(*p); + ClassDefPtr cl = ClassDefPtr::dynamicCast(*p); if(cl) continue; // Ignore class definitions - Type_ptr type = Type_ptr::dynamicCast(*p); + TypePtr type = TypePtr::dynamicCast(*p); if(!type) { if(printError) @@ -567,7 +567,7 @@ Slice::Container::lookupTypeNoBuiltin(const string& scoped, bool printError) string msg = "`"; msg += scoped; msg += "' is not a type"; - unit_ -> error(msg); + _unit -> error(msg); } return TypeList(); } @@ -583,13 +583,13 @@ Slice::Container::lookupContained(const string& scoped, bool printError) assert(!scoped.empty()); if(scoped[0] == ':') - return unit_ -> lookupContained(scoped.substr(2), printError); + return _unit -> lookupContained(scoped.substr(2), printError); ContainedList matches = - unit_ -> findContents(thisScope() + scoped); + _unit -> findContents(thisScope() + scoped); if(matches.empty()) { - Contained_ptr contained = Contained_ptr::dynamicCast(this); + ContainedPtr contained = ContainedPtr::dynamicCast(this); if(!contained) { if(printError) @@ -597,7 +597,7 @@ Slice::Container::lookupContained(const string& scoped, bool printError) string msg = "`"; msg += scoped; msg += "' is not defined"; - unit_ -> error(msg); + _unit -> error(msg); } return ContainedList(); } @@ -611,7 +611,7 @@ Slice::Container::lookupContained(const string& scoped, bool printError) p != matches.end(); ++p) { - if(!ClassDef_ptr::dynamicCast(*p)) // Ignore class definitions + if(!ClassDefPtr::dynamicCast(*p)) // Ignore class definitions results.push_back(*p); } return results; @@ -622,11 +622,11 @@ ModuleList Slice::Container::modules() { ModuleList result; - for(ContainedList::const_iterator p = contents_.begin(); - p != contents_.end(); + for(ContainedList::const_iterator p = _contents.begin(); + p != _contents.end(); ++p) { - Module_ptr q = Module_ptr::dynamicCast(*p); + ModulePtr q = ModulePtr::dynamicCast(*p); if(q) result.push_back(q); } @@ -637,11 +637,11 @@ ClassList Slice::Container::classes() { ClassList result; - for(ContainedList::const_iterator p = contents_.begin(); - p != contents_.end(); + for(ContainedList::const_iterator p = _contents.begin(); + p != _contents.end(); ++p) { - ClassDef_ptr q = ClassDef_ptr::dynamicCast(*p); + ClassDefPtr q = ClassDefPtr::dynamicCast(*p); if(q) result.push_back(q); } @@ -652,11 +652,11 @@ VectorList Slice::Container::vectors() { VectorList result; - for(ContainedList::const_iterator p = contents_.begin(); - p != contents_.end(); + for(ContainedList::const_iterator p = _contents.begin(); + p != _contents.end(); ++p) { - Vector_ptr q = Vector_ptr::dynamicCast(*p); + VectorPtr q = VectorPtr::dynamicCast(*p); if(q) result.push_back(q); } @@ -667,11 +667,11 @@ EnumList Slice::Container::enums() { EnumList result; - for(ContainedList::const_iterator p = contents_.begin(); - p != contents_.end(); + for(ContainedList::const_iterator p = _contents.begin(); + p != _contents.end(); ++p) { - Enum_ptr q = Enum_ptr::dynamicCast(*p); + EnumPtr q = EnumPtr::dynamicCast(*p); if(q) result.push_back(q); } @@ -682,11 +682,11 @@ NativeList Slice::Container::natives() { NativeList result; - for(ContainedList::const_iterator p = contents_.begin(); - p != contents_.end(); + for(ContainedList::const_iterator p = _contents.begin(); + p != _contents.end(); ++p) { - Native_ptr q = Native_ptr::dynamicCast(*p); + NativePtr q = NativePtr::dynamicCast(*p); if(q) result.push_back(q); } @@ -696,21 +696,21 @@ Slice::Container::natives() int Slice::Container::includeLevel() { - return includeLevel_; + return _includeLevel; } bool Slice::Container::hasProxies() { - for(ContainedList::const_iterator p = contents_.begin(); - p != contents_.end(); + for(ContainedList::const_iterator p = _contents.begin(); + p != _contents.end(); ++p) { - ClassDecl_ptr cl = ClassDecl_ptr::dynamicCast(*p); + ClassDeclPtr cl = ClassDeclPtr::dynamicCast(*p); if(cl && !cl -> isLocal()) return true; - Container_ptr container = Container_ptr::dynamicCast(*p); + ContainerPtr container = ContainerPtr::dynamicCast(*p); if(container && container -> hasProxies()) return true; } @@ -721,14 +721,14 @@ Slice::Container::hasProxies() bool Slice::Container::hasClassDecls() { - for(ContainedList::const_iterator p = contents_.begin(); - p != contents_.end(); + for(ContainedList::const_iterator p = _contents.begin(); + p != _contents.end(); ++p) { - if(ClassDecl_ptr::dynamicCast(*p)) + if(ClassDeclPtr::dynamicCast(*p)) return true; - Container_ptr container = Container_ptr::dynamicCast(*p); + ContainerPtr container = ContainerPtr::dynamicCast(*p); if(container && container -> hasClassDecls()) return true; } @@ -739,14 +739,14 @@ Slice::Container::hasClassDecls() bool Slice::Container::hasClassDefs() { - for(ContainedList::const_iterator p = contents_.begin(); - p != contents_.end(); + for(ContainedList::const_iterator p = _contents.begin(); + p != _contents.end(); ++p) { - if(ClassDef_ptr::dynamicCast(*p)) + if(ClassDefPtr::dynamicCast(*p)) return true; - Container_ptr container = Container_ptr::dynamicCast(*p); + ContainerPtr container = ContainerPtr::dynamicCast(*p); if(container && container -> hasClassDefs()) return true; } @@ -757,16 +757,16 @@ Slice::Container::hasClassDefs() bool Slice::Container::hasOtherConstructedTypes() { - for(ContainedList::const_iterator p = contents_.begin(); - p != contents_.end(); + for(ContainedList::const_iterator p = _contents.begin(); + p != _contents.end(); ++p) { - if(Constructed_ptr::dynamicCast(*p) && - !ClassDecl_ptr::dynamicCast(*p) && - !ClassDef_ptr::dynamicCast(*p)) + if(ConstructedPtr::dynamicCast(*p) && + !ClassDeclPtr::dynamicCast(*p) && + !ClassDefPtr::dynamicCast(*p)) return true; - Container_ptr container = Container_ptr::dynamicCast(*p); + ContainerPtr container = ContainerPtr::dynamicCast(*p); if(container && container -> hasOtherConstructedTypes()) return true; } @@ -778,7 +778,7 @@ string Slice::Container::thisScope() { string s; - Contained_ptr contained = Contained_ptr::dynamicCast(this); + ContainedPtr contained = ContainedPtr::dynamicCast(this); if(contained) s = contained -> scoped(); s += "::"; @@ -788,19 +788,19 @@ Slice::Container::thisScope() void Slice::Container::mergeModules() { - for(ContainedList::iterator p = contents_.begin(); - p != contents_.end(); + for(ContainedList::iterator p = _contents.begin(); + p != _contents.end(); ++p) { - Module_ptr mod1 = Module_ptr::dynamicCast(*p); + ModulePtr mod1 = ModulePtr::dynamicCast(*p); if(!mod1) continue; ContainedList::iterator q = p; ++q; - while(q != contents_.end()) + while(q != _contents.end()) { - Module_ptr mod2 = Module_ptr::dynamicCast(*q); + ModulePtr mod2 = ModulePtr::dynamicCast(*q); if(!mod2) { ++q; @@ -813,14 +813,14 @@ Slice::Container::mergeModules() continue; } - mod1 -> contents_.splice(mod1 -> contents_.end(), - mod2 -> contents_); + mod1 -> _contents.splice(mod1 -> _contents.end(), + mod2 -> _contents); - if(mod1 -> comment_.length() < mod2 -> comment_.length()) - mod1 -> comment_ = mod2 -> comment_; + if(mod1 -> _comment.length() < mod2 -> _comment.length()) + mod1 -> _comment = mod2 -> _comment; - unit_ -> removeContent(*q); - q = contents_.erase(q); + _unit -> removeContent(*q); + q = _contents.erase(q); } mod1 -> mergeModules(); @@ -830,36 +830,36 @@ Slice::Container::mergeModules() void Slice::Container::sort() { - for(ContainedList::iterator p = contents_.begin(); - p != contents_.end(); + for(ContainedList::iterator p = _contents.begin(); + p != _contents.end(); ++p) { - Container_ptr container = Module_ptr::dynamicCast(*p); + ContainerPtr container = ModulePtr::dynamicCast(*p); if(container) container -> sort(); } - contents_.sort(); + _contents.sort(); } void Slice::Container::visit(ParserVisitor* visitor) { - for(ContainedList::const_iterator p = contents_.begin(); - p != contents_.end(); + for(ContainedList::const_iterator p = _contents.begin(); + p != _contents.end(); ++p) { (*p) -> visit(visitor); } } -Slice::Container::Container(const Unit_ptr& unit) +Slice::Container::Container(const UnitPtr& unit) : SyntaxTreeBase(unit) { - if(unit_) - includeLevel_ = unit_ -> currentIncludeLevel(); + if(_unit) + _includeLevel = _unit -> currentIncludeLevel(); else - includeLevel_ = 0; + _includeLevel = 0; } bool @@ -880,7 +880,7 @@ Slice::Container::checkInterfaceAndLocal(const string& name, bool defined, msg += "' was "; msg += definedOrDeclared; msg += " as interface"; - unit_ -> error(msg); + _unit -> error(msg); return false; } @@ -891,7 +891,7 @@ Slice::Container::checkInterfaceAndLocal(const string& name, bool defined, msg += "' was "; msg += definedOrDeclared; msg += " as class"; - unit_ -> error(msg); + _unit -> error(msg); return false; } @@ -902,7 +902,7 @@ Slice::Container::checkInterfaceAndLocal(const string& name, bool defined, msg += "' was "; msg += definedOrDeclared; msg += " local"; - unit_ -> error(msg); + _unit -> error(msg); return false; } @@ -913,7 +913,7 @@ Slice::Container::checkInterfaceAndLocal(const string& name, bool defined, msg += "' was "; msg += definedOrDeclared; msg += " non-local"; - unit_ -> error(msg); + _unit -> error(msg); return false; } @@ -933,7 +933,7 @@ Slice::Module::containedType() void Slice::Module::visit(ParserVisitor* visitor) { - if(includeLevel_ > 0) + if(_includeLevel > 0) return; visitor -> visitModuleStart(this); @@ -941,7 +941,7 @@ Slice::Module::visit(ParserVisitor* visitor) visitor -> visitModuleEnd(this); } -Slice::Module::Module(const Container_ptr& container, +Slice::Module::Module(const ContainerPtr& container, const string& name) : Contained(container, name), Container(container -> unit()), @@ -953,7 +953,7 @@ Slice::Module::Module(const Container_ptr& container, // Constructed // ---------------------------------------------------------------------- -Slice::Constructed::Constructed(const Container_ptr& container, +Slice::Constructed::Constructed(const ContainerPtr& container, const string& name) : Type(container -> unit()), Contained(container, name), @@ -965,22 +965,22 @@ Slice::Constructed::Constructed(const Container_ptr& container, // ClassDecl // ---------------------------------------------------------------------- -ClassDef_ptr +ClassDefPtr Slice::ClassDecl::definition() { - return definition_; + return _definition; } bool Slice::ClassDecl::isLocal() { - return local_; + return _local; } bool Slice::ClassDecl::isInterface() { - return interface_; + return _interface; } Slice::Contained::ContainedType @@ -995,7 +995,7 @@ Slice::ClassDecl::visit(ParserVisitor* visitor) visitor -> visitClassDecl(this); } -Slice::ClassDecl::ClassDecl(const Container_ptr& container, +Slice::ClassDecl::ClassDecl(const ContainerPtr& container, const string& name, bool local, bool intf) @@ -1003,8 +1003,8 @@ Slice::ClassDecl::ClassDecl(const Container_ptr& container, Type(container -> unit()), Contained(container, name), SyntaxTreeBase(container -> unit()), - local_(local), - interface_(intf) + _local(local), + _interface(intf) { } @@ -1015,37 +1015,37 @@ Slice::ClassDecl::ClassDecl(const Container_ptr& container, void Slice::ClassDef::destroy() { - bases_.empty(); + _bases.empty(); Container::destroy(); } -Operation_ptr +OperationPtr Slice::ClassDef::createOperation(const string& name, - const Type_ptr& returnType, + const TypePtr& returnType, const TypeStringList& inParams, const TypeStringList& outParams, const TypeList& throws) { - ContainedList matches = unit_ -> findContents(thisScope() + name); + ContainedList matches = _unit -> findContents(thisScope() + name); if(!matches.empty()) { - Operation_ptr p = Operation_ptr::dynamicCast(matches.front()); + OperationPtr p = OperationPtr::dynamicCast(matches.front()); if(p) { - if(unit_ -> ignRedefs()) + if(_unit -> ignRedefs()) return p; string msg = "redefinition of operation `"; msg += name; msg += "'"; - unit_ -> error(msg); + _unit -> error(msg); return 0; } string msg = "redefinition of `"; msg += name; msg += "' as operation"; - unit_ -> error(msg); + _unit -> error(msg); return 0; } @@ -1065,7 +1065,7 @@ Slice::ClassDef::createOperation(const string& name, string msg = "duplicate parameter `"; msg += p -> second; msg += "'"; - unit_ -> error(msg); + _unit -> error(msg); return 0; } ++q; @@ -1083,41 +1083,41 @@ Slice::ClassDef::createOperation(const string& name, msg = "class name `"; msg += name; msg += "' can not be used as operation"; - unit_ -> error(msg); + _unit -> error(msg); return 0; } - Operation_ptr p = new Operation(this, name, returnType, + OperationPtr p = new Operation(this, name, returnType, inParams, outParams, throws); - contents_.push_back(p); + _contents.push_back(p); return p; } -DataMember_ptr -Slice::ClassDef::createDataMember(const string& name, const Type_ptr& type) +DataMemberPtr +Slice::ClassDef::createDataMember(const string& name, const TypePtr& type) { assert(!isInterface()); - ContainedList matches = unit_ -> findContents(thisScope() + name); + ContainedList matches = _unit -> findContents(thisScope() + name); if(!matches.empty()) { - DataMember_ptr p = DataMember_ptr::dynamicCast(matches.front()); + DataMemberPtr p = DataMemberPtr::dynamicCast(matches.front()); if(p) { - if(unit_ -> ignRedefs()) + if(_unit -> ignRedefs()) return p; string msg = "redefinition of data member `"; msg += name; msg += "'"; - unit_ -> error(msg); + _unit -> error(msg); return 0; } string msg = "redefinition of `"; msg += name; msg += "' as data member"; - unit_ -> error(msg); + _unit -> error(msg); return 0; } @@ -1130,29 +1130,29 @@ Slice::ClassDef::createDataMember(const string& name, const Type_ptr& type) msg = "class name `"; msg += name; msg += "' can not be used as data member"; - unit_ -> error(msg); + _unit -> error(msg); return 0; } - DataMember_ptr p = new DataMember(this, name, type); - contents_.push_back(p); + DataMemberPtr p = new DataMember(this, name, type); + _contents.push_back(p); return p; } ClassList Slice::ClassDef::bases() { - return bases_; + return _bases; } ClassList Slice::ClassDef::allBases() { - ClassList result = bases_; + ClassList result = _bases; result.sort(); result.unique(); - for(ClassList::iterator p = bases_.begin(); - p != bases_.end(); + for(ClassList::iterator p = _bases.begin(); + p != _bases.end(); ++p) { ClassList li = (*p) -> allBases(); @@ -1166,11 +1166,11 @@ OperationList Slice::ClassDef::operations() { OperationList result; - for(ContainedList::const_iterator p = contents_.begin(); - p != contents_.end(); + for(ContainedList::const_iterator p = _contents.begin(); + p != _contents.end(); ++p) { - Operation_ptr q = Operation_ptr::dynamicCast(*p); + OperationPtr q = OperationPtr::dynamicCast(*p); if(q) result.push_back(q); } @@ -1183,8 +1183,8 @@ Slice::ClassDef::allOperations() OperationList result = operations(); result.sort(); result.unique(); - for(ClassList::iterator p = bases_.begin(); - p != bases_.end(); + for(ClassList::iterator p = _bases.begin(); + p != _bases.end(); ++p) { OperationList li = (*p) -> allOperations(); @@ -1198,11 +1198,11 @@ DataMemberList Slice::ClassDef::dataMembers() { DataMemberList result; - for(ContainedList::const_iterator p = contents_.begin(); - p != contents_.end(); + for(ContainedList::const_iterator p = _contents.begin(); + p != _contents.end(); ++p) { - DataMember_ptr q = DataMember_ptr::dynamicCast(*p); + DataMemberPtr q = DataMemberPtr::dynamicCast(*p); if(q) result.push_back(q); } @@ -1215,14 +1215,14 @@ Slice::ClassDef::isAbstract() if(isInterface()) return true; - if(!bases_.empty() && bases_.front() -> isAbstract()) + if(!_bases.empty() && _bases.front() -> isAbstract()) return true; - for(ContainedList::const_iterator p = contents_.begin(); - p != contents_.end(); + for(ContainedList::const_iterator p = _contents.begin(); + p != _contents.end(); ++p) { - if(Operation_ptr::dynamicCast(*p)) + if(OperationPtr::dynamicCast(*p)) return true; } @@ -1232,13 +1232,13 @@ Slice::ClassDef::isAbstract() bool Slice::ClassDef::isLocal() { - return local_; + return _local; } bool Slice::ClassDef::isInterface() { - return interface_; + return _interface; } Slice::Contained::ContainedType @@ -1250,7 +1250,7 @@ Slice::ClassDef::containedType() void Slice::ClassDef::visit(ParserVisitor* visitor) { - if(includeLevel_ > 0) + if(_includeLevel > 0) return; visitor -> visitClassDefStart(this); @@ -1258,7 +1258,7 @@ Slice::ClassDef::visit(ParserVisitor* visitor) visitor -> visitClassDefEnd(this); } -Slice::ClassDef::ClassDef(const Container_ptr& container, +Slice::ClassDef::ClassDef(const ContainerPtr& container, const string& name, bool local, bool intf, @@ -1266,20 +1266,20 @@ Slice::ClassDef::ClassDef(const Container_ptr& container, : Contained(container, name), Container(container -> unit()), SyntaxTreeBase(container -> unit()), - local_(local), - interface_(intf), - bases_(bases) + _local(local), + _interface(intf), + _bases(bases) { // // First element of bases may be a class, all others must be // interfaces // #ifndef NDEBUG - for(ClassList::iterator p = bases_.begin(); - p != bases_.end(); + for(ClassList::iterator p = _bases.begin(); + p != _bases.end(); ++p) { - assert(p == bases_.begin() || (*p) -> isInterface()); + assert(p == _bases.begin() || (*p) -> isInterface()); } #endif } @@ -1288,16 +1288,16 @@ Slice::ClassDef::ClassDef(const Container_ptr& container, // Proxy // ---------------------------------------------------------------------- -ClassDecl_ptr +ClassDeclPtr Slice::Proxy::_class() { - return class_; + return __class; } -Slice::Proxy::Proxy(const ClassDecl_ptr& cl) +Slice::Proxy::Proxy(const ClassDeclPtr& cl) : Type(cl -> unit()), SyntaxTreeBase(cl -> unit()), - class_(cl) + __class(cl) { } @@ -1305,28 +1305,28 @@ Slice::Proxy::Proxy(const ClassDecl_ptr& cl) // Operation // ---------------------------------------------------------------------- -Type_ptr +TypePtr Slice::Operation::returnType() { - return returnType_; + return _returnType; } TypeStringList Slice::Operation::inputParameters() { - return inParams_; + return _inParams; } TypeStringList Slice::Operation::outputParameters() { - return outParams_; + return _outParams; } TypeList Slice::Operation::throws() { - return throws_; + return _throws; } Slice::Contained::ContainedType @@ -1341,18 +1341,18 @@ Slice::Operation::visit(ParserVisitor* visitor) visitor -> visitOperation(this); } -Slice::Operation::Operation(const Container_ptr& container, +Slice::Operation::Operation(const ContainerPtr& container, const string& name, - const Type_ptr& returnType, + const TypePtr& returnType, const TypeStringList& inParams, const TypeStringList& outParams, const TypeList& throws) : Contained(container, name), SyntaxTreeBase(container -> unit()), - returnType_(returnType), - inParams_(inParams), - outParams_(outParams), - throws_(throws) + _returnType(returnType), + _inParams(inParams), + _outParams(outParams), + _throws(throws) { } @@ -1360,10 +1360,10 @@ Slice::Operation::Operation(const Container_ptr& container, // DataMember // ---------------------------------------------------------------------- -Type_ptr +TypePtr Slice::DataMember::type() { - return type_; + return _type; } Slice::Contained::ContainedType @@ -1378,12 +1378,12 @@ Slice::DataMember::visit(ParserVisitor* visitor) visitor -> visitDataMember(this); } -Slice::DataMember::DataMember(const Container_ptr& container, +Slice::DataMember::DataMember(const ContainerPtr& container, const string& name, - const Type_ptr& type) + const TypePtr& type) : Contained(container, name), SyntaxTreeBase(container -> unit()), - type_(type) + _type(type) { } @@ -1403,7 +1403,7 @@ Slice::Native::visit(ParserVisitor* visitor) visitor -> visitNative(this); } -Slice::Native::Native(const Container_ptr& container, +Slice::Native::Native(const ContainerPtr& container, const string& name) : Constructed(container, name), Type(container -> unit()), @@ -1416,10 +1416,10 @@ Slice::Native::Native(const Container_ptr& container, // Vector // ---------------------------------------------------------------------- -Type_ptr +TypePtr Slice::Vector::type() { - return type_; + return _type; } Slice::Contained::ContainedType @@ -1434,14 +1434,14 @@ Slice::Vector::visit(ParserVisitor* visitor) visitor -> visitVector(this); } -Slice::Vector::Vector(const Container_ptr& container, +Slice::Vector::Vector(const ContainerPtr& container, const string& name, - const Type_ptr& type) + const TypePtr& type) : Constructed(container, name), Type(container -> unit()), Contained(container, name), SyntaxTreeBase(container -> unit()), - type_(type) + _type(type) { } @@ -1452,7 +1452,7 @@ Slice::Vector::Vector(const Container_ptr& container, Slice::StringList Slice::Enum::enumerators() { - return enumerators_; + return _enumerators; } Slice::Contained::ContainedType @@ -1467,14 +1467,14 @@ Slice::Enum::visit(ParserVisitor* visitor) visitor -> visitEnum(this); } -Slice::Enum::Enum(const Container_ptr& container, +Slice::Enum::Enum(const ContainerPtr& container, const string& name, const StringList& enumerators) : Constructed(container, name), Type(container -> unit()), Contained(container, name), SyntaxTreeBase(container -> unit()), - enumerators_(enumerators) + _enumerators(enumerators) { } @@ -1488,7 +1488,7 @@ Slice::Enumerator::containedType() return ContainedTypeEnumerator; } -Slice::Enumerator::Enumerator(const Container_ptr& container, +Slice::Enumerator::Enumerator(const ContainerPtr& container, const string& name) : Contained(container, name), SyntaxTreeBase(container -> unit()) @@ -1499,7 +1499,7 @@ Slice::Enumerator::Enumerator(const Container_ptr& container, // Unit // ---------------------------------------------------------------------- -Unit_ptr +UnitPtr Slice::Unit::createUnit(bool ignRedefs, bool all) { return new Unit(ignRedefs, all); @@ -1508,13 +1508,13 @@ Slice::Unit::createUnit(bool ignRedefs, bool all) bool Slice::Unit::ignRedefs() { - return ignRedefs_; + return _ignRedefs; } void Slice::Unit::setComment(const std::string& comment) { - currentComment_.empty(); + _currentComment.empty(); string::size_type end = 0; while(true) @@ -1524,7 +1524,7 @@ Slice::Unit::setComment(const std::string& comment) break; end = comment.find('\n', begin); - currentComment_ += comment.substr(begin, end - begin + 1); + _currentComment += comment.substr(begin, end - begin + 1); } } @@ -1532,14 +1532,14 @@ std::string Slice::Unit::currentComment() { string comment; - comment.swap(currentComment_); + comment.swap(_currentComment); return comment; } void Slice::Unit::nextLine() { - currentLine_++; + _currentLine++; } void @@ -1556,7 +1556,7 @@ Slice::Unit::scanPosition(const char* s) if(idx != string::npos) line.erase(0, idx); - currentLine_ = atoi(line.c_str()) - 1; + _currentLine = atoi(line.c_str()) - 1; idx = line.find_first_of(" \t\r"); if(idx != string::npos) @@ -1570,11 +1570,11 @@ Slice::Unit::scanPosition(const char* s) idx = line.find_first_of(" \t\r\""); if(idx != string::npos) { - currentFile_ = line.substr(0, idx); + _currentFile = line.substr(0, idx); line.erase(0, idx + 1); } else - currentFile_ = line; + _currentFile = line; idx = line.find_first_not_of(" \t\r"); if(idx != string::npos) @@ -1583,24 +1583,24 @@ Slice::Unit::scanPosition(const char* s) int val = atoi(line.c_str()); if(val == 1) { - if(++currentIncludeLevel_ == 1) + if(++_currentIncludeLevel == 1) { - if(find(includeFiles_.begin(), includeFiles_.end(), - currentFile_) == includeFiles_.end()) + if(find(_includeFiles.begin(), _includeFiles.end(), + _currentFile) == _includeFiles.end()) { - includeFiles_.push_back(currentFile_); + _includeFiles.push_back(_currentFile); } } } else if(val == 2) { - --currentIncludeLevel_; + --_currentIncludeLevel; } } else { - if(currentIncludeLevel_ == 0) - topLevelFile_ = currentFile_; + if(_currentIncludeLevel == 0) + _topLevelFile = _currentFile; } } } @@ -1608,16 +1608,16 @@ Slice::Unit::scanPosition(const char* s) int Slice::Unit::currentIncludeLevel() { - if(all_) + if(_all) return 0; else - return currentIncludeLevel_; + return _currentIncludeLevel; } void Slice::Unit::error(const char* s) { - cerr << currentFile_ << ':' << currentLine_ << " error: " << s << endl; + cerr << _currentFile << ':' << _currentLine << " error: " << s << endl; yynerrs++; } @@ -1630,7 +1630,7 @@ Slice::Unit::error(const string& s) void Slice::Unit::warning(const char* s) { - cerr << currentFile_ << ':' << currentLine_ << " warning: " << s << endl; + cerr << _currentFile << ':' << _currentLine << " warning: " << s << endl; } void @@ -1639,38 +1639,38 @@ Slice::Unit::warning(const string& s) warning(s.c_str()); } -Container_ptr +ContainerPtr Slice::Unit::currentContainer() { - assert(!containerStack_.empty()); - return containerStack_.top(); + assert(!_containerStack.empty()); + return _containerStack.top(); } void -Slice::Unit::pushContainer(const Container_ptr& cont) +Slice::Unit::pushContainer(const ContainerPtr& cont) { - containerStack_.push(cont); + _containerStack.push(cont); } void Slice::Unit::popContainer() { - assert(!containerStack_.empty()); - containerStack_.pop(); + assert(!_containerStack.empty()); + _containerStack.pop(); } void -Slice::Unit::addContent(const Contained_ptr& contained) +Slice::Unit::addContent(const ContainedPtr& contained) { - contentMap_[contained -> scoped()].push_back(contained); + _contentMap[contained -> scoped()].push_back(contained); } void -Slice::Unit::removeContent(const Contained_ptr& contained) +Slice::Unit::removeContent(const ContainedPtr& contained) { string scoped = contained -> scoped(); - map<string, ContainedList >::iterator p = contentMap_.find(scoped); - assert(p != contentMap_.end()); + map<string, ContainedList >::iterator p = _contentMap.find(scoped); + assert(p != _contentMap.end()); ContainedList::iterator q; for(q = p -> second.begin(); q != p -> second.end(); ++q) { @@ -1689,9 +1689,9 @@ Slice::Unit::findContents(const string& scoped) assert(!scoped.empty()); assert(scoped[0] == ':'); - map<string, ContainedList >::iterator p = contentMap_.find(scoped); + map<string, ContainedList >::iterator p = _contentMap.find(scoped); - if(p != contentMap_.end()) + if(p != _contentMap.end()) return p -> second; else return ContainedList(); @@ -1700,7 +1700,7 @@ Slice::Unit::findContents(const string& scoped) StringList Slice::Unit::includeFiles() { - return includeFiles_; + return _includeFiles; } int @@ -1712,11 +1712,11 @@ Slice::Unit::parse(FILE* file, bool debug) assert(!Slice::unit); Slice::unit = this; - currentLine_ = 1; - currentIncludeLevel_ = 0; - currentFile_ = "<standard input>"; - topLevelFile_ = currentFile_; - includeFiles_.clear(); + _currentLine = 1; + _currentIncludeLevel = 0; + _currentFile = "<standard input>"; + _topLevelFile = _currentFile; + _includeFiles.clear(); pushContainer(this); extern FILE* yyin; @@ -1725,7 +1725,7 @@ Slice::Unit::parse(FILE* file, bool debug) if(yynerrs) status = EXIT_FAILURE; - assert(containerStack_.size() == 1); + assert(_containerStack.size() == 1); popContainer(); Slice::unit = 0; @@ -1735,7 +1735,7 @@ Slice::Unit::parse(FILE* file, bool debug) void Slice::Unit::destroy() { - builtins_.clear(); + _builtins.clear(); Container::destroy(); } @@ -1747,22 +1747,22 @@ Slice::Unit::visit(ParserVisitor* visitor) visitor -> visitUnitEnd(this); } -Builtin_ptr +BuiltinPtr Slice::Unit::builtin(Builtin::Kind kind) { - map<Builtin::Kind, Builtin_ptr>::iterator p = builtins_.find(kind); - if(p != builtins_.end()) + map<Builtin::Kind, BuiltinPtr>::iterator p = _builtins.find(kind); + if(p != _builtins.end()) return p -> second; - Builtin_ptr builtin = new Builtin(this, kind); - builtins_.insert(make_pair(kind, builtin)); + BuiltinPtr builtin = new Builtin(this, kind); + _builtins.insert(make_pair(kind, builtin)); return builtin; } Slice::Unit::Unit(bool ignRedefs, bool all) : SyntaxTreeBase(0), Container(0), - ignRedefs_(ignRedefs), - all_(all) + _ignRedefs(ignRedefs), + _all(all) { - unit_ = this; + _unit = this; } diff --git a/cpp/src/Slice/Parser.h b/cpp/src/Slice/Parser.h index dbea3b36af2..dea9a391676 100644 --- a/cpp/src/Slice/Parser.h +++ b/cpp/src/Slice/Parser.h @@ -46,7 +46,7 @@ class Unit; } -namespace __Ice +namespace IceInternal { void ICE_API incRef(::Slice::GrammerBase*); @@ -91,42 +91,42 @@ void ICE_API decRef(::Slice::Unit*); namespace Slice { -typedef ::__Ice::Handle<GrammerBase> GrammerBase_ptr; -typedef ::__Ice::Handle<SyntaxTreeBase> SyntaxTreeBase_ptr; -typedef ::__Ice::Handle<Type> Type_ptr; -typedef ::__Ice::Handle<Builtin> Builtin_ptr; -typedef ::__Ice::Handle<Contained> Contained_ptr; -typedef ::__Ice::Handle<Container> Container_ptr; -typedef ::__Ice::Handle<Module> Module_ptr; -typedef ::__Ice::Handle<Constructed> Constructed_ptr; -typedef ::__Ice::Handle<ClassDecl> ClassDecl_ptr; -typedef ::__Ice::Handle<ClassDef> ClassDef_ptr; -typedef ::__Ice::Handle<Proxy> Proxy_ptr; -typedef ::__Ice::Handle<Operation> Operation_ptr; -typedef ::__Ice::Handle<DataMember> DataMember_ptr; -typedef ::__Ice::Handle<Vector> Vector_ptr; -typedef ::__Ice::Handle<Enum> Enum_ptr; -typedef ::__Ice::Handle<Enumerator> Enumerator_ptr; -typedef ::__Ice::Handle<Native> Native_ptr; -typedef ::__Ice::Handle<Unit> Unit_ptr; +typedef ::IceInternal::Handle<GrammerBase> GrammerBasePtr; +typedef ::IceInternal::Handle<SyntaxTreeBase> SyntaxTreeBasePtr; +typedef ::IceInternal::Handle<Type> TypePtr; +typedef ::IceInternal::Handle<Builtin> BuiltinPtr; +typedef ::IceInternal::Handle<Contained> ContainedPtr; +typedef ::IceInternal::Handle<Container> ContainerPtr; +typedef ::IceInternal::Handle<Module> ModulePtr; +typedef ::IceInternal::Handle<Constructed> ConstructedPtr; +typedef ::IceInternal::Handle<ClassDecl> ClassDeclPtr; +typedef ::IceInternal::Handle<ClassDef> ClassDefPtr; +typedef ::IceInternal::Handle<Proxy> ProxyPtr; +typedef ::IceInternal::Handle<Operation> OperationPtr; +typedef ::IceInternal::Handle<DataMember> DataMemberPtr; +typedef ::IceInternal::Handle<Vector> VectorPtr; +typedef ::IceInternal::Handle<Enum> EnumPtr; +typedef ::IceInternal::Handle<Enumerator> EnumeratorPtr; +typedef ::IceInternal::Handle<Native> NativePtr; +typedef ::IceInternal::Handle<Unit> UnitPtr; } namespace Slice { -typedef std::list<Type_ptr> TypeList; +typedef std::list<TypePtr> TypeList; typedef std::list<std::string> StringList; -typedef std::pair<Type_ptr, std::string> TypeString; +typedef std::pair<TypePtr, std::string> TypeString; typedef std::list<TypeString> TypeStringList; -typedef std::list<Contained_ptr> ContainedList; -typedef std::list<Module_ptr> ModuleList; -typedef std::list<ClassDef_ptr> ClassList; -typedef std::list<Vector_ptr> VectorList; -typedef std::list<Enum_ptr> EnumList; -typedef std::list<Native_ptr> NativeList; -typedef std::list<Operation_ptr> OperationList; -typedef std::list<DataMember_ptr> DataMemberList; +typedef std::list<ContainedPtr> ContainedList; +typedef std::list<ModulePtr> ModuleList; +typedef std::list<ClassDefPtr> ClassList; +typedef std::list<VectorPtr> VectorList; +typedef std::list<EnumPtr> EnumList; +typedef std::list<NativePtr> NativeList; +typedef std::list<OperationPtr> OperationList; +typedef std::list<DataMemberPtr> DataMemberList; // ---------------------------------------------------------------------- // ParserVisitor @@ -137,29 +137,29 @@ class ICE_API ParserVisitor public: virtual ~ParserVisitor() { } - virtual void visitUnitStart(const Unit_ptr&) { }; - virtual void visitUnitEnd(const Unit_ptr&) { }; - virtual void visitModuleStart(const Module_ptr&) { }; - virtual void visitModuleEnd(const Module_ptr&) { }; - virtual void visitClassDecl(const ClassDecl_ptr&) { }; - virtual void visitClassDefStart(const ClassDef_ptr&) { }; - virtual void visitClassDefEnd(const ClassDef_ptr&) { }; - virtual void visitOperation(const Operation_ptr&) { }; - virtual void visitDataMember(const DataMember_ptr&) { }; - virtual void visitVector(const Vector_ptr&) { }; - virtual void visitEnum(const Enum_ptr&) { }; - virtual void visitNative(const Native_ptr&) { }; + virtual void visitUnitStart(const UnitPtr&) { }; + virtual void visitUnitEnd(const UnitPtr&) { }; + virtual void visitModuleStart(const ModulePtr&) { }; + virtual void visitModuleEnd(const ModulePtr&) { }; + virtual void visitClassDecl(const ClassDeclPtr&) { }; + virtual void visitClassDefStart(const ClassDefPtr&) { }; + virtual void visitClassDefEnd(const ClassDefPtr&) { }; + virtual void visitOperation(const OperationPtr&) { }; + virtual void visitDataMember(const DataMemberPtr&) { }; + virtual void visitVector(const VectorPtr&) { }; + virtual void visitEnum(const EnumPtr&) { }; + virtual void visitNative(const NativePtr&) { }; }; // ---------------------------------------------------------------------- // GrammerBase // ---------------------------------------------------------------------- -class ICE_API GrammerBase : public ::__Ice::SimpleShared +class ICE_API GrammerBase : public ::IceInternal::SimpleShared { }; -#define YYSTYPE Slice::GrammerBase_ptr +#define YYSTYPE Slice::GrammerBasePtr // ---------------------------------------------------------------------- // SyntaxTreeBase @@ -170,14 +170,14 @@ class ICE_API SyntaxTreeBase : public GrammerBase public: virtual void destroy(); - Unit_ptr unit(); + UnitPtr unit(); virtual void visit(ParserVisitor*); protected: - SyntaxTreeBase(const Unit_ptr&); + SyntaxTreeBase(const UnitPtr&); - Unit_ptr unit_; + UnitPtr _unit; }; // ---------------------------------------------------------------------- @@ -190,7 +190,7 @@ public: protected: - Type(const Unit_ptr&); + Type(const UnitPtr&); }; // ---------------------------------------------------------------------- @@ -220,10 +220,10 @@ public: protected: - Builtin(const Unit_ptr&, Kind); + Builtin(const UnitPtr&, Kind); friend class ICE_API Unit; - Kind kind_; + Kind _kind; }; // ---------------------------------------------------------------------- @@ -234,7 +234,7 @@ class ICE_API Contained : virtual public SyntaxTreeBase { public: - Container_ptr container(); + ContainerPtr container(); std::string name(); std::string scoped(); std::string scope(); @@ -255,14 +255,14 @@ public: protected: - Contained(const Container_ptr&, + Contained(const ContainerPtr&, const std::string&); friend class ICE_API Container; - Container_ptr container_; - std::string name_; - std::string scoped_; - std::string comment_; + ContainerPtr _container; + std::string _name; + std::string _scoped; + std::string _comment; }; bool ICE_API operator<(Contained&, Contained&); @@ -277,14 +277,14 @@ class ICE_API Container : virtual public SyntaxTreeBase public: virtual void destroy(); - Module_ptr createModule(const std::string&); - ClassDef_ptr createClassDef(const std::string&, bool, bool, + ModulePtr createModule(const std::string&); + ClassDefPtr createClassDef(const std::string&, bool, bool, const ClassList&); - ClassDecl_ptr createClassDecl(const std::string&, bool, bool); - Vector_ptr createVector(const std::string&, const Type_ptr&); - Enum_ptr createEnum(const std::string&, const StringList&); - Enumerator_ptr createEnumerator(const std::string&); - Native_ptr createNative(const std::string&); + ClassDeclPtr createClassDecl(const std::string&, bool, bool); + VectorPtr createVector(const std::string&, const TypePtr&); + EnumPtr createEnum(const std::string&, const StringList&); + EnumeratorPtr createEnumerator(const std::string&); + NativePtr createNative(const std::string&); TypeList lookupType(const std::string&, bool = true); TypeList lookupTypeNoBuiltin(const std::string&, bool = true); ContainedList lookupContained(const std::string&, bool = true); @@ -305,13 +305,13 @@ public: protected: - Container(const Unit_ptr&); + Container(const UnitPtr&); bool checkInterfaceAndLocal(const std::string&, bool, bool, bool, bool, bool); - int includeLevel_; - ContainedList contents_; + int _includeLevel; + ContainedList _contents; }; // ---------------------------------------------------------------------- @@ -327,7 +327,7 @@ public: protected: - Module(const Container_ptr&, + Module(const ContainerPtr&, const std::string&); friend class ICE_API Container; }; @@ -342,7 +342,7 @@ public: protected: - Constructed(const Container_ptr&, + Constructed(const ContainerPtr&, const std::string&); }; @@ -354,7 +354,7 @@ class ICE_API ClassDecl : virtual public Constructed { public: - ClassDef_ptr definition(); + ClassDefPtr definition(); bool isLocal(); bool isInterface(); virtual ContainedType containedType(); @@ -362,16 +362,16 @@ public: protected: - ClassDecl(const Container_ptr&, + ClassDecl(const ContainerPtr&, const std::string&, bool, bool); friend class ICE_API Container; friend class ICE_API ClassDef; - ClassDef_ptr definition_; - bool local_; - bool interface_; + ClassDefPtr _definition; + bool _local; + bool _interface; }; // ---------------------------------------------------------------------- @@ -383,10 +383,10 @@ class ICE_API ClassDef : virtual public Container, virtual public Contained public: virtual void destroy(); - Operation_ptr createOperation(const std::string&, const Type_ptr&, + OperationPtr createOperation(const std::string&, const TypePtr&, const TypeStringList&, const TypeStringList&, const TypeList&); - DataMember_ptr createDataMember(const std::string&, const Type_ptr&); + DataMemberPtr createDataMember(const std::string&, const TypePtr&); ClassList bases(); ClassList allBases(); OperationList operations(); @@ -400,16 +400,16 @@ public: protected: - ClassDef(const Container_ptr&, + ClassDef(const ContainerPtr&, const std::string&, bool, bool, const ClassList&); friend class ICE_API Container; - bool local_; - bool interface_; - ClassList bases_; + bool _local; + bool _interface; + ClassList _bases; }; // ---------------------------------------------------------------------- @@ -420,13 +420,13 @@ class ICE_API Proxy : virtual public Type { public: - ClassDecl_ptr _class(); + ClassDeclPtr _class(); - Proxy(const ClassDecl_ptr&); + Proxy(const ClassDeclPtr&); protected: - ClassDecl_ptr class_; + ClassDeclPtr __class; }; // ---------------------------------------------------------------------- @@ -437,7 +437,7 @@ class ICE_API Operation : virtual public Contained { public: - Type_ptr returnType(); + TypePtr returnType(); TypeStringList inputParameters(); TypeStringList outputParameters(); TypeList throws(); @@ -446,18 +446,18 @@ public: protected: - Operation(const Container_ptr&, + Operation(const ContainerPtr&, const std::string&, - const Type_ptr&, + const TypePtr&, const TypeStringList&, const TypeStringList&, const TypeList&); friend class ICE_API ClassDef; - Type_ptr returnType_; - TypeStringList inParams_; - TypeStringList outParams_; - TypeList throws_; + TypePtr _returnType; + TypeStringList _inParams; + TypeStringList _outParams; + TypeList _throws; }; // ---------------------------------------------------------------------- @@ -468,18 +468,18 @@ class ICE_API DataMember : virtual public Contained { public: - Type_ptr type(); + TypePtr type(); virtual ContainedType containedType(); virtual void visit(ParserVisitor*); protected: - DataMember(const Container_ptr&, + DataMember(const ContainerPtr&, const std::string&, - const Type_ptr&); + const TypePtr&); friend class ICE_API ClassDef; - Type_ptr type_; + TypePtr _type; }; // ---------------------------------------------------------------------- @@ -490,18 +490,18 @@ class ICE_API Vector : virtual public Constructed { public: - Type_ptr type(); + TypePtr type(); virtual ContainedType containedType(); virtual void visit(ParserVisitor*); protected: - Vector(const Container_ptr&, + Vector(const ContainerPtr&, const std::string&, - const Type_ptr&); + const TypePtr&); friend class ICE_API Container; - Type_ptr type_; + TypePtr _type; }; // ---------------------------------------------------------------------- @@ -518,12 +518,12 @@ public: protected: - Enum(const Container_ptr&, + Enum(const ContainerPtr&, const std::string&, const StringList&); friend class ICE_API Container; - StringList enumerators_; + StringList _enumerators; }; // ---------------------------------------------------------------------- @@ -538,7 +538,7 @@ public: protected: - Enumerator(const Container_ptr&, + Enumerator(const ContainerPtr&, const std::string&); friend class ICE_API Container; }; @@ -556,7 +556,7 @@ public: protected: - Native(const Container_ptr&, + Native(const ContainerPtr&, const std::string&); friend class Container; }; @@ -569,7 +569,7 @@ class ICE_API Unit : virtual public Container { public: - static Unit_ptr createUnit(bool, bool); + static UnitPtr createUnit(bool, bool); bool ignRedefs(); @@ -586,12 +586,12 @@ public: void warning(const char*); void warning(const std::string&); - Container_ptr currentContainer(); - void pushContainer(const Container_ptr&); + ContainerPtr currentContainer(); + void pushContainer(const ContainerPtr&); void popContainer(); - void addContent(const Contained_ptr&); - void removeContent(const Contained_ptr&); + void addContent(const ContainedPtr&); + void removeContent(const ContainedPtr&); ContainedList findContents(const std::string&); StringList includeFiles(); @@ -601,23 +601,23 @@ public: virtual void destroy(); virtual void visit(ParserVisitor*); - Builtin_ptr builtin(Builtin::Kind); + BuiltinPtr builtin(Builtin::Kind); private: Unit(bool, bool); - bool ignRedefs_; - bool all_; - std::string currentComment_; - int currentLine_; - int currentIncludeLevel_; - std::string currentFile_; - std::string topLevelFile_; - StringList includeFiles_; - std::stack<Container_ptr> containerStack_; - std::map<Builtin::Kind, Builtin_ptr> builtins_; - std::map<std::string, ContainedList > contentMap_; + bool _ignRedefs; + bool _all; + std::string _currentComment; + int _currentLine; + int _currentIncludeLevel; + std::string _currentFile; + std::string _topLevelFile; + StringList _includeFiles; + std::stack<ContainerPtr> _containerStack; + std::map<Builtin::Kind, BuiltinPtr> _builtins; + std::map<std::string, ContainedList > _contentMap; }; extern Unit* unit; // The current parser for bison/flex diff --git a/cpp/src/Slice/Scanner.l b/cpp/src/Slice/Scanner.l index 1a9779c1d2d..bbdd885a298 100644 --- a/cpp/src/Slice/Scanner.l +++ b/cpp/src/Slice/Scanner.l @@ -189,7 +189,7 @@ L [a-zA-Z_] if(s[0] == '\\') // Strip leading backslash ++s; - StringTok_ptr ident = new StringTok; + StringTokPtr ident = new StringTok; ident -> v = s; yylval = ident; return ICE_IDENTIFIER; @@ -201,7 +201,7 @@ L [a-zA-Z_] if(s[0] == '\\') // Strip leading backslash ++s; - StringTok_ptr ident = new StringTok; + StringTokPtr ident = new StringTok; ident -> v = s; ident -> v.erase(ident -> v.find_first_of(" \t\v\n\r\f(")); yylval = ident; diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index 3225095bfa8..398dcc8cfbe 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -42,28 +42,28 @@ Slice::Gen::Gen(const string& name, const string& include, const vector<string>& includePaths, const string& dllExport) - : base_(base), - include_(include), - includePaths_(includePaths), - dllExport_(dllExport) + : _base(base), + _include(include), + _includePaths(includePaths), + _dllExport(dllExport) { - for(vector<string>::iterator p = includePaths_.begin(); - p != includePaths_.end(); + for(vector<string>::iterator p = _includePaths.begin(); + p != _includePaths.end(); ++p) { if(p -> length() && (*p)[p -> length() - 1] != '/') *p += '/'; } - if(dllExport_.length()) - dllExport_ = " " + dllExport_; + if(_dllExport.length()) + _dllExport = " " + _dllExport; - string::size_type pos = base_.rfind('/'); + string::size_type pos = _base.rfind('/'); if(pos != string::npos) - base_.erase(0, pos + 1); + _base.erase(0, pos + 1); - string fileH = base_ + ".h"; - string fileC = base_ + ".cpp"; + string fileH = _base + ".h"; + string fileC = _base + ".cpp"; H.open(fileH.c_str()); if(!H) @@ -103,12 +103,12 @@ Slice::Gen::operator!() const } void -Slice::Gen::generate(const Unit_ptr& unit) +Slice::Gen::generate(const UnitPtr& unit) { C << "\n#include <"; - if(include_.length()) - C << include_ << '/'; - C << base_ << ".h>"; + if(_include.length()) + C << _include << '/'; + C << _base << ".h>"; H << "\n#include <Ice/ProxyF.h>"; H << "\n#include <Ice/ObjectF.h>"; @@ -154,31 +154,31 @@ Slice::Gen::generate(const Unit_ptr& unit) C << "\n#endif"; C.restoreIndent(); - ProxyDeclVisitor proxyDeclVisitor(H, C, dllExport_); + ProxyDeclVisitor proxyDeclVisitor(H, C, _dllExport); unit -> visit(&proxyDeclVisitor); - ObjectDeclVisitor objectDeclVisitor(H, C, dllExport_); + ObjectDeclVisitor objectDeclVisitor(H, C, _dllExport); unit -> visit(&objectDeclVisitor); - IceVisitor iceVisitor(H, C, dllExport_); + IceVisitor iceVisitor(H, C, _dllExport); unit -> visit(&iceVisitor); - HandleVisitor handleVisitor(H, C, dllExport_); + HandleVisitor handleVisitor(H, C, _dllExport); unit -> visit(&handleVisitor); - TypesVisitor typesVisitor(H, C, dllExport_); + TypesVisitor typesVisitor(H, C, _dllExport); unit -> visit(&typesVisitor); - ProxyVisitor proxyVisitor(H, C, dllExport_); + ProxyVisitor proxyVisitor(H, C, _dllExport); unit -> visit(&proxyVisitor); - DelegateVisitor delegateVisitor(H, C, dllExport_); + DelegateVisitor delegateVisitor(H, C, _dllExport); unit -> visit(&delegateVisitor); - DelegateMVisitor delegateMVisitor(H, C, dllExport_); + DelegateMVisitor delegateMVisitor(H, C, _dllExport); unit -> visit(&delegateMVisitor); - ObjectVisitor objectVisitor(H, C, dllExport_); + ObjectVisitor objectVisitor(H, C, _dllExport); unit -> visit(&objectVisitor); } @@ -186,8 +186,8 @@ string Slice::Gen::changeInclude(const string& orig) { string file = orig; - for(vector<string>::iterator p = includePaths_.begin(); - p != includePaths_.end(); + for(vector<string>::iterator p = _includePaths.begin(); + p != _includePaths.end(); ++p) { if(orig.compare(0, p -> length(), *p) == 0) @@ -221,19 +221,19 @@ Slice::Gen::printHeader(Output& out) ; out << header; - out << "\n// Generated from file `" << changeInclude(base_) << ".ice'"; + out << "\n// Generated from file `" << changeInclude(_base) << ".ice'"; out << "\n// Ice version " << ICE_STRING_VERSION; out << '\n'; } Slice::Gen::TypesVisitor::TypesVisitor(Output& h, Output& c, const string& dllExport) - : H(h), C(c), dllExport_(dllExport) + : H(h), C(c), _dllExport(dllExport) { } void -Slice::Gen::TypesVisitor::visitModuleStart(const Module_ptr& p) +Slice::Gen::TypesVisitor::visitModuleStart(const ModulePtr& p) { if(!p -> hasOtherConstructedTypes()) return; @@ -245,7 +245,7 @@ Slice::Gen::TypesVisitor::visitModuleStart(const Module_ptr& p) } void -Slice::Gen::TypesVisitor::visitModuleEnd(const Module_ptr& p) +Slice::Gen::TypesVisitor::visitModuleEnd(const ModulePtr& p) { if(!p -> hasOtherConstructedTypes()) return; @@ -255,17 +255,17 @@ Slice::Gen::TypesVisitor::visitModuleEnd(const Module_ptr& p) } void -Slice::Gen::TypesVisitor::visitVector(const Vector_ptr& p) +Slice::Gen::TypesVisitor::visitVector(const VectorPtr& p) { string name = p -> name(); - Type_ptr subtype = p -> type(); + TypePtr subtype = p -> type(); string s = typeToString(subtype); if(s[0] == ':') s.insert(0, " "); H << sp; H << nl << "typedef ::std::vector<" << s << "> " << name << ';'; - Builtin_ptr builtin = Builtin_ptr::dynamicCast(subtype); + BuiltinPtr builtin = BuiltinPtr::dynamicCast(subtype); if(!builtin) { string scoped = p -> scoped(); @@ -275,13 +275,13 @@ Slice::Gen::TypesVisitor::visitVector(const Vector_ptr& p) H << sp; H << nl << "class __U__" << name << " { };"; - H << nl << "void" << dllExport_ << " __write(::__Ice::Stream*, const " + H << nl << "void" << _dllExport << " __write(::IceInternal::Stream*, const " << name << "&, __U__" << name << ");"; - H << nl << "void" << dllExport_ << " __read(::__Ice::Stream*, " + H << nl << "void" << _dllExport << " __read(::IceInternal::Stream*, " << name << "&, __U__" << name << ");"; C << sp; C << nl << "void" << nl << scope - << "::__write(::__Ice::Stream* __os, const " << scoped << "& v, ::" + << "::__write(::IceInternal::Stream* __os, const " << scoped << "& v, ::" << scope << "::__U__" << name << ')'; C << sb; C << nl << "__os -> write(::Ice::Int(v.size()));"; @@ -293,7 +293,7 @@ Slice::Gen::TypesVisitor::visitVector(const Vector_ptr& p) C << eb; C << sp; C << nl << "void" << nl << scope - << "::__read(::__Ice::Stream* __is, " << scoped << "& v, ::" + << "::__read(::IceInternal::Stream* __is, " << scoped << "& v, ::" << scope << "::__U__" << name << ')'; C << sb; C << nl << "::Ice::Int sz;"; @@ -320,7 +320,7 @@ Slice::Gen::TypesVisitor::visitVector(const Vector_ptr& p) } void -Slice::Gen::TypesVisitor::visitEnum(const Enum_ptr& p) +Slice::Gen::TypesVisitor::visitEnum(const EnumPtr& p) { string name = p -> name(); StringList enumerators = p -> enumerators(); @@ -344,13 +344,11 @@ Slice::Gen::TypesVisitor::visitEnum(const Enum_ptr& p) int sz = enumerators.size(); H << sp; - H << nl << "void" << dllExport_ << " __write(::__Ice::Stream*, " << name - << ");"; - H << nl << "void" << dllExport_ << " __read(::__Ice::Stream*, " << name - << "&);"; + H << nl << "void" << _dllExport << " __write(::IceInternal::Stream*, " << name << ");"; + H << nl << "void" << _dllExport << " __read(::IceInternal::Stream*, " << name << "&);"; C << sp; C << nl << "void" << nl << scope - << "::__write(::__Ice::Stream* __os, " << scoped << " v)"; + << "::__write(::IceInternal::Stream* __os, " << scoped << " v)"; C << sb; if(sz <= numeric_limits<Ice::Byte>::max()) C << nl << "__os -> write(static_cast< ::Ice::Byte>(v));"; @@ -362,7 +360,7 @@ Slice::Gen::TypesVisitor::visitEnum(const Enum_ptr& p) C << nl << "__os -> write(static_cast< ::Ice::Long>(v));"; C << eb; C << sp; - C << nl << "void" << nl << scope << "::__read(::__Ice::Stream* __is, " + C << nl << "void" << nl << scope << "::__read(::IceInternal::Stream* __is, " << scoped << "& v)"; C << sb; if(sz <= numeric_limits<Ice::Byte>::max()) @@ -393,32 +391,32 @@ Slice::Gen::TypesVisitor::visitEnum(const Enum_ptr& p) } void -Slice::Gen::TypesVisitor::visitNative(const Native_ptr& p) +Slice::Gen::TypesVisitor::visitNative(const NativePtr& p) { string name = p -> name(); H << sp; - H << nl << "typedef ::__IceNative::" << name << ' ' << name << ';'; + H << nl << "typedef ::IceNative::" << name << ' ' << name << ';'; } Slice::Gen::ProxyDeclVisitor::ProxyDeclVisitor(Output& h, Output& c, const string& dllExport) - : H(h), C(c), dllExport_(dllExport) + : H(h), C(c), _dllExport(dllExport) { } void -Slice::Gen::ProxyDeclVisitor::visitUnitStart(const Unit_ptr& p) +Slice::Gen::ProxyDeclVisitor::visitUnitStart(const UnitPtr& p) { if(!p -> hasProxies()) return; H << sp; - H << nl << "namespace __IceProxy" << nl << '{'; + H << nl << "namespace IceProxy" << nl << '{'; } void -Slice::Gen::ProxyDeclVisitor::visitUnitEnd(const Unit_ptr& p) +Slice::Gen::ProxyDeclVisitor::visitUnitEnd(const UnitPtr& p) { if(!p -> hasProxies()) return; @@ -428,7 +426,7 @@ Slice::Gen::ProxyDeclVisitor::visitUnitEnd(const Unit_ptr& p) } void -Slice::Gen::ProxyDeclVisitor::visitModuleStart(const Module_ptr& p) +Slice::Gen::ProxyDeclVisitor::visitModuleStart(const ModulePtr& p) { if(!p -> hasProxies()) return; @@ -440,7 +438,7 @@ Slice::Gen::ProxyDeclVisitor::visitModuleStart(const Module_ptr& p) } void -Slice::Gen::ProxyDeclVisitor::visitModuleEnd(const Module_ptr& p) +Slice::Gen::ProxyDeclVisitor::visitModuleEnd(const ModulePtr& p) { if(!p -> hasProxies()) return; @@ -450,7 +448,7 @@ Slice::Gen::ProxyDeclVisitor::visitModuleEnd(const Module_ptr& p) } void -Slice::Gen::ProxyDeclVisitor::visitClassDecl(const ClassDecl_ptr& p) +Slice::Gen::ProxyDeclVisitor::visitClassDecl(const ClassDeclPtr& p) { if(p -> isLocal()) return; @@ -463,22 +461,22 @@ Slice::Gen::ProxyDeclVisitor::visitClassDecl(const ClassDecl_ptr& p) Slice::Gen::ProxyVisitor::ProxyVisitor(Output& h, Output& c, const string& dllExport) - : H(h), C(c), dllExport_(dllExport) + : H(h), C(c), _dllExport(dllExport) { } void -Slice::Gen::ProxyVisitor::visitUnitStart(const Unit_ptr& p) +Slice::Gen::ProxyVisitor::visitUnitStart(const UnitPtr& p) { if(!p -> hasProxies()) return; H << sp; - H << nl << "namespace __IceProxy" << nl << '{'; + H << nl << "namespace IceProxy" << nl << '{'; } void -Slice::Gen::ProxyVisitor::visitUnitEnd(const Unit_ptr& p) +Slice::Gen::ProxyVisitor::visitUnitEnd(const UnitPtr& p) { if(!p -> hasProxies()) return; @@ -488,7 +486,7 @@ Slice::Gen::ProxyVisitor::visitUnitEnd(const Unit_ptr& p) } void -Slice::Gen::ProxyVisitor::visitModuleStart(const Module_ptr& p) +Slice::Gen::ProxyVisitor::visitModuleStart(const ModulePtr& p) { if(!p -> hasProxies()) return; @@ -500,7 +498,7 @@ Slice::Gen::ProxyVisitor::visitModuleStart(const Module_ptr& p) } void -Slice::Gen::ProxyVisitor::visitModuleEnd(const Module_ptr& p) +Slice::Gen::ProxyVisitor::visitModuleEnd(const ModulePtr& p) { if(!p -> hasProxies()) return; @@ -510,7 +508,7 @@ Slice::Gen::ProxyVisitor::visitModuleEnd(const Module_ptr& p) } void -Slice::Gen::ProxyVisitor::visitClassDefStart(const ClassDef_ptr& p) +Slice::Gen::ProxyVisitor::visitClassDefStart(const ClassDefPtr& p) { if(p -> isLocal()) return; @@ -520,16 +518,16 @@ Slice::Gen::ProxyVisitor::visitClassDefStart(const ClassDef_ptr& p) ClassList bases = p -> bases(); H << sp; - H << nl << "class" << dllExport_ << ' ' << name << " : "; + H << nl << "class" << _dllExport << ' ' << name << " : "; if(bases.empty()) - H << "virtual public ::__IceProxy::Ice::Object"; + H << "virtual public ::IceProxy::Ice::Object"; else { H.useCurrentPosAsIndent(); ClassList::iterator q = bases.begin(); while(q != bases.end()) { - H << "virtual public ::__IceProxy" << (*q) -> scoped(); + H << "virtual public ::IceProxy" << (*q) -> scoped(); if(++q != bases.end()) H << ',' << nl; } @@ -543,14 +541,14 @@ Slice::Gen::ProxyVisitor::visitClassDefStart(const ClassDef_ptr& p) H << sp; H << nl << "virtual void _throw();"; - C << sp << nl << "void" << nl << "__IceProxy" << scoped << "::_throw()"; + C << sp << nl << "void" << nl << "IceProxy" << scoped << "::_throw()"; C << sb; - C << nl << "throw " << scoped << "_prxE(this);"; + C << nl << "throw " << scoped << "PrxE(this);"; C << eb; } void -Slice::Gen::ProxyVisitor::visitClassDefEnd(const ClassDef_ptr& p) +Slice::Gen::ProxyVisitor::visitClassDefEnd(const ClassDefPtr& p) { if(p -> isLocal()) return; @@ -562,22 +560,22 @@ Slice::Gen::ProxyVisitor::visitClassDefEnd(const ClassDef_ptr& p) H << nl << "private: "; H.inc(); H << sp; - H << nl << "virtual ::__Ice::Handle< ::__IceDelegateM::Ice::Object> " + H << nl << "virtual ::IceInternal::Handle< ::IceDelegateM::Ice::Object> " << "__createDelegateM();"; H << eb << ';'; C << sp; - C << nl << "::__Ice::Handle< ::__IceDelegateM::Ice::Object>" - << nl << "__IceProxy" << scoped << "::__createDelegateM()" << sb; - C << nl << "return ::__Ice::Handle< ::__IceDelegateM::Ice::Object>" - << "(new ::__IceDelegateM" << scoped << ");"; + C << nl << "::IceInternal::Handle< ::IceDelegateM::Ice::Object>" + << nl << "IceProxy" << scoped << "::__createDelegateM()" << sb; + C << nl << "return ::IceInternal::Handle< ::IceDelegateM::Ice::Object>" + << "(new ::IceDelegateM" << scoped << ");"; C << eb; } void -Slice::Gen::ProxyVisitor::visitOperation(const Operation_ptr& p) +Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p) { - Container_ptr container = p -> container(); - ClassDef_ptr cl = ClassDef_ptr::dynamicCast(container); + ContainerPtr container = p -> container(); + ClassDefPtr cl = ClassDefPtr::dynamicCast(container); if(cl -> isLocal()) return; @@ -585,7 +583,7 @@ Slice::Gen::ProxyVisitor::visitOperation(const Operation_ptr& p) string scoped = p -> scoped(); string scope = p -> scope(); - Type_ptr ret = p -> returnType(); + TypePtr ret = p -> returnType(); string retS = returnTypeToString(ret); TypeStringList inParams = p -> inputParameters(); @@ -639,13 +637,10 @@ Slice::Gen::ProxyVisitor::visitOperation(const Operation_ptr& p) H << sp; H << nl << retS << ' ' << name << params << ';'; C << sp; - C << nl << retS << nl << "__IceProxy" << scoped << paramsDecl + C << nl << retS << nl << "IceProxy" << scoped << paramsDecl << sb; - C << nl << "::__Ice::Handle< ::__IceDelegate::Ice::Object> __delBase" - << " = __getDelegate();"; - C << nl << "::__IceDelegate" << scope - << "* __del = dynamic_cast< ::__IceDelegate" << scope - << "*>(__delBase.get());"; + C << nl << "::IceInternal::Handle< ::IceDelegate::Ice::Object> __delBase = __getDelegate();"; + C << nl << "::IceDelegate" << scope << "* __del = dynamic_cast< ::IceDelegate" << scope << "*>(__delBase.get());"; C << nl; if(ret) C << "return "; @@ -655,22 +650,22 @@ Slice::Gen::ProxyVisitor::visitOperation(const Operation_ptr& p) Slice::Gen::DelegateVisitor::DelegateVisitor(Output& h, Output& c, const string& dllExport) - : H(h), C(c), dllExport_(dllExport) + : H(h), C(c), _dllExport(dllExport) { } void -Slice::Gen::DelegateVisitor::visitUnitStart(const Unit_ptr& p) +Slice::Gen::DelegateVisitor::visitUnitStart(const UnitPtr& p) { if(!p -> hasProxies()) return; H << sp; - H << nl << "namespace __IceDelegate" << nl << '{'; + H << nl << "namespace IceDelegate" << nl << '{'; } void -Slice::Gen::DelegateVisitor::visitUnitEnd(const Unit_ptr& p) +Slice::Gen::DelegateVisitor::visitUnitEnd(const UnitPtr& p) { if(!p -> hasProxies()) return; @@ -680,7 +675,7 @@ Slice::Gen::DelegateVisitor::visitUnitEnd(const Unit_ptr& p) } void -Slice::Gen::DelegateVisitor::visitModuleStart(const Module_ptr& p) +Slice::Gen::DelegateVisitor::visitModuleStart(const ModulePtr& p) { if(!p -> hasProxies()) return; @@ -692,7 +687,7 @@ Slice::Gen::DelegateVisitor::visitModuleStart(const Module_ptr& p) } void -Slice::Gen::DelegateVisitor::visitModuleEnd(const Module_ptr& p) +Slice::Gen::DelegateVisitor::visitModuleEnd(const ModulePtr& p) { if(!p -> hasProxies()) return; @@ -702,7 +697,7 @@ Slice::Gen::DelegateVisitor::visitModuleEnd(const Module_ptr& p) } void -Slice::Gen::DelegateVisitor::visitClassDefStart(const ClassDef_ptr& p) +Slice::Gen::DelegateVisitor::visitClassDefStart(const ClassDefPtr& p) { if(p -> isLocal()) return; @@ -711,16 +706,16 @@ Slice::Gen::DelegateVisitor::visitClassDefStart(const ClassDef_ptr& p) ClassList bases = p -> bases(); H << sp; - H << nl << "class" << dllExport_ << ' ' << name << " : "; + H << nl << "class" << _dllExport << ' ' << name << " : "; if(bases.empty()) - H << "virtual public ::__IceDelegate::Ice::Object"; + H << "virtual public ::IceDelegate::Ice::Object"; else { H.useCurrentPosAsIndent(); ClassList::iterator q = bases.begin(); while(q != bases.end()) { - H << "virtual public ::__IceDelegate" << (*q) -> scoped(); + H << "virtual public ::IceDelegate" << (*q) -> scoped(); if(++q != bases.end()) H << ',' << nl; } @@ -733,7 +728,7 @@ Slice::Gen::DelegateVisitor::visitClassDefStart(const ClassDef_ptr& p) } void -Slice::Gen::DelegateVisitor::visitClassDefEnd(const ClassDef_ptr& p) +Slice::Gen::DelegateVisitor::visitClassDefEnd(const ClassDefPtr& p) { if(p -> isLocal()) return; @@ -742,16 +737,16 @@ Slice::Gen::DelegateVisitor::visitClassDefEnd(const ClassDef_ptr& p) } void -Slice::Gen::DelegateVisitor::visitOperation(const Operation_ptr& p) +Slice::Gen::DelegateVisitor::visitOperation(const OperationPtr& p) { - Container_ptr container = p -> container(); - ClassDef_ptr cl = ClassDef_ptr::dynamicCast(container); + ContainerPtr container = p -> container(); + ClassDefPtr cl = ClassDefPtr::dynamicCast(container); if(cl -> isLocal()) return; string name = p -> name(); - Type_ptr ret = p -> returnType(); + TypePtr ret = p -> returnType(); string retS = returnTypeToString(ret); TypeStringList inParams = p -> inputParameters(); @@ -798,22 +793,22 @@ Slice::Gen::DelegateVisitor::visitOperation(const Operation_ptr& p) Slice::Gen::DelegateMVisitor::DelegateMVisitor(Output& h, Output& c, const string& dllExport) - : H(h), C(c), dllExport_(dllExport) + : H(h), C(c), _dllExport(dllExport) { } void -Slice::Gen::DelegateMVisitor::visitUnitStart(const Unit_ptr& p) +Slice::Gen::DelegateMVisitor::visitUnitStart(const UnitPtr& p) { if(!p -> hasProxies()) return; H << sp; - H << nl << "namespace __IceDelegateM" << nl << '{'; + H << nl << "namespace IceDelegateM" << nl << '{'; } void -Slice::Gen::DelegateMVisitor::visitUnitEnd(const Unit_ptr& p) +Slice::Gen::DelegateMVisitor::visitUnitEnd(const UnitPtr& p) { if(!p -> hasProxies()) return; @@ -823,7 +818,7 @@ Slice::Gen::DelegateMVisitor::visitUnitEnd(const Unit_ptr& p) } void -Slice::Gen::DelegateMVisitor::visitModuleStart(const Module_ptr& p) +Slice::Gen::DelegateMVisitor::visitModuleStart(const ModulePtr& p) { if(!p -> hasProxies()) return; @@ -835,7 +830,7 @@ Slice::Gen::DelegateMVisitor::visitModuleStart(const Module_ptr& p) } void -Slice::Gen::DelegateMVisitor::visitModuleEnd(const Module_ptr& p) +Slice::Gen::DelegateMVisitor::visitModuleEnd(const ModulePtr& p) { if(!p -> hasProxies()) return; @@ -845,7 +840,7 @@ Slice::Gen::DelegateMVisitor::visitModuleEnd(const Module_ptr& p) } void -Slice::Gen::DelegateMVisitor::visitClassDefStart(const ClassDef_ptr& p) +Slice::Gen::DelegateMVisitor::visitClassDefStart(const ClassDefPtr& p) { if(p -> isLocal()) return; @@ -855,17 +850,17 @@ Slice::Gen::DelegateMVisitor::visitClassDefStart(const ClassDef_ptr& p) ClassList bases = p -> bases(); H << sp; - H << nl << "class" << dllExport_ << ' ' << name << " : "; + H << nl << "class" << _dllExport << ' ' << name << " : "; H.useCurrentPosAsIndent(); - H << "virtual public ::__IceDelegate" << scoped << ','; + H << "virtual public ::IceDelegate" << scoped << ','; if(bases.empty()) - H << nl << "virtual public ::__IceDelegateM::Ice::Object"; + H << nl << "virtual public ::IceDelegateM::Ice::Object"; else { ClassList::iterator q = bases.begin(); while(q != bases.end()) { - H << nl << "virtual public ::__IceDelegateM" << (*q) -> scoped(); + H << nl << "virtual public ::IceDelegateM" << (*q) -> scoped(); if(++q != bases.end()) H << ','; } @@ -878,7 +873,7 @@ Slice::Gen::DelegateMVisitor::visitClassDefStart(const ClassDef_ptr& p) } void -Slice::Gen::DelegateMVisitor::visitClassDefEnd(const ClassDef_ptr& p) +Slice::Gen::DelegateMVisitor::visitClassDefEnd(const ClassDefPtr& p) { if(p -> isLocal()) return; @@ -887,10 +882,10 @@ Slice::Gen::DelegateMVisitor::visitClassDefEnd(const ClassDef_ptr& p) } void -Slice::Gen::DelegateMVisitor::visitOperation(const Operation_ptr& p) +Slice::Gen::DelegateMVisitor::visitOperation(const OperationPtr& p) { - Container_ptr container = p -> container(); - ClassDef_ptr cl = ClassDef_ptr::dynamicCast(container); + ContainerPtr container = p -> container(); + ClassDefPtr cl = ClassDefPtr::dynamicCast(container); if(cl -> isLocal()) return; @@ -898,7 +893,7 @@ Slice::Gen::DelegateMVisitor::visitOperation(const Operation_ptr& p) string scoped = p -> scoped(); string scope = p -> scope(); - Type_ptr ret = p -> returnType(); + TypePtr ret = p -> returnType(); string retS = returnTypeToString(ret); TypeStringList inParams = p -> inputParameters(); @@ -952,12 +947,12 @@ Slice::Gen::DelegateMVisitor::visitOperation(const Operation_ptr& p) H << sp; H << nl << "virtual " << retS << ' ' << name << params << ';'; C << sp; - C << nl << retS << nl << "__IceDelegateM" << scoped << paramsDecl + C << nl << retS << nl << "IceDelegateM" << scoped << paramsDecl << sb; - C << nl << "::__Ice::Outgoing __out(__emitter(), __reference());"; + C << nl << "::IceInternal::Outgoing __out(__emitter(), __reference());"; if(ret || !outParams.empty() || !throws.empty()) - C << nl << "::__Ice::Stream* __is = __out.is();"; - C << nl << "::__Ice::Stream* __os = __out.os();"; + C << nl << "::IceInternal::Stream* __is = __out.is();"; + C << nl << "::IceInternal::Stream* __os = __out.os();"; C << nl << "__os -> write(\"" << name << "\");"; writeMarshalCode(C, inParams, 0); C << nl << "if(!__out.invoke())"; @@ -979,7 +974,7 @@ Slice::Gen::DelegateMVisitor::visitOperation(const Operation_ptr& p) li.push_back(make_pair(*r, string("__ex"))); writeAllocateCode(C, li, 0); writeUnmarshalCode(C, li, 0); - if(ClassDecl_ptr::dynamicCast(*r) || Proxy_ptr::dynamicCast(*r)) + if(ClassDeclPtr::dynamicCast(*r) || ProxyPtr::dynamicCast(*r)) C << nl << "__ex -> _throw();"; else C << nl << "throw __ex;"; @@ -1007,12 +1002,12 @@ Slice::Gen::DelegateMVisitor::visitOperation(const Operation_ptr& p) Slice::Gen::ObjectDeclVisitor::ObjectDeclVisitor(Output& h, Output& c, const string& dllExport) - : H(h), C(c), dllExport_(dllExport) + : H(h), C(c), _dllExport(dllExport) { } void -Slice::Gen::ObjectDeclVisitor::visitModuleStart(const Module_ptr& p) +Slice::Gen::ObjectDeclVisitor::visitModuleStart(const ModulePtr& p) { if(!p -> hasClassDecls()) return; @@ -1024,7 +1019,7 @@ Slice::Gen::ObjectDeclVisitor::visitModuleStart(const Module_ptr& p) } void -Slice::Gen::ObjectDeclVisitor::visitModuleEnd(const Module_ptr& p) +Slice::Gen::ObjectDeclVisitor::visitModuleEnd(const ModulePtr& p) { if(!p -> hasClassDecls()) return; @@ -1034,7 +1029,7 @@ Slice::Gen::ObjectDeclVisitor::visitModuleEnd(const Module_ptr& p) } void -Slice::Gen::ObjectDeclVisitor::visitClassDecl(const ClassDecl_ptr& p) +Slice::Gen::ObjectDeclVisitor::visitClassDecl(const ClassDeclPtr& p) { string name = p -> name(); @@ -1044,12 +1039,12 @@ Slice::Gen::ObjectDeclVisitor::visitClassDecl(const ClassDecl_ptr& p) Slice::Gen::ObjectVisitor::ObjectVisitor(Output& h, Output& c, const string& dllExport) - : H(h), C(c), dllExport_(dllExport) + : H(h), C(c), _dllExport(dllExport) { } void -Slice::Gen::ObjectVisitor::visitModuleStart(const Module_ptr& p) +Slice::Gen::ObjectVisitor::visitModuleStart(const ModulePtr& p) { if(!p -> hasClassDefs()) return; @@ -1061,7 +1056,7 @@ Slice::Gen::ObjectVisitor::visitModuleStart(const Module_ptr& p) } void -Slice::Gen::ObjectVisitor::visitModuleEnd(const Module_ptr& p) +Slice::Gen::ObjectVisitor::visitModuleEnd(const ModulePtr& p) { if(!p -> hasClassDefs()) return; @@ -1071,28 +1066,28 @@ Slice::Gen::ObjectVisitor::visitModuleEnd(const Module_ptr& p) } void -Slice::Gen::ObjectVisitor::visitClassDefStart(const ClassDef_ptr& p) +Slice::Gen::ObjectVisitor::visitClassDefStart(const ClassDefPtr& p) { string name = p -> name(); string scoped = p -> scoped(); ClassList bases = p -> bases(); H << sp; - H << nl << "class" << dllExport_ << ' ' << name << "_ptrE : "; + H << nl << "class" << _dllExport << ' ' << name << "PtrE : "; H.useCurrentPosAsIndent(); if(bases.empty()) { if(p -> isLocal()) - H << "virtual public ::Ice::LocalObject_ptrE"; + H << "virtual public ::Ice::LocalObjectPtrE"; else - H << "virtual public ::Ice::Object_ptrE"; + H << "virtual public ::Ice::ObjectPtrE"; } else { ClassList::iterator q = bases.begin(); while(q != bases.end()) { - H << "virtual public " << (*q) -> scoped() << "_ptrE"; + H << "virtual public " << (*q) -> scoped() << "PtrE"; if(++q != bases.end()) H << ',' << nl; } @@ -1103,48 +1098,48 @@ Slice::Gen::ObjectVisitor::visitClassDefStart(const ClassDef_ptr& p) H << nl << "public: "; H.inc(); H << sp; - H << nl << name << "_ptrE() { }"; - H << nl << name << "_ptrE(const " << name << "_ptrE&);"; - H << nl << "explicit " << name << "_ptrE(const " << name << "_ptr&);"; - H << nl << "operator " << name << "_ptr() const;"; + H << nl << name << "PtrE() { }"; + H << nl << name << "PtrE(const " << name << "PtrE&);"; + H << nl << "explicit " << name << "PtrE(const " << name << "Ptr&);"; + H << nl << "operator " << name << "Ptr() const;"; H << nl << name << "* operator->() const;"; H << eb << ';'; - C << sp << nl << scoped.substr(2) << "_ptrE::" << name << "_ptrE(const " - << name << "_ptrE& p)"; + C << sp << nl << scoped.substr(2) << "PtrE::" << name << "PtrE(const " + << name << "PtrE& p)"; C << sb; - C << nl << "ptr_ = p.ptr_;"; + C << nl << "_ptr = p._ptr;"; C << eb; - C << sp << nl << scoped.substr(2) << "_ptrE::" << name << "_ptrE(const " - << scoped << "_ptr& p)"; + C << sp << nl << scoped.substr(2) << "PtrE::" << name << "PtrE(const " + << scoped << "Ptr& p)"; C << sb; - C << nl << "ptr_ = p;"; + C << nl << "_ptr = p;"; C << eb; - C << sp << nl << scoped.substr(2) << "_ptrE::operator " << scoped - << "_ptr() const"; + C << sp << nl << scoped.substr(2) << "PtrE::operator " << scoped + << "Ptr() const"; C << sb; - C << nl << "return " << scoped << "_ptr(dynamic_cast< " << scoped - << "*>(ptr_.get()));"; + C << nl << "return " << scoped << "Ptr(dynamic_cast< " << scoped + << "*>(_ptr.get()));"; C << eb; C << sp << nl << scoped << '*' << nl << scoped.substr(2) - << "_ptrE::operator->() const"; + << "PtrE::operator->() const"; C << sb; - C << nl << "return dynamic_cast< " << scoped << "*>(ptr_.get());"; + C << nl << "return dynamic_cast< " << scoped << "*>(_ptr.get());"; C << eb; if(!p -> isLocal()) { H << sp; - H << nl << "class" << dllExport_ << ' ' << name << "_prxE : "; + H << nl << "class" << _dllExport << ' ' << name << "PrxE : "; H.useCurrentPosAsIndent(); if(bases.empty()) - H << "virtual public ::Ice::Object_prxE"; + H << "virtual public ::Ice::ObjectPrxE"; else { ClassList::iterator q = bases.begin(); while(q != bases.end()) { H << "virtual public " << (*q) -> scoped() - << "_prxE"; + << "PrxE"; if(++q != bases.end()) H << ',' << nl; } @@ -1155,38 +1150,38 @@ Slice::Gen::ObjectVisitor::visitClassDefStart(const ClassDef_ptr& p) H << nl << "public: "; H.inc(); H << sp; - H << nl << name << "_prxE() { }"; - H << nl << name << "_prxE(const " << name << "_prxE&);"; - H << nl << "explicit " << name << "_prxE(const " << name << "_prx&);"; - H << nl << "operator " << name << "_prx() const;"; - H << nl << "::__IceProxy" << scoped << "* operator->() const;"; + H << nl << name << "PrxE() { }"; + H << nl << name << "PrxE(const " << name << "PrxE&);"; + H << nl << "explicit " << name << "PrxE(const " << name << "Prx&);"; + H << nl << "operator " << name << "Prx() const;"; + H << nl << "::IceProxy" << scoped << "* operator->() const;"; H << eb << ';'; - C << sp << nl << scoped.substr(2) << "_prxE::" << name - << "_prxE(const " << name << "_prxE& p)"; + C << sp << nl << scoped.substr(2) << "PrxE::" << name + << "PrxE(const " << name << "PrxE& p)"; C << sb; - C << nl << "prx_ = p.prx_;"; + C << nl << "_prx = p._prx;"; C << eb; - C << sp << nl << scoped.substr(2) << "_prxE::" << name - << "_prxE(const " << scoped << "_prx& p)"; + C << sp << nl << scoped.substr(2) << "PrxE::" << name + << "PrxE(const " << scoped << "Prx& p)"; C << sb; - C << nl << "prx_ = p;"; + C << nl << "_prx = p;"; C << eb; - C << sp << nl << scoped.substr(2) << "_prxE::operator " << scoped - << "_prx() const"; + C << sp << nl << scoped.substr(2) << "PrxE::operator " << scoped + << "Prx() const"; C << sb; - C << nl << "return " << scoped << "_prx(dynamic_cast< ::__IceProxy" - << scoped << "*>(prx_.get()));"; + C << nl << "return " << scoped << "Prx(dynamic_cast< ::IceProxy" + << scoped << "*>(_prx.get()));"; C << eb; - C << sp << nl << "::__IceProxy" << scoped << '*' << nl - << scoped.substr(2) << "_prxE::operator->() const"; + C << sp << nl << "::IceProxy" << scoped << '*' << nl + << scoped.substr(2) << "PrxE::operator->() const"; C << sb; - C << nl << "return dynamic_cast< ::__IceProxy" << scoped - << "*>(prx_.get());"; + C << nl << "return dynamic_cast< ::IceProxy" << scoped + << "*>(_prx.get());"; C << eb; } H << sp; - H << nl << "class" << dllExport_ << ' ' << name << " : "; + H << nl << "class" << _dllExport << ' ' << name << " : "; H.useCurrentPosAsIndent(); if(bases.empty()) { @@ -1206,7 +1201,7 @@ Slice::Gen::ObjectVisitor::visitClassDefStart(const ClassDef_ptr& p) } } if(!p -> isLocal()) - H << ',' << nl << "virtual public ::__IceDelegate" << scoped; + H << ',' << nl << "virtual public ::IceDelegate" << scoped; H.restoreIndent(); H << sb; H.dec(); @@ -1217,7 +1212,7 @@ Slice::Gen::ObjectVisitor::visitClassDefStart(const ClassDef_ptr& p) H << nl << "virtual void _throw();"; C << sp << nl << "void" << nl << scoped.substr(2) << "::_throw()"; C << sb; - C << nl << "throw " << scoped << "_ptrE(this);"; + C << nl << "throw " << scoped << "PtrE(this);"; C << eb; if(!p -> isLocal()) @@ -1235,7 +1230,7 @@ Slice::Gen::ObjectVisitor::visitClassDefStart(const ClassDef_ptr& p) ids.unique(); ClassList allBaseClasses; - ClassDef_ptr cl; + ClassDefPtr cl; if(!bases.empty()) cl = bases.front(); else @@ -1311,13 +1306,13 @@ Slice::Gen::ObjectVisitor::visitClassDefStart(const ClassDef_ptr& p) } void -Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDef_ptr& p) +Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p) { string name = p -> name(); string scoped = p -> scoped(); ClassList bases = p -> bases(); - ClassDef_ptr base; + ClassDefPtr base; if(!bases.empty() && !bases.front() -> isInterface()) base = bases.front(); @@ -1338,8 +1333,8 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDef_ptr& p) H << sp; H << nl << "static std::string __names[" << allOpNames.size() << "];"; - H << nl << "virtual ::__Ice::DispatchStatus " - << "__dispatch(::__Ice::Incoming&, const std::string&);"; + H << nl << "virtual ::IceInternal::DispatchStatus " + << "__dispatch(::IceInternal::Incoming&, const std::string&);"; C << sp; C << nl << "std::string " << scoped.substr(2) << "::__names[" << allOpNames.size() << "] ="; @@ -1353,8 +1348,8 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDef_ptr& p) } C << eb << ';'; C << sp; - C << nl << "::__Ice::DispatchStatus" << nl << scoped.substr(2) - << "::__dispatch(::__Ice::Incoming& in, const std::string& s)"; + C << nl << "::IceInternal::DispatchStatus" << nl << scoped.substr(2) + << "::__dispatch(::IceInternal::Incoming& in, const std::string& s)"; C << sb; C << nl << "std::string* b = __names;"; C << nl << "std::string* e = __names + " << allOpNames.size() << ';'; @@ -1362,7 +1357,7 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDef_ptr& p) << "std::equal_range(b, e, s);"; C << nl << "if(r.first == r.second)"; C.inc(); - C << nl << "return ::__Ice::DispatchOperationNotExist;"; + C << nl << "return ::IceInternal::DispatchOperationNotExist;"; C.dec(); C << sp; C << nl << "switch(r.first - __names)"; @@ -1378,12 +1373,12 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDef_ptr& p) C << eb; C << sp; C << nl << "assert(false);"; - C << nl << "return ::__Ice::DispatchOperationNotExist;"; + C << nl << "return ::IceInternal::DispatchOperationNotExist;"; C << eb; } H << sp; - H << nl << "virtual void __write(::__Ice::Stream*);"; - H << nl << "virtual void __read(::__Ice::Stream*);"; + H << nl << "virtual void __write(::IceInternal::Stream*);"; + H << nl << "virtual void __read(::IceInternal::Stream*);"; H << eb << ';'; TypeStringList memberList; DataMemberList dataMembers = p -> dataMembers(); @@ -1392,7 +1387,7 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDef_ptr& p) memberList.push_back(make_pair((*q) -> type(), (*q) -> name())); C << sp; C << nl << "void" << nl << scoped.substr(2) - << "::__write(::__Ice::Stream* __os)"; + << "::__write(::IceInternal::Stream* __os)"; C << sb; C << nl << "__os -> startWriteEncaps();"; writeMarshalCode(C, memberList, 0); @@ -1414,7 +1409,7 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDef_ptr& p) C << eb; C << sp; C << nl << "void" << nl << scoped.substr(2) - << "::__read(::__Ice::Stream* __is)"; + << "::__read(::IceInternal::Stream* __is)"; C << sb; C << nl << "__is -> startReadEncaps();"; writeUnmarshalCode(C, memberList, 0); @@ -1437,15 +1432,15 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDef_ptr& p) } void -Slice::Gen::ObjectVisitor::visitOperation(const Operation_ptr& p) +Slice::Gen::ObjectVisitor::visitOperation(const OperationPtr& p) { - Container_ptr container = p -> container(); - ClassDef_ptr cl = ClassDef_ptr::dynamicCast(container); + ContainerPtr container = p -> container(); + ClassDefPtr cl = ClassDefPtr::dynamicCast(container); string name = p -> name(); string scoped = p -> scoped(); string scope = p -> scope(); - Type_ptr ret = p -> returnType(); + TypePtr ret = p -> returnType(); string retS = returnTypeToString(ret); TypeStringList inParams = p -> inputParameters(); @@ -1501,16 +1496,16 @@ Slice::Gen::ObjectVisitor::visitOperation(const Operation_ptr& p) if(!cl -> isLocal()) { - H << nl << "::__Ice::DispatchStatus ___" << name - << "(::__Ice::Incoming&);"; + H << nl << "::IceInternal::DispatchStatus ___" << name + << "(::IceInternal::Incoming&);"; C << sp; - C << nl << "::__Ice::DispatchStatus" << nl << scope.substr(2) - << "::___" << name << "(::__Ice::Incoming& __in)"; + C << nl << "::IceInternal::DispatchStatus" << nl << scope.substr(2) + << "::___" << name << "(::IceInternal::Incoming& __in)"; C << sb; if(!inParams.empty()) - C << nl << "::__Ice::Stream* __is = __in.is();"; + C << nl << "::IceInternal::Stream* __is = __in.is();"; if(ret || !outParams.empty() || !throws.empty()) - C << nl << "::__Ice::Stream* __os = __in.os();"; + C << nl << "::IceInternal::Stream* __os = __in.os();"; writeAllocateCode(C, inParams, 0); writeUnmarshalCode(C, inParams, 0); writeAllocateCode(C, outParams, 0); @@ -1533,8 +1528,8 @@ Slice::Gen::ObjectVisitor::visitOperation(const Operation_ptr& p) C << nl << "catch(" << exceptionTypeToString(*r) << " __ex)"; C << sb; C << nl << "__os -> write(" << cnt++ << ");"; - if(ClassDecl_ptr::dynamicCast(*r) || - Proxy_ptr::dynamicCast(*r)) + if(ClassDeclPtr::dynamicCast(*r) || + ProxyPtr::dynamicCast(*r)) { string s = "static_cast< "; s += inputTypeToString(*r); @@ -1543,18 +1538,18 @@ Slice::Gen::ObjectVisitor::visitOperation(const Operation_ptr& p) } else writeMarshalUnmarshalCode(C, *r, "__ex", true); - C << nl << "return ::__Ice::DispatchException;"; + C << nl << "return ::IceInternal::DispatchException;"; C << eb; } } writeMarshalCode(C, outParams, ret); - C << nl << "return ::__Ice::DispatchOK;"; + C << nl << "return ::IceInternal::DispatchOK;"; C << eb; } } void -Slice::Gen::ObjectVisitor::visitDataMember(const DataMember_ptr& p) +Slice::Gen::ObjectVisitor::visitDataMember(const DataMemberPtr& p) { string name = p -> name(); string s = typeToString(p -> type()); @@ -1564,22 +1559,22 @@ Slice::Gen::ObjectVisitor::visitDataMember(const DataMember_ptr& p) Slice::Gen::IceVisitor::IceVisitor(Output& h, Output& c, const string& dllExport) - : H(h), C(c), dllExport_(dllExport) + : H(h), C(c), _dllExport(dllExport) { } void -Slice::Gen::IceVisitor::visitUnitStart(const Unit_ptr& p) +Slice::Gen::IceVisitor::visitUnitStart(const UnitPtr& p) { if(!p -> hasClassDecls()) return; H << sp; - H << nl << "namespace __Ice" << nl << '{'; + H << nl << "namespace IceInternal" << nl << '{'; } void -Slice::Gen::IceVisitor::visitUnitEnd(const Unit_ptr& p) +Slice::Gen::IceVisitor::visitUnitEnd(const UnitPtr& p) { if(!p -> hasClassDecls()) return; @@ -1589,67 +1584,67 @@ Slice::Gen::IceVisitor::visitUnitEnd(const Unit_ptr& p) } void -Slice::Gen::IceVisitor::visitClassDecl(const ClassDecl_ptr& p) +Slice::Gen::IceVisitor::visitClassDecl(const ClassDeclPtr& p) { string scoped = p -> scoped(); H << sp; - H << nl << "void" << dllExport_ << " incRef(" << scoped << "*);"; - H << nl << "void" << dllExport_ << " decRef(" << scoped << "*);"; + H << nl << "void" << _dllExport << " incRef(" << scoped << "*);"; + H << nl << "void" << _dllExport << " decRef(" << scoped << "*);"; if(!p -> isLocal()) { H << sp; - H << nl << "void" << dllExport_ << " incRef(::__IceProxy" << scoped + H << nl << "void" << _dllExport << " incRef(::IceProxy" << scoped << "*);"; - H << nl << "void" << dllExport_ << " decRef(::__IceProxy" << scoped + H << nl << "void" << _dllExport << " decRef(::IceProxy" << scoped << "*);"; H << sp; - H << nl << "void" << dllExport_ - << " checkedCast(::__IceProxy::Ice::Object*, ::__IceProxy" + H << nl << "void" << _dllExport + << " checkedCast(::IceProxy::Ice::Object*, ::IceProxy" << scoped << "*&);"; - H << nl << "void" << dllExport_ - << " uncheckedCast(::__IceProxy::Ice::Object*, ::__IceProxy" + H << nl << "void" << _dllExport + << " uncheckedCast(::IceProxy::Ice::Object*, ::IceProxy" << scoped << "*&);"; } } void -Slice::Gen::IceVisitor::visitClassDefStart(const ClassDef_ptr& p) +Slice::Gen::IceVisitor::visitClassDefStart(const ClassDefPtr& p) { string scoped = p -> scoped(); C << sp; - C << nl << "void __Ice::incRef(" << scoped << "* p) { p -> __incRef(); }"; - C << nl << "void __Ice::decRef(" << scoped << "* p) { p -> __decRef(); }"; + C << nl << "void IceInternal::incRef(" << scoped << "* p) { p -> __incRef(); }"; + C << nl << "void IceInternal::decRef(" << scoped << "* p) { p -> __decRef(); }"; if(!p -> isLocal()) { C << sp; - C << nl << "void __Ice::incRef(::__IceProxy" << scoped + C << nl << "void IceInternal::incRef(::IceProxy" << scoped << "* p) { p -> __incRef(); }"; - C << nl << "void __Ice::decRef(::__IceProxy" << scoped + C << nl << "void IceInternal::decRef(::IceProxy" << scoped << "* p) { p -> __decRef(); }"; C << sp; - C << nl << "void __Ice::checkedCast(::__IceProxy::Ice::Object* b, " - << "::__IceProxy" << scoped << "*& d)"; + C << nl << "void IceInternal::checkedCast(::IceProxy::Ice::Object* b, " + << "::IceProxy" << scoped << "*& d)"; C << sb; - C << nl << "d = dynamic_cast< ::__IceProxy" << scoped + C << nl << "d = dynamic_cast< ::IceProxy" << scoped << "*>(b);"; C << nl << "if(!d && b -> _isA(\"" << scoped << "\"))"; C << sb; - C << nl << "d = new ::__IceProxy" << scoped << ';'; + C << nl << "d = new ::IceProxy" << scoped << ';'; C << nl << "b -> __copyTo(d);"; C << eb; C << eb; C << sp; - C << nl << "void __Ice::uncheckedCast(::__IceProxy::Ice::Object* b, " - << "::__IceProxy" << scoped << "*& d)"; + C << nl << "void IceInternal::uncheckedCast(::IceProxy::Ice::Object* b, " + << "::IceProxy" << scoped << "*& d)"; C << sb; - C << nl << "d = dynamic_cast< ::__IceProxy" << scoped + C << nl << "d = dynamic_cast< ::IceProxy" << scoped << "*>(b);"; C << nl << "if(!d)"; C << sb; - C << nl << "d = new ::__IceProxy" << scoped << ';'; + C << nl << "d = new ::IceProxy" << scoped << ';'; C << nl << "b -> __copyTo(d);"; C << eb; C << eb; @@ -1658,12 +1653,12 @@ Slice::Gen::IceVisitor::visitClassDefStart(const ClassDef_ptr& p) Slice::Gen::HandleVisitor::HandleVisitor(Output& h, Output& c, const string& dllExport) - : H(h), C(c), dllExport_(dllExport) + : H(h), C(c), _dllExport(dllExport) { } void -Slice::Gen::HandleVisitor::visitModuleStart(const Module_ptr& p) +Slice::Gen::HandleVisitor::visitModuleStart(const ModulePtr& p) { if(!p -> hasClassDecls()) return; @@ -1675,7 +1670,7 @@ Slice::Gen::HandleVisitor::visitModuleStart(const Module_ptr& p) } void -Slice::Gen::HandleVisitor::visitModuleEnd(const Module_ptr& p) +Slice::Gen::HandleVisitor::visitModuleEnd(const ModulePtr& p) { if(!p -> hasClassDecls()) return; @@ -1685,28 +1680,28 @@ Slice::Gen::HandleVisitor::visitModuleEnd(const Module_ptr& p) } void -Slice::Gen::HandleVisitor::visitClassDecl(const ClassDecl_ptr& p) +Slice::Gen::HandleVisitor::visitClassDecl(const ClassDeclPtr& p) { string name = p -> name(); string scoped = p -> scoped(); H << sp; - H << nl << "typedef ::__Ice::Handle< " << scoped << "> " << name - << "_ptr;"; + H << nl << "typedef ::IceInternal::Handle< " << scoped << "> " << name + << "Ptr;"; if(!p -> isLocal()) { - H << nl << "typedef ::__Ice::ProxyHandle< ::__IceProxy" << scoped - << "> " << name << "_prx;"; + H << nl << "typedef ::IceInternal::ProxyHandle< ::IceProxy" << scoped + << "> " << name << "Prx;"; H << sp; - H << nl << "void" << dllExport_ << " __write(::__Ice::Stream*, const " - << name << "_prx&);"; - H << nl << "void" << dllExport_ << " __read(::__Ice::Stream*, " - << name << "_prx&);"; + H << nl << "void" << _dllExport << " __write(::IceInternal::Stream*, const " + << name << "Prx&);"; + H << nl << "void" << _dllExport << " __read(::IceInternal::Stream*, " + << name << "Prx&);"; } } void -Slice::Gen::HandleVisitor::visitClassDefStart(const ClassDef_ptr& p) +Slice::Gen::HandleVisitor::visitClassDefStart(const ClassDefPtr& p) { if(p -> isLocal()) return; @@ -1718,19 +1713,19 @@ Slice::Gen::HandleVisitor::visitClassDefStart(const ClassDef_ptr& p) C << sp; C << nl << "void" << nl << scope - << "::__write(::__Ice::Stream* __os, const " << scoped << "_prx& v)"; + << "::__write(::IceInternal::Stream* __os, const " << scoped << "Prx& v)"; C << sb; // TODO: Should be ::Ice::__write - C << nl << "::__Ice::write(__os, ::Ice::Object_prx(v));"; + C << nl << "::IceInternal::write(__os, ::Ice::ObjectPrx(v));"; C << eb; C << sp; C << nl << "void" << nl << scope - << "::__read(::__Ice::Stream* __is, " << scoped << "_prx& v)"; + << "::__read(::IceInternal::Stream* __is, " << scoped << "Prx& v)"; C << sb; - C << nl << "::Ice::Object_prx proxy;"; + C << nl << "::Ice::ObjectPrx proxy;"; // TODO: Should be ::Ice::__read - C << nl << "::__Ice::read(__is, proxy);"; - C << nl << "v = new ::__IceProxy" << scoped << ';'; + C << nl << "::IceInternal::read(__is, proxy);"; + C << nl << "v = new ::IceProxy" << scoped << ';'; C << nl << "proxy -> __copyTo(v.get());"; C << eb; } diff --git a/cpp/src/slice2cpp/Gen.h b/cpp/src/slice2cpp/Gen.h index e2ded3d7e7d..2c07763f8fe 100644 --- a/cpp/src/slice2cpp/Gen.h +++ b/cpp/src/slice2cpp/Gen.h @@ -17,7 +17,7 @@ namespace Slice { -class Gen : ::__Ice::noncopyable +class Gen : ::IceInternal::noncopyable { public: @@ -30,7 +30,7 @@ public: bool operator!() const; // Returns true if there was a constructor error - void generate(const Unit_ptr&); + void generate(const UnitPtr&); private: @@ -40,192 +40,192 @@ private: Output H; Output C; - std::string base_; - std::string include_; - std::vector<std::string> includePaths_; - std::string dllExport_; + std::string _base; + std::string _include; + std::vector<std::string> _includePaths; + std::string _dllExport; - class TypesVisitor : ::__Ice::noncopyable, public ParserVisitor + class TypesVisitor : ::IceInternal::noncopyable, public ParserVisitor { public: TypesVisitor(Output&, Output&, const std::string&); - virtual void visitModuleStart(const Module_ptr&); - virtual void visitModuleEnd(const Module_ptr&); - virtual void visitVector(const Vector_ptr&); - virtual void visitEnum(const Enum_ptr&); - virtual void visitNative(const Native_ptr&); + virtual void visitModuleStart(const ModulePtr&); + virtual void visitModuleEnd(const ModulePtr&); + virtual void visitVector(const VectorPtr&); + virtual void visitEnum(const EnumPtr&); + virtual void visitNative(const NativePtr&); private: Output& H; Output& C; - std::string dllExport_; + std::string _dllExport; }; - class ProxyDeclVisitor : ::__Ice::noncopyable, public ParserVisitor + class ProxyDeclVisitor : ::IceInternal::noncopyable, public ParserVisitor { public: ProxyDeclVisitor(Output&, Output&, const std::string&); - virtual void visitUnitStart(const Unit_ptr&); - virtual void visitUnitEnd(const Unit_ptr&); - virtual void visitModuleStart(const Module_ptr&); - virtual void visitModuleEnd(const Module_ptr&); - virtual void visitClassDecl(const ClassDecl_ptr&); + virtual void visitUnitStart(const UnitPtr&); + virtual void visitUnitEnd(const UnitPtr&); + virtual void visitModuleStart(const ModulePtr&); + virtual void visitModuleEnd(const ModulePtr&); + virtual void visitClassDecl(const ClassDeclPtr&); private: Output& H; Output& C; - std::string dllExport_; + std::string _dllExport; }; - class ProxyVisitor : ::__Ice::noncopyable, public ParserVisitor + class ProxyVisitor : ::IceInternal::noncopyable, public ParserVisitor { public: ProxyVisitor(Output&, Output&, const std::string&); - virtual void visitUnitStart(const Unit_ptr&); - virtual void visitUnitEnd(const Unit_ptr&); - virtual void visitModuleStart(const Module_ptr&); - virtual void visitModuleEnd(const Module_ptr&); - virtual void visitClassDefStart(const ClassDef_ptr&); - virtual void visitClassDefEnd(const ClassDef_ptr&); - virtual void visitOperation(const Operation_ptr&); + virtual void visitUnitStart(const UnitPtr&); + virtual void visitUnitEnd(const UnitPtr&); + virtual void visitModuleStart(const ModulePtr&); + virtual void visitModuleEnd(const ModulePtr&); + virtual void visitClassDefStart(const ClassDefPtr&); + virtual void visitClassDefEnd(const ClassDefPtr&); + virtual void visitOperation(const OperationPtr&); private: Output& H; Output& C; - std::string dllExport_; + std::string _dllExport; }; - class DelegateVisitor : ::__Ice::noncopyable, public ParserVisitor + class DelegateVisitor : ::IceInternal::noncopyable, public ParserVisitor { public: DelegateVisitor(Output&, Output&, const std::string&); - virtual void visitUnitStart(const Unit_ptr&); - virtual void visitUnitEnd(const Unit_ptr&); - virtual void visitModuleStart(const Module_ptr&); - virtual void visitModuleEnd(const Module_ptr&); - virtual void visitClassDefStart(const ClassDef_ptr&); - virtual void visitClassDefEnd(const ClassDef_ptr&); - virtual void visitOperation(const Operation_ptr&); + virtual void visitUnitStart(const UnitPtr&); + virtual void visitUnitEnd(const UnitPtr&); + virtual void visitModuleStart(const ModulePtr&); + virtual void visitModuleEnd(const ModulePtr&); + virtual void visitClassDefStart(const ClassDefPtr&); + virtual void visitClassDefEnd(const ClassDefPtr&); + virtual void visitOperation(const OperationPtr&); private: Output& H; Output& C; - std::string dllExport_; + std::string _dllExport; }; - class DelegateMVisitor : ::__Ice::noncopyable, public ParserVisitor + class DelegateMVisitor : ::IceInternal::noncopyable, public ParserVisitor { public: DelegateMVisitor(Output&, Output&, const std::string&); - virtual void visitUnitStart(const Unit_ptr&); - virtual void visitUnitEnd(const Unit_ptr&); - virtual void visitModuleStart(const Module_ptr&); - virtual void visitModuleEnd(const Module_ptr&); - virtual void visitClassDefStart(const ClassDef_ptr&); - virtual void visitClassDefEnd(const ClassDef_ptr&); - virtual void visitOperation(const Operation_ptr&); + virtual void visitUnitStart(const UnitPtr&); + virtual void visitUnitEnd(const UnitPtr&); + virtual void visitModuleStart(const ModulePtr&); + virtual void visitModuleEnd(const ModulePtr&); + virtual void visitClassDefStart(const ClassDefPtr&); + virtual void visitClassDefEnd(const ClassDefPtr&); + virtual void visitOperation(const OperationPtr&); private: Output& H; Output& C; - std::string dllExport_; + std::string _dllExport; }; - class ObjectDeclVisitor : ::__Ice::noncopyable, public ParserVisitor + class ObjectDeclVisitor : ::IceInternal::noncopyable, public ParserVisitor { public: ObjectDeclVisitor(Output&, Output&, const std::string&); - virtual void visitModuleStart(const Module_ptr&); - virtual void visitModuleEnd(const Module_ptr&); - virtual void visitClassDecl(const ClassDecl_ptr&); + virtual void visitModuleStart(const ModulePtr&); + virtual void visitModuleEnd(const ModulePtr&); + virtual void visitClassDecl(const ClassDeclPtr&); private: Output& H; Output& C; - std::string dllExport_; + std::string _dllExport; }; - class ObjectVisitor : ::__Ice::noncopyable, public ParserVisitor + class ObjectVisitor : ::IceInternal::noncopyable, public ParserVisitor { public: ObjectVisitor(Output&, Output&, const std::string&); - virtual void visitModuleStart(const Module_ptr&); - virtual void visitModuleEnd(const Module_ptr&); - virtual void visitClassDefStart(const ClassDef_ptr&); - virtual void visitClassDefEnd(const ClassDef_ptr&); - virtual void visitOperation(const Operation_ptr&); - virtual void visitDataMember(const DataMember_ptr&); + virtual void visitModuleStart(const ModulePtr&); + virtual void visitModuleEnd(const ModulePtr&); + virtual void visitClassDefStart(const ClassDefPtr&); + virtual void visitClassDefEnd(const ClassDefPtr&); + virtual void visitOperation(const OperationPtr&); + virtual void visitDataMember(const DataMemberPtr&); private: Output& H; Output& C; - std::string dllExport_; + std::string _dllExport; }; - class IceVisitor : ::__Ice::noncopyable, public ParserVisitor + class IceVisitor : ::IceInternal::noncopyable, public ParserVisitor { public: IceVisitor(Output&, Output&, const std::string&); - virtual void visitUnitStart(const Unit_ptr&); - virtual void visitUnitEnd(const Unit_ptr&); - virtual void visitClassDecl(const ClassDecl_ptr&); - virtual void visitClassDefStart(const ClassDef_ptr&); + virtual void visitUnitStart(const UnitPtr&); + virtual void visitUnitEnd(const UnitPtr&); + virtual void visitClassDecl(const ClassDeclPtr&); + virtual void visitClassDefStart(const ClassDefPtr&); private: Output& H; Output& C; - std::string dllExport_; + std::string _dllExport; }; - class HandleVisitor : ::__Ice::noncopyable, public ParserVisitor + class HandleVisitor : ::IceInternal::noncopyable, public ParserVisitor { public: HandleVisitor(Output&, Output&, const std::string&); - virtual void visitModuleStart(const Module_ptr&); - virtual void visitModuleEnd(const Module_ptr&); - virtual void visitClassDecl(const ClassDecl_ptr&); - virtual void visitClassDefStart(const ClassDef_ptr&); + virtual void visitModuleStart(const ModulePtr&); + virtual void visitModuleEnd(const ModulePtr&); + virtual void visitClassDecl(const ClassDeclPtr&); + virtual void visitClassDefStart(const ClassDefPtr&); private: Output& H; Output& C; - std::string dllExport_; + std::string _dllExport; }; }; diff --git a/cpp/src/slice2cpp/GenUtil.cpp b/cpp/src/slice2cpp/GenUtil.cpp index b2fad506791..e6b37e6a27c 100644 --- a/cpp/src/slice2cpp/GenUtil.cpp +++ b/cpp/src/slice2cpp/GenUtil.cpp @@ -14,7 +14,7 @@ using namespace std; using namespace Slice; string -Slice::typeToString(const Type_ptr& type) +Slice::typeToString(const TypePtr& type) { static const char* builtinTable[] = { @@ -27,24 +27,24 @@ Slice::typeToString(const Type_ptr& type) "::Ice::Double", "::std::string", "::std::wstring", - "::Ice::Object_ptr", - "::Ice::Object_prx", - "::Ice::LocalObject_ptr" + "::Ice::ObjectPtr", + "::Ice::ObjectPrx", + "::Ice::LocalObjectPtr" }; - Builtin_ptr builtin = Builtin_ptr::dynamicCast(type); + BuiltinPtr builtin = BuiltinPtr::dynamicCast(type); if(builtin) return builtinTable[builtin -> kind()]; - ClassDecl_ptr cl = ClassDecl_ptr::dynamicCast(type); + ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type); if(cl) - return cl -> scoped() + "_ptr"; + return cl -> scoped() + "Ptr"; - Proxy_ptr proxy = Proxy_ptr::dynamicCast(type); + ProxyPtr proxy = ProxyPtr::dynamicCast(type); if(proxy) - return proxy -> _class() -> scoped() + "_prx"; + return proxy -> _class() -> scoped() + "Prx"; - Contained_ptr contained = Contained_ptr::dynamicCast(type); + ContainedPtr contained = ContainedPtr::dynamicCast(type); if(contained) return contained -> scoped(); @@ -52,7 +52,7 @@ Slice::typeToString(const Type_ptr& type) } string -Slice::returnTypeToString(const Type_ptr& type) +Slice::returnTypeToString(const TypePtr& type) { if(!type) return "void"; @@ -61,7 +61,7 @@ Slice::returnTypeToString(const Type_ptr& type) } string -Slice::inputTypeToString(const Type_ptr& type) +Slice::inputTypeToString(const TypePtr& type) { static const char* inputBuiltinTable[] = { @@ -74,32 +74,32 @@ Slice::inputTypeToString(const Type_ptr& type) "::Ice::Double", "const ::std::string&", "const ::std::wstring&", - "const ::Ice::Object_ptr&", - "const ::Ice::Object_prx&", - "const ::Ice::LocalObject_ptr&" + "const ::Ice::ObjectPtr&", + "const ::Ice::ObjectPrx&", + "const ::Ice::LocalObjectPtr&" }; - Builtin_ptr builtin = Builtin_ptr::dynamicCast(type); + BuiltinPtr builtin = BuiltinPtr::dynamicCast(type); if(builtin) return inputBuiltinTable[builtin -> kind()]; - ClassDecl_ptr cl = ClassDecl_ptr::dynamicCast(type); + ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type); if(cl) - return "const " + cl -> scoped() + "_ptr&"; + return "const " + cl -> scoped() + "Ptr&"; - Proxy_ptr proxy = Proxy_ptr::dynamicCast(type); + ProxyPtr proxy = ProxyPtr::dynamicCast(type); if(proxy) - return "const " + proxy -> _class() -> scoped() + "_prx&"; + return "const " + proxy -> _class() -> scoped() + "Prx&"; - Enum_ptr en = Enum_ptr::dynamicCast(type); + EnumPtr en = EnumPtr::dynamicCast(type); if(en) return en -> scoped(); - Native_ptr native = Native_ptr::dynamicCast(type); + NativePtr native = NativePtr::dynamicCast(type); if(native) return native -> scoped(); - Contained_ptr contained = Contained_ptr::dynamicCast(type); + ContainedPtr contained = ContainedPtr::dynamicCast(type); if(contained) return "const " + contained -> scoped() + "&"; @@ -107,7 +107,7 @@ Slice::inputTypeToString(const Type_ptr& type) } string -Slice::outputTypeToString(const Type_ptr& type) +Slice::outputTypeToString(const TypePtr& type) { static const char* outputBuiltinTable[] = { @@ -120,28 +120,28 @@ Slice::outputTypeToString(const Type_ptr& type) "::Ice::Double&", "::std::string&", "::std::wstring&", - "::Ice::Object_ptr", - "::Ice::Object_prx", - "::Ice::LocalObject_ptr" + "::Ice::ObjectPtr", + "::Ice::ObjectPrx", + "::Ice::LocalObjectPtr" }; - Builtin_ptr builtin = Builtin_ptr::dynamicCast(type); + BuiltinPtr builtin = BuiltinPtr::dynamicCast(type); if(builtin) return outputBuiltinTable[builtin -> kind()]; - ClassDecl_ptr cl = ClassDecl_ptr::dynamicCast(type); + ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type); if(cl) - return cl -> scoped() + "_ptr&"; + return cl -> scoped() + "Ptr&"; - Proxy_ptr proxy = Proxy_ptr::dynamicCast(type); + ProxyPtr proxy = ProxyPtr::dynamicCast(type); if(proxy) - return proxy -> _class() -> scoped() + "_prx&"; + return proxy -> _class() -> scoped() + "Prx&"; - Native_ptr native = Native_ptr::dynamicCast(type); + NativePtr native = NativePtr::dynamicCast(type); if(native) return native -> scoped(); - Contained_ptr contained = Contained_ptr::dynamicCast(type); + ContainedPtr contained = ContainedPtr::dynamicCast(type); if(contained) return contained -> scoped() + "&"; @@ -149,7 +149,7 @@ Slice::outputTypeToString(const Type_ptr& type) } string -Slice::exceptionTypeToString(const Type_ptr& type) +Slice::exceptionTypeToString(const TypePtr& type) { static const char* inputBuiltinTable[] = { @@ -162,32 +162,32 @@ Slice::exceptionTypeToString(const Type_ptr& type) "::Ice::Double", "const ::std::string&", "const ::std::wstring&", - "const ::Ice::Object_ptrE&", - "const ::Ice::Object_prxE&", - "const ::Ice::LocalObject_ptrE&" + "const ::Ice::ObjectPtrE&", + "const ::Ice::ObjectPrxE&", + "const ::Ice::LocalObjectPtrE&" }; - Builtin_ptr builtin = Builtin_ptr::dynamicCast(type); + BuiltinPtr builtin = BuiltinPtr::dynamicCast(type); if(builtin) return inputBuiltinTable[builtin -> kind()]; - ClassDecl_ptr cl = ClassDecl_ptr::dynamicCast(type); + ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type); if(cl) - return "const " + cl -> scoped() + "_ptrE&"; + return "const " + cl -> scoped() + "PtrE&"; - Proxy_ptr proxy = Proxy_ptr::dynamicCast(type); + ProxyPtr proxy = ProxyPtr::dynamicCast(type); if(proxy) - return "const " + proxy -> _class() -> scoped() + "_prxE&"; + return "const " + proxy -> _class() -> scoped() + "PrxE&"; - Enum_ptr en = Enum_ptr::dynamicCast(type); + EnumPtr en = EnumPtr::dynamicCast(type); if(en) return en -> scoped(); - Native_ptr native = Native_ptr::dynamicCast(type); + NativePtr native = NativePtr::dynamicCast(type); if(native) return native -> scoped(); - Contained_ptr contained = Contained_ptr::dynamicCast(type); + ContainedPtr contained = ContainedPtr::dynamicCast(type); if(contained) return "const " + contained -> scoped() + "&"; @@ -195,34 +195,34 @@ Slice::exceptionTypeToString(const Type_ptr& type) } void -Slice::writeMarshalUnmarshalCode(Output& out, const Type_ptr& type, +Slice::writeMarshalUnmarshalCode(Output& out, const TypePtr& type, const string& param, bool marshal) { const char* func = marshal ? "write(" : "read("; const char* stream = marshal ? "__os" : "__is"; - if(Builtin_ptr::dynamicCast(type)) + if(BuiltinPtr::dynamicCast(type)) { out << nl << stream << " -> " << func << param << ");"; return; } - ClassDecl_ptr cl = ClassDecl_ptr::dynamicCast(type); + ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type); if(cl) { out << sb; if(marshal) { - out << nl << "::Ice::Object_ptr __obj = " << param << ';'; + out << nl << "::Ice::ObjectPtr __obj = " << param << ';'; out << nl << stream << " -> write(__obj);"; } else { - out << nl << "::Ice::Object_ptr __obj;"; + out << nl << "::Ice::ObjectPtr __obj;"; out << nl << stream << " -> read(__obj, " << cl -> scoped() << "::__classIds[0]);"; out << nl << "if(!__obj)"; - ClassDef_ptr def = cl -> definition(); + ClassDefPtr def = cl -> definition(); if(def && !def -> isAbstract()) { out << sb; @@ -238,7 +238,7 @@ Slice::writeMarshalUnmarshalCode(Output& out, const Type_ptr& type, out.dec(); } out << nl << param << " = " << cl -> scoped() - << "_ptr::dynamicCast(__obj);"; + << "Ptr::dynamicCast(__obj);"; out << nl << "if(!" << param << ')'; out.inc(); out << nl @@ -250,10 +250,10 @@ Slice::writeMarshalUnmarshalCode(Output& out, const Type_ptr& type, return; } - Vector_ptr vec = Vector_ptr::dynamicCast(type); + VectorPtr vec = VectorPtr::dynamicCast(type); if(vec) { - if(Builtin_ptr::dynamicCast(vec -> type())) + if(BuiltinPtr::dynamicCast(vec -> type())) out << nl << stream << " -> " << func << param << ");"; else out << nl << vec -> scope() << "::__" << func << stream\ @@ -262,13 +262,13 @@ Slice::writeMarshalUnmarshalCode(Output& out, const Type_ptr& type, return; } - Native_ptr native = Native_ptr::dynamicCast(type); + NativePtr native = NativePtr::dynamicCast(type); assert(!native); // TODO - Constructed_ptr constructed = Constructed_ptr::dynamicCast(type); + ConstructedPtr constructed = ConstructedPtr::dynamicCast(type); if(!constructed) { - Proxy_ptr proxy = Proxy_ptr::dynamicCast(type); + ProxyPtr proxy = ProxyPtr::dynamicCast(type); assert(proxy); constructed = proxy -> _class(); } @@ -279,10 +279,10 @@ Slice::writeMarshalUnmarshalCode(Output& out, const Type_ptr& type, void Slice::writeMarshalCode(Output& out, - const list<pair<Type_ptr, string> >& params, - const Type_ptr& ret) + const list<pair<TypePtr, string> >& params, + const TypePtr& ret) { - list<pair<Type_ptr, string> >::const_iterator p; + list<pair<TypePtr, string> >::const_iterator p; for(p = params.begin(); p != params.end(); ++p) writeMarshalUnmarshalCode(out, p -> first, p -> second, true); if(ret) @@ -291,10 +291,10 @@ Slice::writeMarshalCode(Output& out, void Slice::writeUnmarshalCode(Output& out, - const list<pair<Type_ptr, string> >& params, - const Type_ptr& ret) + const list<pair<TypePtr, string> >& params, + const TypePtr& ret) { - list<pair<Type_ptr, string> >::const_iterator p; + list<pair<TypePtr, string> >::const_iterator p; for(p = params.begin(); p != params.end(); ++p) writeMarshalUnmarshalCode(out, p -> first, p -> second, false); if(ret) @@ -303,14 +303,14 @@ Slice::writeUnmarshalCode(Output& out, void Slice::writeAllocateCode(Output& out, - const list<pair<Type_ptr, string> >& params, - const Type_ptr& ret) + const list<pair<TypePtr, string> >& params, + const TypePtr& ret) { - list<pair<Type_ptr, string> > ps = params; + list<pair<TypePtr, string> > ps = params; if(ret) ps.push_back(make_pair(ret, string("__ret"))); - list<pair<Type_ptr, string> >::const_iterator p; + list<pair<TypePtr, string> >::const_iterator p; for(p = ps.begin(); p != ps.end(); ++p) out << nl << typeToString(p -> first) << ' ' << p -> second << ';'; } diff --git a/cpp/src/slice2cpp/GenUtil.h b/cpp/src/slice2cpp/GenUtil.h index 21f1f83fe85..7dd9a6404b3 100644 --- a/cpp/src/slice2cpp/GenUtil.h +++ b/cpp/src/slice2cpp/GenUtil.h @@ -17,28 +17,28 @@ namespace Slice { -std::string typeToString(const Type_ptr&); -std::string returnTypeToString(const Type_ptr&); -std::string inputTypeToString(const Type_ptr&); -std::string outputTypeToString(const Type_ptr&); -std::string exceptionTypeToString(const Type_ptr&); +std::string typeToString(const TypePtr&); +std::string returnTypeToString(const TypePtr&); +std::string inputTypeToString(const TypePtr&); +std::string outputTypeToString(const TypePtr&); +std::string exceptionTypeToString(const TypePtr&); void writeMarshalUnmarshalCode(Output&, - const Type_ptr&, + const TypePtr&, const std::string&, bool); void writeMarshalCode(Output&, - const std::list<std::pair<Type_ptr, std::string> >&, - const Type_ptr&); + const std::list<std::pair<TypePtr, std::string> >&, + const TypePtr&); void writeUnmarshalCode(Output&, - const std::list<std::pair<Type_ptr, std::string> >&, - const Type_ptr&); + const std::list<std::pair<TypePtr, std::string> >&, + const TypePtr&); void writeAllocateCode(Output&, - const std::list<std::pair<Type_ptr, std::string> >&, - const Type_ptr&); + const std::list<std::pair<TypePtr, std::string> >&, + const TypePtr&); } diff --git a/cpp/src/slice2cpp/Main.cpp b/cpp/src/slice2cpp/Main.cpp index 21575b54eb3..e30af271d12 100644 --- a/cpp/src/slice2cpp/Main.cpp +++ b/cpp/src/slice2cpp/Main.cpp @@ -177,7 +177,7 @@ main(int argc, char* argv[]) return EXIT_FAILURE; } - Unit_ptr unit = Unit::createUnit(false, false); + UnitPtr unit = Unit::createUnit(false, false); int parseStatus = unit -> parse(cppHandle, debug); #ifdef WIN32 diff --git a/cpp/src/slice2docbook/Gen.cpp b/cpp/src/slice2docbook/Gen.cpp index 655fde98747..4acd74fa535 100644 --- a/cpp/src/slice2docbook/Gen.cpp +++ b/cpp/src/slice2docbook/Gen.cpp @@ -17,9 +17,9 @@ using namespace Slice; Slice::Gen::Gen(const string& name, const string& file, bool standAlone, bool noGlobals) - : standAlone_(standAlone), - noGlobals_(noGlobals), - chapter_("section") // Could also be "chapter" + : _standAlone(standAlone), + _noGlobals(noGlobals), + _chapter("section") // Could also be "chapter" { O.open(file.c_str()); if(!O) @@ -41,7 +41,7 @@ Slice::Gen::operator!() const } void -Slice::Gen::generate(const Unit_ptr& unit) +Slice::Gen::generate(const UnitPtr& unit) { unit -> mergeModules(); unit -> sort(); @@ -49,9 +49,9 @@ Slice::Gen::generate(const Unit_ptr& unit) } void -Slice::Gen::visitUnitStart(const Unit_ptr& p) +Slice::Gen::visitUnitStart(const UnitPtr& p) { - if(standAlone_) + if(_standAlone) { O << "<!DOCTYPE book PUBLIC \"-//OASIS//DTD DocBook V3.1//EN\">"; start("article"); @@ -59,25 +59,25 @@ Slice::Gen::visitUnitStart(const Unit_ptr& p) printHeader(); - if(!noGlobals_) + if(!_noGlobals) { - start(chapter_, "Global Module"); + start(_chapter, "Global Module"); start("section", "Overview"); visitContainer(p); } } void -Slice::Gen::visitUnitEnd(const Unit_ptr& p) +Slice::Gen::visitUnitEnd(const UnitPtr& p) { - if(standAlone_) + if(_standAlone) end(); } void -Slice::Gen::visitModuleStart(const Module_ptr& p) +Slice::Gen::visitModuleStart(const ModulePtr& p) { - start(chapter_ + " id=" + scopedToId(p -> scoped()), + start(_chapter + " id=" + scopedToId(p -> scoped()), p -> scoped().substr(2)); start("section", "Overview"); O.zeroIndent(); @@ -89,7 +89,7 @@ Slice::Gen::visitModuleStart(const Module_ptr& p) } void -Slice::Gen::visitContainer(const Container_ptr& p) +Slice::Gen::visitContainer(const ContainerPtr& p) { ModuleList modules = p -> modules(); modules.sort(); @@ -252,7 +252,7 @@ Slice::Gen::visitContainer(const Container_ptr& p) q != vectors.end(); ++q) { - Type_ptr type = (*q) -> type(); + TypePtr type = (*q) -> type(); start("section id=" + scopedToId((*q) -> scoped()), (*q) -> name()); @@ -312,9 +312,9 @@ Slice::Gen::visitContainer(const Container_ptr& p) } void -Slice::Gen::visitClassDefStart(const ClassDef_ptr& p) +Slice::Gen::visitClassDefStart(const ClassDefPtr& p) { - start(chapter_ + " id=" + scopedToId(p -> scoped()), + start(_chapter + " id=" + scopedToId(p -> scoped()), p -> scoped().substr(2)); start("section", "Overview"); @@ -419,7 +419,7 @@ Slice::Gen::visitClassDefStart(const ClassDef_ptr& p) q != operations.end(); ++q) { - Type_ptr returnType = (*q) -> returnType(); + TypePtr returnType = (*q) -> returnType(); TypeStringList inputParams = (*q) -> inputParameters(); TypeStringList outputParams = (*q) -> outputParameters(); TypeList throws = (*q) -> throws(); @@ -480,7 +480,7 @@ Slice::Gen::visitClassDefStart(const ClassDef_ptr& p) q != dataMembers.end(); ++q) { - Type_ptr type = (*q) -> type(); + TypePtr type = (*q) -> type(); start("section id=" + scopedToId((*q) -> scoped()), (*q) -> name()); @@ -553,9 +553,9 @@ Slice::Gen::getTagged(const string& tag, string& comment) } void -Slice::Gen::printComment(const Contained_ptr& p) +Slice::Gen::printComment(const ContainedPtr& p) { - Container_ptr container = Container_ptr::dynamicCast(p); + ContainerPtr container = ContainerPtr::dynamicCast(p); if(!container) container = p -> container(); @@ -678,7 +678,7 @@ Slice::Gen::printComment(const Contained_ptr& p) } void -Slice::Gen::printSummary(const Contained_ptr& p) +Slice::Gen::printSummary(const ContainedPtr& p) { string comment = p -> comment(); @@ -702,9 +702,9 @@ Slice::Gen::start(const std::string& element) string::size_type pos = element.find_first_of(" \t"); if(pos == string::npos) - elementStack_.push(element); + _elementStack.push(element); else - elementStack_.push(element.substr(0, pos)); + _elementStack.push(element.substr(0, pos)); } void @@ -719,8 +719,8 @@ Slice::Gen::start(const std::string& element, const std::string& title) void Slice::Gen::end() { - string element = elementStack_.top(); - elementStack_.pop(); + string element = _elementStack.top(); + _elementStack.pop(); O.dec(); O << nl << "</" << element << '>'; diff --git a/cpp/src/slice2docbook/Gen.h b/cpp/src/slice2docbook/Gen.h index af79f330eed..61e8522bc09 100644 --- a/cpp/src/slice2docbook/Gen.h +++ b/cpp/src/slice2docbook/Gen.h @@ -18,7 +18,7 @@ namespace Slice { -class Gen : ::__Ice::noncopyable, public ParserVisitor +class Gen : ::IceInternal::noncopyable, public ParserVisitor { public: @@ -27,30 +27,30 @@ public: bool operator!() const; // Returns true if there was a constructor error - void generate(const Unit_ptr&); + void generate(const UnitPtr&); - virtual void visitUnitStart(const Unit_ptr&); - virtual void visitUnitEnd(const Unit_ptr&); - virtual void visitModuleStart(const Module_ptr&); - virtual void visitContainer(const Container_ptr&); - virtual void visitClassDefStart(const ClassDef_ptr&); + virtual void visitUnitStart(const UnitPtr&); + virtual void visitUnitEnd(const UnitPtr&); + virtual void visitModuleStart(const ModulePtr&); + virtual void visitContainer(const ContainerPtr&); + virtual void visitClassDefStart(const ClassDefPtr&); private: void printHeader(); StringList getTagged(const std::string&, std::string&); - void printComment(const Contained_ptr&); - void printSummary(const Contained_ptr&); + void printComment(const ContainedPtr&); + void printSummary(const ContainedPtr&); void start(const std::string&); void start(const std::string&, const std::string&); void end(); Output O; - bool standAlone_; - bool noGlobals_; - std::string chapter_; - std::stack<std::string> elementStack_; + bool _standAlone; + bool _noGlobals; + std::string _chapter; + std::stack<std::string> _elementStack; }; } diff --git a/cpp/src/slice2docbook/GenUtil.cpp b/cpp/src/slice2docbook/GenUtil.cpp index 0c00efcd0be..1827ec2f829 100644 --- a/cpp/src/slice2docbook/GenUtil.cpp +++ b/cpp/src/slice2docbook/GenUtil.cpp @@ -15,7 +15,7 @@ using namespace std; using namespace Slice; string -Slice::typeToString(const Type_ptr& type) +Slice::typeToString(const TypePtr& type) { static const char* builtinTable[] = { @@ -35,21 +35,21 @@ Slice::typeToString(const Type_ptr& type) string result; - Builtin_ptr builtin = Builtin_ptr::dynamicCast(type); + BuiltinPtr builtin = BuiltinPtr::dynamicCast(type); if(builtin) result = "<type>" + string(builtinTable[builtin -> kind()]) + "</type>"; - Proxy_ptr proxy = Proxy_ptr::dynamicCast(type); + ProxyPtr proxy = ProxyPtr::dynamicCast(type); if(proxy) result = "<classname>" + proxy -> _class() -> scoped().substr(2) + "*</classname>"; - ClassDecl_ptr cl = ClassDecl_ptr::dynamicCast(type); + ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type); if(cl) result = "<classname>" + cl -> scoped().substr(2) + "</classname>"; - Contained_ptr contained = Contained_ptr::dynamicCast(type); + ContainedPtr contained = ContainedPtr::dynamicCast(type); if(contained) { if(result.empty()) @@ -66,19 +66,19 @@ Slice::typeToString(const Type_ptr& type) } string -Slice::addLink(const string& s, const Container_ptr& container) +Slice::addLink(const string& s, const ContainerPtr& container) { TypeList types = container -> lookupType(s, false); if(!types.empty()) { string result; - if(ClassDecl_ptr::dynamicCast(types.front())) + if(ClassDeclPtr::dynamicCast(types.front())) result = "<classname>" + s + "</classname>"; else result = "<type>" + s + "</type>"; - Contained_ptr p = Contained_ptr::dynamicCast(types.front()); + ContainedPtr p = ContainedPtr::dynamicCast(types.front()); if(p) result = "<link linkend=" + scopedToId(p -> scoped()) + ">" + result + "</link>"; @@ -92,11 +92,11 @@ Slice::addLink(const string& s, const Container_ptr& container) string result = "<link linkend=" + scopedToId(contList.front() -> scoped()) + ">"; - if(Module_ptr::dynamicCast(contList.front())) + if(ModulePtr::dynamicCast(contList.front())) result += "<classname>" + s + "</classname>"; - else if(Operation_ptr::dynamicCast(contList.front())) + else if(OperationPtr::dynamicCast(contList.front())) result += "<function>" + s + "</function>"; - else if(DataMember_ptr::dynamicCast(contList.front())) + else if(DataMemberPtr::dynamicCast(contList.front())) result += "<structfield>" + s + "</structfield>"; else assert(false); @@ -136,7 +136,7 @@ string Slice::scopedToId(const string& scoped) { static map<string, int> idMap; - static int nextId_ = 0; + static int _nextId = 0; string s; if(scoped[0] == ':') @@ -147,7 +147,7 @@ Slice::scopedToId(const string& scoped) int id = idMap[s]; if(id == 0) { - id = ++nextId_; + id = ++_nextId; idMap[s] = id; } diff --git a/cpp/src/slice2docbook/GenUtil.h b/cpp/src/slice2docbook/GenUtil.h index 4ecb768f497..bec737d7fff 100644 --- a/cpp/src/slice2docbook/GenUtil.h +++ b/cpp/src/slice2docbook/GenUtil.h @@ -17,8 +17,8 @@ namespace Slice { -std::string typeToString(const Type_ptr&); -std::string addLink(const std::string&, const Container_ptr&); +std::string typeToString(const TypePtr&); +std::string addLink(const std::string&, const ContainerPtr&); std::string scopedToFile(const std::string&); std::string scopedToId(const std::string&); diff --git a/cpp/src/slice2docbook/Main.cpp b/cpp/src/slice2docbook/Main.cpp index adba203cb80..e6cad9e4c3a 100644 --- a/cpp/src/slice2docbook/Main.cpp +++ b/cpp/src/slice2docbook/Main.cpp @@ -142,7 +142,7 @@ main(int argc, char* argv[]) return EXIT_FAILURE; } - Unit_ptr unit = Unit::createUnit(true, true); + UnitPtr unit = Unit::createUnit(true, true); int status = EXIT_SUCCESS; |