[GME-commit] GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep Dumper.cpp,1.18,1.19

gme-commit at list.isis.vanderbilt.edu gme-commit at list.isis.vanderbilt.edu
Tue Jun 22 17:07:55 CDT 2004


Update of /var/lib/gme/GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep
In directory braindrain:/tmp/cvs-serv27904/Rep

Modified Files:
	Dumper.cpp 
Log Message:
Names must be unique (including aspect, folder names).


CVS User: zolmol

Index: Dumper.cpp
===================================================================
RCS file: /var/lib/gme/GMESRC/Paradigms/MetaGME/MetaInterpreter2004/Rep/Dumper.cpp,v
retrieving revision 1.18
retrieving revision 1.19
diff -C2 -d -r1.18 -r1.19
*** Dumper.cpp	16 Jun 2004 18:56:52 -0000	1.18
--- Dumper.cpp	22 Jun 2004 21:07:52 -0000	1.19
***************
*** 822,826 ****
  				mmm += (*it_cons1)->doDump();
  				if ( last_name != "" && last_name == (*it_cons1)->getName())
! 					global_vars.err << "Error: Duplicate global constraint name found " << (*it_cons1)->getName() << "\n";
  				last_name = (*it_cons1)->getName();
  			}
--- 822,826 ----
  				mmm += (*it_cons1)->doDump();
  				if ( last_name != "" && last_name == (*it_cons1)->getName())
! 					global_vars.err << "Error: Duplicate global constraint name found \"" << (*it_cons1)->getName() << "\"\n";
  				last_name = (*it_cons1)->getName();
  			}
***************
*** 841,845 ****
  			mmm += (*it_cons2)->doDump();
  			if ( last_name != "" && last_name == (*it_cons2)->getName())
! 				global_vars.err << "Error: Duplicate constraint function name found " << (*it_cons2)->getName() << "\n";
  			last_name = (*it_cons2)->getName();
  		}
--- 841,845 ----
  			mmm += (*it_cons2)->doDump();
  			if ( last_name != "" && last_name == (*it_cons2)->getName())
! 				global_vars.err << "Error: Duplicate constraint function name found \"" << (*it_cons2)->getName() << "\"\n";
  			last_name = (*it_cons2)->getName();
  		}
***************
*** 863,867 ****
  				mmm += (*it)->doDumpAttr("");
  				if ( last_name != "" && last_name == (*it)->getName())
! 					global_vars.err << "Error: Duplicate global attribute name found " << (*it)->getName() << "\n";
  				last_name = (*it)->getName();
  			}
--- 863,867 ----
  				mmm += (*it)->doDumpAttr("");
  				if ( last_name != "" && last_name == (*it)->getName())
! 					global_vars.err << "Error: Duplicate global attribute name found \"" << (*it)->getName() << "\"\n";
  				last_name = (*it)->getName();
  			}
***************
*** 885,891 ****
  				this_name = (*it_b)->getName();
  				if (last_name != "" && last_name == this_name)
! 					global_vars.err << "Error: Duplicate atom name found " << this_name << "\n";
  				else if (already_dumped[ this_name])
! 					global_vars.err << "Error: Duplicate fco name found " << this_name << "\n";
  
  				already_dumped[ this_name] = true;
--- 885,891 ----
  				this_name = (*it_b)->getName();
  				if (last_name != "" && last_name == this_name)
! 					global_vars.err << "Error: Duplicate atom name found \"" << this_name << "\"\n";
  				else if (already_dumped[ this_name])
! 					global_vars.err << "Error: Duplicate fco name found \"" << this_name << "\"\n";
  
  				already_dumped[ this_name] = true;
***************
*** 912,918 ****
  				this_name = (*it_c)->getName();
  				if ( last_name != "" && last_name == this_name)
! 					global_vars.err << "Error: Duplicate set name found " << this_name << "\n";
  				else if (already_dumped[ this_name])
! 					global_vars.err << "Error: Duplicate fco name found " << this_name << "\n";
  
  				already_dumped[ this_name] = true;
--- 912,918 ----
  				this_name = (*it_c)->getName();
  				if ( last_name != "" && last_name == this_name)
! 					global_vars.err << "Error: Duplicate set name found \"" << this_name << "\"\n";
  				else if (already_dumped[ this_name])
! 					global_vars.err << "Error: Duplicate fco name found \"" << this_name << "\"\n";
  
  				already_dumped[ this_name] = true;
***************
*** 939,945 ****
  				this_name = (*it_cn)->getName();
  				if ( last_name != "" && last_name == this_name)
! 					global_vars.err << "Error: Duplicate connection name found " << this_name << "\n";
  				else if (already_dumped[ this_name])
! 					global_vars.err << "Error: Duplicate fco name found " << this_name << "\n";
  
  				already_dumped[ this_name] = true;
--- 939,945 ----
  				this_name = (*it_cn)->getName();
  				if ( last_name != "" && last_name == this_name)
! 					global_vars.err << "Error: Duplicate connection name found \"" << this_name << "\"\n";
  				else if (already_dumped[ this_name])
! 					global_vars.err << "Error: Duplicate fco name found \"" << this_name << "\"\n";
  
  				already_dumped[ this_name] = true;
***************
*** 966,972 ****
  				this_name = (*it_ref)->getName();
  				if ( last_name != "" && last_name == this_name)
! 					global_vars.err << "Error: Duplicate reference name found " << this_name << "\n";
  				else if (already_dumped[ this_name])
! 					global_vars.err << "Error: Duplicate fco name found " << this_name << "\n";
  
  				already_dumped[ this_name] = true;
--- 966,972 ----
  				this_name = (*it_ref)->getName();
  				if ( last_name != "" && last_name == this_name)
! 					global_vars.err << "Error: Duplicate reference name found \"" << this_name << "\"\n";
  				else if (already_dumped[ this_name])
! 					global_vars.err << "Error: Duplicate fco name found \"" << this_name << "\"\n";
  
  				already_dumped[ this_name] = true;
***************
*** 993,999 ****
  				this_name = (*it_m)->getName();
  				if ( last_name != "" && last_name == this_name)
! 					global_vars.err << "Error: Duplicate model name found " << this_name << "\n";
  				else if (already_dumped[ this_name])
! 					global_vars.err << "Error: Duplicate fco name found " << this_name << "\n";
  
  				already_dumped[ this_name] = true;
--- 993,999 ----
  				this_name = (*it_m)->getName();
  				if ( last_name != "" && last_name == this_name)
! 					global_vars.err << "Error: Duplicate model name found \"" << this_name << "\"\n";
  				else if (already_dumped[ this_name])
! 					global_vars.err << "Error: Duplicate fco name found \"" << this_name << "\"\n";
  
  				already_dumped[ this_name] = true;
***************
*** 1007,1011 ****
  	// folders
  	{AnyLexicographicSort lex;
! 	std::string last_name = "";
  	std::sort( m_folderList.begin(), m_folderList.end(), lex );
  	std::vector<FolderRep*>::iterator it_fd = m_folderList.begin();
--- 1007,1011 ----
  	// folders
  	{AnyLexicographicSort lex;
! 	std::string last_name = "", this_name = "";
  	std::sort( m_folderList.begin(), m_folderList.end(), lex );
  	std::vector<FolderRep*>::iterator it_fd = m_folderList.begin();
***************
*** 1015,1022 ****
  		{
  			mmm += (*it_fd)->doDump();
- 			if ( last_name != "" && last_name == (*it_fd)->getName())
- 				global_vars.err << "Error: Duplicate folder name found " << (*it_fd)->getName() << "\n";
- 			last_name = (*it_fd)->getName();
  
  		}
  		DMP( mmm);
--- 1015,1027 ----
  		{
  			mmm += (*it_fd)->doDump();
  
+ 			this_name = (*it_fd)->getName();
+ 			if ( last_name != "" && last_name == this_name)
+ 				global_vars.err << "Error: Duplicate folder name found \"" << this_name << "\"\n";
+ 			else if (already_dumped[ this_name])
+ 				global_vars.err << "Error: Duplicate name found \"" << this_name << "\"\n";
+ 
+ 			already_dumped[ this_name] = true;
+ 			last_name = this_name;
  		}
  		DMP( mmm);
***************
*** 1031,1034 ****
--- 1036,1052 ----
  	--ind;
  	DMP("</paradigm>\n");
+ 
+ 	// aspect names checked for uniqueness ( cannot be equal with kind names)
+ 	// for all aspects	
+ 	{std::vector<AspectRep*>::iterator it( m_aspectList.begin());
+ 	for( ; it != m_aspectList.end(); ++it)
+ 	{
+ 		const std::string asp_name = (*it)->getName();
+ 		if (already_dumped[ asp_name])
+ 		{
+ 			global_vars.err << "Error: Duplicate name found \"" << asp_name << "\"\n";
+ 		}
+ 	}}	
+ 
  }
  



More information about the GME-commit mailing list