|
From: <ma...@us...> - 2010-03-01 21:46:05
|
Revision: 642
http://scstudio.svn.sourceforge.net/scstudio/?rev=642&view=rev
Author: madzin
Date: 2010-03-01 21:45:55 +0000 (Mon, 01 Mar 2010)
Log Message:
-----------
Parser modification in condition node.
Modified Paths:
--------------
trunk/src/data/Z120/Context.cpp
trunk/src/data/Z120/Context.h
trunk/src/data/Z120/Z120.g
trunk/tests/z120_test/z120_test22.mpr.result
trunk/tests/z120_test/z120_test52.mpr.result
Modified: trunk/src/data/Z120/Context.cpp
===================================================================
--- trunk/src/data/Z120/Context.cpp 2010-03-01 20:25:30 UTC (rev 641)
+++ trunk/src/data/Z120/Context.cpp 2010-03-01 21:45:55 UTC (rev 642)
@@ -1039,9 +1039,14 @@
*/
void set_condition_name_fun(struct Context* context, char* name)
{
- context->condition_name = name;
+ context->condition_name += name;
}
+void clear_condition_name_fun(struct Context* context)
+{
+ context->condition_name = "";
+}
+
/*
* Set name of node
*/
Modified: trunk/src/data/Z120/Context.h
===================================================================
--- trunk/src/data/Z120/Context.h 2010-03-01 20:25:30 UTC (rev 641)
+++ trunk/src/data/Z120/Context.h 2010-03-01 21:45:55 UTC (rev 642)
@@ -123,6 +123,8 @@
void set_condition_name_fun(struct Context* context, char* name);
+void clear_condition_name_fun(struct Context* context);
+
void set_node_name_fun(struct Context* context, char* name);
void add_connect_name_fun(struct Context* context, char* name);
Modified: trunk/src/data/Z120/Z120.g
===================================================================
--- trunk/src/data/Z120/Z120.g 2010-03-01 20:25:30 UTC (rev 641)
+++ trunk/src/data/Z120/Z120.g 2010-03-01 21:45:55 UTC (rev 642)
@@ -773,16 +773,23 @@
;
condition_identification:
+ { clear_condition_name_fun(context); }
'condition' condition_text
- { set_condition_name_fun(context, (char*) $condition_text.text->chars); }
;
condition_text:
- condition_name_list
- | 'when' (condition_name_list | '(' expression ')')
- | 'otherwise'
+ condition_name_list { set_condition_name_fun(context, (char*) $condition_name_list.text->chars); }
+
+ | 'when' { set_condition_name_fun(context, "when "); }
+ (condition_name_list { set_condition_name_fun(context, (char*) $condition_name_list.text->chars); }
+ | expr = ( '(' expression ')' ) { set_condition_name_fun(context, (char*) $expr.text->chars); }
+ )
+
+ | 'otherwise' { set_condition_name_fun(context, "otherwise"); }
+
// *** proprietary Z.120 extension
- | 'for' expression '%'
+ | 'for' { set_condition_name_fun(context, "for "); }
+ (a=expression b='%') { set_condition_name_fun(context, (char*) $a.text->chars); set_condition_name_fun(context, (char*) $b.text->chars); }
;
condition_name_list:
Modified: trunk/tests/z120_test/z120_test22.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test22.mpr.result 2010-03-01 20:25:30 UTC (rev 641)
+++ trunk/tests/z120_test/z120_test22.mpr.result 2010-03-01 21:45:55 UTC (rev 642)
@@ -3,7 +3,7 @@
mscdocument z120_test22;
msc setup_attach;
initial connect L0;
-L0: condition disconnected connect L1;
+L0: condition when disconnected connect L1;
L1: connect L2, L3;
L2: reference failure connect L0;
L3: reference connection connect L4;
Modified: trunk/tests/z120_test/z120_test52.mpr.result
===================================================================
--- trunk/tests/z120_test/z120_test52.mpr.result 2010-03-01 20:25:30 UTC (rev 641)
+++ trunk/tests/z120_test/z120_test52.mpr.result 2010-03-01 21:45:55 UTC (rev 642)
@@ -3,6 +3,6 @@
mscdocument z120_test52;
msc One;
initial connect L0;
-L0: condition access_a connect L1;
+L0: condition access, a connect L1;
L1: final;
endmsc;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|