From 956aa2b9bcf6171234bc9749acbfabf8660beade Mon Sep 17 00:00:00 2001 From: ukashanoor Date: Tue, 27 Jun 2017 12:40:50 +0530 Subject: matrix complete --- macros/CCodeGeneration/C_FinalizeCode.bin | Bin 0 -> 18232 bytes macros/CCodeGeneration/C_ForExpression.bin | Bin 0 -> 32208 bytes macros/CCodeGeneration/C_Funcall.bin | Bin 0 -> 73176 bytes macros/CCodeGeneration/C_GenDeclarations.bin | Bin 0 -> 22004 bytes macros/CCodeGeneration/C_GenDeclarations_Dup.bin | Bin 0 -> 24932 bytes macros/CCodeGeneration/C_GenDeclarations_Dup.sci | 155 +++++++++++++++++++++ macros/CCodeGeneration/C_GenerateFunName.bin | Bin 0 -> 7776 bytes macros/CCodeGeneration/C_GenerateLaunchScript.bin | Bin 0 -> 17232 bytes macros/CCodeGeneration/C_GenerateMakefile.bin | Bin 0 -> 32632 bytes macros/CCodeGeneration/C_GenerateMakefile_msvc.bin | Bin 0 -> 29868 bytes macros/CCodeGeneration/C_GenerateMkfle_arduino.bin | Bin 0 -> 3104 bytes macros/CCodeGeneration/C_GenerateSCI2CHeader.bin | Bin 0 -> 1936 bytes macros/CCodeGeneration/C_IfElseBlocks.bin | Bin 0 -> 8516 bytes macros/CCodeGeneration/C_IfExpression.bin | Bin 0 -> 12440 bytes macros/CCodeGeneration/C_IndentBlanks.bin | Bin 0 -> 3184 bytes macros/CCodeGeneration/C_InitHeader.bin | Bin 0 -> 14140 bytes macros/CCodeGeneration/C_MemAllocOutTempVars.bin | Bin 0 -> 12996 bytes macros/CCodeGeneration/C_SCI2CHeader.bin | Bin 0 -> 7268 bytes macros/CCodeGeneration/C_Type.bin | Bin 0 -> 6816 bytes macros/CCodeGeneration/C_WhileExpression.bin | Bin 0 -> 15704 bytes macros/CCodeGeneration/GenCFunDatFiles.bin | Bin 0 -> 9348 bytes macros/CCodeGeneration/GetClsFileName.bin | Bin 0 -> 14164 bytes macros/CCodeGeneration/GetSymbolDimension.bin | Bin 0 -> 8944 bytes macros/CCodeGeneration/GetWhileCondVariable.bin | Bin 0 -> 10228 bytes macros/CCodeGeneration/JoinDeclarAndCcode.bin | Bin 0 -> 22776 bytes macros/CCodeGeneration/Sci2AnnotationFile.bin | Bin 0 -> 7400 bytes macros/CCodeGeneration/lib | Bin 936 -> 936 bytes macros/CCodeGeneration/names | 2 +- 28 files changed, 156 insertions(+), 1 deletion(-) create mode 100644 macros/CCodeGeneration/C_FinalizeCode.bin create mode 100644 macros/CCodeGeneration/C_ForExpression.bin create mode 100644 macros/CCodeGeneration/C_Funcall.bin create mode 100644 macros/CCodeGeneration/C_GenDeclarations.bin create mode 100644 macros/CCodeGeneration/C_GenDeclarations_Dup.bin create mode 100644 macros/CCodeGeneration/C_GenDeclarations_Dup.sci create mode 100644 macros/CCodeGeneration/C_GenerateFunName.bin create mode 100644 macros/CCodeGeneration/C_GenerateLaunchScript.bin create mode 100644 macros/CCodeGeneration/C_GenerateMakefile.bin create mode 100644 macros/CCodeGeneration/C_GenerateMakefile_msvc.bin create mode 100644 macros/CCodeGeneration/C_GenerateMkfle_arduino.bin create mode 100644 macros/CCodeGeneration/C_GenerateSCI2CHeader.bin create mode 100644 macros/CCodeGeneration/C_IfElseBlocks.bin create mode 100644 macros/CCodeGeneration/C_IfExpression.bin create mode 100644 macros/CCodeGeneration/C_IndentBlanks.bin create mode 100644 macros/CCodeGeneration/C_InitHeader.bin create mode 100644 macros/CCodeGeneration/C_MemAllocOutTempVars.bin create mode 100644 macros/CCodeGeneration/C_SCI2CHeader.bin create mode 100644 macros/CCodeGeneration/C_Type.bin create mode 100644 macros/CCodeGeneration/C_WhileExpression.bin create mode 100644 macros/CCodeGeneration/GenCFunDatFiles.bin create mode 100644 macros/CCodeGeneration/GetClsFileName.bin create mode 100644 macros/CCodeGeneration/GetSymbolDimension.bin create mode 100644 macros/CCodeGeneration/GetWhileCondVariable.bin create mode 100644 macros/CCodeGeneration/JoinDeclarAndCcode.bin create mode 100644 macros/CCodeGeneration/Sci2AnnotationFile.bin (limited to 'macros/CCodeGeneration') diff --git a/macros/CCodeGeneration/C_FinalizeCode.bin b/macros/CCodeGeneration/C_FinalizeCode.bin new file mode 100644 index 0000000..b400591 Binary files /dev/null and b/macros/CCodeGeneration/C_FinalizeCode.bin differ diff --git a/macros/CCodeGeneration/C_ForExpression.bin b/macros/CCodeGeneration/C_ForExpression.bin new file mode 100644 index 0000000..1c3f674 Binary files /dev/null and b/macros/CCodeGeneration/C_ForExpression.bin differ diff --git a/macros/CCodeGeneration/C_Funcall.bin b/macros/CCodeGeneration/C_Funcall.bin new file mode 100644 index 0000000..80fda7c Binary files /dev/null and b/macros/CCodeGeneration/C_Funcall.bin differ diff --git a/macros/CCodeGeneration/C_GenDeclarations.bin b/macros/CCodeGeneration/C_GenDeclarations.bin new file mode 100644 index 0000000..c3b3600 Binary files /dev/null and b/macros/CCodeGeneration/C_GenDeclarations.bin differ diff --git a/macros/CCodeGeneration/C_GenDeclarations_Dup.bin b/macros/CCodeGeneration/C_GenDeclarations_Dup.bin new file mode 100644 index 0000000..ab05955 Binary files /dev/null and b/macros/CCodeGeneration/C_GenDeclarations_Dup.bin differ diff --git a/macros/CCodeGeneration/C_GenDeclarations_Dup.sci b/macros/CCodeGeneration/C_GenDeclarations_Dup.sci new file mode 100644 index 0000000..46d9de7 --- /dev/null +++ b/macros/CCodeGeneration/C_GenDeclarations_Dup.sci @@ -0,0 +1,155 @@ +function Cdeclaration = C_GenDeclarations_Dup(InArg,NInArg,com_type,ArgStruct,CDeclarationFileName,IndentLevel,ReportFileName,FlagExt,ResizeApproach) +// function Cdeclaration = C_GenDeclarations(ArgStruct,CDeclarationFileName,IndentLevel,ReportFileName,FlagExt,ResizeApproach) +// ----------------------------------------------------------------- +// //NUT: add description here +// +// Input data: +// //NUT: add description here +// +// Output data: +// //NUT: add description here +// +// Status: +// 27-Oct-2007 -- Raffaele Nutricato: Author. +// 10-Jun-2008 -- Raffaele Nutricato: adapted to work with realloc function. +// +// Copyright 2007 Raffaele Nutricato. +// Contact: raffaele.nutricato@tiscali.it +// ----------------------------------------------------------------- + +// Generate C corresponding declaration given some information in ArgStruct +// + +// ------------------------------ +// --- Check input arguments. --- +// ------------------------------ + //SCI2CNInArgCheck(argn(2),6,6); +// #RNU_RES_B +//NUT: ilnome di questa funzione va cambiato perche' le dichiarazioni le fanno anche i for e i while. + +PrintStringInfo(' ',ReportFileName,'file','y'); +PrintStringInfo('***Generating C declaration***',ReportFileName,'file','y'); +// #RNU_RES_E + +Cdeclaration = ''; +if (ArgStruct.Dimension > 0) + if (FlagExt == 1) + Cdeclaration(1) = 'extern '; + Cdeclaration(2) = 'extern '; + else + Cdeclaration(1) = ''; + Cdeclaration(2) = ''; + end +// #RNU_RES_B +//NUT: vedi Mem_Alloc_Out per maggiori info sulla rimozione della temp nella if +// if ((ArgStruct.Scope=='Temp') | (ArgStruct.FindLike == -1) | (isnum(ArgStruct.Size(1))==%F) | (isnum(ArgStruct.Size(2))==%F)) +// #RNU_RES_E + if (ArgStruct.Type=='g') +// if (isnan(ArgStruct.Value) ) + if ((isnum(ArgStruct.Size(1))==%F) | (isnum(ArgStruct.Size(2))==%F) ) + Cdeclaration(1) = Cdeclaration(1)+C_Type(ArgStruct.Type)+... + ' * '+ArgStruct.Name+';'; + else + if ((FlagExt == 1) | (isnan(ArgStruct.Value))) + Cdeclaration(1) = Cdeclaration(1)+C_Type(ArgStruct.Type)+... + ' '+ArgStruct.Name+'['+ArgStruct.Size(1)+'*'+ArgStruct.Size(2)+'];'; + else + Cdeclaration(1) = Cdeclaration(1)+C_Type(ArgStruct.Type)+... + ' '+ArgStruct.Name+'['+ArgStruct.Size(1)+'*'+ArgStruct.Size(2)+'] = {'+ArgStruct.Value+'};'; + end + end + Cdeclaration(2) = Cdeclaration(2)+C_Type('i')+' __'+ArgStruct.Name+'Size[2] = {'+ArgStruct.Size(1)+','+ArgStruct.Size(2)+'};'; + elseif ((ArgStruct.FindLike == -1) | ... + (isnum(ArgStruct.Size(1))==%F) | (isnum(ArgStruct.Size(2))==%F) | ... + (ResizeApproach=='REALLOC_ALL_RESIZE_ALL' & ArgStruct.Type~='g')) +// #RNU_RES_B +//RNU sulle stringhe non ho ancora deciso se applicare la realloc. +// Generate only the pointer that will be used by the malloc function. +// #RNU_RES_E + if (FlagExt == 1) + Cdeclaration(1) = Cdeclaration(1)+C_Type(ArgStruct.Type)+'* '+... + ArgStruct.Name+';'; + else + Cdeclaration(1) = Cdeclaration(1)+C_Type(ArgStruct.Type)+'* '+... + ArgStruct.Name+' = NULL;'; + end +// Declare the Size array + Cdeclaration(2) = Cdeclaration(2)+C_Type('i')+' __'+ArgStruct.Name+'Size[2];'; + else +// Declare the array with its size. + computedSize = ArgStruct.Size(1); + computedSizeLength = size(ArgStruct.Size, '*'); + computedSizeField = ArgStruct.Size(1); + for sizeIterator = 2:computedSizeLength; + computedSize = computedSize + ' * ' + ArgStruct.Size(sizeIterator); + computedSizeField = computedSizeField + ', ' + ArgStruct.Size(sizeIterator); + end + Cdeclaration(1) = Cdeclaration(1)+C_Type(ArgStruct.Type)+' '+ArgStruct.Name+'['+computedSize+']={'; + if com_type == 0 + for i = 1:NInArg-1 + Cdeclaration(1) = Cdeclaration(1)+InArg(i).Name+','; + end + Cdeclaration(1) = Cdeclaration(1)+InArg(NInArg).Name+'};'; + else + for i=1:NInArg-1 + if InArg(i).Type <> 'z' + Cdeclaration(1) = Cdeclaration(1)+InArg(i).Name+',0,'; + else + Cdeclaration(1) = Cdeclaration(1)+InArg(i).Name+','; + end + end + if InArg(NInArg).Type <> 'z' + Cdeclaration(1) = Cdeclaration(1) + InArg(NInArg).Name + ',0};' + else + Cdeclaration(1) = Cdeclaration(1) + InArg(NInArg).Name + '};' + end + end + Cdeclaration(2) = Cdeclaration(2)+C_Type('i')+' __'+ArgStruct.Name+'Size['+string(computedSizeLength)+']'; + if (FlagExt <> 1) + Cdeclaration(2) = Cdeclaration(2)+' = {'+computedSizeField+'};'; + end + Cdeclaration(2) = Cdeclaration(2)+';'; + end +else + if (ArgStruct.Type == 'fn') + //do nothing. This is a function name. Will be declared in header file. + else + if (FlagExt == 1) + Cdeclaration(1) = 'extern '; + else + Cdeclaration(1) = ''; + end + Cdeclaration(1) = Cdeclaration(1)+C_Type(ArgStruct.Type)+' '+ArgStruct.Name; + if (~isnan(ArgStruct.Value) & (FlagExt == 0)) + if isreal(ArgStruct.Value) + Cdeclaration(1) = Cdeclaration(1)+' = '+SCI2Cstring(ArgStruct.Value); + else + if (ArgStruct.Type == 'z') + Cdeclaration(1) = Cdeclaration(1)+' = DoubleComplex('+SCI2Cstring(real(ArgStruct.Value))+','+SCI2Cstring(imag(ArgStruct.Value))+')'; + else + Cdeclaration(1) = Cdeclaration(1)+' = FloatComplex('+SCI2Cstring(real(ArgStruct.Value))+','+SCI2Cstring(imag(ArgStruct.Value))+')'; + end + end + end + Cdeclaration(1) = Cdeclaration(1)+';'; + end +end + + +// -------------------------------------------- +// --- Write C declaration into the C file. --- +// -------------------------------------------- +PrintStringInfo(' ',CDeclarationFileName,'file','y'); +for cntdecl = 1:size(Cdeclaration, '*') + PrintStringInfo(' '+Cdeclaration(cntdecl),ReportFileName,'file','y'); + PrintStringInfo(C_IndentBlanks(IndentLevel)+Cdeclaration(cntdecl),CDeclarationFileName,'file','y'); +end + +PrintStringInfo(' Writing C declaration in: '+CDeclarationFileName,ReportFileName,'file','y'); +PrintStringInfo(' ',CDeclarationFileName,'file','y'); + +endfunction +// #RNU_RES_B +//NUT: dove sta il controllo che verifica se dopo aver dichiarato una local A[10] essa viene utilizzata +//NUT: per memorizzare un A = sin(B) dove B[11]?? +// #RNU_RES_E diff --git a/macros/CCodeGeneration/C_GenerateFunName.bin b/macros/CCodeGeneration/C_GenerateFunName.bin new file mode 100644 index 0000000..1b723f1 Binary files /dev/null and b/macros/CCodeGeneration/C_GenerateFunName.bin differ diff --git a/macros/CCodeGeneration/C_GenerateLaunchScript.bin b/macros/CCodeGeneration/C_GenerateLaunchScript.bin new file mode 100644 index 0000000..587c154 Binary files /dev/null and b/macros/CCodeGeneration/C_GenerateLaunchScript.bin differ diff --git a/macros/CCodeGeneration/C_GenerateMakefile.bin b/macros/CCodeGeneration/C_GenerateMakefile.bin new file mode 100644 index 0000000..cea8641 Binary files /dev/null and b/macros/CCodeGeneration/C_GenerateMakefile.bin differ diff --git a/macros/CCodeGeneration/C_GenerateMakefile_msvc.bin b/macros/CCodeGeneration/C_GenerateMakefile_msvc.bin new file mode 100644 index 0000000..838c674 Binary files /dev/null and b/macros/CCodeGeneration/C_GenerateMakefile_msvc.bin differ diff --git a/macros/CCodeGeneration/C_GenerateMkfle_arduino.bin b/macros/CCodeGeneration/C_GenerateMkfle_arduino.bin new file mode 100644 index 0000000..ce25219 Binary files /dev/null and b/macros/CCodeGeneration/C_GenerateMkfle_arduino.bin differ diff --git a/macros/CCodeGeneration/C_GenerateSCI2CHeader.bin b/macros/CCodeGeneration/C_GenerateSCI2CHeader.bin new file mode 100644 index 0000000..2e02cae Binary files /dev/null and b/macros/CCodeGeneration/C_GenerateSCI2CHeader.bin differ diff --git a/macros/CCodeGeneration/C_IfElseBlocks.bin b/macros/CCodeGeneration/C_IfElseBlocks.bin new file mode 100644 index 0000000..332e89b Binary files /dev/null and b/macros/CCodeGeneration/C_IfElseBlocks.bin differ diff --git a/macros/CCodeGeneration/C_IfExpression.bin b/macros/CCodeGeneration/C_IfExpression.bin new file mode 100644 index 0000000..b1dc737 Binary files /dev/null and b/macros/CCodeGeneration/C_IfExpression.bin differ diff --git a/macros/CCodeGeneration/C_IndentBlanks.bin b/macros/CCodeGeneration/C_IndentBlanks.bin new file mode 100644 index 0000000..77bfaeb Binary files /dev/null and b/macros/CCodeGeneration/C_IndentBlanks.bin differ diff --git a/macros/CCodeGeneration/C_InitHeader.bin b/macros/CCodeGeneration/C_InitHeader.bin new file mode 100644 index 0000000..567822c Binary files /dev/null and b/macros/CCodeGeneration/C_InitHeader.bin differ diff --git a/macros/CCodeGeneration/C_MemAllocOutTempVars.bin b/macros/CCodeGeneration/C_MemAllocOutTempVars.bin new file mode 100644 index 0000000..443ad3c Binary files /dev/null and b/macros/CCodeGeneration/C_MemAllocOutTempVars.bin differ diff --git a/macros/CCodeGeneration/C_SCI2CHeader.bin b/macros/CCodeGeneration/C_SCI2CHeader.bin new file mode 100644 index 0000000..1d3e618 Binary files /dev/null and b/macros/CCodeGeneration/C_SCI2CHeader.bin differ diff --git a/macros/CCodeGeneration/C_Type.bin b/macros/CCodeGeneration/C_Type.bin new file mode 100644 index 0000000..7b5bf44 Binary files /dev/null and b/macros/CCodeGeneration/C_Type.bin differ diff --git a/macros/CCodeGeneration/C_WhileExpression.bin b/macros/CCodeGeneration/C_WhileExpression.bin new file mode 100644 index 0000000..5e42650 Binary files /dev/null and b/macros/CCodeGeneration/C_WhileExpression.bin differ diff --git a/macros/CCodeGeneration/GenCFunDatFiles.bin b/macros/CCodeGeneration/GenCFunDatFiles.bin new file mode 100644 index 0000000..6a374f5 Binary files /dev/null and b/macros/CCodeGeneration/GenCFunDatFiles.bin differ diff --git a/macros/CCodeGeneration/GetClsFileName.bin b/macros/CCodeGeneration/GetClsFileName.bin new file mode 100644 index 0000000..dda0293 Binary files /dev/null and b/macros/CCodeGeneration/GetClsFileName.bin differ diff --git a/macros/CCodeGeneration/GetSymbolDimension.bin b/macros/CCodeGeneration/GetSymbolDimension.bin new file mode 100644 index 0000000..5c73f43 Binary files /dev/null and b/macros/CCodeGeneration/GetSymbolDimension.bin differ diff --git a/macros/CCodeGeneration/GetWhileCondVariable.bin b/macros/CCodeGeneration/GetWhileCondVariable.bin new file mode 100644 index 0000000..6815fb4 Binary files /dev/null and b/macros/CCodeGeneration/GetWhileCondVariable.bin differ diff --git a/macros/CCodeGeneration/JoinDeclarAndCcode.bin b/macros/CCodeGeneration/JoinDeclarAndCcode.bin new file mode 100644 index 0000000..084ab08 Binary files /dev/null and b/macros/CCodeGeneration/JoinDeclarAndCcode.bin differ diff --git a/macros/CCodeGeneration/Sci2AnnotationFile.bin b/macros/CCodeGeneration/Sci2AnnotationFile.bin new file mode 100644 index 0000000..95fe561 Binary files /dev/null and b/macros/CCodeGeneration/Sci2AnnotationFile.bin differ diff --git a/macros/CCodeGeneration/lib b/macros/CCodeGeneration/lib index 4e87a55..baf9dba 100644 Binary files a/macros/CCodeGeneration/lib and b/macros/CCodeGeneration/lib differ diff --git a/macros/CCodeGeneration/names b/macros/CCodeGeneration/names index c4dea61..bf9ced9 100644 --- a/macros/CCodeGeneration/names +++ b/macros/CCodeGeneration/names @@ -2,6 +2,7 @@ C_FinalizeCode C_ForExpression C_Funcall C_GenDeclarations +C_GenDeclarations_Dup C_GenerateFunName C_GenerateLaunchScript C_GenerateMakefile @@ -12,7 +13,6 @@ C_IfExpression C_IndentBlanks C_InitHeader C_MemAllocOutTempVars -C_RCOperator C_SCI2CHeader C_Type C_WhileExpression -- cgit From f15ab8a9f06e3936309886b52b0eb547ab1094e0 Mon Sep 17 00:00:00 2001 From: ukashanoor Date: Tue, 27 Jun 2017 16:51:16 +0530 Subject: matrix complete1 --- macros/CCodeGeneration/C_GenDeclarations_Dup.bin | Bin 24932 -> 29588 bytes macros/CCodeGeneration/C_GenDeclarations_Dup.sci | 67 +++++++++++++++++------ 2 files changed, 50 insertions(+), 17 deletions(-) (limited to 'macros/CCodeGeneration') diff --git a/macros/CCodeGeneration/C_GenDeclarations_Dup.bin b/macros/CCodeGeneration/C_GenDeclarations_Dup.bin index ab05955..7a4ed87 100644 Binary files a/macros/CCodeGeneration/C_GenDeclarations_Dup.bin and b/macros/CCodeGeneration/C_GenDeclarations_Dup.bin differ diff --git a/macros/CCodeGeneration/C_GenDeclarations_Dup.sci b/macros/CCodeGeneration/C_GenDeclarations_Dup.sci index 46d9de7..ab32ff1 100644 --- a/macros/CCodeGeneration/C_GenDeclarations_Dup.sci +++ b/macros/CCodeGeneration/C_GenDeclarations_Dup.sci @@ -85,28 +85,61 @@ if (ArgStruct.Dimension > 0) computedSizeField = computedSizeField + ', ' + ArgStruct.Size(sizeIterator); end Cdeclaration(1) = Cdeclaration(1)+C_Type(ArgStruct.Type)+' '+ArgStruct.Name+'['+computedSize+']={'; - if com_type == 0 - for i = 1:NInArg-1 - Cdeclaration(1) = Cdeclaration(1)+InArg(i).Name+','; - end - Cdeclaration(1) = Cdeclaration(1)+InArg(NInArg).Name+'};'; - else - for i=1:NInArg-1 - if InArg(i).Type <> 'z' - Cdeclaration(1) = Cdeclaration(1)+InArg(i).Name+',0,'; - else - Cdeclaration(1) = Cdeclaration(1)+InArg(i).Name+','; - end - end - if InArg(NInArg).Type <> 'z' - Cdeclaration(1) = Cdeclaration(1) + InArg(NInArg).Name + ',0};' + row = eval(ArgStruct.Size(1)) + col = eval(ArgStruct.Size(2)) + if row == 1 + if com_type == 0 + for i = 1:NInArg-1 + Cdeclaration(1) = Cdeclaration(1)+InArg(i).Name+','; + end + Cdeclaration(1) = Cdeclaration(1)+InArg(NInArg).Name+'};'; else - Cdeclaration(1) = Cdeclaration(1) + InArg(NInArg).Name + '};' + for i=1:NInArg-1 + if InArg(i).Type <> 'z' + Cdeclaration(1) = Cdeclaration(1)+InArg(i).Name+',0,'; + else + Cdeclaration(1) = Cdeclaration(1)+InArg(i).Name+','; + end + end + if InArg(NInArg).Type <> 'z' + Cdeclaration(1) = Cdeclaration(1) + InArg(NInArg).Name + ',0};' + else + Cdeclaration(1) = Cdeclaration(1) + InArg(NInArg).Name + '};' + end end + else + if com_type == 0 + for i = 1:col + for j = 0:row-1 + if (j*col)+i ~= row*col + Cdeclaration(1) = Cdeclaration(1) + InArg(((j*col)+i)).Name + ','; + end + end + end + Cdeclaration(1) = Cdeclaration(1) + InArg(NInArg).Name + '};'; + else + disp("hello") + for i = 1:col + for j = 0:row-1 + if (j*col)+i ~= row*col + if InArg(((j*col)+i)).Type <> 'z' + Cdeclaration(1) = Cdeclaration(1) + InArg(((j*col)+i)).Name + ',0,'; + else + Cdeclaration(1) = Cdeclaration(1) + InArg(((j*col)+i)).Name + ','; + end + end + end + end + if InArg(NInArg).Type <> 'z' + Cdeclaration(1) = Cdeclaration(1) + InArg(NInArg).Name + ',0};'; + else + Cdeclaration(1) = Cdeclaration(1) + InArg(NInArg).Name + '};'; + end + end end Cdeclaration(2) = Cdeclaration(2)+C_Type('i')+' __'+ArgStruct.Name+'Size['+string(computedSizeLength)+']'; if (FlagExt <> 1) - Cdeclaration(2) = Cdeclaration(2)+' = {'+computedSizeField+'};'; + Cdeclaration(2) = Cdeclaration(2)+' = {'+computedSizeField+'}'; end Cdeclaration(2) = Cdeclaration(2)+';'; end -- cgit From 43592401ec4efefec61c236cd90b063a90a981b8 Mon Sep 17 00:00:00 2001 From: ukashanoor Date: Wed, 28 Jun 2017 16:30:53 +0530 Subject: float matrix done and func disp --- macros/CCodeGeneration/C_GenDeclarations_Dup.bin | Bin 29588 -> 30104 bytes macros/CCodeGeneration/C_GenDeclarations_Dup.sci | 11 +++++------ macros/CCodeGeneration/C_IfExpression.bin | Bin 12440 -> 12500 bytes macros/CCodeGeneration/C_IfExpression.sci | 2 +- macros/CCodeGeneration/C_WhileExpression.bin | Bin 15704 -> 15764 bytes macros/CCodeGeneration/C_WhileExpression.sci | 2 +- 6 files changed, 7 insertions(+), 8 deletions(-) (limited to 'macros/CCodeGeneration') diff --git a/macros/CCodeGeneration/C_GenDeclarations_Dup.bin b/macros/CCodeGeneration/C_GenDeclarations_Dup.bin index 7a4ed87..bdf3564 100644 Binary files a/macros/CCodeGeneration/C_GenDeclarations_Dup.bin and b/macros/CCodeGeneration/C_GenDeclarations_Dup.bin differ diff --git a/macros/CCodeGeneration/C_GenDeclarations_Dup.sci b/macros/CCodeGeneration/C_GenDeclarations_Dup.sci index ab32ff1..475e2e0 100644 --- a/macros/CCodeGeneration/C_GenDeclarations_Dup.sci +++ b/macros/CCodeGeneration/C_GenDeclarations_Dup.sci @@ -23,7 +23,7 @@ function Cdeclaration = C_GenDeclarations_Dup(InArg,NInArg,com_type,ArgStruct,CD // ------------------------------ // --- Check input arguments. --- // ------------------------------ - //SCI2CNInArgCheck(argn(2),6,6); +SCI2CNInArgCheck(argn(2),9,9); // #RNU_RES_B //NUT: ilnome di questa funzione va cambiato perche' le dichiarazioni le fanno anche i for e i while. @@ -95,13 +95,13 @@ if (ArgStruct.Dimension > 0) Cdeclaration(1) = Cdeclaration(1)+InArg(NInArg).Name+'};'; else for i=1:NInArg-1 - if InArg(i).Type <> 'z' + if InArg(i).Type <> 'z' & InArg(i).Type <> 'c' Cdeclaration(1) = Cdeclaration(1)+InArg(i).Name+',0,'; else Cdeclaration(1) = Cdeclaration(1)+InArg(i).Name+','; end end - if InArg(NInArg).Type <> 'z' + if InArg(NInArg).Type <> 'z' & InArg(NInArg).Type <> 'c' Cdeclaration(1) = Cdeclaration(1) + InArg(NInArg).Name + ',0};' else Cdeclaration(1) = Cdeclaration(1) + InArg(NInArg).Name + '};' @@ -118,11 +118,10 @@ if (ArgStruct.Dimension > 0) end Cdeclaration(1) = Cdeclaration(1) + InArg(NInArg).Name + '};'; else - disp("hello") for i = 1:col for j = 0:row-1 if (j*col)+i ~= row*col - if InArg(((j*col)+i)).Type <> 'z' + if InArg(((j*col)+i)).Type <> 'z' & InArg(((j*col)+i)).Type <> 'c' Cdeclaration(1) = Cdeclaration(1) + InArg(((j*col)+i)).Name + ',0,'; else Cdeclaration(1) = Cdeclaration(1) + InArg(((j*col)+i)).Name + ','; @@ -130,7 +129,7 @@ if (ArgStruct.Dimension > 0) end end end - if InArg(NInArg).Type <> 'z' + if InArg(NInArg).Type <> 'z' & InArg(NInArg).Type <> 'c' Cdeclaration(1) = Cdeclaration(1) + InArg(NInArg).Name + ',0};'; else Cdeclaration(1) = Cdeclaration(1) + InArg(NInArg).Name + '};'; diff --git a/macros/CCodeGeneration/C_IfExpression.bin b/macros/CCodeGeneration/C_IfExpression.bin index b1dc737..c93b629 100644 Binary files a/macros/CCodeGeneration/C_IfExpression.bin and b/macros/CCodeGeneration/C_IfExpression.bin differ diff --git a/macros/CCodeGeneration/C_IfExpression.sci b/macros/CCodeGeneration/C_IfExpression.sci index c723d95..359b788 100644 --- a/macros/CCodeGeneration/C_IfExpression.sci +++ b/macros/CCodeGeneration/C_IfExpression.sci @@ -19,7 +19,7 @@ function SharedInfo = C_IfExpression(IfCondArg,NIfCondArg,Op,NOp,ASTIfExpType,Fi // ------------------------------ // --- Check input arguments. --- // ------------------------------ -//SCI2CNInArgCheck(argn(4),7,7); +SCI2CNInArgCheck(argn(2),7,7); //global SCI2CSTACK //global StackPosition; diff --git a/macros/CCodeGeneration/C_WhileExpression.bin b/macros/CCodeGeneration/C_WhileExpression.bin index 5e42650..c10e117 100644 Binary files a/macros/CCodeGeneration/C_WhileExpression.bin and b/macros/CCodeGeneration/C_WhileExpression.bin differ diff --git a/macros/CCodeGeneration/C_WhileExpression.sci b/macros/CCodeGeneration/C_WhileExpression.sci index d7cf70e..368ccff 100644 --- a/macros/CCodeGeneration/C_WhileExpression.sci +++ b/macros/CCodeGeneration/C_WhileExpression.sci @@ -19,7 +19,7 @@ function SharedInfo = C_WhileExpression(IfCondArg,NIfCondArg,Op,NOp,FileInfo,Sha // ------------------------------ // --- Check input arguments. --- // ------------------------------ -//SCI2CNInArgCheck(argn(2),2,2); +SCI2CNInArgCheck(argn(2),6,6); // ----------------------- // --- Initialization. --- -- cgit From 9fc55b8370323fd8f7364a5abfcee3af65899a97 Mon Sep 17 00:00:00 2001 From: ukashanoor Date: Thu, 29 Jun 2017 20:26:08 +0530 Subject: till disp complete --- macros/CCodeGeneration/C_GenDeclarations_Dup.bin | Bin 30104 -> 30376 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'macros/CCodeGeneration') diff --git a/macros/CCodeGeneration/C_GenDeclarations_Dup.bin b/macros/CCodeGeneration/C_GenDeclarations_Dup.bin index bdf3564..9228993 100644 Binary files a/macros/CCodeGeneration/C_GenDeclarations_Dup.bin and b/macros/CCodeGeneration/C_GenDeclarations_Dup.bin differ -- cgit