summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
authorukashanoor2017-06-27 16:51:16 +0530
committerukashanoor2017-06-27 16:51:16 +0530
commitf15ab8a9f06e3936309886b52b0eb547ab1094e0 (patch)
treeda9c1a9de0bc0d96fc3821120efc34d074f99ca8 /macros
parent956aa2b9bcf6171234bc9749acbfabf8660beade (diff)
downloadScilab2C_fossee_old-f15ab8a9f06e3936309886b52b0eb547ab1094e0.tar.gz
Scilab2C_fossee_old-f15ab8a9f06e3936309886b52b0eb547ab1094e0.tar.bz2
Scilab2C_fossee_old-f15ab8a9f06e3936309886b52b0eb547ab1094e0.zip
matrix complete1
Diffstat (limited to 'macros')
-rw-r--r--macros/ASTManagement/AST_HandleFunCC.binbin20772 -> 22244 bytes
-rw-r--r--macros/ASTManagement/AST_HandleFunCC.sci24
-rw-r--r--macros/ASTManagement/AST_HandleFunRC.binbin20896 -> 22288 bytes
-rw-r--r--macros/ASTManagement/AST_HandleFunRC.sci24
-rw-r--r--macros/CCodeGeneration/C_GenDeclarations_Dup.binbin24932 -> 29588 bytes
-rw-r--r--macros/CCodeGeneration/C_GenDeclarations_Dup.sci67
6 files changed, 84 insertions, 31 deletions
diff --git a/macros/ASTManagement/AST_HandleFunCC.bin b/macros/ASTManagement/AST_HandleFunCC.bin
index 615d147..4689450 100644
--- a/macros/ASTManagement/AST_HandleFunCC.bin
+++ b/macros/ASTManagement/AST_HandleFunCC.bin
Binary files differ
diff --git a/macros/ASTManagement/AST_HandleFunCC.sci b/macros/ASTManagement/AST_HandleFunCC.sci
index 063cdc4..12cb577 100644
--- a/macros/ASTManagement/AST_HandleFunCC.sci
+++ b/macros/ASTManagement/AST_HandleFunCC.sci
@@ -160,13 +160,23 @@ for i = 1:NInArg
end
-PrintStringInfo(' Generating Out Arg names.',ReportFileName,'file','y');
-OutArg(1).Type = InArg(1).Type;
-OutArg(1).Size(1) = string(NRow);
-OutArg(1).Size(2) = string(NCol);
-OutArg(1).Dimension = 2;
-OutArg(1).Value = InArg(1).Value;
-OutArg(1).FindLike = InArg(1).FindLike;
+if com_type == 0
+ PrintStringInfo(' Generating Out Arg names.',ReportFileName,'file','y');
+ OutArg(1).Type = InArg(1).Type;
+ OutArg(1).Size(1) = string(NCol);
+ OutArg(1).Size(2) = string(NRow);
+ OutArg(1).Dimension = 2;
+ OutArg(1).Value = InArg(1).Value;
+ OutArg(1).FindLike = InArg(1).FindLike;
+else
+ PrintStringInfo(' Generating Out Arg names.',ReportFileName,'file','y');
+ OutArg(1).Type = 'z';
+ OutArg(1).Size(1) = string(NCol);
+ OutArg(1).Size(2) = string(NRow);
+ OutArg(1).Dimension = 2;
+ OutArg(1).Value = InArg(1).Value;
+ OutArg(1).FindLike = InArg(1).FindLike;
+end
//--- Check for output Argument in symbol table ---//
OutArg = ST_AnalyzeScope(OutArg,NOutArg,FileInfo,SharedInfo);
diff --git a/macros/ASTManagement/AST_HandleFunRC.bin b/macros/ASTManagement/AST_HandleFunRC.bin
index 8b61e48..b9fcd1f 100644
--- a/macros/ASTManagement/AST_HandleFunRC.bin
+++ b/macros/ASTManagement/AST_HandleFunRC.bin
Binary files differ
diff --git a/macros/ASTManagement/AST_HandleFunRC.sci b/macros/ASTManagement/AST_HandleFunRC.sci
index 654f04d..10f5151 100644
--- a/macros/ASTManagement/AST_HandleFunRC.sci
+++ b/macros/ASTManagement/AST_HandleFunRC.sci
@@ -162,13 +162,23 @@ for i = 1:NInArg
end
-PrintStringInfo(' Generating Out Arg names.',ReportFileName,'file','y');
-OutArg(1).Type = InArg(1).Type;
-OutArg(1).Size(1) = '1'
-OutArg(1).Size(2) = string(size_count);
-OutArg(1).Dimension = 2;
-OutArg(1).Value = InArg(1).Value;
-OutArg(1).FindLike = InArg(1).FindLike;
+if com_type == 0
+ PrintStringInfo(' Generating Out Arg names.',ReportFileName,'file','y');
+ OutArg(1).Type = InArg(1).Type;
+ OutArg(1).Size(1) = '1'
+ OutArg(1).Size(2) = string(size_count);
+ OutArg(1).Dimension = 2;
+ OutArg(1).Value = InArg(1).Value;
+ OutArg(1).FindLike = InArg(1).FindLike;
+else
+ PrintStringInfo(' Generating Out Arg names.',ReportFileName,'file','y');
+ OutArg(1).Type = 'z';
+ OutArg(1).Size(1) = '1'
+ OutArg(1).Size(2) = string(size_count);
+ OutArg(1).Dimension = 2;
+ OutArg(1).Value = InArg(1).Value;
+ OutArg(1).FindLike = InArg(1).FindLike;
+end
//--- Check for output Argument in symbol table ---//
OutArg = ST_AnalyzeScope(OutArg,NOutArg,FileInfo,SharedInfo);
diff --git a/macros/CCodeGeneration/C_GenDeclarations_Dup.bin b/macros/CCodeGeneration/C_GenDeclarations_Dup.bin
index ab05955..7a4ed87 100644
--- a/macros/CCodeGeneration/C_GenDeclarations_Dup.bin
+++ b/macros/CCodeGeneration/C_GenDeclarations_Dup.bin
Binary files 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