diff options
Diffstat (limited to 'macros/CCodeGeneration/C_IfExpression.sci')
-rw-r--r-- | macros/CCodeGeneration/C_IfExpression.sci | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/macros/CCodeGeneration/C_IfExpression.sci b/macros/CCodeGeneration/C_IfExpression.sci index 48a0538..23be452 100644 --- a/macros/CCodeGeneration/C_IfExpression.sci +++ b/macros/CCodeGeneration/C_IfExpression.sci @@ -1,4 +1,8 @@ +<<<<<<< HEAD +function SharedInfo = C_IfExpression(IfCondArg,NIfCondArg,Op,NOp,ASTIfExpType,FileInfo,SharedInfo) +======= function SharedInfo = C_IfExpression(IfCondArg,NIfCondArg,ASTIfExpType,FileInfo,SharedInfo) +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 // function SharedInfo = C_IfExpression(IfCondArg,NIfCondArg,ASTIfExpType,FileInfo,SharedInfo) // ----------------------------------------------------------------- // //NUT: add description here @@ -19,12 +23,25 @@ function SharedInfo = C_IfExpression(IfCondArg,NIfCondArg,ASTIfExpType,FileInfo, // ------------------------------ // --- Check input arguments. --- // ------------------------------ +<<<<<<< HEAD +SCI2CNInArgCheck(argn(2),7,7); + +//global SCI2CSTACK +//global StackPosition; +//global STACKDEDUG + +// --- 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 +======= 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 +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 // ----------------------- // --- Initialization. --- @@ -37,7 +54,11 @@ CPass1FileName = FileInfo.Funct(nxtscifunnumber).CPass1FileName; // #RNU_RES_B PrintStringInfo(' ',ReportFileName,'file','y'); +<<<<<<< HEAD +PrintStringInfo('***Generating C code***'+ string(NIfCondArg),ReportFileName,'file','y'); +======= PrintStringInfo('***Generating C code***',ReportFileName,'file','y'); +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 // #RNU_RES_E // --------------------------- // --- End Initialization. --- @@ -66,10 +87,30 @@ if SCI2Cstrncmps1size(ASTIfExpType,'else') SharedInfo = C_IfElseBlocks(FileInfo,SharedInfo,'out'); end +<<<<<<< HEAD +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 = CCall+CFunName; if (ASTIfExpType~='else') CCall = CCall+'('+IfCondArg(1)+')'; +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 end PrintStringInfo(' '+CCall,ReportFileName,'file','y'); PrintStringInfo(C_IndentBlanks(SharedInfo.NIndent)+CCall,CPass1FileName,'file','y'); |