summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/Parser.cpp
diff options
context:
space:
mode:
authorMarc Laukien <marc@zeroc.com>2001-07-19 22:14:34 +0000
committerMarc Laukien <marc@zeroc.com>2001-07-19 22:14:34 +0000
commit032f424df7f4dec8ab18cc21f865bddad38c4f50 (patch)
tree2f6e777d7cd3ee28df8e02e8dc23118110fba70d /cpp/src/Slice/Parser.cpp
parenterror checking (diff)
downloadice-032f424df7f4dec8ab18cc21f865bddad38c4f50.tar.bz2
ice-032f424df7f4dec8ab18cc21f865bddad38c4f50.tar.xz
ice-032f424df7f4dec8ab18cc21f865bddad38c4f50.zip
started with slice2docbook; removed slice2html
Diffstat (limited to 'cpp/src/Slice/Parser.cpp')
-rw-r--r--cpp/src/Slice/Parser.cpp51
1 files changed, 51 insertions, 0 deletions
diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp
index 7d90baaf121..a45b517766e 100644
--- a/cpp/src/Slice/Parser.cpp
+++ b/cpp/src/Slice/Parser.cpp
@@ -890,6 +890,44 @@ Slice::ClassDef::createOperation(const string& name,
return 0;
}
+ {
+ TypeStringList allParams = inParams;
+ allParams.insert(allParams.end(), outParams.begin(), outParams.end());
+
+ TypeStringList::iterator p = allParams.begin();
+ while(p != allParams.end())
+ {
+ TypeStringList::iterator q = p;
+ ++q;
+ while(q != allParams.end())
+ {
+ if(p -> second == q -> second)
+ {
+ string msg = "duplicate parameter `";
+ msg += p -> second;
+ msg += "'";
+ yyerror(msg);
+ return 0;
+ }
+ ++q;
+ }
+ ++p;
+ }
+ }
+
+ if(name == this -> name())
+ {
+ string msg;
+ if(isInterface())
+ msg = "interface name `";
+ else
+ msg = "class name `";
+ msg += name;
+ msg += "' can not be used as operation";
+ yyerror(msg);
+ return 0;
+ }
+
Operation_ptr p = new Operation(this, name, returnType,
inParams, outParams, throws);
contents_.push_back(p);
@@ -924,6 +962,19 @@ Slice::ClassDef::createDataMember(const string& name, const Type_ptr& type)
return 0;
}
+ if(name == this -> name())
+ {
+ string msg;
+ if(isInterface())
+ msg = "interface name `";
+ else
+ msg = "class name `";
+ msg += name;
+ msg += "' can not be used as data member";
+ yyerror(msg);
+ return 0;
+ }
+
DataMember_ptr p = new DataMember(this, name, type);
contents_.push_back(p);
return p;