summaryrefslogtreecommitdiff
path: root/macros/CCodeGeneration
diff options
context:
space:
mode:
Diffstat (limited to 'macros/CCodeGeneration')
-rw-r--r--macros/CCodeGeneration/C_FinalizeCode.binbin0 -> 18232 bytes
-rw-r--r--macros/CCodeGeneration/C_ForExpression.binbin0 -> 32208 bytes
-rw-r--r--macros/CCodeGeneration/C_Funcall.binbin0 -> 73176 bytes
-rw-r--r--macros/CCodeGeneration/C_GenDeclarations.binbin0 -> 22004 bytes
-rw-r--r--macros/CCodeGeneration/C_GenerateFunName.binbin0 -> 7776 bytes
-rw-r--r--macros/CCodeGeneration/C_GenerateLaunchScript.binbin0 -> 17232 bytes
-rw-r--r--macros/CCodeGeneration/C_GenerateMakefile.binbin0 -> 32632 bytes
-rw-r--r--macros/CCodeGeneration/C_GenerateMakefile_msvc.binbin0 -> 29868 bytes
-rw-r--r--macros/CCodeGeneration/C_GenerateSCI2CHeader.binbin0 -> 1936 bytes
-rw-r--r--macros/CCodeGeneration/C_IfElseBlocks.binbin0 -> 8516 bytes
-rw-r--r--macros/CCodeGeneration/C_IfExpression.binbin0 -> 12440 bytes
-rw-r--r--macros/CCodeGeneration/C_IfExpression.sci31
-rw-r--r--macros/CCodeGeneration/C_IndentBlanks.binbin0 -> 3184 bytes
-rw-r--r--macros/CCodeGeneration/C_InitHeader.binbin0 -> 14140 bytes
-rw-r--r--macros/CCodeGeneration/C_MemAllocOutTempVars.binbin0 -> 12996 bytes
-rw-r--r--macros/CCodeGeneration/C_SCI2CHeader.binbin0 -> 7268 bytes
-rw-r--r--macros/CCodeGeneration/C_Type.binbin0 -> 6816 bytes
-rw-r--r--macros/CCodeGeneration/C_WhileExpression.binbin0 -> 15704 bytes
-rw-r--r--macros/CCodeGeneration/C_WhileExpression.sci28
-rw-r--r--macros/CCodeGeneration/GenCFunDatFiles.binbin0 -> 9348 bytes
-rw-r--r--macros/CCodeGeneration/GetClsFileName.binbin0 -> 14164 bytes
-rw-r--r--macros/CCodeGeneration/GetClsFileName.sci4
-rw-r--r--macros/CCodeGeneration/GetSymbolDimension.binbin0 -> 8944 bytes
-rw-r--r--macros/CCodeGeneration/GetWhileCondVariable.binbin0 -> 10228 bytes
-rw-r--r--macros/CCodeGeneration/JoinDeclarAndCcode.binbin0 -> 22776 bytes
-rw-r--r--macros/CCodeGeneration/Sci2AnnotationFile.binbin0 -> 7400 bytes
-rw-r--r--macros/CCodeGeneration/libbin2449 -> 912 bytes
27 files changed, 52 insertions, 11 deletions
diff --git a/macros/CCodeGeneration/C_FinalizeCode.bin b/macros/CCodeGeneration/C_FinalizeCode.bin
new file mode 100644
index 0000000..b400591
--- /dev/null
+++ b/macros/CCodeGeneration/C_FinalizeCode.bin
Binary files differ
diff --git a/macros/CCodeGeneration/C_ForExpression.bin b/macros/CCodeGeneration/C_ForExpression.bin
new file mode 100644
index 0000000..1c3f674
--- /dev/null
+++ b/macros/CCodeGeneration/C_ForExpression.bin
Binary files differ
diff --git a/macros/CCodeGeneration/C_Funcall.bin b/macros/CCodeGeneration/C_Funcall.bin
new file mode 100644
index 0000000..80fda7c
--- /dev/null
+++ b/macros/CCodeGeneration/C_Funcall.bin
Binary files differ
diff --git a/macros/CCodeGeneration/C_GenDeclarations.bin b/macros/CCodeGeneration/C_GenDeclarations.bin
new file mode 100644
index 0000000..c3b3600
--- /dev/null
+++ b/macros/CCodeGeneration/C_GenDeclarations.bin
Binary files differ
diff --git a/macros/CCodeGeneration/C_GenerateFunName.bin b/macros/CCodeGeneration/C_GenerateFunName.bin
new file mode 100644
index 0000000..1b723f1
--- /dev/null
+++ b/macros/CCodeGeneration/C_GenerateFunName.bin
Binary files differ
diff --git a/macros/CCodeGeneration/C_GenerateLaunchScript.bin b/macros/CCodeGeneration/C_GenerateLaunchScript.bin
new file mode 100644
index 0000000..587c154
--- /dev/null
+++ b/macros/CCodeGeneration/C_GenerateLaunchScript.bin
Binary files differ
diff --git a/macros/CCodeGeneration/C_GenerateMakefile.bin b/macros/CCodeGeneration/C_GenerateMakefile.bin
new file mode 100644
index 0000000..cea8641
--- /dev/null
+++ b/macros/CCodeGeneration/C_GenerateMakefile.bin
Binary files differ
diff --git a/macros/CCodeGeneration/C_GenerateMakefile_msvc.bin b/macros/CCodeGeneration/C_GenerateMakefile_msvc.bin
new file mode 100644
index 0000000..838c674
--- /dev/null
+++ b/macros/CCodeGeneration/C_GenerateMakefile_msvc.bin
Binary files differ
diff --git a/macros/CCodeGeneration/C_GenerateSCI2CHeader.bin b/macros/CCodeGeneration/C_GenerateSCI2CHeader.bin
new file mode 100644
index 0000000..2e02cae
--- /dev/null
+++ b/macros/CCodeGeneration/C_GenerateSCI2CHeader.bin
Binary files differ
diff --git a/macros/CCodeGeneration/C_IfElseBlocks.bin b/macros/CCodeGeneration/C_IfElseBlocks.bin
new file mode 100644
index 0000000..332e89b
--- /dev/null
+++ b/macros/CCodeGeneration/C_IfElseBlocks.bin
Binary files differ
diff --git a/macros/CCodeGeneration/C_IfExpression.bin b/macros/CCodeGeneration/C_IfExpression.bin
new file mode 100644
index 0000000..b1dc737
--- /dev/null
+++ b/macros/CCodeGeneration/C_IfExpression.bin
Binary files differ
diff --git a/macros/CCodeGeneration/C_IfExpression.sci b/macros/CCodeGeneration/C_IfExpression.sci
index 48a0538..c723d95 100644
--- a/macros/CCodeGeneration/C_IfExpression.sci
+++ b/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/macros/CCodeGeneration/C_IndentBlanks.bin b/macros/CCodeGeneration/C_IndentBlanks.bin
new file mode 100644
index 0000000..77bfaeb
--- /dev/null
+++ b/macros/CCodeGeneration/C_IndentBlanks.bin
Binary files differ
diff --git a/macros/CCodeGeneration/C_InitHeader.bin b/macros/CCodeGeneration/C_InitHeader.bin
new file mode 100644
index 0000000..567822c
--- /dev/null
+++ b/macros/CCodeGeneration/C_InitHeader.bin
Binary files differ
diff --git a/macros/CCodeGeneration/C_MemAllocOutTempVars.bin b/macros/CCodeGeneration/C_MemAllocOutTempVars.bin
new file mode 100644
index 0000000..443ad3c
--- /dev/null
+++ b/macros/CCodeGeneration/C_MemAllocOutTempVars.bin
Binary files differ
diff --git a/macros/CCodeGeneration/C_SCI2CHeader.bin b/macros/CCodeGeneration/C_SCI2CHeader.bin
new file mode 100644
index 0000000..1d3e618
--- /dev/null
+++ b/macros/CCodeGeneration/C_SCI2CHeader.bin
Binary files differ
diff --git a/macros/CCodeGeneration/C_Type.bin b/macros/CCodeGeneration/C_Type.bin
new file mode 100644
index 0000000..7b5bf44
--- /dev/null
+++ b/macros/CCodeGeneration/C_Type.bin
Binary files differ
diff --git a/macros/CCodeGeneration/C_WhileExpression.bin b/macros/CCodeGeneration/C_WhileExpression.bin
new file mode 100644
index 0000000..5e42650
--- /dev/null
+++ b/macros/CCodeGeneration/C_WhileExpression.bin
Binary files differ
diff --git a/macros/CCodeGeneration/C_WhileExpression.sci b/macros/CCodeGeneration/C_WhileExpression.sci
index edd2830..d7cf70e 100644
--- a/macros/CCodeGeneration/C_WhileExpression.sci
+++ b/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/macros/CCodeGeneration/GenCFunDatFiles.bin b/macros/CCodeGeneration/GenCFunDatFiles.bin
new file mode 100644
index 0000000..6a374f5
--- /dev/null
+++ b/macros/CCodeGeneration/GenCFunDatFiles.bin
Binary files differ
diff --git a/macros/CCodeGeneration/GetClsFileName.bin b/macros/CCodeGeneration/GetClsFileName.bin
new file mode 100644
index 0000000..dda0293
--- /dev/null
+++ b/macros/CCodeGeneration/GetClsFileName.bin
Binary files differ
diff --git a/macros/CCodeGeneration/GetClsFileName.sci b/macros/CCodeGeneration/GetClsFileName.sci
index 46f0820..d92a431 100644
--- a/macros/CCodeGeneration/GetClsFileName.sci
+++ b/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/macros/CCodeGeneration/GetSymbolDimension.bin b/macros/CCodeGeneration/GetSymbolDimension.bin
new file mode 100644
index 0000000..5c73f43
--- /dev/null
+++ b/macros/CCodeGeneration/GetSymbolDimension.bin
Binary files differ
diff --git a/macros/CCodeGeneration/GetWhileCondVariable.bin b/macros/CCodeGeneration/GetWhileCondVariable.bin
new file mode 100644
index 0000000..6815fb4
--- /dev/null
+++ b/macros/CCodeGeneration/GetWhileCondVariable.bin
Binary files differ
diff --git a/macros/CCodeGeneration/JoinDeclarAndCcode.bin b/macros/CCodeGeneration/JoinDeclarAndCcode.bin
new file mode 100644
index 0000000..084ab08
--- /dev/null
+++ b/macros/CCodeGeneration/JoinDeclarAndCcode.bin
Binary files differ
diff --git a/macros/CCodeGeneration/Sci2AnnotationFile.bin b/macros/CCodeGeneration/Sci2AnnotationFile.bin
new file mode 100644
index 0000000..95fe561
--- /dev/null
+++ b/macros/CCodeGeneration/Sci2AnnotationFile.bin
Binary files differ
diff --git a/macros/CCodeGeneration/lib b/macros/CCodeGeneration/lib
index 2db4b8c..b62a6c7 100644
--- a/macros/CCodeGeneration/lib
+++ b/macros/CCodeGeneration/lib
Binary files differ