From 1fd0dce8d72c4d5869ce5ff4025ac09af603bc0f Mon Sep 17 00:00:00 2001 From: siddhu8990 Date: Wed, 19 Apr 2017 14:57:49 +0530 Subject: Merged Shamik's work --- macros/ASTManagement/_ifthenel_string.sci | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 macros/ASTManagement/_ifthenel_string.sci (limited to 'macros/ASTManagement/_ifthenel_string.sci') diff --git a/macros/ASTManagement/_ifthenel_string.sci b/macros/ASTManagement/_ifthenel_string.sci new file mode 100644 index 00000000..6787a87c --- /dev/null +++ b/macros/ASTManagement/_ifthenel_string.sci @@ -0,0 +1,27 @@ +function txt=%ifthenel_string(I) +//overloading function for "ifthenel" type tlist string function +//this is a node of the AST +//fields: +// expression : "expression" type tlist (the if expression) +// then : list of "equal" type tlist and list('EOL') (the +// then instructions list) +// elseifs : a list of tlists +// else : list of "equal" type tlist and list('EOL') (the +// else instructions list) + txt=['If ' + ' Expression:' + ' '+string(I.expression) + ' If Statements' + ' '+objectlist2string(I.then)] + for e=I.elseifs + txt=[txt; + ' Else If Expression' + ' '+string(e.expression) + ' Else If Statements' + ' '+objectlist2string(e.then)] + end + txt=[txt; + ' Else Statements' + ' '+objectlist2string(I.else) + 'EndIf'] +endfunction -- cgit