diff options
Diffstat (limited to '2.3-1/macros/ASTManagement')
16 files changed, 69 insertions, 8 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 |