summaryrefslogtreecommitdiff
path: root/cpp/src/Slice
diff options
context:
space:
mode:
Diffstat (limited to 'cpp/src/Slice')
-rw-r--r--cpp/src/Slice/CPlusPlusUtil.cpp4
-rw-r--r--cpp/src/Slice/Checksum.cpp2
-rw-r--r--cpp/src/Slice/CsUtil.cpp2
-rw-r--r--cpp/src/Slice/DotNetNames.cpp2
-rw-r--r--cpp/src/Slice/FileTracker.cpp2
-rw-r--r--cpp/src/Slice/Grammar.cpp2
-rw-r--r--cpp/src/Slice/Grammar.y2
-rw-r--r--cpp/src/Slice/GrammarUtil.h2
-rw-r--r--cpp/src/Slice/JavaUtil.cpp4
-rw-r--r--cpp/src/Slice/MD5.cpp2
-rw-r--r--cpp/src/Slice/MD5.h2
-rw-r--r--cpp/src/Slice/Makefile2
-rw-r--r--cpp/src/Slice/Makefile.mak2
-rw-r--r--cpp/src/Slice/PHPUtil.cpp2
-rw-r--r--cpp/src/Slice/Parser.cpp60
-rw-r--r--cpp/src/Slice/Preprocessor.cpp14
-rw-r--r--cpp/src/Slice/PythonUtil.cpp4
-rw-r--r--cpp/src/Slice/RubyUtil.cpp4
-rw-r--r--cpp/src/Slice/Scanner.cpp2
-rw-r--r--cpp/src/Slice/Scanner.l2
-rw-r--r--cpp/src/Slice/Slice.rc2
-rw-r--r--cpp/src/Slice/Util.cpp2
22 files changed, 96 insertions, 26 deletions
diff --git a/cpp/src/Slice/CPlusPlusUtil.cpp b/cpp/src/Slice/CPlusPlusUtil.cpp
index 13d16113027..86a7b138805 100644
--- a/cpp/src/Slice/CPlusPlusUtil.cpp
+++ b/cpp/src/Slice/CPlusPlusUtil.cpp
@@ -1,6 +1,6 @@
// **********************************************************************
//
-// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
+// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
@@ -355,7 +355,7 @@ Slice::printHeader(Output& out)
static const char* header =
"// **********************************************************************\n"
"//\n"
-"// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.\n"
+"// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.\n"
"//\n"
"// This copy of Ice is licensed to you under the terms described in the\n"
"// ICE_LICENSE file included in this distribution.\n"
diff --git a/cpp/src/Slice/Checksum.cpp b/cpp/src/Slice/Checksum.cpp
index 47532688d85..37cf915c44d 100644
--- a/cpp/src/Slice/Checksum.cpp
+++ b/cpp/src/Slice/Checksum.cpp
@@ -1,6 +1,6 @@
// **********************************************************************
//
-// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
+// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
diff --git a/cpp/src/Slice/CsUtil.cpp b/cpp/src/Slice/CsUtil.cpp
index a78e55a183a..d66d2c020b7 100644
--- a/cpp/src/Slice/CsUtil.cpp
+++ b/cpp/src/Slice/CsUtil.cpp
@@ -1,6 +1,6 @@
// **********************************************************************
//
-// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
+// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
diff --git a/cpp/src/Slice/DotNetNames.cpp b/cpp/src/Slice/DotNetNames.cpp
index b76fe695993..32b9f1fad54 100644
--- a/cpp/src/Slice/DotNetNames.cpp
+++ b/cpp/src/Slice/DotNetNames.cpp
@@ -1,6 +1,6 @@
// **********************************************************************
//
-// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
+// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
diff --git a/cpp/src/Slice/FileTracker.cpp b/cpp/src/Slice/FileTracker.cpp
index f6233ac49ea..d2ebb9d5896 100644
--- a/cpp/src/Slice/FileTracker.cpp
+++ b/cpp/src/Slice/FileTracker.cpp
@@ -1,6 +1,6 @@
// **********************************************************************
//
-// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
+// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
diff --git a/cpp/src/Slice/Grammar.cpp b/cpp/src/Slice/Grammar.cpp
index ddb2f591629..1d12b32567c 100644
--- a/cpp/src/Slice/Grammar.cpp
+++ b/cpp/src/Slice/Grammar.cpp
@@ -81,7 +81,7 @@
// **********************************************************************
//
-// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
+// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
diff --git a/cpp/src/Slice/Grammar.y b/cpp/src/Slice/Grammar.y
index a3c5ca4ba48..c2a377966bb 100644
--- a/cpp/src/Slice/Grammar.y
+++ b/cpp/src/Slice/Grammar.y
@@ -2,7 +2,7 @@
// **********************************************************************
//
-// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
+// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
diff --git a/cpp/src/Slice/GrammarUtil.h b/cpp/src/Slice/GrammarUtil.h
index b4d310c8951..3c452e1ee2e 100644
--- a/cpp/src/Slice/GrammarUtil.h
+++ b/cpp/src/Slice/GrammarUtil.h
@@ -1,6 +1,6 @@
// **********************************************************************
//
-// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
+// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
diff --git a/cpp/src/Slice/JavaUtil.cpp b/cpp/src/Slice/JavaUtil.cpp
index 10665aface9..cba34e6d2e8 100644
--- a/cpp/src/Slice/JavaUtil.cpp
+++ b/cpp/src/Slice/JavaUtil.cpp
@@ -1,6 +1,6 @@
// **********************************************************************
//
-// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
+// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
@@ -259,7 +259,7 @@ Slice::JavaOutput::printHeader()
static const char* header =
"// **********************************************************************\n"
"//\n"
-"// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.\n"
+"// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.\n"
"//\n"
"// This copy of Ice is licensed to you under the terms described in the\n"
"// ICE_LICENSE file included in this distribution.\n"
diff --git a/cpp/src/Slice/MD5.cpp b/cpp/src/Slice/MD5.cpp
index da791ce40ab..b9f4a8b2005 100644
--- a/cpp/src/Slice/MD5.cpp
+++ b/cpp/src/Slice/MD5.cpp
@@ -1,6 +1,6 @@
// **********************************************************************
//
-// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
+// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
diff --git a/cpp/src/Slice/MD5.h b/cpp/src/Slice/MD5.h
index 3545ff31f00..baeb6ca088f 100644
--- a/cpp/src/Slice/MD5.h
+++ b/cpp/src/Slice/MD5.h
@@ -1,6 +1,6 @@
// **********************************************************************
//
-// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
+// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
diff --git a/cpp/src/Slice/Makefile b/cpp/src/Slice/Makefile
index 7b2b08353ee..f644eabeb0a 100644
--- a/cpp/src/Slice/Makefile
+++ b/cpp/src/Slice/Makefile
@@ -1,6 +1,6 @@
# **********************************************************************
#
-# Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
+# Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
diff --git a/cpp/src/Slice/Makefile.mak b/cpp/src/Slice/Makefile.mak
index 562a5341eb8..31d73081ed3 100644
--- a/cpp/src/Slice/Makefile.mak
+++ b/cpp/src/Slice/Makefile.mak
@@ -1,6 +1,6 @@
# **********************************************************************
#
-# Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
+# Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
#
# This copy of Ice is licensed to you under the terms described in the
# ICE_LICENSE file included in this distribution.
diff --git a/cpp/src/Slice/PHPUtil.cpp b/cpp/src/Slice/PHPUtil.cpp
index e0d2a13971e..b8a8f98ccda 100644
--- a/cpp/src/Slice/PHPUtil.cpp
+++ b/cpp/src/Slice/PHPUtil.cpp
@@ -1,6 +1,6 @@
// **********************************************************************
//
-// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
+// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
diff --git a/cpp/src/Slice/Parser.cpp b/cpp/src/Slice/Parser.cpp
index abdffefb7e1..aedac4d3070 100644
--- a/cpp/src/Slice/Parser.cpp
+++ b/cpp/src/Slice/Parser.cpp
@@ -1,6 +1,6 @@
// **********************************************************************
//
-// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
+// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
@@ -544,6 +544,11 @@ Slice::Container::createModule(const string& name)
ContainedList matches = _unit->findContents(thisScope() + name);
matches.sort(); // Modules can occur many times...
matches.unique(); // ... but we only want one instance of each.
+
+ if(thisScope() == "::")
+ {
+ _unit->addTopLevelModule(_unit->currentFile(), name);
+ }
for(ContainedList::const_iterator p = matches.begin(); p != matches.end(); ++p)
{
@@ -1643,6 +1648,8 @@ Slice::Container::hasNonLocalExceptions() const
return false;
}
+
+
bool
Slice::Container::hasClassDecls() const
{
@@ -1739,6 +1746,28 @@ Slice::Container::hasClassDefs() const
}
bool
+Slice::Container::hasOnlyClassDecls() const
+{
+ for(ContainedList::const_iterator p = _contents.begin(); p != _contents.end(); ++p)
+ {
+ ModulePtr m = ModulePtr::dynamicCast(*p);
+ if(m)
+ {
+ if(!m->hasOnlyClassDecls())
+ {
+ return false;
+ }
+ }
+ else if(!ClassDeclPtr::dynamicCast(*p))
+ {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool
Slice::Container::hasAbstractClassDefs() const
{
for(ContainedList::const_iterator p = _contents.begin(); p != _contents.end(); ++p)
@@ -6171,6 +6200,35 @@ Slice::Unit::builtin(Builtin::Kind kind)
return builtin;
}
+void
+Slice::Unit::addTopLevelModule(const string& file, const string& module)
+{
+ map<string, set<string> >::iterator i = _fileTopLevelModules.find(file);
+ if(i == _fileTopLevelModules.end())
+ {
+ set<string> modules;
+ modules.insert(module);
+ _fileTopLevelModules.insert(make_pair(file, modules));
+ }
+ else
+ {
+ i->second.insert(module);
+ }
+}
+set<string>
+Slice::Unit::getTopLevelModules(const string& file) const
+{
+ map<string, set<string> >::const_iterator i = _fileTopLevelModules.find(file);
+ if(i == _fileTopLevelModules.end())
+ {
+ return set<string>();
+ }
+ else
+ {
+ return i->second;
+ }
+}
+
Slice::Unit::Unit(bool ignRedefs, bool all, bool allowIcePrefix, bool allowUnderscore,
const StringList& defaultGlobalMetadata) :
SyntaxTreeBase(0),
diff --git a/cpp/src/Slice/Preprocessor.cpp b/cpp/src/Slice/Preprocessor.cpp
index 1573e0e31c7..a4981328ed7 100644
--- a/cpp/src/Slice/Preprocessor.cpp
+++ b/cpp/src/Slice/Preprocessor.cpp
@@ -1,6 +1,6 @@
// **********************************************************************
//
-// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
+// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
@@ -558,6 +558,18 @@ Slice::Preprocessor::printMakefileDependencies(Language lang, const vector<strin
}
break;
}
+ case JS:
+ {
+ //
+ // Change .o[bj] suffix to .js suffix.
+ //
+ string::size_type pos;
+ if((pos = result.find(suffix)) != string::npos)
+ {
+ result.replace(pos, suffix.size() - 1, ".js");
+ }
+ break;
+ }
case Python:
{
//
diff --git a/cpp/src/Slice/PythonUtil.cpp b/cpp/src/Slice/PythonUtil.cpp
index 718ae297ba6..59f4e98ab51 100644
--- a/cpp/src/Slice/PythonUtil.cpp
+++ b/cpp/src/Slice/PythonUtil.cpp
@@ -1,6 +1,6 @@
// **********************************************************************
//
-// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
+// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
@@ -2433,7 +2433,7 @@ Slice::Python::printHeader(IceUtilInternal::Output& out)
static const char* header =
"# **********************************************************************\n"
"#\n"
-"# Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.\n"
+"# Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.\n"
"#\n"
"# This copy of Ice is licensed to you under the terms described in the\n"
"# ICE_LICENSE file included in this distribution.\n"
diff --git a/cpp/src/Slice/RubyUtil.cpp b/cpp/src/Slice/RubyUtil.cpp
index 3ea9ffeb34c..a93af8ec9fd 100644
--- a/cpp/src/Slice/RubyUtil.cpp
+++ b/cpp/src/Slice/RubyUtil.cpp
@@ -1,6 +1,6 @@
// **********************************************************************
//
-// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
+// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
@@ -1774,7 +1774,7 @@ Slice::Ruby::printHeader(IceUtilInternal::Output& out)
static const char* header =
"# **********************************************************************\n"
"#\n"
-"# Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.\n"
+"# Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.\n"
"#\n"
"# This copy of Ice is licensed to you under the terms described in the\n"
"# ICE_LICENSE file included in this distribution.\n"
diff --git a/cpp/src/Slice/Scanner.cpp b/cpp/src/Slice/Scanner.cpp
index b945860a572..df3a47e29af 100644
--- a/cpp/src/Slice/Scanner.cpp
+++ b/cpp/src/Slice/Scanner.cpp
@@ -547,7 +547,7 @@ char *slice_text;
// **********************************************************************
//
-// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
+// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
diff --git a/cpp/src/Slice/Scanner.l b/cpp/src/Slice/Scanner.l
index 428dfbddd11..267e0fcafe2 100644
--- a/cpp/src/Slice/Scanner.l
+++ b/cpp/src/Slice/Scanner.l
@@ -2,7 +2,7 @@
// **********************************************************************
//
-// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
+// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.
diff --git a/cpp/src/Slice/Slice.rc b/cpp/src/Slice/Slice.rc
index bdcf6ac2f60..897db62f504 100644
--- a/cpp/src/Slice/Slice.rc
+++ b/cpp/src/Slice/Slice.rc
@@ -25,7 +25,7 @@ BEGIN
VALUE "FileDescription", "Slice Utilities DLL\0"
VALUE "FileVersion", "3.5.1\0"
VALUE "InternalName", INTERNALNAME
- VALUE "LegalCopyright", "Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.\0"
+ VALUE "LegalCopyright", "Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.\0"
VALUE "OriginalFilename", ORIGINALFILENAME
VALUE "ProductName", "Ice\0"
VALUE "ProductVersion", "3.5.1\0"
diff --git a/cpp/src/Slice/Util.cpp b/cpp/src/Slice/Util.cpp
index 97b9e7c9844..2bd3d0afe5f 100644
--- a/cpp/src/Slice/Util.cpp
+++ b/cpp/src/Slice/Util.cpp
@@ -1,6 +1,6 @@
// **********************************************************************
//
-// Copyright (c) 2003-2013 ZeroC, Inc. All rights reserved.
+// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
//
// This copy of Ice is licensed to you under the terms described in the
// ICE_LICENSE file included in this distribution.