summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Kellogg <okellogg@users.sourceforge.net>2018-02-04 19:20:45 +0100
committerOliver Kellogg <okellogg@users.sourceforge.net>2018-02-04 19:20:45 +0100
commit2030786490a776fc7fd3a538e3b46ba63cfa6c11 (patch)
treee051eeca70f85736fe42c717d06aecc1fad56939
parentbe871ac59565386b582b41e48ef129d509c354fc (diff)
parenta13ddfc5371ca69a38c7d66906bd357a8ca87830 (diff)
downloadATCD-2030786490a776fc7fd3a538e3b46ba63cfa6c11.tar.gz
Merge remote-tracking branch 'upstream/master'
-rw-r--r--ACE/ace/ETCL/ETCL.ll3
-rw-r--r--ACE/ace/XML_Utils/XMLSchema/id_map.hpp39
-rwxr-xr-xACE/bin/fuzz.pl2
3 files changed, 34 insertions, 10 deletions
diff --git a/ACE/ace/ETCL/ETCL.ll b/ACE/ace/ETCL/ETCL.ll
index 7cbc0c47828..fde5839ac57 100644
--- a/ACE/ace/ETCL/ETCL.ll
+++ b/ACE/ace/ETCL/ETCL.ll
@@ -1,7 +1,6 @@
%option noyywrap
%{
-// ETCL.ll,v 1.5 2005/11/16 07:53:24 ossama Exp
// ========================================================================
//
// = LIBRARY
@@ -156,4 +155,4 @@ yywrap (void)
return 1;
}
-ACE_END_VERSIONED_NAMESPACE_DECL \ No newline at end of file
+ACE_END_VERSIONED_NAMESPACE_DECL
diff --git a/ACE/ace/XML_Utils/XMLSchema/id_map.hpp b/ACE/ace/XML_Utils/XMLSchema/id_map.hpp
index 2803a5a85be..6cdcbe45a13 100644
--- a/ACE/ace/XML_Utils/XMLSchema/id_map.hpp
+++ b/ACE/ace/XML_Utils/XMLSchema/id_map.hpp
@@ -54,7 +54,18 @@
//Unresolved_IDREF thrown when there are IDREF's in the
//XML document.
- class Unresolved_IDREF {};
+ class Unresolved_IDREF {
+ public:
+ explicit Unresolved_IDREF(const std::basic_string<ACE_TCHAR> &message) : message(message)
+ {}
+ ~Unresolved_IDREF(){}
+ std::basic_string<ACE_TCHAR> get_message ( void )
+ {
+ return message;
+ }
+ private:
+ std::basic_string<ACE_TCHAR> message;
+ };
//Only a default constructor and destructor are needed
//Constructor
@@ -67,8 +78,8 @@
{
}
- //Add an ID to the ID map
- void add_id (std::basic_string<ACE_TCHAR> id, XSCRT::Type *obj_ref)
+ // Add an ID to the ID map
+ void add_id (const std::basic_string<ACE_TCHAR>& id, XSCRT::Type *obj_ref)
{
if (obj_ref)
{
@@ -81,8 +92,8 @@
return;
}
- //Add an IDREF to the IDREF map
- void add_idref (std::basic_string<ACE_TCHAR> idref, XSCRT::Type *obj_ref)
+ // Add an IDREF to the IDREF map
+ void add_idref (const std::basic_string<ACE_TCHAR>& idref, XSCRT::Type *obj_ref)
{
if (obj_ref)
{
@@ -95,6 +106,19 @@
return;
}
+ void resolve_single_idref (const std::basic_string<ACE_TCHAR>& idref, ::XSCRT::Type * element)
+ {
+ ID_Map::id_iterator id_iterator = this->id_map_.find(idref);
+ if (id_iterator != this->id_map_.end())
+ {
+ element->set_idref(idref, id_iterator->second);
+ }
+ else
+ {
+ throw Unresolved_IDREF(idref);
+ }
+ }
+
//Sets the referencing elements XSCRT::Type::idref_ to point to the
//referenced element.
//Note: The pointer is of type "XSCRT::Type*"
@@ -119,7 +143,8 @@
}
else
{
- //throw Unresolved_IDREF();
+ std::basic_string<ACE_TCHAR> temp (idref_iterator->first);
+ throw Unresolved_IDREF(temp);
}
}
}
@@ -133,9 +158,9 @@
private:
//id_map_: maps the ID string to the element with the
// ID attribute
+ ID_MAP id_map_;
//idref_map_: multimap that maps the IDREF string to the
// element with the IDREF attribute
- ID_MAP id_map_;
IDREF_MAP idref_map_;
};
diff --git a/ACE/bin/fuzz.pl b/ACE/bin/fuzz.pl
index 5053b0b6115..a237f0ed59f 100755
--- a/ACE/bin/fuzz.pl
+++ b/ACE/bin/fuzz.pl
@@ -610,7 +610,7 @@ sub check_for_trailing_whitespace ()
print "Running trailing_whitespaces check\n";
ITERATION: foreach $file (@files_cpp, @files_inl, @files_h, @files_idl,
- @files_cdp, @files_pl, @files_generic) {
+ @files_cdp, @files_pl, @files_py, @files_generic) {
if (open (FILE, $file)) {
my $disable = 0;
print "Looking at file $file\n" if $opt_d;