diff options
Diffstat (limited to '2.3-1')
24 files changed, 77 insertions, 16 deletions
diff --git a/2.3-1/macros/ASTManagement/%funcall_string.bin b/2.3-1/macros/ASTManagement/%funcall_string.bin Binary files differindex 8354586d..258933b9 100644 --- a/2.3-1/macros/ASTManagement/%funcall_string.bin +++ b/2.3-1/macros/ASTManagement/%funcall_string.bin diff --git a/2.3-1/macros/ASTManagement/%funcall_string.sci b/2.3-1/macros/ASTManagement/%funcall_string.sci index faeb81d9..0ee97016 100644 --- a/2.3-1/macros/ASTManagement/%funcall_string.sci +++ b/2.3-1/macros/ASTManagement/%funcall_string.sci @@ -6,10 +6,19 @@ function txt=%funcall_string(F) // name : string, the name of the function // lhsnb: number, the number of function lhs +if F.name <> 'disp' txt=['Funcall : '+F.name ' #lhs : '+string(F.lhsnb) ' Rhs : ' ' '+objectlist2string(F.rhs) 'EndFuncall' ] +else +txt=['Funcall : '+F.name + ' #lhs : '+'0' + ' Rhs : ' + ' '+objectlist2string(F.rhs) + 'EndFuncall' + ] +end endfunction diff --git a/2.3-1/macros/ASTManagement/AST2Ccode.bin b/2.3-1/macros/ASTManagement/AST2Ccode.bin Binary files differindex c6635196..337baa22 100644 --- a/2.3-1/macros/ASTManagement/AST2Ccode.bin +++ b/2.3-1/macros/ASTManagement/AST2Ccode.bin diff --git a/2.3-1/macros/ASTManagement/AST2Ccode.sci b/2.3-1/macros/ASTManagement/AST2Ccode.sci index f3c87aba..563f3133 100644 --- a/2.3-1/macros/ASTManagement/AST2Ccode.sci +++ b/2.3-1/macros/ASTManagement/AST2Ccode.sci @@ -62,7 +62,8 @@ StackPosition = 1; global STACKDEDUG STACKDEDUG = 0; // 1 -> Every Pop and Push operation on the stack, the stack content will be printed on screen. - +global disp_isthere +disp_isthere = 0; // ------------------------------------- // --- End parameter Initialization. --- // ------------------------------------- @@ -141,9 +142,10 @@ while ~meof(fidAST) //NUT: qui puoi anche aggiunger piu' case per specificare meglio la struttura della funcall //NUT: i case aggiunti ovviamente faranno solo il push della treeline. case 'EndOperation' then - [FileInfo,SharedInfo] = AST_HandleEndGenFun(FileInfo,SharedInfo,'Operation'); + [disp_isthere,FileInfo,SharedInfo] = AST_HandleEndGenFun(disp_isthere,FileInfo,SharedInfo,'Operation'); case 'EndFuncall' then - [FileInfo,SharedInfo] = AST_HandleEndGenFun(FileInfo,SharedInfo,'Funcall'); + [disp_isthere,FileInfo,SharedInfo] = AST_HandleEndGenFun(disp_isthere,FileInfo,SharedInfo,'Funcall'); + disp(disp_isthere); // -------------- // --- Equal. --- @@ -161,13 +163,18 @@ while ~meof(fidAST) rc_count = 0; cc_count = 0; else - [FileInfo,SharedInfo] = AST_HandleEndGenFun(FileInfo,SharedInfo,'Equal'); + if disp_isthere == 0 + [disp_isthere,FileInfo,SharedInfo] = AST_HandleEndGenFun(disp_isthere,FileInfo,SharedInfo,'Equal'); SharedInfo = INIT_SharedInfoEqual(SharedInfo); + end end + disp_isthere = 0; + case 'Equal' then SharedInfo.Equal.Enabled = 1; // 1 means enabled -> we are inside an equal AST block. AST_PushASTStack(treeline); case 'Lhs :' then + disp(disp_isthere); if rc_count > 0 & cc_count == 0 SharedInfo.Equal.Lhs = 1; [EqualInArgName,EqualInArgScope,EqualNInArg] = AST_HandleRC(FileInfo,SharedInfo); @@ -184,6 +191,7 @@ while ~meof(fidAST) else SharedInfo.Equal.Lhs = 1; // 1 means that we are inside the Lhs block of the Equal //if SharedInfo.Equal.NOutArg > 0 + if disp_isthere == 0 [EqualInArgName,EqualInArgScope,EqualNInArg] = AST_ReadEqualRhsNames(FileInfo,SharedInfo); SharedInfo.Equal.NInArg = EqualNInArg; //end @@ -198,6 +206,7 @@ while ~meof(fidAST) SharedInfo.Equal.InArg(tmpcnt).Scope = EqualInArgScope(tmpcnt); end //end + end AST_PushASTStack(treeline); end @@ -233,6 +242,7 @@ while ~meof(fidAST) // ----------------- case 'EndProgram' SharedInfo = AST_HandleEndProgram(FileInfo,SharedInfo); + disp_isthere = 0; //NUT: per essere precisi si puo' pensare di mettere un check //NUT: alla fine dell'albero per accertarsi che c'e' end program li' dove ce lo aspettiamo diff --git a/2.3-1/macros/ASTManagement/AST_HandleCC.bin b/2.3-1/macros/ASTManagement/AST_HandleCC.bin Binary files differindex 0d302e4f..b9cc964a 100644 --- a/2.3-1/macros/ASTManagement/AST_HandleCC.bin +++ b/2.3-1/macros/ASTManagement/AST_HandleCC.bin diff --git a/2.3-1/macros/ASTManagement/AST_HandleCC.sci b/2.3-1/macros/ASTManagement/AST_HandleCC.sci index d0a2244b..0b9e4d9c 100644 --- a/2.3-1/macros/ASTManagement/AST_HandleCC.sci +++ b/2.3-1/macros/ASTManagement/AST_HandleCC.sci @@ -32,6 +32,8 @@ function [RhsNames,RhsScope,NRhs] = AST_HandleCC(FileInfo,SharedInfo) // Contact: raffaele.nutricato@tiscali.it // ----------------------------------------------------------------- +SCI2CNInArgCheck(argn(2),2,2) + ReportFileName = FileInfo.Funct(nxtscifunnumber).ReportFileName; // ------------------------------ diff --git a/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.bin b/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.bin Binary files differindex dfbf15db..e1685ec7 100644 --- a/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.bin +++ b/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.bin diff --git a/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci b/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci index 9fdfbb3d..e948529b 100644 --- a/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci +++ b/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci @@ -1,5 +1,5 @@ -function [FileInfo,SharedInfo] = AST_HandleEndGenFun(FileInfo,SharedInfo,ASTFunType) +function [disp_isthere,FileInfo,SharedInfo] = AST_HandleEndGenFun(disp_isthere,FileInfo,SharedInfo,ASTFunType) // function [FileInfo,SharedInfo] = AST_HandleEndGenFun(FileInfo,SharedInfo,ASTFunType) // ----------------------------------------------------------------- // #RNU_RES_B @@ -36,7 +36,7 @@ function [FileInfo,SharedInfo] = AST_HandleEndGenFun(FileInfo,SharedInfo,ASTFunT // ------------------------------ // --- Check input arguments. --- // ------------------------------ -//SCI2CNInArgCheck(argn(2),3,3); +SCI2CNInArgCheck(argn(2),4,4); // ----------------------- // --- Initialization. --- @@ -83,6 +83,11 @@ NOutArg_mod = NOutArg AST_PushASTStack('||'); return; end + + if ASTFunName == 'disp' + disp_isthere = 1; + end + if(mtlb_strcmp(part(ASTFunName,1:2),'CV') == %T) SharedInfo.OpenCVUsed = %T; end diff --git a/2.3-1/macros/ASTManagement/AST_HandleFunCC.bin b/2.3-1/macros/ASTManagement/AST_HandleFunCC.bin Binary files differindex 4689450d..e36fa6c6 100644 --- a/2.3-1/macros/ASTManagement/AST_HandleFunCC.bin +++ b/2.3-1/macros/ASTManagement/AST_HandleFunCC.bin diff --git a/2.3-1/macros/ASTManagement/AST_HandleFunCC.sci b/2.3-1/macros/ASTManagement/AST_HandleFunCC.sci index 12cb577a..40155bac 100644 --- a/2.3-1/macros/ASTManagement/AST_HandleFunCC.sci +++ b/2.3-1/macros/ASTManagement/AST_HandleFunCC.sci @@ -32,6 +32,8 @@ function [FileInfo,SharedInfo] = AST_HandleFunCC(NCol,FileInfo,SharedInfo) // Contact: ukashanoor.iiitk@gmail.com // ----------------------------------------------------------------- +SCI2CNInArgCheck(argn(2),3,3) + // ------------------------------ // --- Check input arguments. --- // ------------------------------ @@ -156,6 +158,8 @@ com_type = 0; for i = 1:NInArg if InArg(i).Type == 'z' com_type = 1; + elseif InArg(i).Type == 'c' + com_type = 2; end end @@ -168,7 +172,7 @@ if com_type == 0 OutArg(1).Dimension = 2; OutArg(1).Value = InArg(1).Value; OutArg(1).FindLike = InArg(1).FindLike; -else +elseif com_type == 1 PrintStringInfo(' Generating Out Arg names.',ReportFileName,'file','y'); OutArg(1).Type = 'z'; OutArg(1).Size(1) = string(NCol); @@ -176,6 +180,14 @@ else 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 = 'c'; + 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 ---// diff --git a/2.3-1/macros/ASTManagement/AST_HandleFunRC.bin b/2.3-1/macros/ASTManagement/AST_HandleFunRC.bin Binary files differindex b9fcd1ff..70d8b561 100644 --- a/2.3-1/macros/ASTManagement/AST_HandleFunRC.bin +++ b/2.3-1/macros/ASTManagement/AST_HandleFunRC.bin diff --git a/2.3-1/macros/ASTManagement/AST_HandleFunRC.sci b/2.3-1/macros/ASTManagement/AST_HandleFunRC.sci index 10f51519..c08c17e7 100644 --- a/2.3-1/macros/ASTManagement/AST_HandleFunRC.sci +++ b/2.3-1/macros/ASTManagement/AST_HandleFunRC.sci @@ -32,6 +32,8 @@ function [FileInfo,SharedInfo] = AST_HandleFunRC(FileInfo,SharedInfo) // Contact: ukashanoor.iiitk@gmail.com // ----------------------------------------------------------------- +SCI2CNInArgCheck(argn(2),2,2) + // ------------------------------ // --- Check input arguments. --- // ------------------------------ @@ -158,6 +160,8 @@ com_type = 0; for i = 1:NInArg if InArg(i).Type == 'z' com_type = 1; + elseif InArg(i).Type == 'c' + com_type = 2; end end @@ -170,7 +174,7 @@ if com_type == 0 OutArg(1).Dimension = 2; OutArg(1).Value = InArg(1).Value; OutArg(1).FindLike = InArg(1).FindLike; -else +elseif com_type == 1 PrintStringInfo(' Generating Out Arg names.',ReportFileName,'file','y'); OutArg(1).Type = 'z'; OutArg(1).Size(1) = '1' @@ -178,6 +182,14 @@ else 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 = 'c'; + 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 ---// diff --git a/2.3-1/macros/ASTManagement/AST_HandleRC.bin b/2.3-1/macros/ASTManagement/AST_HandleRC.bin Binary files differindex 829fd67a..f5b8a1af 100644 --- a/2.3-1/macros/ASTManagement/AST_HandleRC.bin +++ b/2.3-1/macros/ASTManagement/AST_HandleRC.bin diff --git a/2.3-1/macros/ASTManagement/AST_HandleRC.sci b/2.3-1/macros/ASTManagement/AST_HandleRC.sci index 3952c8eb..2a6cbc3f 100644 --- a/2.3-1/macros/ASTManagement/AST_HandleRC.sci +++ b/2.3-1/macros/ASTManagement/AST_HandleRC.sci @@ -32,6 +32,8 @@ function [RhsNames,RhsScope,NRhs] = AST_HandleRC(FileInfo,SharedInfo) // Contact: raffaele.nutricato@tiscali.it // ----------------------------------------------------------------- +SCI2CNInArgCheck(argn(2),2,2) + ReportFileName = FileInfo.Funct(nxtscifunnumber).ReportFileName; // ------------------------------ diff --git a/2.3-1/macros/ASTManagement/_funcall_string.bin b/2.3-1/macros/ASTManagement/_funcall_string.bin Binary files differindex 8354586d..258933b9 100644 --- a/2.3-1/macros/ASTManagement/_funcall_string.bin +++ b/2.3-1/macros/ASTManagement/_funcall_string.bin diff --git a/2.3-1/macros/ASTManagement/_funcall_string.sci b/2.3-1/macros/ASTManagement/_funcall_string.sci index faeb81d9..0ee97016 100644 --- a/2.3-1/macros/ASTManagement/_funcall_string.sci +++ b/2.3-1/macros/ASTManagement/_funcall_string.sci @@ -6,10 +6,19 @@ function txt=%funcall_string(F) // name : string, the name of the function // lhsnb: number, the number of function lhs +if F.name <> 'disp' txt=['Funcall : '+F.name ' #lhs : '+string(F.lhsnb) ' Rhs : ' ' '+objectlist2string(F.rhs) 'EndFuncall' ] +else +txt=['Funcall : '+F.name + ' #lhs : '+'0' + ' Rhs : ' + ' '+objectlist2string(F.rhs) + 'EndFuncall' + ] +end endfunction diff --git a/2.3-1/macros/CCodeGeneration/C_GenDeclarations_Dup.bin b/2.3-1/macros/CCodeGeneration/C_GenDeclarations_Dup.bin Binary files differindex 7a4ed870..bdf35642 100644 --- a/2.3-1/macros/CCodeGeneration/C_GenDeclarations_Dup.bin +++ b/2.3-1/macros/CCodeGeneration/C_GenDeclarations_Dup.bin diff --git a/2.3-1/macros/CCodeGeneration/C_GenDeclarations_Dup.sci b/2.3-1/macros/CCodeGeneration/C_GenDeclarations_Dup.sci index ab32ff1c..475e2e0c 100644 --- a/2.3-1/macros/CCodeGeneration/C_GenDeclarations_Dup.sci +++ b/2.3-1/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/2.3-1/macros/CCodeGeneration/C_IfExpression.bin b/2.3-1/macros/CCodeGeneration/C_IfExpression.bin Binary files differindex b1dc7370..c93b6295 100644 --- a/2.3-1/macros/CCodeGeneration/C_IfExpression.bin +++ b/2.3-1/macros/CCodeGeneration/C_IfExpression.bin diff --git a/2.3-1/macros/CCodeGeneration/C_IfExpression.sci b/2.3-1/macros/CCodeGeneration/C_IfExpression.sci index c723d95a..359b7882 100644 --- a/2.3-1/macros/CCodeGeneration/C_IfExpression.sci +++ b/2.3-1/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/2.3-1/macros/CCodeGeneration/C_WhileExpression.bin b/2.3-1/macros/CCodeGeneration/C_WhileExpression.bin Binary files differindex 5e426505..c10e1170 100644 --- a/2.3-1/macros/CCodeGeneration/C_WhileExpression.bin +++ b/2.3-1/macros/CCodeGeneration/C_WhileExpression.bin diff --git a/2.3-1/macros/CCodeGeneration/C_WhileExpression.sci b/2.3-1/macros/CCodeGeneration/C_WhileExpression.sci index d7cf70ec..368ccffa 100644 --- a/2.3-1/macros/CCodeGeneration/C_WhileExpression.sci +++ b/2.3-1/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. --- diff --git a/2.3-1/macros/SymbolTable/ST_InsOutArg_Dup.bin b/2.3-1/macros/SymbolTable/ST_InsOutArg_Dup.bin Binary files differindex 3c59d47c..4c4da4db 100644 --- a/2.3-1/macros/SymbolTable/ST_InsOutArg_Dup.bin +++ b/2.3-1/macros/SymbolTable/ST_InsOutArg_Dup.bin diff --git a/2.3-1/macros/SymbolTable/ST_InsOutArg_Dup.sci b/2.3-1/macros/SymbolTable/ST_InsOutArg_Dup.sci index 01d25528..bca66235 100644 --- a/2.3-1/macros/SymbolTable/ST_InsOutArg_Dup.sci +++ b/2.3-1/macros/SymbolTable/ST_InsOutArg_Dup.sci @@ -16,6 +16,7 @@ function ST_InsOutArg_Dup(InArg,NInArg,OutArg,NOutArg,com_type,FileInfo,SharedIn // Copyright 2007 Raffaele Nutricato & Alberto Morea. // Contact: raffaele.nutricato@tiscali.it // ----------------------------------------------------------------- +SCI2CNInArgCheck(argn(2),8,8) // ------------------------------ |