summaryrefslogtreecommitdiff
path: root/cpp/src/Slice/Parser.cpp
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2002-06-19 06:38:05 +0000
committerMichi Henning <michi@zeroc.com>2002-06-19 06:38:05 +0000
commitac5baaf4675325375d05f2079f2f0678c6e86fd8 (patch)
treebb2526a6c6593f1125196d6e5ff3a1f9cf7b784d /cpp/src/Slice/Parser.cpp
parentfile ActivatorI.cpp was initially added on branch location. (diff)
downloadice-ac5baaf4675325375d05f2079f2f0678c6e86fd8.tar.bz2
ice-ac5baaf4675325375d05f2079f2f0678c6e86fd8.tar.xz
ice-ac5baaf4675325375d05f2079f2f0678c6e86fd8.zip
Changed the grammar for out parameters to deprecate the semicolon syntax
and use an "out" keyword instead. The old syntax still works, but now prints a warning. Fixed up all the test cases that got broken by this and add a new test case for out-of-order in and out parameters. Refactored the grammar somewhat because, initially, out params added something like 50 shift/reduce conflicts. One shift/reduce conflict remains, caused by the addition of ICE_OUT to the last production in Grammar.y. We could avoid the conflict by removing ICE_OUT from that production, but then we wouldn't catch other errors anymore, such as an attempt to use "out" as the name of an operation or interface. I've added a warning to the Makefile to expect 1 shift/reduce conflict when Grammar.y is rebuilt.
Diffstat (limited to 'cpp/src/Slice/Parser.cpp')
-rw-r--r--cpp/src/Slice/Parser.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp
index cea765dc172..8fd318910e1 100644
--- a/cpp/src/Slice/Parser.cpp
+++ b/cpp/src/Slice/Parser.cpp
@@ -1352,7 +1352,14 @@ Slice::ClassDef::createOperation(const string& name,
++q;
while (q != allParams.end())
{
- if (p->second == q->second)
+ //
+ // Complain about duplicate parameters only if they are
+ // non-empty; otherwise, we get a complaint about duplicates
+ // if two or more parameter names are missing in an operation
+ // signature (but the missing parameters have been reported
+ // already).
+ //
+ if (p->second == q->second && p->second != "")
{
string msg = "duplicate parameter `";
msg += p->second;