diff options
Diffstat (limited to 'cpp')
-rw-r--r-- | cpp/src/Slice/Grammer.y | 194 | ||||
-rw-r--r-- | cpp/src/Slice/GrammerUtil.cpp | 24 | ||||
-rw-r--r-- | cpp/src/Slice/Parser.cpp | 320 | ||||
-rw-r--r-- | cpp/src/Slice/Scanner.l | 24 | ||||
-rw-r--r-- | cpp/src/slice2cpp/Gen.cpp | 402 | ||||
-rw-r--r-- | cpp/src/slice2cpp/GenUtil.cpp | 76 | ||||
-rw-r--r-- | cpp/src/slice2cpp/Main.cpp | 6 | ||||
-rw-r--r-- | cpp/src/slice2docbook/Gen.cpp | 118 | ||||
-rw-r--r-- | cpp/src/slice2docbook/GenUtil.cpp | 18 | ||||
-rw-r--r-- | cpp/src/slice2docbook/Main.cpp | 12 |
10 files changed, 597 insertions, 597 deletions
diff --git a/cpp/src/Slice/Grammer.y b/cpp/src/Slice/Grammer.y index 5fdee6c3963..a5ebc96d816 100644 --- a/cpp/src/Slice/Grammer.y +++ b/cpp/src/Slice/Grammer.y @@ -18,7 +18,7 @@ using namespace Slice; void yyerror(const char* s) { - unit -> error(s); + unit->error(s); } %} @@ -71,7 +71,7 @@ definitions } | definition { - unit -> error("`;' missing after definition"); + unit->error("`;' missing after definition"); } | { @@ -118,7 +118,7 @@ class_exports } | class_export { - unit -> error("`;' missing after definition"); + unit->error("`;' missing after definition"); } | { @@ -147,7 +147,7 @@ interface_exports } | interface_export { - unit -> error("`;' missing after definition"); + unit->error("`;' missing after definition"); } | { @@ -168,15 +168,15 @@ module_def : ICE_MODULE ICE_IDENTIFIER { StringTokPtr ident = StringTokPtr::dynamicCast($2); - ContainerPtr cont = unit -> currentContainer(); - ModulePtr module = cont -> createModule(ident -> v); + ContainerPtr cont = unit->currentContainer(); + ModulePtr module = cont->createModule(ident->v); if (!module) YYERROR; // Can't continue, jump to next yyerrok - unit -> pushContainer(module); + unit->pushContainer(module); } '{' definitions '}' { - unit -> popContainer(); + unit->popContainer(); } ; @@ -186,13 +186,13 @@ local : ICE_LOCAL { BoolTokPtr local = new BoolTok; - local -> v = true; + local->v = true; $$ = local; } | { BoolTokPtr local = new BoolTok; - local -> v = false; + local->v = false; $$ = local; } ; @@ -204,9 +204,9 @@ class_decl { BoolTokPtr local = BoolTokPtr::dynamicCast($1); StringTokPtr ident = StringTokPtr::dynamicCast($3); - ContainerPtr cont = unit -> currentContainer(); - ClassDeclPtr cl = cont -> createClassDecl(ident -> v, - local -> v, + ContainerPtr cont = unit->currentContainer(); + ClassDeclPtr cl = cont->createClassDecl(ident->v, + local->v, false); } ; @@ -218,22 +218,22 @@ class_def { BoolTokPtr local = BoolTokPtr::dynamicCast($1); StringTokPtr ident = StringTokPtr::dynamicCast($3); - ContainerPtr cont = unit -> currentContainer(); + ContainerPtr cont = unit->currentContainer(); ClassDefPtr base = ClassDefPtr::dynamicCast($4); ClassListTokPtr bases = ClassListTokPtr::dynamicCast($5); if (base) - bases -> v.push_front(base); - ClassDefPtr cl = cont -> createClassDef(ident -> v, - local -> v, + bases->v.push_front(base); + ClassDefPtr cl = cont->createClassDef(ident->v, + local->v, false, - bases -> v); + bases->v); if (!cl) YYERROR; // Can't continue, jump to next yyerrok - unit -> pushContainer(cl); + unit->pushContainer(cl); } '{' class_exports '}' { - unit -> popContainer(); + unit->popContainer(); } ; @@ -243,8 +243,8 @@ class_extends : ICE_EXTENDS scoped_name { StringTokPtr scoped = StringTokPtr::dynamicCast($2); - ContainerPtr cont = unit -> currentContainer(); - list<TypePtr> types = cont -> lookupType(scoped -> v); + ContainerPtr cont = unit->currentContainer(); + list<TypePtr> types = cont->lookupType(scoped->v); $$ = 0; if (!types.empty()) { @@ -252,19 +252,19 @@ class_extends if (!cl) { string msg = "`"; - msg += scoped -> v; + msg += scoped->v; msg += "' is not a class"; - unit -> error(msg); + unit->error(msg); } else { - ClassDefPtr def = cl -> definition(); + ClassDefPtr def = cl->definition(); if (!def) { string msg = "`"; - msg += scoped -> v; + msg += scoped->v; msg += "' has been declared but not defined"; - unit -> error(msg); + unit->error(msg); } else { @@ -299,9 +299,9 @@ interface_decl { BoolTokPtr local = BoolTokPtr::dynamicCast($1); StringTokPtr ident = StringTokPtr::dynamicCast($3); - ContainerPtr cont = unit -> currentContainer(); - ClassDeclPtr cl = cont -> createClassDecl(ident -> v, - local -> v, + ContainerPtr cont = unit->currentContainer(); + ClassDeclPtr cl = cont->createClassDecl(ident->v, + local->v, true); } ; @@ -313,19 +313,19 @@ interface_def { BoolTokPtr local = BoolTokPtr::dynamicCast($1); StringTokPtr ident = StringTokPtr::dynamicCast($3); - ContainerPtr cont = unit -> currentContainer(); + ContainerPtr cont = unit->currentContainer(); ClassListTokPtr bases = ClassListTokPtr::dynamicCast($4); - ClassDefPtr cl = cont -> createClassDef(ident -> v, - local -> v, + ClassDefPtr cl = cont->createClassDef(ident->v, + local->v, true, - bases -> v); + bases->v); if (!cl) YYERROR; // Can't continue, jump to next yyerrok - unit -> pushContainer(cl); + unit->pushContainer(cl); } '{' interface_exports '}' { - unit -> popContainer(); + unit->popContainer(); } ; @@ -337,31 +337,31 @@ interface_list ClassListTokPtr intfs = ClassListTokPtr::dynamicCast($3); $$ = intfs; StringTokPtr scoped = StringTokPtr::dynamicCast($1); - ContainerPtr cont = unit -> currentContainer(); - list<TypePtr> types = cont -> lookupType(scoped -> v); + ContainerPtr cont = unit->currentContainer(); + list<TypePtr> types = cont->lookupType(scoped->v); if (!types.empty()) { ClassDeclPtr cl = ClassDeclPtr::dynamicCast(types.front()); - if (!cl || !cl -> isInterface()) + if (!cl || !cl->isInterface()) { string msg = "`"; - msg += scoped -> v; + msg += scoped->v; msg += "' is not an interface"; - unit -> error(msg); + unit->error(msg); } else { - ClassDefPtr def = cl -> definition(); + ClassDefPtr def = cl->definition(); if (!def) { string msg = "`"; - msg += scoped -> v; + msg += scoped->v; msg += "' has been declared but not defined"; - unit -> error(msg); + unit->error(msg); } else { - intfs -> v.push_front(def); + intfs->v.push_front(def); } } } @@ -371,31 +371,31 @@ interface_list ClassListTokPtr intfs = new ClassListTok; $$ = intfs; StringTokPtr scoped = StringTokPtr::dynamicCast($1); - ContainerPtr cont = unit -> currentContainer(); - list<TypePtr> types = cont -> lookupType(scoped -> v); + ContainerPtr cont = unit->currentContainer(); + list<TypePtr> types = cont->lookupType(scoped->v); if (!types.empty()) { ClassDeclPtr cl = ClassDeclPtr::dynamicCast(types.front()); - if (!cl || !cl -> isInterface()) + if (!cl || !cl->isInterface()) { string msg = "`"; - msg += scoped -> v; + msg += scoped->v; msg += "' is not an interface"; - unit -> error(msg); + unit->error(msg); } else { - ClassDefPtr def = cl -> definition(); + ClassDefPtr def = cl->definition(); if (!def) { string msg = "`"; - msg += scoped -> v; + msg += scoped->v; msg += "' has been declared but not defined"; - unit -> error(msg); + unit->error(msg); } else { - intfs -> v.push_front(def); + intfs->v.push_front(def); } } } @@ -425,9 +425,9 @@ operation 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); + ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); + cl->createOperation(name->v, returnType, inParms->v, outParms->v, + throws->v); } // ---------------------------------------------------------------------- @@ -438,7 +438,7 @@ parameters 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->v.push_front(make_pair(type, ident->v)); $$ = parms; } | type ICE_IDENTIFIER @@ -446,7 +446,7 @@ parameters TypePtr type = TypePtr::dynamicCast($1); StringTokPtr ident = StringTokPtr::dynamicCast($2); TypeStringListTokPtr parms = new TypeStringListTok; - parms -> v.push_front(make_pair(type, ident -> v)); + parms->v.push_front(make_pair(type, ident->v)); $$ = parms; } | @@ -487,9 +487,9 @@ data_member { TypePtr type = TypePtr::dynamicCast($1); StringTokPtr ident = StringTokPtr::dynamicCast($2); - ClassDefPtr cl = ClassDefPtr::dynamicCast(unit -> currentContainer()); - assert(!cl -> isInterface()); - cl -> createDataMember(ident -> v, type); + ClassDefPtr cl = ClassDefPtr::dynamicCast(unit->currentContainer()); + assert(!cl->isInterface()); + cl->createDataMember(ident->v, type); } ; @@ -498,57 +498,57 @@ type // ---------------------------------------------------------------------- : ICE_BYTE { - $$ = unit -> builtin(Builtin::KindByte); + $$ = unit->builtin(Builtin::KindByte); } | ICE_BOOL { - $$ = unit -> builtin(Builtin::KindBool); + $$ = unit->builtin(Builtin::KindBool); } | ICE_SHORT { - $$ = unit -> builtin(Builtin::KindShort); + $$ = unit->builtin(Builtin::KindShort); } | ICE_INT { - $$ = unit -> builtin(Builtin::KindInt); + $$ = unit->builtin(Builtin::KindInt); } | ICE_LONG { - $$ = unit -> builtin(Builtin::KindLong); + $$ = unit->builtin(Builtin::KindLong); } | ICE_FLOAT { - $$ = unit -> builtin(Builtin::KindFloat); + $$ = unit->builtin(Builtin::KindFloat); } | ICE_DOUBLE { - $$ = unit -> builtin(Builtin::KindDouble); + $$ = unit->builtin(Builtin::KindDouble); } | ICE_STRING { - $$ = unit -> builtin(Builtin::KindString); + $$ = unit->builtin(Builtin::KindString); } | ICE_WSTRING { - $$ = unit -> builtin(Builtin::KindWString); + $$ = unit->builtin(Builtin::KindWString); } | ICE_OBJECT { - $$ = unit -> builtin(Builtin::KindObject); + $$ = unit->builtin(Builtin::KindObject); } | ICE_OBJECT '*' { - $$ = unit -> builtin(Builtin::KindObjectProxy); + $$ = unit->builtin(Builtin::KindObjectProxy); } | ICE_LOCAL_OBJECT { - $$ = unit -> builtin(Builtin::KindLocalObject); + $$ = unit->builtin(Builtin::KindLocalObject); } | scoped_name { StringTokPtr scoped = StringTokPtr::dynamicCast($1); - ContainerPtr cont = unit -> currentContainer(); - list<TypePtr> types = cont -> lookupType(scoped -> v); + ContainerPtr cont = unit->currentContainer(); + list<TypePtr> types = cont->lookupType(scoped->v); if (types.empty()) YYERROR; // Can't continue, jump to next yyerrok $$ = types.front(); @@ -556,8 +556,8 @@ type | scoped_name '*' { StringTokPtr scoped = StringTokPtr::dynamicCast($1); - ContainerPtr cont = unit -> currentContainer(); - list<TypePtr> types = cont -> lookupType(scoped -> v); + ContainerPtr cont = unit->currentContainer(); + list<TypePtr> types = cont->lookupType(scoped->v); if (types.empty()) YYERROR; // Can't continue, jump to next yyerrok for (list<TypePtr>::iterator p = types.begin(); @@ -568,9 +568,9 @@ type if (!cl) { string msg = "`"; - msg += scoped -> v; + msg += scoped->v; msg += "' must be class or interface"; - unit -> error(msg); + unit->error(msg); YYERROR; // Can't continue, jump to next yyerrok } *p = new Proxy(cl); @@ -586,14 +586,14 @@ type_list { TypePtr type = TypePtr::dynamicCast($1); TypeListTokPtr typeList = TypeListTokPtr::dynamicCast($3); - typeList -> v.push_front(type); + typeList->v.push_front(type); $$ = typeList; } | type { TypePtr type = TypePtr::dynamicCast($1); TypeListTokPtr typeList = new TypeListTok; - typeList -> v.push_front(type); + typeList->v.push_front(type); $$ = typeList; } ; @@ -617,8 +617,8 @@ native_def : ICE_NATIVE ICE_IDENTIFIER { StringTokPtr ident = StringTokPtr::dynamicCast($2); - ContainerPtr cont = unit -> currentContainer(); - cont -> createNative(ident -> v); + ContainerPtr cont = unit->currentContainer(); + cont->createNative(ident->v); } ; @@ -629,8 +629,8 @@ vector_def { StringTokPtr ident = StringTokPtr::dynamicCast($5); TypePtr type = TypePtr::dynamicCast($3); - ContainerPtr cont = unit -> currentContainer(); - cont -> createVector(ident -> v, type); + ContainerPtr cont = unit->currentContainer(); + cont->createVector(ident->v, type); } ; @@ -641,8 +641,8 @@ enum_def { StringTokPtr ident = StringTokPtr::dynamicCast($2); StringListTokPtr enumerators = StringListTokPtr::dynamicCast($4); - ContainerPtr cont = unit -> currentContainer(); - EnumPtr en = cont -> createEnum(ident -> v, enumerators -> v); + ContainerPtr cont = unit->currentContainer(); + EnumPtr en = cont->createEnum(ident->v, enumerators->v); } ; @@ -654,20 +654,20 @@ identifier_list StringTokPtr ident = StringTokPtr::dynamicCast($1); StringListTokPtr ens = StringListTokPtr::dynamicCast($3); $$ = ens; - ContainerPtr cont = unit -> currentContainer(); - EnumeratorPtr en = cont -> createEnumerator(ident -> v); + ContainerPtr cont = unit->currentContainer(); + EnumeratorPtr en = cont->createEnumerator(ident->v); if (en) - ens -> v.push_front(ident -> v); + ens->v.push_front(ident->v); } | ICE_IDENTIFIER { StringTokPtr ident = StringTokPtr::dynamicCast($1); StringListTokPtr ens = new StringListTok; $$ = ens; - ContainerPtr cont = unit -> currentContainer(); - EnumeratorPtr en = cont -> createEnumerator(ident -> v); + ContainerPtr cont = unit->currentContainer(); + EnumeratorPtr en = cont->createEnumerator(ident->v); if (en) - ens -> v.push_front(ident -> v); + ens->v.push_front(ident->v); } ; @@ -681,15 +681,15 @@ scoped_name | ICE_SCOPE_DELIMITOR ICE_IDENTIFIER { StringTokPtr ident = StringTokPtr::dynamicCast($2); - ident -> v = "::" + ident -> v; + ident->v = "::" + ident->v; $$ = ident; } | scoped_name ICE_SCOPE_DELIMITOR ICE_IDENTIFIER { StringTokPtr scoped = StringTokPtr::dynamicCast($1); StringTokPtr ident = StringTokPtr::dynamicCast($3); - scoped -> v += "::"; - scoped -> v += ident -> v; + scoped->v += "::"; + scoped->v += ident->v; $$ = scoped; } ; diff --git a/cpp/src/Slice/GrammerUtil.cpp b/cpp/src/Slice/GrammerUtil.cpp index fed434f56f9..575b0bd06ea 100644 --- a/cpp/src/Slice/GrammerUtil.cpp +++ b/cpp/src/Slice/GrammerUtil.cpp @@ -13,15 +13,15 @@ using namespace std; using namespace Slice; -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(); } +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/Parser.cpp b/cpp/src/Slice/Parser.cpp index 69ef9c1eb0d..2122cad7cf1 100644 --- a/cpp/src/Slice/Parser.cpp +++ b/cpp/src/Slice/Parser.cpp @@ -21,42 +21,42 @@ Unit* unit; } -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(); } +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 @@ -148,18 +148,18 @@ Slice::Contained::comment() Slice::Contained::Contained(const ContainerPtr& container, const string& name) - : SyntaxTreeBase(container -> unit()), + : SyntaxTreeBase(container->unit()), _container(container), _name(name) { ContainedPtr cont = ContainedPtr::dynamicCast(_container); if (cont) - _scoped = cont -> scoped(); + _scoped = cont->scoped(); _scoped += "::" + _name; if (_unit) { - _unit -> addContent(this); - _comment = _unit -> currentComment(); + _unit->addContent(this); + _comment = _unit->currentComment(); } } @@ -195,7 +195,7 @@ Slice::Container::destroy() 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) @@ -207,7 +207,7 @@ Slice::Container::createModule(const string& name) string msg = "redefinition of `"; msg += name; msg += "' as module"; - _unit -> error(msg); + _unit->error(msg); return 0; } @@ -220,7 +220,7 @@ 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) @@ -229,8 +229,8 @@ Slice::Container::createClassDef(const string& name, bool local, bool intf, if (cl) { if (checkInterfaceAndLocal(name, false, - intf, cl -> isInterface(), - local, cl -> isLocal())) + intf, cl->isInterface(), + local, cl->isLocal())) continue; return 0; @@ -239,7 +239,7 @@ Slice::Container::createClassDef(const string& name, bool local, bool intf, 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,7 +261,7 @@ Slice::Container::createClassDef(const string& name, bool local, bool intf, msg += "interface"; else msg += "class"; - _unit -> error(msg); + _unit->error(msg); return 0; } @@ -273,7 +273,7 @@ Slice::Container::createClassDef(const string& name, bool local, bool intf, ++q) { ClassDeclPtr cl = ClassDeclPtr::dynamicCast(*q); - cl -> _definition = def; + cl->_definition = def; } // @@ -291,7 +291,7 @@ Slice::Container::createClassDecl(const string& name, bool local, bool intf) { ClassDefPtr def; - ContainedList matches = _unit -> findContents(thisScope() + name); + ContainedList matches = _unit->findContents(thisScope() + name); for (ContainedList::iterator p = matches.begin(); p != matches.end(); ++p) @@ -300,8 +300,8 @@ Slice::Container::createClassDecl(const string& name, bool local, bool intf) if (clDef) { if (checkInterfaceAndLocal(name, true, - intf, clDef -> isInterface(), - local, clDef -> isLocal())) + intf, clDef->isInterface(), + local, clDef->isLocal())) { assert(!def); def = clDef; @@ -315,8 +315,8 @@ Slice::Container::createClassDecl(const string& name, bool local, bool intf) if (clDecl) { if (checkInterfaceAndLocal(name, false, - intf, clDecl -> isInterface(), - local, clDecl -> isLocal())) + intf, clDecl->isInterface(), + local, clDecl->isLocal())) continue; return 0; @@ -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; } @@ -342,7 +342,7 @@ Slice::Container::createClassDecl(const string& name, bool local, bool intf) q != _contents.end(); ++q) { - if ((*q) -> name() == name) + if ((*q)->name() == name) { ClassDeclPtr cl = ClassDeclPtr::dynamicCast(*q); if (cl) @@ -356,7 +356,7 @@ Slice::Container::createClassDecl(const string& name, bool local, bool intf) _contents.push_back(cl); if (def) - cl -> _definition = def; + cl->_definition = def; return cl; } @@ -364,26 +364,26 @@ Slice::Container::createClassDecl(const string& name, bool local, bool intf) 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()) { 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; } @@ -395,26 +395,26 @@ Slice::Container::createVector(const string& name, const TypePtr& type) 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()) { 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; } @@ -426,26 +426,26 @@ Slice::Container::createEnum(const string& name, const StringList& enumerators) EnumeratorPtr Slice::Container::createEnumerator(const std::string& name) { - ContainedList matches = _unit -> findContents(thisScope() + name); + ContainedList matches = _unit->findContents(thisScope() + name); if (!matches.empty()) { 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; } @@ -457,26 +457,26 @@ Slice::Container::createEnumerator(const std::string& name) NativePtr Slice::Container::createNative(const string& name) { - ContainedList matches = _unit -> findContents(thisScope() + name); + ContainedList matches = _unit->findContents(thisScope() + name); if (!matches.empty()) { 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; } @@ -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,10 +527,10 @@ 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()) { ContainedPtr contained = ContainedPtr::dynamicCast(this); @@ -541,11 +541,11 @@ Slice::Container::lookupTypeNoBuiltin(const string& scoped, bool printError) string msg = "`"; msg += scoped; msg += "' is not defined"; - _unit -> error(msg); + _unit->error(msg); } return TypeList(); } - return contained -> container() -> lookupTypeNoBuiltin(scoped, + return contained->container()->lookupTypeNoBuiltin(scoped, printError); } else @@ -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,10 +583,10 @@ 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()) { ContainedPtr contained = ContainedPtr::dynamicCast(this); @@ -597,11 +597,11 @@ Slice::Container::lookupContained(const string& scoped, bool printError) string msg = "`"; msg += scoped; msg += "' is not defined"; - _unit -> error(msg); + _unit->error(msg); } return ContainedList(); } - return contained -> container() -> lookupContained(scoped, + return contained->container()->lookupContained(scoped, printError); } else @@ -707,11 +707,11 @@ Slice::Container::hasProxies() ++p) { ClassDeclPtr cl = ClassDeclPtr::dynamicCast(*p); - if (cl && !cl -> isLocal()) + if (cl && !cl->isLocal()) return true; ContainerPtr container = ContainerPtr::dynamicCast(*p); - if (container && container -> hasProxies()) + if (container && container->hasProxies()) return true; } @@ -729,7 +729,7 @@ Slice::Container::hasClassDecls() return true; ContainerPtr container = ContainerPtr::dynamicCast(*p); - if (container && container -> hasClassDecls()) + if (container && container->hasClassDecls()) return true; } @@ -747,7 +747,7 @@ Slice::Container::hasClassDefs() return true; ContainerPtr container = ContainerPtr::dynamicCast(*p); - if (container && container -> hasClassDefs()) + if (container && container->hasClassDefs()) return true; } @@ -767,7 +767,7 @@ Slice::Container::hasOtherConstructedTypes() return true; ContainerPtr container = ContainerPtr::dynamicCast(*p); - if (container && container -> hasOtherConstructedTypes()) + if (container && container->hasOtherConstructedTypes()) return true; } @@ -780,7 +780,7 @@ Slice::Container::thisScope() string s; ContainedPtr contained = ContainedPtr::dynamicCast(this); if (contained) - s = contained -> scoped(); + s = contained->scoped(); s += "::"; return s; } @@ -807,23 +807,23 @@ Slice::Container::mergeModules() continue; } - if (mod1 -> name() != mod2 -> name()) + if (mod1->name() != mod2->name()) { ++q; 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); + _unit->removeContent(*q); q = _contents.erase(q); } - mod1 -> mergeModules(); + mod1->mergeModules(); } } @@ -836,7 +836,7 @@ Slice::Container::sort() { ContainerPtr container = ModulePtr::dynamicCast(*p); if (container) - container -> sort(); + container->sort(); } _contents.sort(); @@ -849,7 +849,7 @@ Slice::Container::visit(ParserVisitor* visitor) p != _contents.end(); ++p) { - (*p) -> visit(visitor); + (*p)->visit(visitor); } } @@ -857,7 +857,7 @@ Slice::Container::Container(const UnitPtr& unit) : SyntaxTreeBase(unit) { if (_unit) - _includeLevel = _unit -> currentIncludeLevel(); + _includeLevel = _unit->currentIncludeLevel(); else _includeLevel = 0; } @@ -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; } @@ -936,16 +936,16 @@ Slice::Module::visit(ParserVisitor* visitor) if (_includeLevel > 0) return; - visitor -> visitModuleStart(this); + visitor->visitModuleStart(this); Container::visit(visitor); - visitor -> visitModuleEnd(this); + visitor->visitModuleEnd(this); } Slice::Module::Module(const ContainerPtr& container, const string& name) : Contained(container, name), - Container(container -> unit()), - SyntaxTreeBase(container -> unit()) + Container(container->unit()), + SyntaxTreeBase(container->unit()) { } @@ -955,9 +955,9 @@ Slice::Module::Module(const ContainerPtr& container, Slice::Constructed::Constructed(const ContainerPtr& container, const string& name) - : Type(container -> unit()), + : Type(container->unit()), Contained(container, name), - SyntaxTreeBase(container -> unit()) + SyntaxTreeBase(container->unit()) { } @@ -992,7 +992,7 @@ Slice::ClassDecl::containedType() void Slice::ClassDecl::visit(ParserVisitor* visitor) { - visitor -> visitClassDecl(this); + visitor->visitClassDecl(this); } Slice::ClassDecl::ClassDecl(const ContainerPtr& container, @@ -1000,9 +1000,9 @@ Slice::ClassDecl::ClassDecl(const ContainerPtr& container, bool local, bool intf) : Constructed(container, name), - Type(container -> unit()), + Type(container->unit()), Contained(container, name), - SyntaxTreeBase(container -> unit()), + SyntaxTreeBase(container->unit()), _local(local), _interface(intf) { @@ -1026,26 +1026,26 @@ Slice::ClassDef::createOperation(const string& name, const TypeStringList& outParams, const TypeList& throws) { - ContainedList matches = _unit -> findContents(thisScope() + name); + ContainedList matches = _unit->findContents(thisScope() + name); if (!matches.empty()) { 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; } @@ -1060,12 +1060,12 @@ Slice::ClassDef::createOperation(const string& name, ++q; while (q != allParams.end()) { - if (p -> second == q -> second) + if (p->second == q->second) { string msg = "duplicate parameter `"; - msg += p -> second; + msg += p->second; msg += "'"; - _unit -> error(msg); + _unit->error(msg); return 0; } ++q; @@ -1074,7 +1074,7 @@ Slice::ClassDef::createOperation(const string& name, } } - if (name == this -> name()) + if (name == this->name()) { string msg; if (isInterface()) @@ -1083,7 +1083,7 @@ 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; } @@ -1098,30 +1098,30 @@ 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()) { 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; } - if (name == this -> name()) + if (name == this->name()) { string msg; if (isInterface()) @@ -1130,7 +1130,7 @@ Slice::ClassDef::createDataMember(const string& name, const TypePtr& type) msg = "class name `"; msg += name; msg += "' can not be used as data member"; - _unit -> error(msg); + _unit->error(msg); return 0; } @@ -1155,7 +1155,7 @@ Slice::ClassDef::allBases() p != _bases.end(); ++p) { - ClassList li = (*p) -> allBases(); + ClassList li = (*p)->allBases(); result.merge(li); result.unique(); } @@ -1187,7 +1187,7 @@ Slice::ClassDef::allOperations() p != _bases.end(); ++p) { - OperationList li = (*p) -> allOperations(); + OperationList li = (*p)->allOperations(); result.merge(li); result.unique(); } @@ -1215,7 +1215,7 @@ 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(); @@ -1253,9 +1253,9 @@ Slice::ClassDef::visit(ParserVisitor* visitor) if (_includeLevel > 0) return; - visitor -> visitClassDefStart(this); + visitor->visitClassDefStart(this); Container::visit(visitor); - visitor -> visitClassDefEnd(this); + visitor->visitClassDefEnd(this); } Slice::ClassDef::ClassDef(const ContainerPtr& container, @@ -1264,8 +1264,8 @@ Slice::ClassDef::ClassDef(const ContainerPtr& container, bool intf, const ClassList& bases) : Contained(container, name), - Container(container -> unit()), - SyntaxTreeBase(container -> unit()), + Container(container->unit()), + SyntaxTreeBase(container->unit()), _local(local), _interface(intf), _bases(bases) @@ -1279,7 +1279,7 @@ Slice::ClassDef::ClassDef(const ContainerPtr& container, p != _bases.end(); ++p) { - assert(p == _bases.begin() || (*p) -> isInterface()); + assert(p == _bases.begin() || (*p)->isInterface()); } #endif } @@ -1295,8 +1295,8 @@ Slice::Proxy::_class() } Slice::Proxy::Proxy(const ClassDeclPtr& cl) - : Type(cl -> unit()), - SyntaxTreeBase(cl -> unit()), + : Type(cl->unit()), + SyntaxTreeBase(cl->unit()), __class(cl) { } @@ -1338,7 +1338,7 @@ Slice::Operation::containedType() void Slice::Operation::visit(ParserVisitor* visitor) { - visitor -> visitOperation(this); + visitor->visitOperation(this); } Slice::Operation::Operation(const ContainerPtr& container, @@ -1348,7 +1348,7 @@ Slice::Operation::Operation(const ContainerPtr& container, const TypeStringList& outParams, const TypeList& throws) : Contained(container, name), - SyntaxTreeBase(container -> unit()), + SyntaxTreeBase(container->unit()), _returnType(returnType), _inParams(inParams), _outParams(outParams), @@ -1375,14 +1375,14 @@ Slice::DataMember::containedType() void Slice::DataMember::visit(ParserVisitor* visitor) { - visitor -> visitDataMember(this); + visitor->visitDataMember(this); } Slice::DataMember::DataMember(const ContainerPtr& container, const string& name, const TypePtr& type) : Contained(container, name), - SyntaxTreeBase(container -> unit()), + SyntaxTreeBase(container->unit()), _type(type) { } @@ -1400,15 +1400,15 @@ Slice::Native::containedType() void Slice::Native::visit(ParserVisitor* visitor) { - visitor -> visitNative(this); + visitor->visitNative(this); } Slice::Native::Native(const ContainerPtr& container, const string& name) : Constructed(container, name), - Type(container -> unit()), + Type(container->unit()), Contained(container, name), - SyntaxTreeBase(container -> unit()) + SyntaxTreeBase(container->unit()) { } @@ -1431,16 +1431,16 @@ Slice::Vector::containedType() void Slice::Vector::visit(ParserVisitor* visitor) { - visitor -> visitVector(this); + visitor->visitVector(this); } Slice::Vector::Vector(const ContainerPtr& container, const string& name, const TypePtr& type) : Constructed(container, name), - Type(container -> unit()), + Type(container->unit()), Contained(container, name), - SyntaxTreeBase(container -> unit()), + SyntaxTreeBase(container->unit()), _type(type) { } @@ -1464,16 +1464,16 @@ Slice::Enum::containedType() void Slice::Enum::visit(ParserVisitor* visitor) { - visitor -> visitEnum(this); + visitor->visitEnum(this); } Slice::Enum::Enum(const ContainerPtr& container, const string& name, const StringList& enumerators) : Constructed(container, name), - Type(container -> unit()), + Type(container->unit()), Contained(container, name), - SyntaxTreeBase(container -> unit()), + SyntaxTreeBase(container->unit()), _enumerators(enumerators) { } @@ -1491,7 +1491,7 @@ Slice::Enumerator::containedType() Slice::Enumerator::Enumerator(const ContainerPtr& container, const string& name) : Contained(container, name), - SyntaxTreeBase(container -> unit()) + SyntaxTreeBase(container->unit()) { } @@ -1662,21 +1662,21 @@ Slice::Unit::popContainer() void Slice::Unit::addContent(const ContainedPtr& contained) { - _contentMap[contained -> scoped()].push_back(contained); + _contentMap[contained->scoped()].push_back(contained); } void Slice::Unit::removeContent(const ContainedPtr& contained) { - string scoped = contained -> scoped(); + string scoped = contained->scoped(); 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) + for (q = p->second.begin(); q != p->second.end(); ++q) { - if (q -> get() == contained.get()) + if (q->get() == contained.get()) { - p -> second.erase(q); + p->second.erase(q); return; } } @@ -1692,7 +1692,7 @@ Slice::Unit::findContents(const string& scoped) map<string, ContainedList >::iterator p = _contentMap.find(scoped); if (p != _contentMap.end()) - return p -> second; + return p->second; else return ContainedList(); } @@ -1742,9 +1742,9 @@ Slice::Unit::destroy() void Slice::Unit::visit(ParserVisitor* visitor) { - visitor -> visitUnitStart(this); + visitor->visitUnitStart(this); Container::visit(visitor); - visitor -> visitUnitEnd(this); + visitor->visitUnitEnd(this); } BuiltinPtr @@ -1752,7 +1752,7 @@ Slice::Unit::builtin(Builtin::Kind kind) { map<Builtin::Kind, BuiltinPtr>::iterator p = _builtins.find(kind); if (p != _builtins.end()) - return p -> second; + return p->second; BuiltinPtr builtin = new Builtin(this, kind); _builtins.insert(make_pair(kind, builtin)); return builtin; diff --git a/cpp/src/Slice/Scanner.l b/cpp/src/Slice/Scanner.l index 535dfc4eeaf..959f9516533 100644 --- a/cpp/src/Slice/Scanner.l +++ b/cpp/src/Slice/Scanner.l @@ -29,19 +29,19 @@ L [a-zA-Z_] %% ^"#"{S}*{D}+{S}*$ { - unit -> scanPosition(yytext); + unit->scanPosition(yytext); } ^"#"{S}*{D}+{S}+"\""[^\"]*"\"".*$ { - unit -> scanPosition(yytext); + unit->scanPosition(yytext); } ^"#"{S}*"line"{S}+{D}+{S}*$ { - unit -> scanPosition(yytext); + unit->scanPosition(yytext); } ^"#"{S}*"line"{S}+{D}+{S}+"\""[^\"]*"\"".*$ { - unit -> scanPosition(yytext); + unit->scanPosition(yytext); } "//" { @@ -53,7 +53,7 @@ L [a-zA-Z_] { c = yyinput(); if (c == '\n') - unit -> nextLine(); + unit->nextLine(); } while (c != '\n' && c != EOF); } @@ -69,7 +69,7 @@ L [a-zA-Z_] if (c == '\n') { - unit -> nextLine(); + unit->nextLine(); } else if (c == '*') { @@ -82,13 +82,13 @@ L [a-zA-Z_] } else if (c == EOF) { - unit -> warning("EOF in comment"); + unit->warning("EOF in comment"); break; } } if (comment[0] == '*') - unit -> setComment(comment); + unit->setComment(comment); } "::" { @@ -190,7 +190,7 @@ L [a-zA-Z_] ++s; StringTokPtr ident = new StringTok; - ident -> v = s; + ident->v = s; yylval = ident; return ICE_IDENTIFIER; } @@ -202,8 +202,8 @@ L [a-zA-Z_] ++s; StringTokPtr ident = new StringTok; - ident -> v = s; - ident -> v.erase(ident -> v.find_first_of(" \t\v\n\r\f(")); + ident->v = s; + ident->v.erase(ident->v.find_first_of(" \t\v\n\r\f(")); yylval = ident; return ICE_OP_IDENTIFIER; } @@ -212,7 +212,7 @@ L [a-zA-Z_] // Igore white-space if (yytext[0] == '\n') - unit -> nextLine(); + unit->nextLine(); } . { diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index dbe6030ac2f..e4de966a3c8 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -51,7 +51,7 @@ Slice::Gen::Gen(const string& name, p != _includePaths.end(); ++p) { - if (p -> length() && (*p)[p -> length() - 1] != '/') + if (p->length() && (*p)[p->length() - 1] != '/') *p += '/'; } @@ -113,7 +113,7 @@ Slice::Gen::generate(const UnitPtr& unit) H << "\n#include <Ice/ObjectF.h>"; H << "\n#include <Ice/LocalObjectF.h>"; H << "\n#include <Ice/Native.h>"; - if (unit -> hasProxies()) + if (unit->hasProxies()) { H << "\n#include <Ice/Proxy.h>"; H << "\n#include <Ice/Object.h>"; @@ -127,7 +127,7 @@ Slice::Gen::generate(const UnitPtr& unit) C << "\n#include <Ice/Stream.h>"; } - StringList includes = unit -> includeFiles(); + StringList includes = unit->includeFiles(); for (StringList::iterator q = includes.begin(); q != includes.end(); ++q) @@ -154,31 +154,31 @@ Slice::Gen::generate(const UnitPtr& unit) C.restoreIndent(); ProxyDeclVisitor proxyDeclVisitor(H, C, _dllExport); - unit -> visit(&proxyDeclVisitor); + unit->visit(&proxyDeclVisitor); ObjectDeclVisitor objectDeclVisitor(H, C, _dllExport); - unit -> visit(&objectDeclVisitor); + unit->visit(&objectDeclVisitor); IceVisitor iceVisitor(H, C, _dllExport); - unit -> visit(&iceVisitor); + unit->visit(&iceVisitor); HandleVisitor handleVisitor(H, C, _dllExport); - unit -> visit(&handleVisitor); + unit->visit(&handleVisitor); TypesVisitor typesVisitor(H, C, _dllExport); - unit -> visit(&typesVisitor); + unit->visit(&typesVisitor); ProxyVisitor proxyVisitor(H, C, _dllExport); - unit -> visit(&proxyVisitor); + unit->visit(&proxyVisitor); DelegateVisitor delegateVisitor(H, C, _dllExport); - unit -> visit(&delegateVisitor); + unit->visit(&delegateVisitor); DelegateMVisitor delegateMVisitor(H, C, _dllExport); - unit -> visit(&delegateMVisitor); + unit->visit(&delegateMVisitor); ObjectVisitor objectVisitor(H, C, _dllExport); - unit -> visit(&objectVisitor); + unit->visit(&objectVisitor); } string @@ -189,9 +189,9 @@ Slice::Gen::changeInclude(const string& orig) p != _includePaths.end(); ++p) { - if (orig.compare(0, p -> length(), *p) == 0) + if (orig.compare(0, p->length(), *p) == 0) { - string s = orig.substr(p -> length()); + string s = orig.substr(p->length()); if (s.length() < file.length()) file = s; } @@ -233,10 +233,10 @@ Slice::Gen::TypesVisitor::TypesVisitor(Output& h, Output& c, const string& dllEx void Slice::Gen::TypesVisitor::visitModuleStart(const ModulePtr& p) { - if (!p -> hasOtherConstructedTypes()) + if (!p->hasOtherConstructedTypes()) return; - string name = p -> name(); + string name = p->name(); H << sp; H << nl << "namespace " << name << nl << '{'; @@ -245,7 +245,7 @@ Slice::Gen::TypesVisitor::visitModuleStart(const ModulePtr& p) void Slice::Gen::TypesVisitor::visitModuleEnd(const ModulePtr& p) { - if (!p -> hasOtherConstructedTypes()) + if (!p->hasOtherConstructedTypes()) return; H << sp; @@ -255,8 +255,8 @@ Slice::Gen::TypesVisitor::visitModuleEnd(const ModulePtr& p) void Slice::Gen::TypesVisitor::visitVector(const VectorPtr& p) { - string name = p -> name(); - TypePtr subtype = p -> type(); + string name = p->name(); + TypePtr subtype = p->type(); string s = typeToString(subtype); if (s[0] == ':') s.insert(0, " "); @@ -266,8 +266,8 @@ Slice::Gen::TypesVisitor::visitVector(const VectorPtr& p) BuiltinPtr builtin = BuiltinPtr::dynamicCast(subtype); if (!builtin) { - string scoped = p -> scoped(); - string scope = p -> scope(); + string scoped = p->scoped(); + string scope = p->scope(); if (scope.length()) scope.erase(0, 2); @@ -280,7 +280,7 @@ Slice::Gen::TypesVisitor::visitVector(const VectorPtr& p) C << nl << "void" << nl << scope << "::__write(::IceInternal::Stream* __os, const " << scoped << "& v, ::" << scope << "::__U__" << name << ')'; C << sb; - C << nl << "__os -> write(::Ice::Int(v.size()));"; + C << nl << "__os->write(::Ice::Int(v.size()));"; C << nl << scoped << "::const_iterator p;"; C << nl << "for (p = v.begin(); p != v.end(); ++p)"; C.inc(); @@ -292,7 +292,7 @@ Slice::Gen::TypesVisitor::visitVector(const VectorPtr& p) << "::__U__" << name << ')'; C << sb; C << nl << "::Ice::Int sz;"; - C << nl << "__is -> read(sz);"; + C << nl << "__is->read(sz);"; // Don't use v.resize(sz) or v.reserve(sz) here, as it // cannot be checked whether sz is a reasonable value C << nl << "while (sz--)"; @@ -317,8 +317,8 @@ Slice::Gen::TypesVisitor::visitVector(const VectorPtr& p) void Slice::Gen::TypesVisitor::visitEnum(const EnumPtr& p) { - string name = p -> name(); - StringList enumerators = p -> enumerators(); + string name = p->name(); + StringList enumerators = p->enumerators(); H << sp; H << nl << "enum " << name; H << sb; @@ -331,8 +331,8 @@ Slice::Gen::TypesVisitor::visitEnum(const EnumPtr& p) } H << eb << ';'; - string scoped = p -> scoped(); - string scope = p -> scope(); + string scoped = p->scoped(); + string scope = p->scope(); if (scope.length()) scope.erase(0, 2); @@ -345,13 +345,13 @@ Slice::Gen::TypesVisitor::visitEnum(const EnumPtr& p) C << nl << "void" << nl << scope << "::__write(::IceInternal::Stream* __os, " << scoped << " v)"; C << sb; if (sz <= numeric_limits<Ice::Byte>::max()) - C << nl << "__os -> write(static_cast< ::Ice::Byte>(v));"; + C << nl << "__os->write(static_cast< ::Ice::Byte>(v));"; else if (sz <= numeric_limits<Ice::Short>::max()) - C << nl << "__os -> write(static_cast< ::Ice::Short>(v));"; + C << nl << "__os->write(static_cast< ::Ice::Short>(v));"; else if (sz <= numeric_limits<Ice::Int>::max()) - C << nl << "__os -> write(static_cast< ::Ice::Int>(v));"; + C << nl << "__os->write(static_cast< ::Ice::Int>(v));"; else - C << nl << "__os -> write(static_cast< ::Ice::Long>(v));"; + C << nl << "__os->write(static_cast< ::Ice::Long>(v));"; C << eb; C << sp; C << nl << "void" << nl << scope << "::__read(::IceInternal::Stream* __is, " << scoped << "& v)"; @@ -359,25 +359,25 @@ Slice::Gen::TypesVisitor::visitEnum(const EnumPtr& p) if (sz <= numeric_limits<Ice::Byte>::max()) { C << nl << "::Ice::Byte val;"; - C << nl << "__is -> read(val);"; + C << nl << "__is->read(val);"; C << nl << "v = static_cast< " << scoped << ">(val);"; } else if (sz <= numeric_limits<Ice::Short>::max()) { C << nl << "::Ice::Short val;"; - C << nl << "__is -> read(val);"; + C << nl << "__is->read(val);"; C << nl << "v = static_cast< " << scoped << ">(val);"; } else if (sz <= numeric_limits<Ice::Int>::max()) { C << nl << "::Ice::Int val;"; - C << nl << "__is -> read(val);"; + C << nl << "__is->read(val);"; C << nl << "v = static_cast< " << scoped << ">(val);"; } else { C << nl << "::Ice::Long val;"; - C << nl << "__is -> read(val);"; + C << nl << "__is->read(val);"; C << nl << "v = static_cast< " << scoped << ">(val);"; } C << eb; @@ -386,7 +386,7 @@ Slice::Gen::TypesVisitor::visitEnum(const EnumPtr& p) void Slice::Gen::TypesVisitor::visitNative(const NativePtr& p) { - string name = p -> name(); + string name = p->name(); H << sp; H << nl << "typedef ::IceNative::" << name << ' ' << name << ';'; @@ -400,7 +400,7 @@ Slice::Gen::ProxyDeclVisitor::ProxyDeclVisitor(Output& h, Output& c, const strin void Slice::Gen::ProxyDeclVisitor::visitUnitStart(const UnitPtr& p) { - if (!p -> hasProxies()) + if (!p->hasProxies()) return; H << sp; @@ -410,7 +410,7 @@ Slice::Gen::ProxyDeclVisitor::visitUnitStart(const UnitPtr& p) void Slice::Gen::ProxyDeclVisitor::visitUnitEnd(const UnitPtr& p) { - if (!p -> hasProxies()) + if (!p->hasProxies()) return; H << sp; @@ -420,10 +420,10 @@ Slice::Gen::ProxyDeclVisitor::visitUnitEnd(const UnitPtr& p) void Slice::Gen::ProxyDeclVisitor::visitModuleStart(const ModulePtr& p) { - if (!p -> hasProxies()) + if (!p->hasProxies()) return; - string name = p -> name(); + string name = p->name(); H << sp; H << nl << "namespace " << name << nl << '{'; @@ -432,7 +432,7 @@ Slice::Gen::ProxyDeclVisitor::visitModuleStart(const ModulePtr& p) void Slice::Gen::ProxyDeclVisitor::visitModuleEnd(const ModulePtr& p) { - if (!p -> hasProxies()) + if (!p->hasProxies()) return; H << sp; @@ -442,10 +442,10 @@ Slice::Gen::ProxyDeclVisitor::visitModuleEnd(const ModulePtr& p) void Slice::Gen::ProxyDeclVisitor::visitClassDecl(const ClassDeclPtr& p) { - if (p -> isLocal()) + if (p->isLocal()) return; - string name = p -> name(); + string name = p->name(); H << sp; H << nl << "class " << name << ';'; @@ -459,7 +459,7 @@ Slice::Gen::ProxyVisitor::ProxyVisitor(Output& h, Output& c, const string& dllEx void Slice::Gen::ProxyVisitor::visitUnitStart(const UnitPtr& p) { - if (!p -> hasProxies()) + if (!p->hasProxies()) return; H << sp; @@ -469,7 +469,7 @@ Slice::Gen::ProxyVisitor::visitUnitStart(const UnitPtr& p) void Slice::Gen::ProxyVisitor::visitUnitEnd(const UnitPtr& p) { - if (!p -> hasProxies()) + if (!p->hasProxies()) return; H << sp; @@ -479,10 +479,10 @@ Slice::Gen::ProxyVisitor::visitUnitEnd(const UnitPtr& p) void Slice::Gen::ProxyVisitor::visitModuleStart(const ModulePtr& p) { - if (!p -> hasProxies()) + if (!p->hasProxies()) return; - string name = p -> name(); + string name = p->name(); H << sp; H << nl << "namespace " << name << nl << '{'; @@ -491,7 +491,7 @@ Slice::Gen::ProxyVisitor::visitModuleStart(const ModulePtr& p) void Slice::Gen::ProxyVisitor::visitModuleEnd(const ModulePtr& p) { - if (!p -> hasProxies()) + if (!p->hasProxies()) return; H << sp; @@ -501,12 +501,12 @@ Slice::Gen::ProxyVisitor::visitModuleEnd(const ModulePtr& p) void Slice::Gen::ProxyVisitor::visitClassDefStart(const ClassDefPtr& p) { - if (p -> isLocal()) + if (p->isLocal()) return; - string name = p -> name(); - string scoped = p -> scoped(); - ClassList bases = p -> bases(); + string name = p->name(); + string scoped = p->scoped(); + ClassList bases = p->bases(); H << sp; H << nl << "class" << _dllExport << ' ' << name << " : "; @@ -518,7 +518,7 @@ Slice::Gen::ProxyVisitor::visitClassDefStart(const ClassDefPtr& p) 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; } @@ -541,10 +541,10 @@ Slice::Gen::ProxyVisitor::visitClassDefStart(const ClassDefPtr& p) void Slice::Gen::ProxyVisitor::visitClassDefEnd(const ClassDefPtr& p) { - if (p -> isLocal()) + if (p->isLocal()) return; - string scoped = p -> scoped(); + string scoped = p->scoped(); H.dec(); H << sp; @@ -564,20 +564,20 @@ Slice::Gen::ProxyVisitor::visitClassDefEnd(const ClassDefPtr& p) void Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p) { - ContainerPtr container = p -> container(); + ContainerPtr container = p->container(); ClassDefPtr cl = ClassDefPtr::dynamicCast(container); - if (cl -> isLocal()) + if (cl->isLocal()) return; - string name = p -> name(); - string scoped = p -> scoped(); - string scope = p -> scope(); + string name = p->name(); + string scoped = p->scoped(); + string scope = p->scope(); - TypePtr ret = p -> returnType(); + TypePtr ret = p->returnType(); string retS = returnTypeToString(ret); - TypeStringList inParams = p -> inputParameters(); - TypeStringList outParams = p -> outputParameters(); + TypeStringList inParams = p->inputParameters(); + TypeStringList outParams = p->outputParameters(); TypeStringList::iterator q; string params = "("; @@ -593,12 +593,12 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p) args += ", "; } - string typeString = inputTypeToString(q -> first); + string typeString = inputTypeToString(q->first); params += typeString; paramsDecl += typeString; paramsDecl += ' '; - paramsDecl += q -> second; - args += q -> second; + paramsDecl += q->second; + args += q->second; } for (q = outParams.begin(); q != outParams.end(); ++q) @@ -610,19 +610,19 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p) args += ", "; } - string typeString = outputTypeToString(q -> first); + string typeString = outputTypeToString(q->first); params += typeString; paramsDecl += typeString; paramsDecl += ' '; - paramsDecl += q -> second; - args += q -> second; + paramsDecl += q->second; + args += q->second; } params += ')'; paramsDecl += ')'; args += ')'; - TypeList throws = p -> throws(); + TypeList throws = p->throws(); H << sp; H << nl << retS << ' ' << name << params << ';'; @@ -634,7 +634,7 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p) C << nl; if (ret) C << "return "; - C << "__del -> " << name << args << ";"; + C << "__del->" << name << args << ";"; C << eb; } @@ -646,7 +646,7 @@ Slice::Gen::DelegateVisitor::DelegateVisitor(Output& h, Output& c, const string& void Slice::Gen::DelegateVisitor::visitUnitStart(const UnitPtr& p) { - if (!p -> hasProxies()) + if (!p->hasProxies()) return; H << sp; @@ -656,7 +656,7 @@ Slice::Gen::DelegateVisitor::visitUnitStart(const UnitPtr& p) void Slice::Gen::DelegateVisitor::visitUnitEnd(const UnitPtr& p) { - if (!p -> hasProxies()) + if (!p->hasProxies()) return; H << sp; @@ -666,10 +666,10 @@ Slice::Gen::DelegateVisitor::visitUnitEnd(const UnitPtr& p) void Slice::Gen::DelegateVisitor::visitModuleStart(const ModulePtr& p) { - if (!p -> hasProxies()) + if (!p->hasProxies()) return; - string name = p -> name(); + string name = p->name(); H << sp; H << nl << "namespace " << name << nl << '{'; @@ -678,7 +678,7 @@ Slice::Gen::DelegateVisitor::visitModuleStart(const ModulePtr& p) void Slice::Gen::DelegateVisitor::visitModuleEnd(const ModulePtr& p) { - if (!p -> hasProxies()) + if (!p->hasProxies()) return; H << sp; @@ -688,11 +688,11 @@ Slice::Gen::DelegateVisitor::visitModuleEnd(const ModulePtr& p) void Slice::Gen::DelegateVisitor::visitClassDefStart(const ClassDefPtr& p) { - if (p -> isLocal()) + if (p->isLocal()) return; - string name = p -> name(); - ClassList bases = p -> bases(); + string name = p->name(); + ClassList bases = p->bases(); H << sp; H << nl << "class" << _dllExport << ' ' << name << " : "; @@ -704,7 +704,7 @@ Slice::Gen::DelegateVisitor::visitClassDefStart(const ClassDefPtr& p) 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; } @@ -719,7 +719,7 @@ Slice::Gen::DelegateVisitor::visitClassDefStart(const ClassDefPtr& p) void Slice::Gen::DelegateVisitor::visitClassDefEnd(const ClassDefPtr& p) { - if (p -> isLocal()) + if (p->isLocal()) return; H << eb << ';'; @@ -728,18 +728,18 @@ Slice::Gen::DelegateVisitor::visitClassDefEnd(const ClassDefPtr& p) void Slice::Gen::DelegateVisitor::visitOperation(const OperationPtr& p) { - ContainerPtr container = p -> container(); + ContainerPtr container = p->container(); ClassDefPtr cl = ClassDefPtr::dynamicCast(container); - if (cl -> isLocal()) + if (cl->isLocal()) return; - string name = p -> name(); + string name = p->name(); - TypePtr ret = p -> returnType(); + TypePtr ret = p->returnType(); string retS = returnTypeToString(ret); - TypeStringList inParams = p -> inputParameters(); - TypeStringList outParams = p -> outputParameters(); + TypeStringList inParams = p->inputParameters(); + TypeStringList outParams = p->outputParameters(); TypeStringList::iterator q; string params = "("; @@ -753,9 +753,9 @@ Slice::Gen::DelegateVisitor::visitOperation(const OperationPtr& p) args += ", "; } - string typeString = inputTypeToString(q -> first); + string typeString = inputTypeToString(q->first); params += typeString; - args += q -> second; + args += q->second; } for (q = outParams.begin(); q != outParams.end(); ++q) @@ -766,15 +766,15 @@ Slice::Gen::DelegateVisitor::visitOperation(const OperationPtr& p) args += ", "; } - string typeString = outputTypeToString(q -> first); + string typeString = outputTypeToString(q->first); params += typeString; - args += q -> second; + args += q->second; } params += ')'; args += ')'; - TypeList throws = p -> throws(); + TypeList throws = p->throws(); H << sp; H << nl << "virtual " << retS << ' ' << name << params << " = 0;"; @@ -788,7 +788,7 @@ Slice::Gen::DelegateMVisitor::DelegateMVisitor(Output& h, Output& c, const strin void Slice::Gen::DelegateMVisitor::visitUnitStart(const UnitPtr& p) { - if (!p -> hasProxies()) + if (!p->hasProxies()) return; H << sp; @@ -798,7 +798,7 @@ Slice::Gen::DelegateMVisitor::visitUnitStart(const UnitPtr& p) void Slice::Gen::DelegateMVisitor::visitUnitEnd(const UnitPtr& p) { - if (!p -> hasProxies()) + if (!p->hasProxies()) return; H << sp; @@ -808,10 +808,10 @@ Slice::Gen::DelegateMVisitor::visitUnitEnd(const UnitPtr& p) void Slice::Gen::DelegateMVisitor::visitModuleStart(const ModulePtr& p) { - if (!p -> hasProxies()) + if (!p->hasProxies()) return; - string name = p -> name(); + string name = p->name(); H << sp; H << nl << "namespace " << name << nl << '{'; @@ -820,7 +820,7 @@ Slice::Gen::DelegateMVisitor::visitModuleStart(const ModulePtr& p) void Slice::Gen::DelegateMVisitor::visitModuleEnd(const ModulePtr& p) { - if (!p -> hasProxies()) + if (!p->hasProxies()) return; H << sp; @@ -830,12 +830,12 @@ Slice::Gen::DelegateMVisitor::visitModuleEnd(const ModulePtr& p) void Slice::Gen::DelegateMVisitor::visitClassDefStart(const ClassDefPtr& p) { - if (p -> isLocal()) + if (p->isLocal()) return; - string name = p -> name(); - string scoped = p -> scoped(); - ClassList bases = p -> bases(); + string name = p->name(); + string scoped = p->scoped(); + ClassList bases = p->bases(); H << sp; H << nl << "class" << _dllExport << ' ' << name << " : "; @@ -848,7 +848,7 @@ Slice::Gen::DelegateMVisitor::visitClassDefStart(const ClassDefPtr& p) 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 << ','; } @@ -863,7 +863,7 @@ Slice::Gen::DelegateMVisitor::visitClassDefStart(const ClassDefPtr& p) void Slice::Gen::DelegateMVisitor::visitClassDefEnd(const ClassDefPtr& p) { - if (p -> isLocal()) + if (p->isLocal()) return; H << eb << ';'; @@ -872,20 +872,20 @@ Slice::Gen::DelegateMVisitor::visitClassDefEnd(const ClassDefPtr& p) void Slice::Gen::DelegateMVisitor::visitOperation(const OperationPtr& p) { - ContainerPtr container = p -> container(); + ContainerPtr container = p->container(); ClassDefPtr cl = ClassDefPtr::dynamicCast(container); - if (cl -> isLocal()) + if (cl->isLocal()) return; - string name = p -> name(); - string scoped = p -> scoped(); - string scope = p -> scope(); + string name = p->name(); + string scoped = p->scoped(); + string scope = p->scope(); - TypePtr ret = p -> returnType(); + TypePtr ret = p->returnType(); string retS = returnTypeToString(ret); - TypeStringList inParams = p -> inputParameters(); - TypeStringList outParams = p -> outputParameters(); + TypeStringList inParams = p->inputParameters(); + TypeStringList outParams = p->outputParameters(); TypeStringList::iterator q; string params = "("; @@ -901,12 +901,12 @@ Slice::Gen::DelegateMVisitor::visitOperation(const OperationPtr& p) args += ", "; } - string typeString = inputTypeToString(q -> first); + string typeString = inputTypeToString(q->first); params += typeString; paramsDecl += typeString; paramsDecl += ' '; - paramsDecl += q -> second; - args += q -> second; + paramsDecl += q->second; + args += q->second; } for (q = outParams.begin(); q != outParams.end(); ++q) @@ -918,19 +918,19 @@ Slice::Gen::DelegateMVisitor::visitOperation(const OperationPtr& p) args += ", "; } - string typeString = outputTypeToString(q -> first); + string typeString = outputTypeToString(q->first); params += typeString; paramsDecl += typeString; paramsDecl += ' '; - paramsDecl += q -> second; - args += q -> second; + paramsDecl += q->second; + args += q->second; } params += ')'; paramsDecl += ')'; args += ')'; - TypeList throws = p -> throws(); + TypeList throws = p->throws(); H << sp; H << nl << "virtual " << retS << ' ' << name << params << ';'; @@ -941,14 +941,14 @@ Slice::Gen::DelegateMVisitor::visitOperation(const OperationPtr& p) if (ret || !outParams.empty() || !throws.empty()) C << nl << "::IceInternal::Stream* __is = __out.is();"; C << nl << "::IceInternal::Stream* __os = __out.os();"; - C << nl << "__os -> write(\"" << name << "\");"; + C << nl << "__os->write(\"" << name << "\");"; writeMarshalCode(C, inParams, 0); C << nl << "if (!__out.invoke())"; if (!throws.empty()) { C << sb; C << nl << "::Ice::Int __exnum;"; - C << nl << "__is -> read(__exnum);"; + C << nl << "__is->read(__exnum);"; C << nl << "switch (__exnum)"; C << sb; TypeList::iterator r; @@ -962,7 +962,7 @@ Slice::Gen::DelegateMVisitor::visitOperation(const OperationPtr& p) writeAllocateCode(C, li, 0); writeUnmarshalCode(C, li, 0); if (ClassDeclPtr::dynamicCast(*r) || ProxyPtr::dynamicCast(*r)) - C << nl << "__ex -> _throw();"; + C << nl << "__ex->_throw();"; else C << nl << "throw __ex;"; C << eb; @@ -992,10 +992,10 @@ Slice::Gen::ObjectDeclVisitor::ObjectDeclVisitor(Output& h, Output& c, const str void Slice::Gen::ObjectDeclVisitor::visitModuleStart(const ModulePtr& p) { - if (!p -> hasClassDecls()) + if (!p->hasClassDecls()) return; - string name = p -> name(); + string name = p->name(); H << sp; H << nl << "namespace " << name << nl << '{'; @@ -1004,7 +1004,7 @@ Slice::Gen::ObjectDeclVisitor::visitModuleStart(const ModulePtr& p) void Slice::Gen::ObjectDeclVisitor::visitModuleEnd(const ModulePtr& p) { - if (!p -> hasClassDecls()) + if (!p->hasClassDecls()) return; H << sp; @@ -1014,7 +1014,7 @@ Slice::Gen::ObjectDeclVisitor::visitModuleEnd(const ModulePtr& p) void Slice::Gen::ObjectDeclVisitor::visitClassDecl(const ClassDeclPtr& p) { - string name = p -> name(); + string name = p->name(); H << sp; H << nl << "class " << name << ';'; @@ -1028,10 +1028,10 @@ Slice::Gen::ObjectVisitor::ObjectVisitor(Output& h, Output& c, const string& dll void Slice::Gen::ObjectVisitor::visitModuleStart(const ModulePtr& p) { - if (!p -> hasClassDefs()) + if (!p->hasClassDefs()) return; - string name = p -> name(); + string name = p->name(); H << sp; H << nl << "namespace " << name << nl << '{'; @@ -1040,7 +1040,7 @@ Slice::Gen::ObjectVisitor::visitModuleStart(const ModulePtr& p) void Slice::Gen::ObjectVisitor::visitModuleEnd(const ModulePtr& p) { - if (!p -> hasClassDefs()) + if (!p->hasClassDefs()) return; H << sp; @@ -1050,16 +1050,16 @@ Slice::Gen::ObjectVisitor::visitModuleEnd(const ModulePtr& p) void Slice::Gen::ObjectVisitor::visitClassDefStart(const ClassDefPtr& p) { - string name = p -> name(); - string scoped = p -> scoped(); - ClassList bases = p -> bases(); + string name = p->name(); + string scoped = p->scoped(); + ClassList bases = p->bases(); H << sp; H << nl << "class" << _dllExport << ' ' << name << "PtrE : "; H.useCurrentPosAsIndent(); if (bases.empty()) { - if (p -> isLocal()) + if (p->isLocal()) H << "virtual public ::Ice::LocalObjectPtrE"; else H << "virtual public ::Ice::ObjectPtrE"; @@ -1069,7 +1069,7 @@ Slice::Gen::ObjectVisitor::visitClassDefStart(const ClassDefPtr& p) 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,7 +1103,7 @@ Slice::Gen::ObjectVisitor::visitClassDefStart(const ClassDefPtr& p) C << nl << "return dynamic_cast< " << scoped << "*>(_ptr.get());"; C << eb; - if (!p -> isLocal()) + if (!p->isLocal()) { H << sp; H << nl << "class" << _dllExport << ' ' << name << "PrxE : "; @@ -1115,7 +1115,7 @@ Slice::Gen::ObjectVisitor::visitClassDefStart(const ClassDefPtr& p) ClassList::iterator q = bases.begin(); while (q != bases.end()) { - H << "virtual public " << (*q) -> scoped() << "PrxE"; + H << "virtual public " << (*q)->scoped() << "PrxE"; if (++q != bases.end()) H << ',' << nl; } @@ -1156,7 +1156,7 @@ Slice::Gen::ObjectVisitor::visitClassDefStart(const ClassDefPtr& p) H.useCurrentPosAsIndent(); if (bases.empty()) { - if (p -> isLocal()) + if (p->isLocal()) H << "virtual public ::Ice::LocalObject"; else H << "virtual public ::Ice::Object"; @@ -1166,12 +1166,12 @@ Slice::Gen::ObjectVisitor::visitClassDefStart(const ClassDefPtr& p) ClassList::iterator q = bases.begin(); while (q != bases.end()) { - H << "virtual public " << (*q) -> scoped(); + H << "virtual public " << (*q)->scoped(); if (++q != bases.end()) H << ',' << nl; } } - if (!p -> isLocal()) + if (!p->isLocal()) H << ',' << nl << "virtual public ::IceDelegate" << scoped; H.restoreIndent(); H << sb; @@ -1186,9 +1186,9 @@ Slice::Gen::ObjectVisitor::visitClassDefStart(const ClassDefPtr& p) C << nl << "throw " << scoped << "PtrE(this);"; C << eb; - if (!p -> isLocal()) + if (!p->isLocal()) { - ClassList allBases = p -> allBases(); + ClassList allBases = p->allBases(); StringList ids; transform(allBases.begin(), allBases.end(), back_inserter(ids), @@ -1206,10 +1206,10 @@ Slice::Gen::ObjectVisitor::visitClassDefStart(const ClassDefPtr& p) cl = bases.front(); else cl = 0; - while (cl && !cl -> isInterface()) + while (cl && !cl->isInterface()) { allBaseClasses.push_back(cl); - ClassList baseBases = cl -> bases(); + ClassList baseBases = cl->bases(); if (!baseBases.empty()) cl = baseBases.front(); else @@ -1219,7 +1219,7 @@ Slice::Gen::ObjectVisitor::visitClassDefStart(const ClassDefPtr& p) transform(allBaseClasses.begin(), allBaseClasses.end(), back_inserter(classIds), ::Ice::memFun(&ClassDef::scoped)); - if (!p -> isInterface()) + if (!p->isInterface()) classIds.push_front(scoped); classIds.push_back("::Ice::Object"); @@ -1274,18 +1274,18 @@ Slice::Gen::ObjectVisitor::visitClassDefStart(const ClassDefPtr& p) void Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p) { - string name = p -> name(); - string scoped = p -> scoped(); + string name = p->name(); + string scoped = p->scoped(); - ClassList bases = p -> bases(); + ClassList bases = p->bases(); ClassDefPtr base; - if (!bases.empty() && !bases.front() -> isInterface()) + if (!bases.empty() && !bases.front()->isInterface()) base = bases.front(); - if (!p -> isLocal()) + if (!p->isLocal()) { - OperationList allOperations = p -> allOperations(); - if (!p -> allOperations().empty()) + OperationList allOperations = p->allOperations(); + if (!p->allOperations().empty()) { StringList allOpNames; transform(allOperations.begin(), allOperations.end(), back_inserter(allOpNames), @@ -1347,26 +1347,26 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p) H << nl << "virtual void __read(::IceInternal::Stream*);"; H << eb << ';'; TypeStringList memberList; - DataMemberList dataMembers = p -> dataMembers(); + DataMemberList dataMembers = p->dataMembers(); DataMemberList::const_iterator q; for (q = dataMembers.begin(); q != dataMembers.end(); ++q) - memberList.push_back(make_pair((*q) -> type(), (*q) -> name())); + memberList.push_back(make_pair((*q)->type(), (*q)->name())); C << sp; C << nl << "void" << nl << scoped.substr(2) << "::__write(::IceInternal::Stream* __os)"; C << sb; - C << nl << "__os -> startWriteEncaps();"; + C << nl << "__os->startWriteEncaps();"; writeMarshalCode(C, memberList, 0); - C << nl << "__os -> endWriteEncaps();"; + C << nl << "__os->endWriteEncaps();"; if (base) { C.zeroIndent(); C << nl << "#ifdef WIN32"; // COMPILERBUG C.restoreIndent(); - C << nl << base -> name() << "::__write(__os);"; + C << nl << base->name() << "::__write(__os);"; C.zeroIndent(); C << nl << "#else"; C.restoreIndent(); - C << nl << base -> scoped() << "::__write(__os);"; + C << nl << base->scoped() << "::__write(__os);"; C.zeroIndent(); C << nl << "#endif"; C.restoreIndent(); @@ -1375,19 +1375,19 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p) C << sp; C << nl << "void" << nl << scoped.substr(2) << "::__read(::IceInternal::Stream* __is)"; C << sb; - C << nl << "__is -> startReadEncaps();"; + C << nl << "__is->startReadEncaps();"; writeUnmarshalCode(C, memberList, 0); - C << nl << "__is -> endReadEncaps();"; + C << nl << "__is->endReadEncaps();"; if (base) { C.zeroIndent(); C << nl << "#ifdef WIN32"; // COMPILERBUG C.restoreIndent(); - C << nl << base -> name() << "::__read(__is);"; + C << nl << base->name() << "::__read(__is);"; C.zeroIndent(); C << nl << "#else"; C.restoreIndent(); - C << nl << base -> scoped() << "::__read(__is);"; + C << nl << base->scoped() << "::__read(__is);"; C.zeroIndent(); C << nl << "#endif"; C.restoreIndent(); @@ -1398,17 +1398,17 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p) void Slice::Gen::ObjectVisitor::visitOperation(const OperationPtr& p) { - ContainerPtr container = p -> container(); + ContainerPtr container = p->container(); ClassDefPtr cl = ClassDefPtr::dynamicCast(container); - string name = p -> name(); - string scoped = p -> scoped(); - string scope = p -> scope(); + string name = p->name(); + string scoped = p->scoped(); + string scope = p->scope(); - TypePtr ret = p -> returnType(); + TypePtr ret = p->returnType(); string retS = returnTypeToString(ret); - TypeStringList inParams = p -> inputParameters(); - TypeStringList outParams = p -> outputParameters(); + TypeStringList inParams = p->inputParameters(); + TypeStringList outParams = p->outputParameters(); TypeStringList::iterator q; string params = "("; @@ -1424,12 +1424,12 @@ Slice::Gen::ObjectVisitor::visitOperation(const OperationPtr& p) args += ", "; } - string typeString = inputTypeToString(q -> first); + string typeString = inputTypeToString(q->first); params += typeString; paramsDecl += typeString; paramsDecl += ' '; - paramsDecl += q -> second; - args += q -> second; + paramsDecl += q->second; + args += q->second; } for (q = outParams.begin(); q != outParams.end(); ++q) @@ -1441,24 +1441,24 @@ Slice::Gen::ObjectVisitor::visitOperation(const OperationPtr& p) args += ", "; } - string typeString = outputTypeToString(q -> first); + string typeString = outputTypeToString(q->first); params += typeString; paramsDecl += typeString; paramsDecl += ' '; - paramsDecl += q -> second; - args += q -> second; + paramsDecl += q->second; + args += q->second; } params += ')'; paramsDecl += ')'; args += ')'; - TypeList throws = p -> throws(); + TypeList throws = p->throws(); H << sp; H << nl << "virtual " << retS << ' ' << name << params << " = 0;"; - if (!cl -> isLocal()) + if (!cl->isLocal()) { H << nl << "::IceInternal::DispatchStatus ___" << name << "(::IceInternal::Incoming&);"; C << sp; @@ -1490,7 +1490,7 @@ Slice::Gen::ObjectVisitor::visitOperation(const OperationPtr& p) { C << nl << "catch(" << exceptionTypeToString(*r) << " __ex)"; C << sb; - C << nl << "__os -> write(" << cnt++ << ");"; + C << nl << "__os->write(" << cnt++ << ");"; if (ClassDeclPtr::dynamicCast(*r) || ProxyPtr::dynamicCast(*r)) { string s = "static_cast< "; @@ -1513,8 +1513,8 @@ Slice::Gen::ObjectVisitor::visitOperation(const OperationPtr& p) void Slice::Gen::ObjectVisitor::visitDataMember(const DataMemberPtr& p) { - string name = p -> name(); - string s = typeToString(p -> type()); + string name = p->name(); + string s = typeToString(p->type()); H << sp; H << nl << s << ' ' << name << ';'; } @@ -1527,7 +1527,7 @@ Slice::Gen::IceVisitor::IceVisitor(Output& h, Output& c, const string& dllExport void Slice::Gen::IceVisitor::visitUnitStart(const UnitPtr& p) { - if (!p -> hasClassDecls()) + if (!p->hasClassDecls()) return; H << sp; @@ -1537,7 +1537,7 @@ Slice::Gen::IceVisitor::visitUnitStart(const UnitPtr& p) void Slice::Gen::IceVisitor::visitUnitEnd(const UnitPtr& p) { - if (!p -> hasClassDecls()) + if (!p->hasClassDecls()) return; H << sp; @@ -1547,12 +1547,12 @@ Slice::Gen::IceVisitor::visitUnitEnd(const UnitPtr& p) void Slice::Gen::IceVisitor::visitClassDecl(const ClassDeclPtr& p) { - string scoped = p -> scoped(); + string scoped = p->scoped(); H << sp; H << nl << "void" << _dllExport << " incRef(" << scoped << "*);"; H << nl << "void" << _dllExport << " decRef(" << scoped << "*);"; - if (!p -> isLocal()) + if (!p->isLocal()) { H << sp; H << nl << "void" << _dllExport << " incRef(::IceProxy" << scoped << "*);"; @@ -1566,25 +1566,25 @@ Slice::Gen::IceVisitor::visitClassDecl(const ClassDeclPtr& p) void Slice::Gen::IceVisitor::visitClassDefStart(const ClassDefPtr& p) { - string scoped = p -> scoped(); + string scoped = p->scoped(); C << sp; - C << nl << "void IceInternal::incRef(" << scoped << "* p) { p -> __incRef(); }"; - C << nl << "void IceInternal::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()) + if (!p->isLocal()) { C << sp; - C << nl << "void IceInternal::incRef(::IceProxy" << scoped << "* p) { p -> __incRef(); }"; - C << nl << "void IceInternal::decRef(::IceProxy" << scoped << "* p) { p -> __decRef(); }"; + C << nl << "void IceInternal::incRef(::IceProxy" << scoped << "* p) { p->__incRef(); }"; + C << nl << "void IceInternal::decRef(::IceProxy" << scoped << "* p) { p->__decRef(); }"; C << sp; C << nl << "void IceInternal::checkedCast(::IceProxy::Ice::Object* b, ::IceProxy" << scoped << "*& d)"; C << sb; C << nl << "d = dynamic_cast< ::IceProxy" << scoped << "*>(b);"; - C << nl << "if (!d && b -> _isA(\"" << scoped << "\"))"; + C << nl << "if (!d && b->_isA(\"" << scoped << "\"))"; C << sb; C << nl << "d = new ::IceProxy" << scoped << ';'; - C << nl << "b -> __copyTo(d);"; + C << nl << "b->__copyTo(d);"; C << eb; C << eb; C << sp; @@ -1594,7 +1594,7 @@ Slice::Gen::IceVisitor::visitClassDefStart(const ClassDefPtr& p) C << nl << "if (!d)"; C << sb; C << nl << "d = new ::IceProxy" << scoped << ';'; - C << nl << "b -> __copyTo(d);"; + C << nl << "b->__copyTo(d);"; C << eb; C << eb; } @@ -1608,10 +1608,10 @@ Slice::Gen::HandleVisitor::HandleVisitor(Output& h, Output& c, const string& dll void Slice::Gen::HandleVisitor::visitModuleStart(const ModulePtr& p) { - if (!p -> hasClassDecls()) + if (!p->hasClassDecls()) return; - string name = p -> name(); + string name = p->name(); H << sp; H << nl << "namespace " << name << nl << '{'; @@ -1620,7 +1620,7 @@ Slice::Gen::HandleVisitor::visitModuleStart(const ModulePtr& p) void Slice::Gen::HandleVisitor::visitModuleEnd(const ModulePtr& p) { - if (!p -> hasClassDecls()) + if (!p->hasClassDecls()) return; H << sp; @@ -1630,12 +1630,12 @@ Slice::Gen::HandleVisitor::visitModuleEnd(const ModulePtr& p) void Slice::Gen::HandleVisitor::visitClassDecl(const ClassDeclPtr& p) { - string name = p -> name(); - string scoped = p -> scoped(); + string name = p->name(); + string scoped = p->scoped(); H << sp; H << nl << "typedef ::IceInternal::Handle< " << scoped << "> " << name << "Ptr;"; - if (!p -> isLocal()) + if (!p->isLocal()) { H << nl << "typedef ::IceInternal::ProxyHandle< ::IceProxy" << scoped << "> " << name << "Prx;"; H << sp; @@ -1647,11 +1647,11 @@ Slice::Gen::HandleVisitor::visitClassDecl(const ClassDeclPtr& p) void Slice::Gen::HandleVisitor::visitClassDefStart(const ClassDefPtr& p) { - if (p -> isLocal()) + if (p->isLocal()) return; - string scoped = p -> scoped(); - string scope = p -> scope(); + string scoped = p->scoped(); + string scope = p->scope(); if (scope.length()) scope.erase(0, 2); @@ -1668,6 +1668,6 @@ Slice::Gen::HandleVisitor::visitClassDefStart(const ClassDefPtr& p) // TODO: Should be ::Ice::__read C << nl << "::IceInternal::read(__is, proxy);"; C << nl << "v = new ::IceProxy" << scoped << ';'; - C << nl << "proxy -> __copyTo(v.get());"; + C << nl << "proxy->__copyTo(v.get());"; C << eb; } diff --git a/cpp/src/slice2cpp/GenUtil.cpp b/cpp/src/slice2cpp/GenUtil.cpp index 18b66bb2dc8..d8537405028 100644 --- a/cpp/src/slice2cpp/GenUtil.cpp +++ b/cpp/src/slice2cpp/GenUtil.cpp @@ -34,19 +34,19 @@ Slice::typeToString(const TypePtr& type) BuiltinPtr builtin = BuiltinPtr::dynamicCast(type); if (builtin) - return builtinTable[builtin -> kind()]; + return builtinTable[builtin->kind()]; ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type); if (cl) - return cl -> scoped() + "Ptr"; + return cl->scoped() + "Ptr"; ProxyPtr proxy = ProxyPtr::dynamicCast(type); if (proxy) - return proxy -> _class() -> scoped() + "Prx"; + return proxy->_class()->scoped() + "Prx"; ContainedPtr contained = ContainedPtr::dynamicCast(type); if (contained) - return contained -> scoped(); + return contained->scoped(); return "???"; } @@ -81,27 +81,27 @@ Slice::inputTypeToString(const TypePtr& type) BuiltinPtr builtin = BuiltinPtr::dynamicCast(type); if (builtin) - return inputBuiltinTable[builtin -> kind()]; + return inputBuiltinTable[builtin->kind()]; ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type); if (cl) - return "const " + cl -> scoped() + "Ptr&"; + return "const " + cl->scoped() + "Ptr&"; ProxyPtr proxy = ProxyPtr::dynamicCast(type); if (proxy) - return "const " + proxy -> _class() -> scoped() + "Prx&"; + return "const " + proxy->_class()->scoped() + "Prx&"; EnumPtr en = EnumPtr::dynamicCast(type); if (en) - return en -> scoped(); + return en->scoped(); NativePtr native = NativePtr::dynamicCast(type); if (native) - return native -> scoped(); + return native->scoped(); ContainedPtr contained = ContainedPtr::dynamicCast(type); if (contained) - return "const " + contained -> scoped() + "&"; + return "const " + contained->scoped() + "&"; return "???"; } @@ -127,23 +127,23 @@ Slice::outputTypeToString(const TypePtr& type) BuiltinPtr builtin = BuiltinPtr::dynamicCast(type); if (builtin) - return outputBuiltinTable[builtin -> kind()]; + return outputBuiltinTable[builtin->kind()]; ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type); if (cl) - return cl -> scoped() + "Ptr&"; + return cl->scoped() + "Ptr&"; ProxyPtr proxy = ProxyPtr::dynamicCast(type); if (proxy) - return proxy -> _class() -> scoped() + "Prx&"; + return proxy->_class()->scoped() + "Prx&"; NativePtr native = NativePtr::dynamicCast(type); if (native) - return native -> scoped(); + return native->scoped(); ContainedPtr contained = ContainedPtr::dynamicCast(type); if (contained) - return contained -> scoped() + "&"; + return contained->scoped() + "&"; return "???"; } @@ -169,27 +169,27 @@ Slice::exceptionTypeToString(const TypePtr& type) BuiltinPtr builtin = BuiltinPtr::dynamicCast(type); if (builtin) - return inputBuiltinTable[builtin -> kind()]; + return inputBuiltinTable[builtin->kind()]; ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type); if (cl) - return "const " + cl -> scoped() + "PtrE&"; + return "const " + cl->scoped() + "PtrE&"; ProxyPtr proxy = ProxyPtr::dynamicCast(type); if (proxy) - return "const " + proxy -> _class() -> scoped() + "PrxE&"; + return "const " + proxy->_class()->scoped() + "PrxE&"; EnumPtr en = EnumPtr::dynamicCast(type); if (en) - return en -> scoped(); + return en->scoped(); NativePtr native = NativePtr::dynamicCast(type); if (native) - return native -> scoped(); + return native->scoped(); ContainedPtr contained = ContainedPtr::dynamicCast(type); if (contained) - return "const " + contained -> scoped() + "&"; + return "const " + contained->scoped() + "&"; return "???"; } @@ -202,7 +202,7 @@ Slice::writeMarshalUnmarshalCode(Output& out, const TypePtr& type, const string& if (BuiltinPtr::dynamicCast(type)) { - out << nl << stream << " -> " << func << param << ");"; + out << nl << stream << "->" << func << param << ");"; return; } @@ -213,19 +213,19 @@ Slice::writeMarshalUnmarshalCode(Output& out, const TypePtr& type, const string& if (marshal) { out << nl << "::Ice::ObjectPtr __obj = " << param << ';'; - out << nl << stream << " -> write(__obj);"; + out << nl << stream << "->write(__obj);"; } else { out << nl << "::Ice::ObjectPtr __obj;"; - out << nl << stream << " -> read(__obj, " << cl -> scoped() << "::__classIds[0]);"; + out << nl << stream << "->read(__obj, " << cl->scoped() << "::__classIds[0]);"; out << nl << "if (!__obj)"; - ClassDefPtr def = cl -> definition(); - if (def && !def -> isAbstract()) + ClassDefPtr def = cl->definition(); + if (def && !def->isAbstract()) { out << sb; - out << nl << "__obj = new " << cl -> scoped() << ";"; - out << nl << "__obj -> __read(__is);"; + out << nl << "__obj = new " << cl->scoped() << ";"; + out << nl << "__obj->__read(__is);"; out << eb; } else @@ -234,7 +234,7 @@ Slice::writeMarshalUnmarshalCode(Output& out, const TypePtr& type, const string& out << nl << "throw ::Ice::NoFactoryException(__FILE__, __LINE__);"; out.dec(); } - out << nl << param << " = " << cl -> scoped() << "Ptr::dynamicCast(__obj);"; + out << nl << param << " = " << cl->scoped() << "Ptr::dynamicCast(__obj);"; out << nl << "if (!" << param << ')'; out.inc(); out << nl << "throw ::Ice::ValueUnmarshalException(__FILE__, __LINE__);"; @@ -248,11 +248,11 @@ Slice::writeMarshalUnmarshalCode(Output& out, const TypePtr& type, const string& VectorPtr vec = VectorPtr::dynamicCast(type); if (vec) { - if (BuiltinPtr::dynamicCast(vec -> type())) - out << nl << stream << " -> " << func << param << ");"; + if (BuiltinPtr::dynamicCast(vec->type())) + out << nl << stream << "->" << func << param << ");"; else - out << nl << vec -> scope() << "::__" << func << stream << ", " << param << ", " << vec -> scope() - << "::__U__" << vec -> name() << "());"; + out << nl << vec->scope() << "::__" << func << stream << ", " << param << ", " << vec->scope() + << "::__U__" << vec->name() << "());"; return; } @@ -264,10 +264,10 @@ Slice::writeMarshalUnmarshalCode(Output& out, const TypePtr& type, const string& { ProxyPtr proxy = ProxyPtr::dynamicCast(type); assert(proxy); - constructed = proxy -> _class(); + constructed = proxy->_class(); } - out << nl << constructed -> scope() << "::__" << func << stream << ", " << param << ");"; + out << nl << constructed->scope() << "::__" << func << stream << ", " << param << ");"; } void @@ -275,7 +275,7 @@ Slice::writeMarshalCode(Output& out, const list<pair<TypePtr, string> >& params, { list<pair<TypePtr, string> >::const_iterator p; for (p = params.begin(); p != params.end(); ++p) - writeMarshalUnmarshalCode(out, p -> first, p -> second, true); + writeMarshalUnmarshalCode(out, p->first, p->second, true); if (ret) writeMarshalUnmarshalCode(out, ret, "__ret", true); } @@ -285,7 +285,7 @@ Slice::writeUnmarshalCode(Output& out, const list<pair<TypePtr, string> >& param { list<pair<TypePtr, string> >::const_iterator p; for (p = params.begin(); p != params.end(); ++p) - writeMarshalUnmarshalCode(out, p -> first, p -> second, false); + writeMarshalUnmarshalCode(out, p->first, p->second, false); if (ret) writeMarshalUnmarshalCode(out, ret, "__ret", false); } @@ -299,5 +299,5 @@ Slice::writeAllocateCode(Output& out, const list<pair<TypePtr, string> >& params list<pair<TypePtr, string> >::const_iterator p; for (p = ps.begin(); p != ps.end(); ++p) - out << nl << typeToString(p -> first) << ' ' << p -> second << ';'; + out << nl << typeToString(p->first) << ' ' << p->second << ';'; } diff --git a/cpp/src/slice2cpp/Main.cpp b/cpp/src/slice2cpp/Main.cpp index a6bc9c48dc3..afcc1dca9dc 100644 --- a/cpp/src/slice2cpp/Main.cpp +++ b/cpp/src/slice2cpp/Main.cpp @@ -178,7 +178,7 @@ main(int argc, char* argv[]) } UnitPtr unit = Unit::createUnit(false, false); - int parseStatus = unit -> parse(cppHandle, debug); + int parseStatus = unit->parse(cppHandle, debug); #ifdef WIN32 _pclose(cppHandle); @@ -195,13 +195,13 @@ main(int argc, char* argv[]) Gen gen(argv[0], base, include, includePaths, dllExport); if (!gen) { - unit -> destroy(); + unit->destroy(); return EXIT_FAILURE; } gen.generate(unit); } - unit -> destroy(); + unit->destroy(); } return status; diff --git a/cpp/src/slice2docbook/Gen.cpp b/cpp/src/slice2docbook/Gen.cpp index c4fceb0a090..2cde7ebb4eb 100644 --- a/cpp/src/slice2docbook/Gen.cpp +++ b/cpp/src/slice2docbook/Gen.cpp @@ -41,9 +41,9 @@ Slice::Gen::operator!() const void Slice::Gen::generate(const UnitPtr& unit) { - unit -> mergeModules(); - unit -> sort(); - unit -> visit(this); + unit->mergeModules(); + unit->sort(); + unit->visit(this); } void @@ -75,10 +75,10 @@ Slice::Gen::visitUnitEnd(const UnitPtr& p) void Slice::Gen::visitModuleStart(const ModulePtr& p) { - start(_chapter + " id=" + scopedToId(p -> scoped()), p -> scoped().substr(2)); + start(_chapter + " id=" + scopedToId(p->scoped()), p->scoped().substr(2)); start("section", "Overview"); O.zeroIndent(); - O << nl << "<synopsis>module <classname>" << p -> name() << "</classname></synopsis>"; + O << nl << "<synopsis>module <classname>" << p->name() << "</classname></synopsis>"; O.restoreIndent(); printComment(p); visitContainer(p); @@ -87,7 +87,7 @@ Slice::Gen::visitModuleStart(const ModulePtr& p) void Slice::Gen::visitContainer(const ContainerPtr& p) { - ModuleList modules = p -> modules(); + ModuleList modules = p->modules(); modules.sort(); if (!modules.empty()) { @@ -100,7 +100,7 @@ Slice::Gen::visitContainer(const ContainerPtr& p) { start("varlistentry"); start("term"); - O << nl << addLink((*q) -> name(), p); + O << nl << addLink((*q)->name(), p); end(); start("listitem"); printSummary(*q); @@ -112,7 +112,7 @@ Slice::Gen::visitContainer(const ContainerPtr& p) end(); } - ClassList classes = p -> classes(); + ClassList classes = p->classes(); ClassList interfaces; interfaces.splice(interfaces.end(), classes, remove_if(classes.begin(), classes.end(), ::Ice::memFun(&ClassDef::isInterface)), @@ -130,7 +130,7 @@ Slice::Gen::visitContainer(const ContainerPtr& p) { start("varlistentry"); start("term"); - O << nl << addLink((*q) -> name(), p); + O << nl << addLink((*q)->name(), p); end(); start("listitem"); printSummary(*q); @@ -154,7 +154,7 @@ Slice::Gen::visitContainer(const ContainerPtr& p) { start("varlistentry"); start("term"); - O << nl << addLink((*q) -> name(), p); + O << nl << addLink((*q)->name(), p); end(); start("listitem"); printSummary(*q); @@ -166,7 +166,7 @@ Slice::Gen::visitContainer(const ContainerPtr& p) end(); } - VectorList vectors = p -> vectors(); + VectorList vectors = p->vectors(); vectors.sort(); if (!vectors.empty()) { @@ -179,7 +179,7 @@ Slice::Gen::visitContainer(const ContainerPtr& p) { start("varlistentry"); start("term"); - O << nl << addLink((*q) -> name(), p); + O << nl << addLink((*q)->name(), p); end(); start("listitem"); printSummary(*q); @@ -191,7 +191,7 @@ Slice::Gen::visitContainer(const ContainerPtr& p) end(); } - EnumList enums = p -> enums(); + EnumList enums = p->enums(); enums.sort(); if (!enums.empty()) { @@ -204,7 +204,7 @@ Slice::Gen::visitContainer(const ContainerPtr& p) { start("varlistentry"); start("term"); - O << nl << addLink((*q) -> name(), p); + O << nl << addLink((*q)->name(), p); end(); start("listitem"); printSummary(*q); @@ -216,7 +216,7 @@ Slice::Gen::visitContainer(const ContainerPtr& p) end(); } - NativeList natives = p -> natives(); + NativeList natives = p->natives(); natives.sort(); if (!natives.empty()) { @@ -229,7 +229,7 @@ Slice::Gen::visitContainer(const ContainerPtr& p) { start("varlistentry"); start("term"); - O << nl << addLink((*q) -> name(), p); + O << nl << addLink((*q)->name(), p); end(); start("listitem"); printSummary(*q); @@ -247,12 +247,12 @@ Slice::Gen::visitContainer(const ContainerPtr& p) q != vectors.end(); ++q) { - TypePtr type = (*q) -> type(); + TypePtr type = (*q)->type(); - start("section id=" + scopedToId((*q) -> scoped()), (*q) -> name()); + start("section id=" + scopedToId((*q)->scoped()), (*q)->name()); O.zeroIndent(); - O << nl << "<synopsis>vector< " << typeToString(type) << " > <type>" << (*q) -> name() + O << nl << "<synopsis>vector< " << typeToString(type) << " > <type>" << (*q)->name() << "</type>;</synopsis>"; O.restoreIndent(); @@ -265,12 +265,12 @@ Slice::Gen::visitContainer(const ContainerPtr& p) q != enums.end(); ++q) { - start("section id=" + scopedToId((*q) -> scoped()), (*q) -> name()); + start("section id=" + scopedToId((*q)->scoped()), (*q)->name()); O.zeroIndent(); - O << nl << "<synopsis>enum <type>" << (*q) -> name() << "</type>"; + O << nl << "<synopsis>enum <type>" << (*q)->name() << "</type>"; O << sb; - StringList enumerators = (*q) -> enumerators(); + StringList enumerators = (*q)->enumerators(); StringList::iterator r = enumerators.begin(); while (r != enumerators.end()) { @@ -290,10 +290,10 @@ Slice::Gen::visitContainer(const ContainerPtr& p) q != natives.end(); ++q) { - start("section id=" + scopedToId((*q) -> scoped()), (*q) -> name()); + start("section id=" + scopedToId((*q)->scoped()), (*q)->name()); O.zeroIndent(); - O << nl << "<synopsis>native <type>" << (*q) -> name() << "</type>;</synopsis>"; + O << nl << "<synopsis>native <type>" << (*q)->name() << "</type>;</synopsis>"; O.restoreIndent(); printComment(*q); @@ -307,25 +307,25 @@ Slice::Gen::visitContainer(const ContainerPtr& p) void Slice::Gen::visitClassDefStart(const ClassDefPtr& p) { - start(_chapter + " id=" + scopedToId(p -> scoped()), p -> scoped().substr(2)); + start(_chapter + " id=" + scopedToId(p->scoped()), p->scoped().substr(2)); start("section", "Overview"); O.zeroIndent(); O << nl << "<synopsis>"; - if (p -> isLocal()) + if (p->isLocal()) O << "local "; - if (p -> isInterface()) + if (p->isInterface()) O << "interface"; else O << "class"; - O << " <classname>" << p -> name() << "</classname>"; - ClassList bases = p -> bases(); - if (!bases.empty() && !bases.front() -> isInterface()) + O << " <classname>" << p->name() << "</classname>"; + ClassList bases = p->bases(); + if (!bases.empty() && !bases.front()->isInterface()) { O.inc(); O << nl << "extends "; O.inc(); - O << "<classname>" << bases.front() -> scoped().substr(2) << "</classname>"; + O << "<classname>" << bases.front()->scoped().substr(2) << "</classname>"; bases.pop_front(); O.dec(); O.dec(); @@ -333,7 +333,7 @@ Slice::Gen::visitClassDefStart(const ClassDefPtr& p) if (!bases.empty()) { O.inc(); - if (p -> isInterface()) + if (p->isInterface()) O << nl << "extends "; else O << nl << "implements "; @@ -341,7 +341,7 @@ Slice::Gen::visitClassDefStart(const ClassDefPtr& p) ClassList::iterator q = bases.begin(); while (q != bases.end()) { - O << nl << "<classname>" << (*q) -> scoped().substr(2) << "</classname>"; + O << nl << "<classname>" << (*q)->scoped().substr(2) << "</classname>"; if (++q != bases.end()) O << ","; } @@ -353,7 +353,7 @@ Slice::Gen::visitClassDefStart(const ClassDefPtr& p) printComment(p); - OperationList operations = p -> operations(); + OperationList operations = p->operations(); operations.sort(); if (!operations.empty()) { @@ -366,7 +366,7 @@ Slice::Gen::visitClassDefStart(const ClassDefPtr& p) { start("varlistentry"); start("term"); - O << nl << addLink((*q) -> name(), p); + O << nl << addLink((*q)->name(), p); end(); start("listitem"); printSummary(*q); @@ -378,7 +378,7 @@ Slice::Gen::visitClassDefStart(const ClassDefPtr& p) end(); } - DataMemberList dataMembers = p -> dataMembers(); + DataMemberList dataMembers = p->dataMembers(); dataMembers.sort(); if (!dataMembers.empty()) { @@ -391,7 +391,7 @@ Slice::Gen::visitClassDefStart(const ClassDefPtr& p) { start("varlistentry"); start("term"); - O << nl << addLink((*q) -> name(), p); + O << nl << addLink((*q)->name(), p); end(); start("listitem"); printSummary(*q); @@ -409,21 +409,21 @@ Slice::Gen::visitClassDefStart(const ClassDefPtr& p) q != operations.end(); ++q) { - TypePtr returnType = (*q) -> returnType(); - TypeStringList inputParams = (*q) -> inputParameters(); - TypeStringList outputParams = (*q) -> outputParameters(); - TypeList throws = (*q) -> throws(); + TypePtr returnType = (*q)->returnType(); + TypeStringList inputParams = (*q)->inputParameters(); + TypeStringList outputParams = (*q)->outputParameters(); + TypeList throws = (*q)->throws(); - start("section id=" + scopedToId((*q) -> scoped()), (*q) -> name()); + start("section id=" + scopedToId((*q)->scoped()), (*q)->name()); O.zeroIndent(); O << nl << "<synopsis>" << (returnType ? typeToString(returnType) : "<type>void</type>") - << " <function>" << (*q) -> name() << "</function>("; + << " <function>" << (*q)->name() << "</function>("; O.inc(); TypeStringList::iterator r = inputParams.begin(); while (r != inputParams.end()) { - O << nl << typeToString(r -> first) << " <parameter>" << r -> second << "</parameter>"; + O << nl << typeToString(r->first) << " <parameter>" << r->second << "</parameter>"; if (++r != inputParams.end()) O << ','; } @@ -433,7 +433,7 @@ Slice::Gen::visitClassDefStart(const ClassDefPtr& p) r = outputParams.begin(); while (r != outputParams.end()) { - O << nl << typeToString(r -> first) << " <parameter>" << r -> second << "</parameter>"; + O << nl << typeToString(r->first) << " <parameter>" << r->second << "</parameter>"; if (++r != outputParams.end()) O << ','; } @@ -467,12 +467,12 @@ Slice::Gen::visitClassDefStart(const ClassDefPtr& p) q != dataMembers.end(); ++q) { - TypePtr type = (*q) -> type(); + TypePtr type = (*q)->type(); - start("section id=" + scopedToId((*q) -> scoped()), (*q) -> name()); + start("section id=" + scopedToId((*q)->scoped()), (*q)->name()); O.zeroIndent(); - O << nl << "<synopsis>" << typeToString(type) << " <structfield>" << (*q) -> name() + O << nl << "<synopsis>" << typeToString(type) << " <structfield>" << (*q)->name() << "</structfield>;</synopsis>"; O.restoreIndent(); @@ -542,9 +542,9 @@ Slice::Gen::printComment(const ContainedPtr& p) { ContainerPtr container = ContainerPtr::dynamicCast(p); if (!container) - container = p -> container(); + container = p->container(); - string comment = p -> comment(); + string comment = p->comment(); StringList par = getTagged("param", comment); StringList ret = getTagged("return", comment); StringList throws = getTagged("throws", comment); @@ -571,13 +571,13 @@ Slice::Gen::printComment(const ContainedPtr& p) { string::size_type pos; string term; - pos = q -> find_first_of(" \t\r\n"); + pos = q->find_first_of(" \t\r\n"); if (pos != string::npos) - term = q -> substr(0, pos); + term = q->substr(0, pos); string item; - pos = q -> find_first_not_of(" \t\r\n", pos); + pos = q->find_first_not_of(" \t\r\n", pos); if (pos != string::npos) - item = q -> substr(pos); + item = q->substr(pos); start("varlistentry"); start("term"); @@ -617,13 +617,13 @@ Slice::Gen::printComment(const ContainedPtr& p) { string::size_type pos; string term; - pos = q -> find_first_of(" \t\r\n"); + pos = q->find_first_of(" \t\r\n"); if (pos != string::npos) - term = q -> substr(0, pos); + term = q->substr(0, pos); string item; - pos = q -> find_first_not_of(" \t\r\n", pos); + pos = q->find_first_not_of(" \t\r\n", pos); if (pos != string::npos) - item = q -> substr(pos); + item = q->substr(pos); start("varlistentry"); start("term"); @@ -665,7 +665,7 @@ Slice::Gen::printComment(const ContainedPtr& p) void Slice::Gen::printSummary(const ContainedPtr& p) { - string comment = p -> comment(); + string comment = p->comment(); start("para"); string::size_type pos = comment.find('.'); diff --git a/cpp/src/slice2docbook/GenUtil.cpp b/cpp/src/slice2docbook/GenUtil.cpp index 64be85a894f..81eede553e3 100644 --- a/cpp/src/slice2docbook/GenUtil.cpp +++ b/cpp/src/slice2docbook/GenUtil.cpp @@ -37,23 +37,23 @@ Slice::typeToString(const TypePtr& type) BuiltinPtr builtin = BuiltinPtr::dynamicCast(type); if (builtin) - result = "<type>" + string(builtinTable[builtin -> kind()]) + "</type>"; + result = "<type>" + string(builtinTable[builtin->kind()]) + "</type>"; ProxyPtr proxy = ProxyPtr::dynamicCast(type); if (proxy) - result = "<classname>" + proxy -> _class() -> scoped().substr(2) + "*</classname>"; + result = "<classname>" + proxy->_class()->scoped().substr(2) + "*</classname>"; ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type); if (cl) - result = "<classname>" + cl -> scoped().substr(2) + "</classname>"; + result = "<classname>" + cl->scoped().substr(2) + "</classname>"; ContainedPtr contained = ContainedPtr::dynamicCast(type); if (contained) { if (result.empty()) - result = "<type>" + contained -> scoped().substr(2) + "</type>"; + result = "<type>" + contained->scoped().substr(2) + "</type>"; - result = "<link linkend=" + scopedToId(contained -> scoped()) + ">" + result + "</link>"; + result = "<link linkend=" + scopedToId(contained->scoped()) + ">" + result + "</link>"; } if (result.empty()) @@ -65,7 +65,7 @@ Slice::typeToString(const TypePtr& type) string Slice::addLink(const string& s, const ContainerPtr& container) { - TypeList types = container -> lookupType(s, false); + TypeList types = container->lookupType(s, false); if (!types.empty()) { string result; @@ -77,15 +77,15 @@ Slice::addLink(const string& s, const ContainerPtr& container) ContainedPtr p = ContainedPtr::dynamicCast(types.front()); if (p) - result = "<link linkend=" + scopedToId(p -> scoped()) + ">" + result + "</link>"; + result = "<link linkend=" + scopedToId(p->scoped()) + ">" + result + "</link>"; return result; } - ContainedList contList = container -> lookupContained(s, false); + ContainedList contList = container->lookupContained(s, false); if (!contList.empty()) { - string result = "<link linkend=" + scopedToId(contList.front() -> scoped()) + ">"; + string result = "<link linkend=" + scopedToId(contList.front()->scoped()) + ">"; if (ModulePtr::dynamicCast(contList.front())) result += "<classname>" + s + "</classname>"; diff --git a/cpp/src/slice2docbook/Main.cpp b/cpp/src/slice2docbook/Main.cpp index 189bcb4d450..d0330454f8b 100644 --- a/cpp/src/slice2docbook/Main.cpp +++ b/cpp/src/slice2docbook/Main.cpp @@ -160,7 +160,7 @@ main(int argc, char* argv[]) { cerr << argv[0] << ": input files must end with `.ice'" << endl; - unit -> destroy(); + unit->destroy(); return EXIT_FAILURE; } base.erase(pos); @@ -170,7 +170,7 @@ main(int argc, char* argv[]) { cerr << argv[0] << ": can't open `" << argv[idx] << "' for reading: " << strerror(errno) << endl; - unit -> destroy(); + unit->destroy(); return EXIT_FAILURE; } test.close(); @@ -185,11 +185,11 @@ main(int argc, char* argv[]) { cerr << argv[0] << ": can't run C++ preprocessor: " << strerror(errno) << endl; - unit -> destroy(); + unit->destroy(); return EXIT_FAILURE; } - int parseStatus = unit -> parse(cppHandle, debug); + int parseStatus = unit->parse(cppHandle, debug); if (parseStatus == EXIT_FAILURE) { status = EXIT_FAILURE; @@ -208,13 +208,13 @@ main(int argc, char* argv[]) Gen gen(argv[0], docbook, standAlone, noGlobals); if (!gen) { - unit -> destroy(); + unit->destroy(); return EXIT_FAILURE; } gen.generate(unit); } - unit -> destroy(); + unit->destroy(); return status; } |