|
From: <ma...@us...> - 2010-02-11 14:54:55
|
Revision: 587
http://scstudio.svn.sourceforge.net/scstudio/?rev=587&view=rev
Author: madzin
Date: 2010-02-11 14:54:47 +0000 (Thu, 11 Feb 2010)
Log Message:
-----------
New msc ordering in parser result
Modified Paths:
--------------
trunk/src/data/Z120/Context.cpp
trunk/src/data/Z120/Context_Impl.h
trunk/tests/z120_test/z120_test25.mpr.result
trunk/tests/z120_test/z120_test26.mpr.result
trunk/tests/z120_test/z120_test40.mpr.result
trunk/tests/z120_test/z120_test79.mpr.result
Modified: trunk/src/data/Z120/Context.cpp
===================================================================
--- trunk/src/data/Z120/Context.cpp 2010-02-11 10:56:33 UTC (rev 586)
+++ trunk/src/data/Z120/Context.cpp 2010-02-11 14:54:47 UTC (rev 587)
@@ -143,6 +143,7 @@
std::vector<std::string>::iterator order_it;
Context::MscPtrMap::const_iterator mscs_it;
+
//add nonpointed HMSC
for(order_it = context->hmscs_order.begin(); order_it != context->hmscs_order.end(); order_it++)
{
@@ -150,7 +151,7 @@
if(nonpointed_it != context->nonpointed.end())
{
- for(Context::MscPtrMap::iterator mscs_it = context->mscs.lower_bound(*nonpointed_it);
+ for(mscs_it = context->mscs.lower_bound(*nonpointed_it);
mscs_it != context->mscs.upper_bound(*nonpointed_it); mscs_it++)
{
Msc* my_msc = mscs_it->second.get();
@@ -180,14 +181,21 @@
}
}
}
-
+
//add others MSC
- for(mscs_it = context->mscs.begin(); mscs_it != context->mscs.end(); mscs_it++)
+ for(order_it = context->msc_file_order.begin();
+ order_it != context->msc_file_order.end();
+ order_it++)
{
// msc's listed nonpointed have already been processed above
- if(context->nonpointed.find(mscs_it->first) != context->nonpointed.end())
+ if(context->nonpointed.find(*order_it) != context->nonpointed.end())
continue;
+
+ mscs_it = context->mscs.find(*order_it);
+ if(mscs_it == context->mscs.end())
+ continue;
+
Msc* my_msc = mscs_it->second.get();
if(my_msc != NULL){
intrusive_ptr_add_ref(my_msc);
@@ -431,7 +439,9 @@
}
if(context->mscs.find(context->msc_name) == context->mscs.end())
- {
+ {
+ context->msc_file_order.push_back(context->msc_name);
+
if(context->myBmsc == NULL)
context->hmscs_order.push_back(context->msc_name);
else
Modified: trunk/src/data/Z120/Context_Impl.h
===================================================================
--- trunk/src/data/Z120/Context_Impl.h 2010-02-11 10:56:33 UTC (rev 586)
+++ trunk/src/data/Z120/Context_Impl.h 2010-02-11 14:54:47 UTC (rev 587)
@@ -52,8 +52,11 @@
*/
typedef std::multimap<std::string, MscPtr> MscPtrMap;
MscPtrMap mscs; // map of msc in the file
+
std::vector<std::string> hmscs_order; //HMSCs order in the file
std::vector<std::string> bmscs_order; //BMSCs order in the file
+ std::vector<std::string> msc_file_order; //msc ordering in the file
+
typedef std::set<std::string> MscNameSet;
MscNameSet nonpointed; // msc which is not refered
std::map<std::string, std::set<ReferenceNodePtr> > future_reference; //map of name of nodes on which was refered and does not exist
Modified: trunk/tests/z120_test/z120_test25.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test25.mpr.result 2010-02-11 10:56:33 UTC (rev 586)
+++ trunk/tests/z120_test/z120_test25.mpr.result 2010-02-11 14:54:47 UTC (rev 587)
@@ -9,6 +9,16 @@
L1: reference Two connect L2;
L2: final;
endmsc;
+msc Two;
+inst Second;
+inst First;
+Second: instance;
+out true,0 to First;
+endinstance;
+First: instance;
+in true,0 from Second;
+endinstance;
+endmsc;
msc One;
initial connect L0;
L0: condition access connect L1;
@@ -24,13 +34,3 @@
NAME: instance;
endinstance;
endmsc;
-msc Two;
-inst Second;
-inst First;
-Second: instance;
-out true,0 to First;
-endinstance;
-First: instance;
-in true,0 from Second;
-endinstance;
-endmsc;
Modified: trunk/tests/z120_test/z120_test26.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test26.mpr.result 2010-02-11 10:56:33 UTC (rev 586)
+++ trunk/tests/z120_test/z120_test26.mpr.result 2010-02-11 14:54:47 UTC (rev 587)
@@ -7,11 +7,6 @@
L1: reference Two connect L2;
L2: final;
endmsc;
-msc One;
-initial connect L0;
-L0: condition access connect L1;
-L1: final;
-endmsc;
msc Two;
inst Second;
inst First;
@@ -22,3 +17,8 @@
in true,0 from Second;
endinstance;
endmsc;
+msc One;
+initial connect L0;
+L0: condition access connect L1;
+L1: final;
+endmsc;
Modified: trunk/tests/z120_test/z120_test40.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test40.mpr.result 2010-02-11 10:56:33 UTC (rev 586)
+++ trunk/tests/z120_test/z120_test40.mpr.result 2010-02-11 14:54:47 UTC (rev 587)
@@ -9,11 +9,6 @@
L1: reference Two connect L2;
L2: final;
endmsc;
-msc One;
-initial connect L0;
-L0: condition access connect L1;
-L1: final;
-endmsc;
msc Two;
inst Second;
inst First;
@@ -24,3 +19,8 @@
in true,0 from Second;
endinstance;
endmsc;
+msc One;
+initial connect L0;
+L0: condition access connect L1;
+L1: final;
+endmsc;
Modified: trunk/tests/z120_test/z120_test79.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test79.mpr.result 2010-02-11 10:56:33 UTC (rev 586)
+++ trunk/tests/z120_test/z120_test79.mpr.result 2010-02-11 14:54:47 UTC (rev 587)
@@ -9,6 +9,16 @@
L1: reference Denied connect L2;
L2: final;
endmsc;
+msc Denied;
+inst NAME2;
+inst NAME;
+NAME2: instance;
+out NAME,0 to NAME;
+endinstance;
+NAME: instance;
+in NAME,0 from NAME2;
+endinstance;
+endmsc;
msc Accept;
inst NAME;
inst NAME1;
@@ -19,13 +29,3 @@
out NAME,0 to NAME;
endinstance;
endmsc;
-msc Denied;
-inst NAME2;
-inst NAME;
-NAME2: instance;
-out NAME,0 to NAME;
-endinstance;
-NAME: instance;
-in NAME,0 from NAME2;
-endinstance;
-endmsc;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|