summaryrefslogtreecommitdiff
path: root/macros/ASTManagement
diff options
context:
space:
mode:
Diffstat (limited to 'macros/ASTManagement')
-rw-r--r--macros/ASTManagement/AST2Ccode.binbin31996 -> 32492 bytes
-rw-r--r--macros/ASTManagement/AST2Ccode.sci5
-rw-r--r--macros/ASTManagement/AST_ExtractNameAndScope.binbin13180 -> 13184 bytes
-rw-r--r--macros/ASTManagement/AST_ExtractNameAndScope.sci1
-rw-r--r--macros/ASTManagement/AST_GetPrecAndLhsArg.binbin12360 -> 12552 bytes
-rw-r--r--macros/ASTManagement/AST_GetPrecAndLhsArg.sci4
-rw-r--r--macros/ASTManagement/AST_HandleEndGenFun.binbin93256 -> 96888 bytes
-rw-r--r--macros/ASTManagement/AST_HandleEndGenFun.sci32
-rw-r--r--macros/ASTManagement/AST_HandleHeader.binbin40400 -> 39124 bytes
-rw-r--r--macros/ASTManagement/AST_HandleHeader.sci8
10 files changed, 33 insertions, 17 deletions
diff --git a/macros/ASTManagement/AST2Ccode.bin b/macros/ASTManagement/AST2Ccode.bin
index 5f8c96b..f931fd3 100644
--- a/macros/ASTManagement/AST2Ccode.bin
+++ b/macros/ASTManagement/AST2Ccode.bin
Binary files differ
diff --git a/macros/ASTManagement/AST2Ccode.sci b/macros/ASTManagement/AST2Ccode.sci
index 275aadf..b42fe95 100644
--- a/macros/ASTManagement/AST2Ccode.sci
+++ b/macros/ASTManagement/AST2Ccode.sci
@@ -152,6 +152,11 @@ while ~meof(fidAST)
case 'Lhs :' then
SharedInfo.Equal.Lhs = 1; // 1 means that we are inside the Lhs block of the Equal
[EqualInArgName,EqualInArgScope,EqualNInArg] = AST_ReadEqualRhsNames(FileInfo,SharedInfo);
+
+ lengthNumber = length('Number_');
+ if (part(EqualInArgScope,1:lengthNumber) == 'Number_')
+ SharedInfo.SkipNextEqual = 1
+ end
SharedInfo.Equal.NInArg = EqualNInArg;
for tmpcnt = 1:SharedInfo.Equal.NInArg
SharedInfo.Equal.InArg(tmpcnt).Name = EqualInArgName(tmpcnt);
diff --git a/macros/ASTManagement/AST_ExtractNameAndScope.bin b/macros/ASTManagement/AST_ExtractNameAndScope.bin
index 260f69a..1944d88 100644
--- a/macros/ASTManagement/AST_ExtractNameAndScope.bin
+++ b/macros/ASTManagement/AST_ExtractNameAndScope.bin
Binary files differ
diff --git a/macros/ASTManagement/AST_ExtractNameAndScope.sci b/macros/ASTManagement/AST_ExtractNameAndScope.sci
index fe5dc05..1dbaaad 100644
--- a/macros/ASTManagement/AST_ExtractNameAndScope.sci
+++ b/macros/ASTManagement/AST_ExtractNameAndScope.sci
@@ -75,6 +75,7 @@ if (SCI2Cstrncmps1size(tagname(1),ASTField))
ArgName = stripblanks(part(ASTField,taglength(1)+3:fieldlength));
ArgScope = stripblanks(part(ASTField,1:taglength(1)+1));
end
+
elseif (SCI2Cstrncmps1size(tagname(2),ASTField))
ArgName = stripblanks(part(ASTField,taglength(2)+1:fieldlength));
ArgName = part(ArgName,2:length(ArgName)-1); // I remove also the first and the last "
diff --git a/macros/ASTManagement/AST_GetPrecAndLhsArg.bin b/macros/ASTManagement/AST_GetPrecAndLhsArg.bin
index d35ce90..71e44cb 100644
--- a/macros/ASTManagement/AST_GetPrecAndLhsArg.bin
+++ b/macros/ASTManagement/AST_GetPrecAndLhsArg.bin
Binary files differ
diff --git a/macros/ASTManagement/AST_GetPrecAndLhsArg.sci b/macros/ASTManagement/AST_GetPrecAndLhsArg.sci
index 07ad3b0..f45c29e 100644
--- a/macros/ASTManagement/AST_GetPrecAndLhsArg.sci
+++ b/macros/ASTManagement/AST_GetPrecAndLhsArg.sci
@@ -57,7 +57,8 @@ end
// --- Check Last Function Condition and update LhsArg info. ---
// -------------------------------------------------------------
// #RNU_RES_E
-if (ASTFunType~='Equal')
+if ((ASTFunType~='Equal')& (NOutArg ~= 0))
+ //If NOutArg = 0, bypass.
// #RNU_RES_B
PrintStringInfo(' ',ReportFileName,'file','y');
PrintStringInfo(' Checking presence of Equal after the current function...',ReportFileName,'file','y');
@@ -68,7 +69,6 @@ else
LhsArgScope = '';
NLhsArg = 0;
end
-
// --- Generate the LhsArg structure. ---
LhsArg = [];
for cntarg = 1:NLhsArg
diff --git a/macros/ASTManagement/AST_HandleEndGenFun.bin b/macros/ASTManagement/AST_HandleEndGenFun.bin
index 123ff51..f16974e 100644
--- a/macros/ASTManagement/AST_HandleEndGenFun.bin
+++ b/macros/ASTManagement/AST_HandleEndGenFun.bin
Binary files differ
diff --git a/macros/ASTManagement/AST_HandleEndGenFun.sci b/macros/ASTManagement/AST_HandleEndGenFun.sci
index df4334f..5086680 100644
--- a/macros/ASTManagement/AST_HandleEndGenFun.sci
+++ b/macros/ASTManagement/AST_HandleEndGenFun.sci
@@ -72,6 +72,7 @@ global STACKDEDUG
//NUT: verifica se ASTFunType e' veramente importante
// #RNU_RES_E
[ASTFunName,InArg,NInArg,OutArg,NOutArg] = AST_GetFuncallPrm(FileInfo,SharedInfo,ASTFunType);
+NOutArg_mod = NOutArg
if(mtlb_strcmp(part(ASTFunName,1:2),'CV') == %T)
SharedInfo.OpenCVUsed = %T;
end
@@ -118,13 +119,14 @@ global STACKDEDUG
// --- Read the function annotations. ---
// --------------------------------------
// #RNU_RES_E
+
if (ASTFunName == 'OpEqual')
FunTypeAnnot = '';
FunSizeAnnot = '';
else
- [FunTypeAnnot,FunSizeAnnot] = FA_GetFunAnn(NInArg,NOutArg,ASTFunName,FileInfo,SharedInfo);
+ [FunTypeAnnot,FunSizeAnnot,NOutArg_mod] = FA_GetFunAnn(NInArg,NOutArg,ASTFunName,FileInfo,SharedInfo);
end
-
+
// #RNU_RES_B
// -------------------------------------------------------------------------------------------
// --- Search for Equal Lhs and precision specifier to be applied to the current function. ---
@@ -310,7 +312,7 @@ global STACKDEDUG
else
OutArg = FA_GetOutArgInfo(InArg,NInArg,OutArg,NOutArg,SharedInfo,FunPrecSpecifier,FunTypeAnnot,FunSizeAnnot,ReportFileName);
end
-
+
// #RNU_RES_B
// --- Generate the names for the output arguments. ---
// Update of OutArg.Name and OutArg.Scope fields.
@@ -324,7 +326,21 @@ global STACKDEDUG
else
[OutArg,SharedInfo] = GenOutArgNames(ASTFunName,InArg,NInArg,OutArg,NOutArg,LhsArg,NLhsArg,FileInfo,SharedInfo);
end
-
+
+ if ((ASTFunName == 'uint8') & (NInArg == 1) & (InArg(1).Dimension == 0) & (InArg(1).Scope == 'Number'))
+ OutArg(1).Value = InArg(1).Value;
+ SharedInfo.SkipNextFun = 1;
+ elseif ((ASTFunName == 'int8') & (NInArg == 1) & (InArg(1).Dimension == 0) & (InArg(1).Scope == 'Number'))
+ OutArg(1).Value = InArg(1).Value;
+ SharedInfo.SkipNextFun = 1;
+ elseif ((ASTFunName == 'uint16') & (NInArg == 1) & (InArg(1).Dimension == 0) & (InArg(1).Scope == 'Number'))
+ OutArg(1).Value = InArg(1).Value;
+ SharedInfo.SkipNextFun = 1;
+ elseif ((ASTFunName == 'int16') & (NInArg == 1) & (InArg(1).Dimension == 0) & (InArg(1).Scope == 'Number'))
+ OutArg(1).Value = InArg(1).Value;
+ SharedInfo.SkipNextFun = 1;
+ end
+
// #RNU_RES_B
// --- Push in the AST stack the Output arguments. ---
// #RNU_RES_E
@@ -340,6 +356,7 @@ global STACKDEDUG
end
end
+
// #RNU_RES_B
//NUT: verificare se si puo' accorpare qualcosa qui sotto
//RN: non capisco come mai analizzo lo scope dopo che faccio il push nello stack dove lo utilizzo!!!
@@ -360,6 +377,7 @@ global STACKDEDUG
//#RNUREM_ME --- Store the while condition variable (if any). ---
SharedInfo = GetWhileCondVariable(OutArg,NOutArg,ASTFunName,FileInfo,SharedInfo);
+
//#RNUREM_ME --- Update Symbol Table with output arguments. ---
if ((ASTFunName == 'OpMinus') & (NInArg == 1) & (InArg(1).Dimension == 0) & (InArg(1).Scope == 'Number'))
@@ -399,8 +417,8 @@ global STACKDEDUG
// --- Generate the C name of the function. ---
// --------------------------------------------
//#RNU_RES_E
-
- CFunName = C_GenerateFunName(ASTFunName,InArg,NInArg,OutArg,NOutArg);
+ //disp(OutArg,InArg,ASTFunName)
+ CFunName = C_GenerateFunName(ASTFunName,InArg,NInArg,OutArg,NOutArg_mod);
//#RNU_RES_B
PrintStringInfo(' C Function Name: '+CFunName,ReportFileName,'file','y');
@@ -448,7 +466,7 @@ global STACKDEDUG
//NUT: magari posso fare una funzione che inserisce solo i campi diversi e fa un check su quelli che
//NUT: dovrebbero essere identici.
//#RNU_RES_E
- GenCFunDatFiles(ASTFunName,FunPrecSpecifier,FunTypeAnnot,FunSizeAnnot,InArg,NInArg,OutArg,NOutArg,CFunName,LibTypeInfo,FunInfoDatDir);
+ GenCFunDatFiles(ASTFunName,FunPrecSpecifier,FunTypeAnnot,FunSizeAnnot,InArg,NInArg,OutArg,NOutArg_mod,CFunName,LibTypeInfo,FunInfoDatDir);
//#RNU_RES_B
// -----------------------------------
diff --git a/macros/ASTManagement/AST_HandleHeader.bin b/macros/ASTManagement/AST_HandleHeader.bin
index 078d21b..268846f 100644
--- a/macros/ASTManagement/AST_HandleHeader.bin
+++ b/macros/ASTManagement/AST_HandleHeader.bin
Binary files differ
diff --git a/macros/ASTManagement/AST_HandleHeader.sci b/macros/ASTManagement/AST_HandleHeader.sci
index 98875a3..75b2f97 100644
--- a/macros/ASTManagement/AST_HandleHeader.sci
+++ b/macros/ASTManagement/AST_HandleHeader.sci
@@ -107,14 +107,6 @@ load(fullfile(FileInfo.FunctionList.FunInfoDatDir,SharedInfo.NextCFunName+'.dat'
SharedInfo.CurrentFunInfo = FunInfo;
clear FunInfo
-//Required if single file is being translated and has input/outputs
-if(SharedInfo.RunMode == "FunCall")
-[FunTypeAnnot,FunSizeAnnot] = FA_GetFunAnn(NInArg,NOutArg,FunctionName,FileInfo,SharedInfo);
- if((nxtscifunname == SharedInfo.SCIMainFunName))
- SharedInfo.CurrentFunInfo.FunTypeAnnot = FunTypeAnnot;
- SharedInfo.CurrentFunInfo.FunSizeAnnot = FunSizeAnnot;
- end
-end
//#RNU_RES_B
// -----------------------------------------------------------------------------
// --- Check coherence between In/Out names and In/Out Arg structure loaded. ---