diff options
author | Sandeep Gupta | 2017-07-05 12:41:25 +0530 |
---|---|---|
committer | Sandeep Gupta | 2017-07-05 12:41:25 +0530 |
commit | 06337f0dc8114c70fd0c7767083971a0d091750a (patch) | |
tree | 446481550ba88e6e0f7df2db7fdc66d2016ee2f1 /macros/CCodeGeneration/C_IfExpression.sci | |
parent | c2e305c3b82ed944d57402dd515b3d5839a31980 (diff) | |
download | scilab2c-06337f0dc8114c70fd0c7767083971a0d091750a.tar.gz scilab2c-06337f0dc8114c70fd0c7767083971a0d091750a.tar.bz2 scilab2c-06337f0dc8114c70fd0c7767083971a0d091750a.zip |
LinearAlgebra and MatrixOperation Update
Diffstat (limited to 'macros/CCodeGeneration/C_IfExpression.sci')
-rw-r--r-- | macros/CCodeGeneration/C_IfExpression.sci | 31 |
1 files changed, 7 insertions, 24 deletions
diff --git a/macros/CCodeGeneration/C_IfExpression.sci b/macros/CCodeGeneration/C_IfExpression.sci index 359b7882..48a05383 100644 --- a/macros/CCodeGeneration/C_IfExpression.sci +++ b/macros/CCodeGeneration/C_IfExpression.sci @@ -1,4 +1,4 @@ -function SharedInfo = C_IfExpression(IfCondArg,NIfCondArg,Op,NOp,ASTIfExpType,FileInfo,SharedInfo) +function SharedInfo = C_IfExpression(IfCondArg,NIfCondArg,ASTIfExpType,FileInfo,SharedInfo) // function SharedInfo = C_IfExpression(IfCondArg,NIfCondArg,ASTIfExpType,FileInfo,SharedInfo) // ----------------------------------------------------------------- // //NUT: add description here @@ -19,16 +19,12 @@ function SharedInfo = C_IfExpression(IfCondArg,NIfCondArg,Op,NOp,ASTIfExpType,Fi // ------------------------------ // --- Check input arguments. --- // ------------------------------ -SCI2CNInArgCheck(argn(2),7,7); - -//global SCI2CSTACK -//global StackPosition; -//global STACKDEDUG +SCI2CNInArgCheck(argn(2),5,5); // --- Check NIfCondArg value. --- -//if ((NIfCondArg ~= 1) & (ASTIfExpType~='else')) - // error(9999, 'Cannot manage ""if/elseif"" with a number of condition variables not equal to 1.'); -//end +if ((NIfCondArg ~= 1) & (ASTIfExpType~='else')) + error(9999, 'Cannot manage ""if/elseif"" with a number of condition variables not equal to 1.'); +end // ----------------------- // --- Initialization. --- @@ -41,7 +37,7 @@ CPass1FileName = FileInfo.Funct(nxtscifunnumber).CPass1FileName; // #RNU_RES_B PrintStringInfo(' ',ReportFileName,'file','y'); -PrintStringInfo('***Generating C code***'+ string(NIfCondArg),ReportFileName,'file','y'); +PrintStringInfo('***Generating C code***',ReportFileName,'file','y'); // #RNU_RES_E // --------------------------- // --- End Initialization. --- @@ -70,23 +66,10 @@ if SCI2Cstrncmps1size(ASTIfExpType,'else') SharedInfo = C_IfElseBlocks(FileInfo,SharedInfo,'out'); end -i=1; -k=1; CCall =''; CCall = CCall+CFunName; if (ASTIfExpType~='else') - CCall = CCall+'('; - while i <= NIfCondArg - CCall = CCall + IfCondArg(i) + ' '; - //d = modulo(i,3); - //PrintStringInfo(' '+string(i)+string(d),'file','y'); - if (modulo(i,3)==0 & i<>NIfCondArg) - CCall = CCall + Op(k) + ' '; - k = k + 1; - end - i = i + 1; - end - CCall = CCall+')'; + CCall = CCall+'('+IfCondArg(1)+')'; end PrintStringInfo(' '+CCall,ReportFileName,'file','y'); PrintStringInfo(C_IndentBlanks(SharedInfo.NIndent)+CCall,CPass1FileName,'file','y'); |