|
From: <ma...@us...> - 2009-10-02 16:03:30
|
Revision: 392
http://scstudio.svn.sourceforge.net/scstudio/?rev=392&view=rev
Author: madzin
Date: 2009-10-02 16:03:11 +0000 (Fri, 02 Oct 2009)
Log Message:
-----------
Parser is able to work with time intervals.
Modified Paths:
--------------
trunk/src/data/Z120/Context.cpp
trunk/src/data/Z120/Context.h
trunk/src/data/Z120/Context_Impl.h
trunk/src/data/Z120/Z120.g
trunk/tests/z120_test/CMakeLists.txt
trunk/tests/z120_test/z120_test01.mpr.result
trunk/tests/z120_test/z120_test02.mpr.result
trunk/tests/z120_test/z120_time01.mpr
trunk/tests/z120_test/z120_time01.mpr.result
Added Paths:
-----------
trunk/tests/z120_test/z120_time02.mpr
trunk/tests/z120_test/z120_time02.mpr.result
trunk/tests/z120_test/z120_time03.mpr
trunk/tests/z120_test/z120_time03.mpr.result
trunk/tests/z120_test/z120_time04.mpr
trunk/tests/z120_test/z120_time04.mpr.result
trunk/tests/z120_test/z120_time05.mpr
trunk/tests/z120_test/z120_time05.mpr.result
Modified: trunk/src/data/Z120/Context.cpp
===================================================================
--- trunk/src/data/Z120/Context.cpp 2009-10-01 20:28:42 UTC (rev 391)
+++ trunk/src/data/Z120/Context.cpp 2009-10-02 16:03:11 UTC (rev 392)
@@ -22,7 +22,7 @@
*/
/*
- * Maximal number of warning/error message is 22
+ * Maximal number of warning/error message is 24
*/
#ifndef __ParserStruct__
@@ -47,6 +47,9 @@
*/
void init(struct Context* context)
{
+ context->interval_label = "";
+ context->time = "";
+
context->myBmsc = new BMsc();
context->myHmsc = new HMsc();
context->myBmsc = NULL;
@@ -54,12 +57,13 @@
context->element_name = "";
context->reference_name = "";
context->condition_name = "";
- context->node_type = 0;
+ context->node_type = connection;
context->event_name = "";
context->coregion_area_finished.clear();
context->instances.clear();
context->messages.clear();
context->future_events.clear();
+ context->future_time_events.clear();
context->named_events.clear();
context->current_event = NULL;
context->not_create_event = 0;
@@ -71,6 +75,9 @@
context->connect_name.clear();
context->hmsc_nodes.clear();
context->future_connections.clear();
+ context->future_bottom_time_relations.clear();
+ context->future_top_time_relations.clear();
+ context->not_connect = 0;
}
/*
@@ -118,6 +125,11 @@
{
context->z->print_report(RS_WARNING, L"Warning 21: Some instance has been finished more times\n");
}
+
+ if(context->future_top_time_relations.size() > 0 || context->future_bottom_time_relations.size() > 0)
+ {
+ context->z->print_report(RS_WARNING, L"Warning 24: Some time information points to non-existed reference node\n");
+ }
s_Msc** result = NULL;
@@ -272,6 +284,12 @@
context->z->print_report(RS_ERROR, TOWSTRING(report));
}
+void add_time_fun(struct Context* context, char* time)
+{
+ context->time = time;
+}
+
+
/*
* Create new BMsc structure
*/
@@ -372,12 +390,10 @@
//if event is named, it adds event to named_events
if(context->event_name != "")
{
- CoregionEventPtr event1 = boost::dynamic_pointer_cast<CoregionEvent>(event);
- if(event1 != NULL){
- context->named_events.insert(std::make_pair(context->event_name, event1));
- }
+ context->named_events.insert(std::make_pair(context->event_name, event));
}
-
+
+ create_future_time_relations(context);
context->event_name = "";
}
@@ -558,12 +574,10 @@
//if event is named, it adds event to named_events
if(context->event_name != "")
{
- CoregionEventPtr event1 = boost::dynamic_pointer_cast<CoregionEvent>(event);
- if(event1 != NULL){
- context->named_events.insert(std::make_pair(context->event_name, event1));
- }
+ context->named_events.insert(std::make_pair(context->event_name, event));
}
-
+
+ create_future_time_relations(context);
context->event_name = "";
}
@@ -580,7 +594,7 @@
}
std::set<std::string>::iterator it;
- std::map<std::string, CoregionEventPtr>::iterator named_event_it;
+ std::map<std::string, EventPtr>::iterator named_event_it;
CoregionEventPtr event = boost::dynamic_pointer_cast<CoregionEvent>(context->current_event);
if(event == NULL){
context->z->print_report(RS_ERROR, L"Internal Error 13: Typecast failed\n");
@@ -588,12 +602,20 @@
}
for(it = context->order_events.begin(); it != context->order_events.end(); ++it){
if((named_event_it = context->named_events.find(*it)) != context->named_events.end()){
- if(kind == before){
- event->add_successor(named_event_it->second.get());
+
+ CoregionEventPtr event1 = boost::dynamic_pointer_cast<CoregionEvent>(named_event_it->second);
+
+ if(event1 != NULL)
+ {
+ if(kind == before)
+ {
+ event->add_successor(event1.get());
+ }
+ else
+ {
+ event1->add_successor(event.get());
+ }
}
- else{
- named_event_it->second->add_successor(event.get());
- }
}
else{
InstancePtr instance = context->instances.find(context->element_name)->second;
@@ -601,6 +623,7 @@
EventPtr event1 = instance->get_last()->add_event();
CoregionEventPtr event2 = boost::dynamic_pointer_cast<CoregionEvent>(event1);
context->future_events.insert(std::make_pair(*it, event2));
+
if(kind == before){
event->add_successor(event2.get());
}
@@ -646,7 +669,59 @@
context->open_instance--;
}
+void add_time_relation_event_fun(struct Context* context)
+{
+ MscTimeIntervalSet<double> interval (context->time);
+ TimeRelationEventPtr relation = new TimeRelationEvent(interval);
+
+ std::map<std::string, EventPtr>::iterator named_events_it = context->named_events.find(context->time_event_name);
+
+ if(named_events_it != context->named_events.end())
+ {
+ relation->glue_events(context->current_event.get(), named_events_it->second.get());
+ }
+ else
+ {
+ relation->glue_event_a(context->current_event.get());
+
+ std::map<std::string, std::set<TimeRelationEventPtr> >::iterator it = context->future_time_events.find(context->time_event_name);
+
+ if(it != context->future_time_events.end())
+ {
+ it->second.insert(relation);
+ }
+ else
+ {
+ std::set<TimeRelationEventPtr> my_set;
+ my_set.insert(relation);
+ context->future_time_events.insert(std::make_pair(context->time_event_name, my_set));
+ }
+ }
+}
+
/*
+ * Set name of event which is in time relation with the event
+ */
+void set_time_reference_event_fun(struct Context* context, char* name)
+{
+ context->time_event_name = name;
+}
+
+void create_future_time_relations(struct Context* context)
+{
+ std::map<std::string, std::set<TimeRelationEventPtr> >::iterator it = context->future_time_events.find(context->event_name);
+ std::set<TimeRelationEventPtr>::iterator set_it;
+
+ if(it != context->future_time_events.end())
+ {
+ for(set_it = it->second.begin(); set_it != it->second.end(); ++set_it)
+ {
+ (*set_it)->glue_event_b(context->current_event.get());
+ }
+ }
+}
+
+/*
* FUNCTIONS FOR HMSC
*/
@@ -674,17 +749,10 @@
*/
void new_end_node_fun(struct Context* context)
{
-// if (context->connect_name.size() == 0)
-// {
EndNodePtr node = new EndNode();
context->myHmsc->add_node(node);
context->end_node = std::make_pair(context->element_name, node);
create_future_connections_fun(context, node.get());
-// }
-// else
-// {
-// context->z->print_report(RS_WARNING, L"Warning 14: There is node which is successor of end node\n");
-// }
}
/*
@@ -726,10 +794,11 @@
{
std::map<std::string, HMscNodePtr>::iterator it = context->hmsc_nodes.find(context->element_name);
std::multimap<std::string, MscPtr>::iterator msc_it = context->mscs.find(context->reference_name);
+ ReferenceNodePtr node = NULL;
if (it == context->hmsc_nodes.end())
{
- ReferenceNodePtr node = new ReferenceNode();
+ node = new ReferenceNode();
std::multimap<std::string, MscPtr>::iterator msc_it = context->mscs.find(context->reference_name);
if(msc_it == context->mscs.end())
@@ -760,13 +829,43 @@
context->hmsc_nodes.insert(make_pair(context->element_name, node));
context->myHmsc->add_node(node);
- future_connection_fill_in_fun(context);
- create_future_connections_fun(context, node.get());
+ context->current_node = node;
+ context->node_type = reference;
+
+ std::map<std::string, std::set<TimeRelationRefNodePtr> >::iterator top_it;
+ std::map<std::string, std::set<TimeRelationRefNodePtr> >::iterator bottom_it;
+
+ top_it = context->future_top_time_relations.find(context->element_name);
+ bottom_it = context->future_bottom_time_relations.find(context->element_name);
+
+ if(top_it != context->future_top_time_relations.end())
+ {
+ std::set<TimeRelationRefNodePtr>::iterator set_it;
+
+ for(set_it = top_it->second.begin(); set_it != top_it->second.end(); ++set_it)
+ {
+ (*set_it)->glue_ref_node_b(false, node.get());
+ }
+
+ context->future_top_time_relations.erase(top_it);
+ }
+
+ if(bottom_it != context->future_bottom_time_relations.end())
+ {
+ std::set<TimeRelationRefNodePtr>::iterator set_it;
+
+ for(set_it = bottom_it->second.begin(); set_it != bottom_it->second.end(); ++set_it)
+ {
+ (*set_it)->glue_ref_node_b(true, node.get());
+ }
+
+ context->future_bottom_time_relations.erase(top_it);
+ }
}
else
{
context->z->print_report(RS_WARNING, stringize() << "Warning 15: The node " << TOWSTRING(context->element_name) << " has been created\n");
- context->connect_name.clear();
+ context->not_connect = 1;
}
}
@@ -782,15 +881,14 @@
ConnectionNodePtr node = new ConnectionNode();
context->hmsc_nodes.insert(std::make_pair(context->element_name, node));
context->myHmsc->add_node(node);
- future_connection_fill_in_fun(context);
- create_future_connections_fun(context, node.get());
+ context->current_node = node;
+ context->node_type = connection;
}
else
{
context->z->print_report(RS_WARNING, stringize() << "Warning 15: The node " << TOWSTRING(context->element_name) << " has been created\n");
- context->connect_name.clear();
+ context->not_connect = 1;
}
- context->node_type = 0;
}
/*
@@ -805,17 +903,47 @@
ConditionNodePtr node = new ConditionNode(TOWSTRING(context->condition_name));
context->hmsc_nodes.insert(std::make_pair(context->element_name, node));
context->myHmsc->add_node(node);
- future_connection_fill_in_fun(context);
- create_future_connections_fun(context, node.get());
+ context->current_node = node;
+ context->node_type = condition;
}
else
{
context->z->print_report(RS_WARNING, stringize() << "Warning 15: The node " << TOWSTRING(context->element_name) << " has been created\n");
- context->connect_name.clear();
+ context->not_connect = 1;
}
- context->node_type = 0;
}
+void create_connections_fun(struct Context* context)
+{
+ if(context->not_connect == 1)
+ {
+ context->connect_name.clear();
+ return ;
+ }
+
+ future_connection_fill_in_fun(context);
+
+ if(context->node_type == reference)
+ {
+ ReferenceNodePtr node = boost::dynamic_pointer_cast<ReferenceNode>(context->current_node);
+ create_future_connections_fun(context, node.get());
+ }
+
+ if(context->node_type == connection)
+ {
+ ConnectionNodePtr node = boost::dynamic_pointer_cast<ConnectionNode>(context->current_node);
+ create_future_connections_fun(context, node.get());
+ }
+
+ if(context->node_type == condition)
+ {
+ ConditionNodePtr node = boost::dynamic_pointer_cast<ConditionNode>(context->current_node);
+ create_future_connections_fun(context, node.get());
+ }
+
+ context->connect_name.clear();
+}
+
/*
* Create connections among curently created node and existed nodes or create record in future_connections
*/
@@ -864,7 +992,7 @@
if (context->connect_name.front() == context->end_node.first)
{
node->add_successor(context->end_node.second.get());
- context->connect_name.pop_front();
+ context->connect_name.pop_front();
}
}
}
@@ -902,29 +1030,106 @@
}
/*
- * Set flag node_type to 1;
+ * Set time_relation_type to define where the time interval should be connected
*/
-void set_connection_node_fun(struct Context* context)
+void set_time_ref_relation_type_fun(struct Context* context, enum time_relation_kind time_relation_type)
{
- context->node_type = 1;
+ context->time_relation_type = time_relation_type;
}
/*
- * Set flag node_type to 2;
+ * Set time_ to define where the time interval should be connected
*/
-void set_condition_node_fun(struct Context* context)
+void set_time_reference_node_fun(struct Context* context, char* name)
{
- context->node_type = 2;
+ context->time_node_name = name;
}
/*
- * Return flag node_type
+ * Set time interval from top to bottom on the same node
*/
-int get_node_type_fun(struct Context* context)
+void add_time_relation_ref_time_fun(struct Context* context)
{
- return context->node_type;
+ MscTimeIntervalSet<double> interval (context->time);
+ TimeRelationRefNodePtr relation = new TimeRelationRefNode(interval);
+
+ ReferenceNodePtr node = boost::dynamic_pointer_cast<ReferenceNode>(context->current_node);
+
+ if(node != NULL)
+ {
+ relation->glue_ref_nodes(false, node.get(), true, node.get());
+ }
}
+/*
+ * Set time interval between current node and another node.
+ *
+ * Kind defines where the time interval is defined on the current node
+ * context->time_relation_type defines where the time interval is defined on the other node.
+ */
+void add_time_relation_ref_fun(struct Context* context, enum time_relation_kind kind)
+{
+ MscTimeIntervalSet<double> interval (context->time);
+ TimeRelationRefNodePtr relation = new TimeRelationRefNode(interval);
+
+ std::map<std::string, HMscNodePtr>::iterator ref_it;
+ ReferenceNodePtr node;
+ std::set<TimeRelationRefNodePtr> my_set;
+
+ ref_it = context->hmsc_nodes.find(context->time_node_name);
+ node = boost::dynamic_pointer_cast<ReferenceNode>(context->current_node);
+
+ if(node == NULL)
+ {
+ context->z->print_report(RS_ERROR, L"Warning 23: Time information can be defined only to a reference node\n");
+ return ;
+ }
+
+ if(ref_it != context->hmsc_nodes.end())
+ {
+ ReferenceNodePtr node2 = boost::dynamic_pointer_cast<ReferenceNode>(ref_it->second);
+ if(node == NULL)
+ {
+ context->z->print_report(RS_ERROR, L"Warning 23: Time information can be defined only to a reference node\n");
+ return ;
+ }
+
+ relation->glue_ref_nodes(kind, node.get(), context->time_relation_type, node2.get());
+ }
+ else
+ {
+ if(context->time_relation_type == top)
+ {
+ std::map<std::string, std::set<TimeRelationRefNodePtr> >::iterator top_it;
+ top_it = context->future_top_time_relations.find(context->time_node_name);
+
+ if(top_it == context->future_top_time_relations.end())
+ {
+ my_set.insert(relation);
+ context->future_top_time_relations.insert(std::make_pair(context->time_node_name, my_set));
+ }
+ else
+ {
+ top_it->second.insert(relation);
+ }
+ }
+ else{
+ std::map<std::string, std::set<TimeRelationRefNodePtr> >::iterator bottom_it;
+ bottom_it = context->future_bottom_time_relations.find(context->time_node_name);
+
+ if(bottom_it == context->future_bottom_time_relations.end())
+ {
+ my_set.insert(relation);
+ context->future_bottom_time_relations.insert(std::make_pair(context->time_node_name, my_set));
+ }
+ else
+ {
+ bottom_it->second.insert(relation);
+ }
+ }
+ }
+}
+
#endif
// $Id$
Modified: trunk/src/data/Z120/Context.h
===================================================================
--- trunk/src/data/Z120/Context.h 2009-10-01 20:28:42 UTC (rev 391)
+++ trunk/src/data/Z120/Context.h 2009-10-02 16:03:11 UTC (rev 392)
@@ -34,6 +34,7 @@
enum msg_kind {output, input};
enum relation_kind {before, after};
+enum time_relation_kind {top, bottom};
void my_print(char* a);
@@ -57,6 +58,8 @@
void bug_report_fun(struct Context* context, char* report);
+void add_time_fun(struct Context* context, char* time);
+
//BMsc
void new_bmsc_fun(struct Context* context);
@@ -84,6 +87,12 @@
void end_instance_fun(struct Context* context);
+void add_time_relation_event_fun(struct Context* context);
+
+void set_time_reference_event_fun(struct Context* context, char* name);
+
+void create_future_time_relations(struct Context* context);
+
//HMsc
void new_hmsc_fun(struct Context* context);
@@ -105,14 +114,18 @@
void new_condition_node_fun(struct Context* context);
+void create_connections_fun(struct Context* context);
+
void future_connection_fill_in_fun(struct Context* context);
-void set_connection_node_fun(struct Context* context);
+void set_time_ref_relation_type_fun(struct Context* context, enum time_relation_kind time_relation_type);
-void set_condition_node_fun(struct Context* context);
+void set_time_reference_node_fun(struct Context* context, char* name);
-int get_node_type_fun(struct Context* context);
+void add_time_relation_ref_time_fun(struct Context* context);
+void add_time_relation_ref_fun(struct Context* context, enum time_relation_kind kind);
+
#ifdef __cplusplus
}
#endif
Modified: trunk/src/data/Z120/Context_Impl.h
===================================================================
--- trunk/src/data/Z120/Context_Impl.h 2009-10-01 20:28:42 UTC (rev 391)
+++ trunk/src/data/Z120/Context_Impl.h 2009-10-02 16:03:11 UTC (rev 392)
@@ -34,6 +34,8 @@
#include "data/msc.h"
#include "z120.h"
+enum hmsc_node_type {reference, connection, condition};
+
struct Context
{
std::string msc_name;
@@ -55,6 +57,12 @@
Z120* z;
/*
+ * Time interval
+ */
+ std::string interval_label;
+ std::string time;
+
+ /*
* BMsc
*/
BMscPtr myBmsc;
@@ -63,13 +71,15 @@
std::map<std::string, InstancePtr> instances; // map of instances (key: name of instance, value: smart pointer to instance)
std::multimap<std::string, CompleteMessagePtr> messages; // map of future complete messages
std::map<std::string, EventPtr> future_events; // map of name of events on which was pointed before they were created
- std::map<std::string, CoregionEventPtr> named_events; // map of name of events
+ std::map<std::string, std::set<TimeRelationEventPtr> > future_time_events; // map of name of events on which was created time relation before they were created
+ std::map<std::string, EventPtr> named_events; // map of name of events
std::set<std::string> order_events; //set of name of events which takes place after keywords 'before', 'after'
EventPtr current_event; //event which was currently created
std::string event_name; //name of event
+ std::string time_event_name; //name of event on which points a reference in the time relation
int not_create_event; //flag for event in case msc has two labeled event with the same name
int no_message_label; //flag for message which does not have label
- int open_instance; //counter of open instances
+ int open_instance; //counter of open instances
/*
* HMsc
@@ -79,11 +89,20 @@
std::pair<std::string, EndNodePtr> end_node;
std::list<std::string> connect_name; // name of HMsc nodes which are successors of actual node
std::string reference_name;
+
std::string condition_name;
+ HMscNodePtr current_node;
+
std::map<std::string, HMscNodePtr> hmsc_nodes; // map of hmsc nodes (key: name of node, value: smart pointer to node)
std::map<std::string, std::set<std::string> > future_connections; // map of nodes to which node will be connected
- int node_type; //flag to recognize HMsc nodes (ConnectionNode, ReferenceNode, ConditionNode). Used in Z120.g
+ std::map<std::string, std::set<TimeRelationRefNodePtr> > future_top_time_relations;
+ std::map<std::string, std::set<TimeRelationRefNodePtr> > future_bottom_time_relations;
+ enum hmsc_node_type node_type; //flag to recognize HMsc nodes (ConnectionNode, ReferenceNode, ConditionNode).
+ enum time_relation_kind time_relation_type;
+ std::string time_node_name;
+ int not_connect;
+
~Context() {}
};
Modified: trunk/src/data/Z120/Z120.g
===================================================================
--- trunk/src/data/Z120/Z120.g 2009-10-01 20:28:42 UTC (rev 391)
+++ trunk/src/data/Z120/Z120.g 2009-10-02 16:03:11 UTC (rev 392)
@@ -129,7 +129,7 @@
;
non_par_non_escape:
-Character_String | NAME {bug_report_fun(context, "Warning: The file is breaking the ITU-T Z120 standard");}
+Character_String | NAME //{bug_report_fun(context, "Warning: The file is breaking the ITU-T Z120 standard");}
;
non_nestable_par:
@@ -413,7 +413,10 @@
{
add_relation_fun(context, after);
})? end
- ('time' time_dest_list end)?
+ ('time' time_dest_list end
+ {
+ add_time_relation_event_fun(context);
+ })?
{
set_not_create_event_fun(context);
@@ -425,12 +428,16 @@
;
time_dest_list:
-// (time_dest ('origin')?)?
+ (time_dest ('origin')?)?
time_interval (',' time_dest_list)?
;
time_dest:
- NAME | ('top' | 'bottom') (reference_identification | NAME)
+ NAME {set_time_reference_event_fun(context, (char*) $NAME.text->chars);}
+ |
+ ('top' { set_time_ref_relation_type_fun(context, top); }
+ | 'bottom' { set_time_ref_relation_type_fun(context, bottom); })
+ (reference_identification | NAME { set_time_reference_node_fun(context, (char*) $NAME.text->chars);} )
;
non_orderable_event:
@@ -1085,7 +1092,15 @@
// ----- Time Interval
time_interval:
- (interval_label)? ( (('@')? ('(' | '[') (time_point)? ',')=> bounded_time (measurement)? | singular_time )
+ (interval_label)?
+ ( (('@')? ('(' | '[') (time_point)? ',')=> bounded_time
+ {
+ add_time_fun(context, (char*) $bounded_time.text->chars);
+ } (measurement)?
+ | singular_time
+ {
+ add_time_fun(context, (char*) $singular_time.text->chars);
+ })
;
/*
@@ -1433,21 +1448,7 @@
}
':' intermediate_node_type connection_list end
{
- switch (get_node_type_fun(context))
- {
- case 0:
- new_reference_node_fun(context);
- break;
- case 1:
- new_connection_node_fun(context);
- break;
- case 2:
- new_condition_node_fun(context);
- break;
- default:
- bug_report_fun(context, "Internal Error 16: There is no node to create\n");
- }
-
+ create_connections_fun(context);
}
;
@@ -1458,11 +1459,11 @@
untimeable_node:
hmsc_connection_node
{
- set_connection_node_fun(context);
+ new_connection_node_fun(context);
}
| hmsc_condition_node
{
- set_condition_node_fun(context);
+ new_condition_node_fun(context);
}
;
@@ -1470,7 +1471,7 @@
start {new_start_node_fun(context);}
(node_expression
- | (NAME ':' {bug_report_fun(context, "Warning: The file is breaking the ITU-T Z120 standard");})?
+ | (NAME ':'/* {bug_report_fun(context, "Warning: The file is breaking the ITU-T Z120 standard");}*/)?
text_definition)* // add NAME ':' out of standart Z120_1999
;
@@ -1481,25 +1482,12 @@
node_expression:
NAME
{
- set_node_name_fun(context, (char*) ($NAME.text->chars));
+ set_node_name_fun(context, (char*) ($NAME.text->chars));
}
- ':' (node 'seq' '('label_name_list')'
+ ':' (node 'seq' '('label_name_list')'
{
- switch (get_node_type_fun(context))
- {
- case 0:
- new_reference_node_fun(context);
- break;
- case 1:
- new_connection_node_fun(context);
- break;
- case 2:
- new_condition_node_fun(context);
- break;
- default:
- bug_report_fun(context, "Internal Error 16: There is no node to create\n");
- }
- }
+ create_connections_fun(context);
+ }
| 'end'
{
new_end_node_fun(context);
@@ -1516,10 +1504,10 @@
;
node:
- '(' msc_ref_expr ')' (time_interval)? //reference node
+ '(' msc_ref_expr ')' (time_interval)? { new_reference_node_fun(context); }//reference node
| par_expression (time_interval)?
- | condition_identification {set_condition_node_fun(context);}
- | 'connect' {set_connection_node_fun(context);}
+ | condition_identification {new_condition_node_fun(context);}
+ | 'connect' {new_connection_node_fun(context);}
;
par_expression:
@@ -1535,10 +1523,10 @@
;
timeable_node:
- (hmsc_ref_expr_node | hmsc_expression)
- ('time' time_interval end)?
- ('top' time_dest_list end)?
- ('bottom' time_dest_list end)?
+ (hmsc_ref_expr_node { new_reference_node_fun(context); } | hmsc_expression)
+ ('time' time_interval end { add_time_relation_ref_time_fun(context); })?
+ ('top' time_dest_list end { add_time_relation_ref_fun(context, top); })?
+ ('bottom' time_dest_list end { add_time_relation_ref_fun(context, bottom); })?
;
hmsc_ref_expr_node:
Modified: trunk/tests/z120_test/CMakeLists.txt
===================================================================
--- trunk/tests/z120_test/CMakeLists.txt 2009-10-01 20:28:42 UTC (rev 391)
+++ trunk/tests/z120_test/CMakeLists.txt 2009-10-02 16:03:11 UTC (rev 392)
@@ -88,6 +88,10 @@
ADD_Z120_TEST(z120_test65.mpr 1)
ADD_Z120_TEST(z120_time01.mpr 1)
+ADD_Z120_TEST(z120_time02.mpr 1)
+ADD_Z120_TEST(z120_time03.mpr 1)
+ADD_Z120_TEST(z120_time04.mpr 1)
+ADD_Z120_TEST(z120_time05.mpr 1)
# $Id$
Modified: trunk/tests/z120_test/z120_test01.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test01.mpr.result 2009-10-01 20:28:42 UTC (rev 391)
+++ trunk/tests/z120_test/z120_test01.mpr.result 2009-10-02 16:03:11 UTC (rev 392)
@@ -1,11 +1,3 @@
-Warning: The file is breaking the ITU-T Z120 standard
-Warning: The file is breaking the ITU-T Z120 standard
-Warning: The file is breaking the ITU-T Z120 standard
-Warning: The file is breaking the ITU-T Z120 standard
-Warning: The file is breaking the ITU-T Z120 standard
-Warning: The file is breaking the ITU-T Z120 standard
-Warning: The file is breaking the ITU-T Z120 standard
-Warning: The file is breaking the ITU-T Z120 standard
Warning 20: Msc has not finished 1 instance
OK: z120_test01 is correct, should be correct
Modified: trunk/tests/z120_test/z120_test02.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test02.mpr.result 2009-10-01 20:28:42 UTC (rev 391)
+++ trunk/tests/z120_test/z120_test02.mpr.result 2009-10-02 16:03:11 UTC (rev 392)
@@ -1,4 +1,3 @@
-Warning: The file is breaking the ITU-T Z120 standard
Warning 09: There is reference to nonexisted MSC
OK: z120_test02 is correct, should be correct
Modified: trunk/tests/z120_test/z120_time01.mpr
===================================================================
--- trunk/tests/z120_test/z120_time01.mpr 2009-10-01 20:28:42 UTC (rev 391)
+++ trunk/tests/z120_test/z120_time01.mpr 2009-10-02 16:03:11 UTC (rev 392)
@@ -25,7 +25,7 @@
concurrent;
label e2;
in NAME,0 from P1 before e3;
-time e4 12;
+time e4 [12];
label e3;
in NAME,1 from P1;
endconcurrent;
Modified: trunk/tests/z120_test/z120_time01.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_time01.mpr.result 2009-10-01 20:28:42 UTC (rev 391)
+++ trunk/tests/z120_test/z120_time01.mpr.result 2009-10-02 16:03:11 UTC (rev 392)
@@ -6,8 +6,8 @@
L0: connect L1, L2;
L1: reference Subprocess connect L3;
L2: reference Subprocess time [1,2);
-top bottom L1 (1,10);
-connect L1;
+ top bottom L1 (1,10);
+ connect L1;
L3: final;
endmsc;
msc Subprocess;
@@ -25,7 +25,7 @@
concurrent;
label e2;
in NAME,0 from P1 before e3;
-time e4 12;
+time e4 [12];
label e3;
in NAME,1 from P1;
endconcurrent;
Added: trunk/tests/z120_test/z120_time02.mpr
===================================================================
--- trunk/tests/z120_test/z120_time02.mpr (rev 0)
+++ trunk/tests/z120_test/z120_time02.mpr 2009-10-02 16:03:11 UTC (rev 392)
@@ -0,0 +1,34 @@
+/* Basic time constraints in both MSC and HMSC
+ */
+mscdocument z120_time01;
+msc Main;
+initial connect L0;
+L0: connect L1, L2;
+L1: reference Subprocess connect L3;
+L2: reference Subprocess time (1,2);
+top L1 (1,10);connect L1;
+L3: final;
+endmsc;
+msc Subprocess;
+inst P1;
+inst P2;
+P1: instance;
+out NAME,0 to P2;
+label e0;
+out NAME,1 to P2;
+time e1 [7];
+label e1;
+in NAME,2 from P2;
+endinstance;
+P2: instance;
+concurrent;
+label e2;
+in NAME,0 from P1 before e3;
+time e4 [12];
+label e3;
+in NAME,1 from P1;
+endconcurrent;
+label e4;
+out NAME,2 to P1;
+endinstance;
+endmsc;
Added: trunk/tests/z120_test/z120_time02.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_time02.mpr.result (rev 0)
+++ trunk/tests/z120_test/z120_time02.mpr.result 2009-10-02 16:03:11 UTC (rev 392)
@@ -0,0 +1,28 @@
+OK: z120_time02 is correct, should be correct
+
+mscdocument z120_time02;
+msc Main;
+initial connect L0;
+L0: connect L1, L2;
+L1: reference Subprocess connect L3;
+L2: reference Subprocesstime (1,10);
+ connect L1;
+L3: final;
+endmsc;
+msc Subprocess;
+inst P1;
+inst P2;
+P1: instance;
+out NAME,0 to P2;
+out NAME,1 to P2;
+in NAME,2 from P2;
+endinstance;
+P2: instance;
+concurrent;
+in NAME,0 from P1 before e0;
+label e0;
+in NAME,1 from P1;
+endconcurrent;
+out NAME,2 to P1;
+endinstance;
+endmsc;
Added: trunk/tests/z120_test/z120_time03.mpr
===================================================================
--- trunk/tests/z120_test/z120_time03.mpr (rev 0)
+++ trunk/tests/z120_test/z120_time03.mpr 2009-10-02 16:03:11 UTC (rev 392)
@@ -0,0 +1,35 @@
+/* Basic time constraints in both MSC and HMSC
+ */
+mscdocument z120_time01;
+msc Main;
+initial connect L0;
+L0: connect L1, L2;
+L1: reference Subprocess connect L3;
+L2: reference Subprocess time [1,2);
+top top L1 (1,10);
+connect L1;
+L3: final;
+endmsc;
+msc Subprocess;
+inst P1;
+inst P2;
+P1: instance;
+out NAME,0 to P2;
+label e0;
+out NAME,1 to P2;
+time e1 [7];
+label e1;
+in NAME,2 from P2;
+endinstance;
+P2: instance;
+concurrent;
+label e2;
+in NAME,0 from P1 before e3;
+time e4 [12];
+label e3;
+in NAME,1 from P1;
+endconcurrent;
+label e4;
+out NAME,2 to P1;
+endinstance;
+endmsc;
Added: trunk/tests/z120_test/z120_time03.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_time03.mpr.result (rev 0)
+++ trunk/tests/z120_test/z120_time03.mpr.result 2009-10-02 16:03:11 UTC (rev 392)
@@ -0,0 +1,35 @@
+OK: z120_time03 is correct, should be correct
+
+mscdocument z120_time03;
+msc Main;
+initial connect L0;
+L0: connect L1, L2;
+L1: reference Subprocess connect L3;
+L2: reference Subprocess time [1,2);
+ top top L1 (1,10);
+ connect L1;
+L3: final;
+endmsc;
+msc Subprocess;
+inst P1;
+inst P2;
+P1: instance;
+out NAME,0 to P2;
+label e0;
+out NAME,1 to P2;
+time e1 [7];
+label e1;
+in NAME,2 from P2;
+endinstance;
+P2: instance;
+concurrent;
+label e2;
+in NAME,0 from P1 before e3;
+time e4 [12];
+label e3;
+in NAME,1 from P1;
+endconcurrent;
+label e4;
+out NAME,2 to P1;
+endinstance;
+endmsc;
Added: trunk/tests/z120_test/z120_time04.mpr
===================================================================
--- trunk/tests/z120_test/z120_time04.mpr (rev 0)
+++ trunk/tests/z120_test/z120_time04.mpr 2009-10-02 16:03:11 UTC (rev 392)
@@ -0,0 +1,35 @@
+/* Basic time constraints in both MSC and HMSC
+ */
+mscdocument z120_time01;
+msc Main;
+initial connect L0;
+L0: connect L1, L2;
+L1: reference Subprocess connect L3;
+L2: reference Subprocess time [1,2);
+bottom top L1 (1,10);
+connect L1;
+L3: final;
+endmsc;
+msc Subprocess;
+inst P1;
+inst P2;
+P1: instance;
+out NAME,0 to P2;
+label e0;
+out NAME,1 to P2;
+time e1 [7];
+label e1;
+in NAME,2 from P2;
+endinstance;
+P2: instance;
+concurrent;
+label e2;
+in NAME,0 from P1 before e3;
+time e4 [12];
+label e3;
+in NAME,1 from P1;
+endconcurrent;
+label e4;
+out NAME,2 to P1;
+endinstance;
+endmsc;
Added: trunk/tests/z120_test/z120_time04.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_time04.mpr.result (rev 0)
+++ trunk/tests/z120_test/z120_time04.mpr.result 2009-10-02 16:03:11 UTC (rev 392)
@@ -0,0 +1,35 @@
+OK: z120_time04 is correct, should be correct
+
+mscdocument z120_time04;
+msc Main;
+initial connect L0;
+L0: connect L1, L2;
+L1: reference Subprocess connect L3;
+L2: reference Subprocess time [1,2);
+ bottom top L1 (1,10);
+ connect L1;
+L3: final;
+endmsc;
+msc Subprocess;
+inst P1;
+inst P2;
+P1: instance;
+out NAME,0 to P2;
+label e0;
+out NAME,1 to P2;
+time e1 [7];
+label e1;
+in NAME,2 from P2;
+endinstance;
+P2: instance;
+concurrent;
+label e2;
+in NAME,0 from P1 before e3;
+time e4 [12];
+label e3;
+in NAME,1 from P1;
+endconcurrent;
+label e4;
+out NAME,2 to P1;
+endinstance;
+endmsc;
Added: trunk/tests/z120_test/z120_time05.mpr
===================================================================
--- trunk/tests/z120_test/z120_time05.mpr (rev 0)
+++ trunk/tests/z120_test/z120_time05.mpr 2009-10-02 16:03:11 UTC (rev 392)
@@ -0,0 +1,35 @@
+/* Basic time constraints in both MSC and HMSC
+ */
+mscdocument z120_time01;
+msc Main;
+initial connect L0;
+L0: connect L1, L2;
+L1: reference Subprocess connect L3;
+L2: reference Subprocess time [1,2);
+bottom bottom L1 (1,10);
+connect L1;
+L3: final;
+endmsc;
+msc Subprocess;
+inst P1;
+inst P2;
+P1: instance;
+out NAME,0 to P2;
+label e0;
+out NAME,1 to P2;
+time e1 [7];
+label e1;
+in NAME,2 from P2;
+endinstance;
+P2: instance;
+concurrent;
+label e2;
+in NAME,0 from P1 before e3;
+time e4 [12];
+label e3;
+in NAME,1 from P1;
+endconcurrent;
+label e4;
+out NAME,2 to P1;
+endinstance;
+endmsc;
Added: trunk/tests/z120_test/z120_time05.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_time05.mpr.result (rev 0)
+++ trunk/tests/z120_test/z120_time05.mpr.result 2009-10-02 16:03:11 UTC (rev 392)
@@ -0,0 +1,35 @@
+OK: z120_time05 is correct, should be correct
+
+mscdocument z120_time05;
+msc Main;
+initial connect L0;
+L0: connect L1, L2;
+L1: reference Subprocess connect L3;
+L2: reference Subprocess time [1,2);
+ bottom bottom L1 (1,10);
+ connect L1;
+L3: final;
+endmsc;
+msc Subprocess;
+inst P1;
+inst P2;
+P1: instance;
+out NAME,0 to P2;
+label e0;
+out NAME,1 to P2;
+time e1 [7];
+label e1;
+in NAME,2 from P2;
+endinstance;
+P2: instance;
+concurrent;
+label e2;
+in NAME,0 from P1 before e3;
+time e4 [12];
+label e3;
+in NAME,1 from P1;
+endconcurrent;
+label e4;
+out NAME,2 to P1;
+endinstance;
+endmsc;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|