From 5975188ba7090de2d9f646102ab006e1127fd6f8 Mon Sep 17 00:00:00 2001 From: ukashanoor Date: Mon, 19 Jun 2017 10:42:03 +0530 Subject: after if and for --- 2.3-1/macros/CCodeGeneration/C_FinalizeCode.bin | Bin 0 -> 18232 bytes 2.3-1/macros/CCodeGeneration/C_ForExpression.bin | Bin 0 -> 32208 bytes 2.3-1/macros/CCodeGeneration/C_Funcall.bin | Bin 0 -> 73176 bytes 2.3-1/macros/CCodeGeneration/C_GenDeclarations.bin | Bin 0 -> 22004 bytes 2.3-1/macros/CCodeGeneration/C_GenerateFunName.bin | Bin 0 -> 7776 bytes .../CCodeGeneration/C_GenerateLaunchScript.bin | Bin 0 -> 17232 bytes .../macros/CCodeGeneration/C_GenerateMakefile.bin | Bin 0 -> 32632 bytes .../CCodeGeneration/C_GenerateMakefile_msvc.bin | Bin 0 -> 29868 bytes .../CCodeGeneration/C_GenerateSCI2CHeader.bin | Bin 0 -> 1936 bytes 2.3-1/macros/CCodeGeneration/C_IfElseBlocks.bin | Bin 0 -> 8516 bytes 2.3-1/macros/CCodeGeneration/C_IfExpression.bin | Bin 0 -> 12440 bytes 2.3-1/macros/CCodeGeneration/C_IfExpression.sci | 31 ++++++++++++++++----- 2.3-1/macros/CCodeGeneration/C_IndentBlanks.bin | Bin 0 -> 3184 bytes 2.3-1/macros/CCodeGeneration/C_InitHeader.bin | Bin 0 -> 14140 bytes .../CCodeGeneration/C_MemAllocOutTempVars.bin | Bin 0 -> 12996 bytes 2.3-1/macros/CCodeGeneration/C_SCI2CHeader.bin | Bin 0 -> 7268 bytes 2.3-1/macros/CCodeGeneration/C_Type.bin | Bin 0 -> 6816 bytes 2.3-1/macros/CCodeGeneration/C_WhileExpression.bin | Bin 0 -> 15704 bytes 2.3-1/macros/CCodeGeneration/C_WhileExpression.sci | 28 ++++++++++++++++--- 2.3-1/macros/CCodeGeneration/GenCFunDatFiles.bin | Bin 0 -> 9348 bytes 2.3-1/macros/CCodeGeneration/GetClsFileName.bin | Bin 0 -> 14164 bytes 2.3-1/macros/CCodeGeneration/GetClsFileName.sci | 4 +++ .../macros/CCodeGeneration/GetSymbolDimension.bin | Bin 0 -> 8944 bytes .../CCodeGeneration/GetWhileCondVariable.bin | Bin 0 -> 10228 bytes .../macros/CCodeGeneration/JoinDeclarAndCcode.bin | Bin 0 -> 22776 bytes .../macros/CCodeGeneration/Sci2AnnotationFile.bin | Bin 0 -> 7400 bytes 2.3-1/macros/CCodeGeneration/lib | Bin 2449 -> 912 bytes 27 files changed, 52 insertions(+), 11 deletions(-) create mode 100644 2.3-1/macros/CCodeGeneration/C_FinalizeCode.bin create mode 100644 2.3-1/macros/CCodeGeneration/C_ForExpression.bin create mode 100644 2.3-1/macros/CCodeGeneration/C_Funcall.bin create mode 100644 2.3-1/macros/CCodeGeneration/C_GenDeclarations.bin create mode 100644 2.3-1/macros/CCodeGeneration/C_GenerateFunName.bin create mode 100644 2.3-1/macros/CCodeGeneration/C_GenerateLaunchScript.bin create mode 100644 2.3-1/macros/CCodeGeneration/C_GenerateMakefile.bin create mode 100644 2.3-1/macros/CCodeGeneration/C_GenerateMakefile_msvc.bin create mode 100644 2.3-1/macros/CCodeGeneration/C_GenerateSCI2CHeader.bin create mode 100644 2.3-1/macros/CCodeGeneration/C_IfElseBlocks.bin create mode 100644 2.3-1/macros/CCodeGeneration/C_IfExpression.bin create mode 100644 2.3-1/macros/CCodeGeneration/C_IndentBlanks.bin create mode 100644 2.3-1/macros/CCodeGeneration/C_InitHeader.bin create mode 100644 2.3-1/macros/CCodeGeneration/C_MemAllocOutTempVars.bin create mode 100644 2.3-1/macros/CCodeGeneration/C_SCI2CHeader.bin create mode 100644 2.3-1/macros/CCodeGeneration/C_Type.bin create mode 100644 2.3-1/macros/CCodeGeneration/C_WhileExpression.bin create mode 100644 2.3-1/macros/CCodeGeneration/GenCFunDatFiles.bin create mode 100644 2.3-1/macros/CCodeGeneration/GetClsFileName.bin create mode 100644 2.3-1/macros/CCodeGeneration/GetSymbolDimension.bin create mode 100644 2.3-1/macros/CCodeGeneration/GetWhileCondVariable.bin create mode 100644 2.3-1/macros/CCodeGeneration/JoinDeclarAndCcode.bin create mode 100644 2.3-1/macros/CCodeGeneration/Sci2AnnotationFile.bin (limited to '2.3-1/macros/CCodeGeneration') diff --git a/2.3-1/macros/CCodeGeneration/C_FinalizeCode.bin b/2.3-1/macros/CCodeGeneration/C_FinalizeCode.bin new file mode 100644 index 00000000..b4005914 Binary files /dev/null and b/2.3-1/macros/CCodeGeneration/C_FinalizeCode.bin differ diff --git a/2.3-1/macros/CCodeGeneration/C_ForExpression.bin b/2.3-1/macros/CCodeGeneration/C_ForExpression.bin new file mode 100644 index 00000000..1c3f6747 Binary files /dev/null and b/2.3-1/macros/CCodeGeneration/C_ForExpression.bin differ diff --git a/2.3-1/macros/CCodeGeneration/C_Funcall.bin b/2.3-1/macros/CCodeGeneration/C_Funcall.bin new file mode 100644 index 00000000..80fda7c4 Binary files /dev/null and b/2.3-1/macros/CCodeGeneration/C_Funcall.bin differ diff --git a/2.3-1/macros/CCodeGeneration/C_GenDeclarations.bin b/2.3-1/macros/CCodeGeneration/C_GenDeclarations.bin new file mode 100644 index 00000000..c3b36009 Binary files /dev/null and b/2.3-1/macros/CCodeGeneration/C_GenDeclarations.bin differ diff --git a/2.3-1/macros/CCodeGeneration/C_GenerateFunName.bin b/2.3-1/macros/CCodeGeneration/C_GenerateFunName.bin new file mode 100644 index 00000000..1b723f16 Binary files /dev/null and b/2.3-1/macros/CCodeGeneration/C_GenerateFunName.bin differ diff --git a/2.3-1/macros/CCodeGeneration/C_GenerateLaunchScript.bin b/2.3-1/macros/CCodeGeneration/C_GenerateLaunchScript.bin new file mode 100644 index 00000000..587c1547 Binary files /dev/null and b/2.3-1/macros/CCodeGeneration/C_GenerateLaunchScript.bin differ diff --git a/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.bin b/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.bin new file mode 100644 index 00000000..cea86411 Binary files /dev/null and b/2.3-1/macros/CCodeGeneration/C_GenerateMakefile.bin differ diff --git a/2.3-1/macros/CCodeGeneration/C_GenerateMakefile_msvc.bin b/2.3-1/macros/CCodeGeneration/C_GenerateMakefile_msvc.bin new file mode 100644 index 00000000..838c674e Binary files /dev/null and b/2.3-1/macros/CCodeGeneration/C_GenerateMakefile_msvc.bin differ diff --git a/2.3-1/macros/CCodeGeneration/C_GenerateSCI2CHeader.bin b/2.3-1/macros/CCodeGeneration/C_GenerateSCI2CHeader.bin new file mode 100644 index 00000000..2e02cae4 Binary files /dev/null and b/2.3-1/macros/CCodeGeneration/C_GenerateSCI2CHeader.bin differ diff --git a/2.3-1/macros/CCodeGeneration/C_IfElseBlocks.bin b/2.3-1/macros/CCodeGeneration/C_IfElseBlocks.bin new file mode 100644 index 00000000..332e89bf Binary files /dev/null and b/2.3-1/macros/CCodeGeneration/C_IfElseBlocks.bin differ diff --git a/2.3-1/macros/CCodeGeneration/C_IfExpression.bin b/2.3-1/macros/CCodeGeneration/C_IfExpression.bin new file mode 100644 index 00000000..b1dc7370 Binary files /dev/null and b/2.3-1/macros/CCodeGeneration/C_IfExpression.bin differ diff --git a/2.3-1/macros/CCodeGeneration/C_IfExpression.sci b/2.3-1/macros/CCodeGeneration/C_IfExpression.sci index 48a05383..c723d95a 100644 --- a/2.3-1/macros/CCodeGeneration/C_IfExpression.sci +++ b/2.3-1/macros/CCodeGeneration/C_IfExpression.sci @@ -1,4 +1,4 @@ -function SharedInfo = C_IfExpression(IfCondArg,NIfCondArg,ASTIfExpType,FileInfo,SharedInfo) +function SharedInfo = C_IfExpression(IfCondArg,NIfCondArg,Op,NOp,ASTIfExpType,FileInfo,SharedInfo) // function SharedInfo = C_IfExpression(IfCondArg,NIfCondArg,ASTIfExpType,FileInfo,SharedInfo) // ----------------------------------------------------------------- // //NUT: add description here @@ -19,12 +19,16 @@ function SharedInfo = C_IfExpression(IfCondArg,NIfCondArg,ASTIfExpType,FileInfo, // ------------------------------ // --- Check input arguments. --- // ------------------------------ -SCI2CNInArgCheck(argn(2),5,5); +//SCI2CNInArgCheck(argn(4),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 +//if ((NIfCondArg ~= 1) & (ASTIfExpType~='else')) + // error(9999, 'Cannot manage ""if/elseif"" with a number of condition variables not equal to 1.'); +//end // ----------------------- // --- Initialization. --- @@ -37,7 +41,7 @@ CPass1FileName = FileInfo.Funct(nxtscifunnumber).CPass1FileName; // #RNU_RES_B PrintStringInfo(' ',ReportFileName,'file','y'); -PrintStringInfo('***Generating C code***',ReportFileName,'file','y'); +PrintStringInfo('***Generating C code***'+ string(NIfCondArg),ReportFileName,'file','y'); // #RNU_RES_E // --------------------------- // --- End Initialization. --- @@ -66,10 +70,23 @@ if SCI2Cstrncmps1size(ASTIfExpType,'else') SharedInfo = C_IfElseBlocks(FileInfo,SharedInfo,'out'); end +i=1; +k=1; CCall =''; CCall = CCall+CFunName; if (ASTIfExpType~='else') - CCall = CCall+'('+IfCondArg(1)+')'; + 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+')'; end PrintStringInfo(' '+CCall,ReportFileName,'file','y'); PrintStringInfo(C_IndentBlanks(SharedInfo.NIndent)+CCall,CPass1FileName,'file','y'); diff --git a/2.3-1/macros/CCodeGeneration/C_IndentBlanks.bin b/2.3-1/macros/CCodeGeneration/C_IndentBlanks.bin new file mode 100644 index 00000000..77bfaebc Binary files /dev/null and b/2.3-1/macros/CCodeGeneration/C_IndentBlanks.bin differ diff --git a/2.3-1/macros/CCodeGeneration/C_InitHeader.bin b/2.3-1/macros/CCodeGeneration/C_InitHeader.bin new file mode 100644 index 00000000..567822c0 Binary files /dev/null and b/2.3-1/macros/CCodeGeneration/C_InitHeader.bin differ diff --git a/2.3-1/macros/CCodeGeneration/C_MemAllocOutTempVars.bin b/2.3-1/macros/CCodeGeneration/C_MemAllocOutTempVars.bin new file mode 100644 index 00000000..443ad3c1 Binary files /dev/null and b/2.3-1/macros/CCodeGeneration/C_MemAllocOutTempVars.bin differ diff --git a/2.3-1/macros/CCodeGeneration/C_SCI2CHeader.bin b/2.3-1/macros/CCodeGeneration/C_SCI2CHeader.bin new file mode 100644 index 00000000..1d3e6182 Binary files /dev/null and b/2.3-1/macros/CCodeGeneration/C_SCI2CHeader.bin differ diff --git a/2.3-1/macros/CCodeGeneration/C_Type.bin b/2.3-1/macros/CCodeGeneration/C_Type.bin new file mode 100644 index 00000000..7b5bf444 Binary files /dev/null and b/2.3-1/macros/CCodeGeneration/C_Type.bin differ diff --git a/2.3-1/macros/CCodeGeneration/C_WhileExpression.bin b/2.3-1/macros/CCodeGeneration/C_WhileExpression.bin new file mode 100644 index 00000000..5e426505 Binary files /dev/null and b/2.3-1/macros/CCodeGeneration/C_WhileExpression.bin differ diff --git a/2.3-1/macros/CCodeGeneration/C_WhileExpression.sci b/2.3-1/macros/CCodeGeneration/C_WhileExpression.sci index edd2830e..d7cf70ec 100644 --- a/2.3-1/macros/CCodeGeneration/C_WhileExpression.sci +++ b/2.3-1/macros/CCodeGeneration/C_WhileExpression.sci @@ -1,4 +1,4 @@ -function SharedInfo = C_WhileExpression(FileInfo,SharedInfo) +function SharedInfo = C_WhileExpression(IfCondArg,NIfCondArg,Op,NOp,FileInfo,SharedInfo) // function SharedInfo = C_WhileExpression(FileInfo,SharedInfo) // ----------------------------------------------------------------- // //NUT: add description here @@ -19,7 +19,7 @@ function SharedInfo = C_WhileExpression(FileInfo,SharedInfo) // ------------------------------ // --- Check input arguments. --- // ------------------------------ -SCI2CNInArgCheck(argn(2),2,2); +//SCI2CNInArgCheck(argn(2),2,2); // ----------------------- // --- Initialization. --- @@ -63,7 +63,7 @@ for cntstr = 1:NumCStrings // Epilogue if (length(C_Strings(cntstr)) == 0) C_Strings(cntstr) = ' '; // RNU for Bruno: If I don't do that I get a PrintStringInfo error related to mputstr. - // Function not defined for given argument type(s), + // Function not defined for given argument type(s), // check arguments or define function %0_mputstr for overloading. end PrintStringInfo(C_Strings(cntstr),CPass1WhileEpilFileName ,'file','y','n'); @@ -76,7 +76,27 @@ PrintStringInfo('}',CPass1WhileEpilFileName ,'file','y'); // ------------------------------ // --- Insert for expression. --- // ------------------------------ -CCall = 'while('+SharedInfo.WhileExpr.CondVar+')'; +//CCall = 'while('+SharedInfo.WhileExpr.CondVar+')'; +//PrintStringInfo(C_IndentBlanks(SharedInfo.NIndent)+CCall,CPass1FileName,'file','y'); + +i=1; +k=1; +CCall =''; +CCall = CCall+'while'; + 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+')'; + +PrintStringInfo(' '+CCall,ReportFileName,'file','y'); PrintStringInfo(C_IndentBlanks(SharedInfo.NIndent)+CCall,CPass1FileName,'file','y'); // ------------------- diff --git a/2.3-1/macros/CCodeGeneration/GenCFunDatFiles.bin b/2.3-1/macros/CCodeGeneration/GenCFunDatFiles.bin new file mode 100644 index 00000000..6a374f5b Binary files /dev/null and b/2.3-1/macros/CCodeGeneration/GenCFunDatFiles.bin differ diff --git a/2.3-1/macros/CCodeGeneration/GetClsFileName.bin b/2.3-1/macros/CCodeGeneration/GetClsFileName.bin new file mode 100644 index 00000000..dda02933 Binary files /dev/null and b/2.3-1/macros/CCodeGeneration/GetClsFileName.bin differ diff --git a/2.3-1/macros/CCodeGeneration/GetClsFileName.sci b/2.3-1/macros/CCodeGeneration/GetClsFileName.sci index 46f08201..d92a431c 100644 --- a/2.3-1/macros/CCodeGeneration/GetClsFileName.sci +++ b/2.3-1/macros/CCodeGeneration/GetClsFileName.sci @@ -45,6 +45,7 @@ if SCI2Cfileexist(FileInfo.USER2CLibCAnnFun,tmpannfilename) // #RNU_RES_B // It is a C function of the USER2C library. // #RNU_RES_E + PrintStringInfo('cUser2c',ReportFileName,'file','y'); FlagFoundAnnFile = 1; AnnFileName = fullfile(FileInfo.USER2CLibCAnnFun,tmpannfilename); SCI2CClassName = FL_GetFunctionClass(AnnFileName,SCI2CClassSpecifier,ReportFileName); @@ -53,6 +54,7 @@ elseif SCI2Cfileexist(FileInfo.USER2CLibSCIAnnFun,tmpannfilename) // #RNU_RES_B // It is a scilab function of the USER2C library. // #RNU_RES_E + PrintStringInfo('fUser2c',ReportFileName,'file','y'); FlagFoundAnnFile = 1; AnnFileName = fullfile(FileInfo.USER2CLibSCIAnnFun,tmpannfilename); SCI2CClassName = FL_GetFunctionClass(AnnFileName,SCI2CClassSpecifier,ReportFileName); @@ -61,6 +63,7 @@ elseif (SCI2Cfileexist(FileInfo.SCI2CLibCAnnFun,tmpannfilename)) // #RNU_RES_B // It is a C function of the SCI2C library. // #RNU_RES_E + PrintStringInfo('csci2c',ReportFileName,'file','y'); FlagFoundAnnFile = 1; AnnFileName = fullfile(FileInfo.SCI2CLibCAnnFun,tmpannfilename); SCI2CClassName = FL_GetFunctionClass(AnnFileName,SCI2CClassSpecifier,ReportFileName); @@ -69,6 +72,7 @@ elseif (SCI2Cfileexist(FileInfo.SCI2CLibSCIAnnFun,tmpannfilename)) // #RNU_RES_B // It is a scilab function of the SCI2C library. // #RNU_RES_E + PrintStringInfo('fsci2c',ReportFileName,'file','y'); FlagFoundAnnFile = 1; AnnFileName = fullfile(FileInfo.SCI2CLibSCIAnnFun,tmpannfilename); SCI2CClassName = FL_GetFunctionClass(AnnFileName,SCI2CClassSpecifier,ReportFileName); diff --git a/2.3-1/macros/CCodeGeneration/GetSymbolDimension.bin b/2.3-1/macros/CCodeGeneration/GetSymbolDimension.bin new file mode 100644 index 00000000..5c73f435 Binary files /dev/null and b/2.3-1/macros/CCodeGeneration/GetSymbolDimension.bin differ diff --git a/2.3-1/macros/CCodeGeneration/GetWhileCondVariable.bin b/2.3-1/macros/CCodeGeneration/GetWhileCondVariable.bin new file mode 100644 index 00000000..6815fb4b Binary files /dev/null and b/2.3-1/macros/CCodeGeneration/GetWhileCondVariable.bin differ diff --git a/2.3-1/macros/CCodeGeneration/JoinDeclarAndCcode.bin b/2.3-1/macros/CCodeGeneration/JoinDeclarAndCcode.bin new file mode 100644 index 00000000..084ab085 Binary files /dev/null and b/2.3-1/macros/CCodeGeneration/JoinDeclarAndCcode.bin differ diff --git a/2.3-1/macros/CCodeGeneration/Sci2AnnotationFile.bin b/2.3-1/macros/CCodeGeneration/Sci2AnnotationFile.bin new file mode 100644 index 00000000..95fe5611 Binary files /dev/null and b/2.3-1/macros/CCodeGeneration/Sci2AnnotationFile.bin differ diff --git a/2.3-1/macros/CCodeGeneration/lib b/2.3-1/macros/CCodeGeneration/lib index 2db4b8c8..b62a6c72 100644 Binary files a/2.3-1/macros/CCodeGeneration/lib and b/2.3-1/macros/CCodeGeneration/lib differ -- cgit