diff options
author | jofret | 2009-05-05 13:52:15 +0000 |
---|---|---|
committer | jofret | 2009-05-05 13:52:15 +0000 |
commit | 83c68889eff40411bbef50df0904f3585ed9e2b7 (patch) | |
tree | 16fb9d67c603e867e10f675a6e5fb8c3bb58b41f /macros/ASTManagement/%ifthenel_string.sci | |
parent | b11350b841069ef8db155516a310eb7523c5e183 (diff) | |
download | scilab2c-83c68889eff40411bbef50df0904f3585ed9e2b7.tar.gz scilab2c-83c68889eff40411bbef50df0904f3585ed9e2b7.tar.bz2 scilab2c-83c68889eff40411bbef50df0904f3585ed9e2b7.zip |
Split into several files
Diffstat (limited to 'macros/ASTManagement/%ifthenel_string.sci')
-rw-r--r-- | macros/ASTManagement/%ifthenel_string.sci | 27 |
1 files changed, 27 insertions, 0 deletions
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 |