diff options
Diffstat (limited to '2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci')
-rw-r--r-- | 2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci b/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci index 96830aa9..6c2abed3 100644 --- a/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci +++ b/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci @@ -1,5 +1,9 @@ +<<<<<<< HEAD function [disp_isthere,FileInfo,SharedInfo] = AST_HandleEndGenFun(disp_isthere,FileInfo,SharedInfo,ASTFunType) +======= +function [FileInfo,SharedInfo] = AST_HandleEndGenFun(FileInfo,SharedInfo,ASTFunType) +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 // function [FileInfo,SharedInfo] = AST_HandleEndGenFun(FileInfo,SharedInfo,ASTFunType) // ----------------------------------------------------------------- // #RNU_RES_B @@ -36,7 +40,11 @@ function [disp_isthere,FileInfo,SharedInfo] = AST_HandleEndGenFun(disp_isthere,F // ------------------------------ // --- Check input arguments. --- // ------------------------------ +<<<<<<< HEAD SCI2CNInArgCheck(argn(2),4,4); +======= +SCI2CNInArgCheck(argn(2),3,3); +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 // ----------------------- // --- Initialization. --- @@ -61,8 +69,11 @@ PrintStepInfo('Handling Funcall/Operation/Equal',FileInfo.Funct(nxtscifunnumber) global SCI2CSTACK global StackPosition; global STACKDEDUG +<<<<<<< HEAD disp_isthere = 0; +======= +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 // --------------------------- // --- End Initialization. --- // --------------------------- @@ -74,6 +85,7 @@ disp_isthere = 0; //NUT: verifica se ASTFunType e' veramente importante // #RNU_RES_E [ASTFunName,InArg,NInArg,OutArg,NOutArg] = AST_GetFuncallPrm(FileInfo,SharedInfo,ASTFunType); +<<<<<<< HEAD NOutArg_mod = NOutArg if ASTFunName == 'OpLogAnd' AST_PushASTStack('&&'); @@ -88,6 +100,13 @@ NOutArg_mod = NOutArg disp_isthere = 1; end +======= +if (ASTFunType=='Funcall') +SharedInfo.Function_list(SharedInfo.Function_list_index) = ASTFunName; +SharedInfo.Function_list_index = SharedInfo.Function_list_index + 1; +end +NOutArg_mod = NOutArg +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 if(mtlb_strcmp(part(ASTFunName,1:2),'CV') == %T) SharedInfo.OpenCVUsed = %T; end @@ -127,8 +146,11 @@ NOutArg_mod = NOutArg PrintStringInfo(' ',ReportFileName,'both','y'); error(9999, 'SCI2CERROR: Unexpected number of output arguments for global function.'); end +<<<<<<< HEAD elseif(ASTFunName == 'raspi' | ASTFunName == 'raspi_close') SharedInfo.SkipNextFun = 1; +======= +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 end // #RNU_RES_B @@ -136,6 +158,7 @@ NOutArg_mod = NOutArg // --- Read the function annotations. --- // -------------------------------------- // #RNU_RES_E +<<<<<<< HEAD if ASTFunName == '%k' ASTFunName='modk'; end @@ -143,6 +166,8 @@ NOutArg_mod = NOutArg if ASTFunName == '%sn' ASTFunName='modsn'; end +======= +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 if (ASTFunName == 'OpEqual') FunTypeAnnot = ''; @@ -156,7 +181,10 @@ NOutArg_mod = NOutArg // --- Search for Equal Lhs and precision specifier to be applied to the current function. --- // ------------------------------------------------------------------------------------------- // #RNU_RES_E +<<<<<<< HEAD PrintStringInfo(' no of out arguments' + string(NOutArg),ReportFileName,'file','y'); +======= +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 [LhsArg,NLhsArg,FunPrecSpecifier,SharedInfo] = AST_GetPrecAndLhsArg(OutArg,NOutArg,ASTFunName,FunTypeAnnot,FunSizeAnnot,ASTFunType,FileInfo,SharedInfo); //NUT: questa funzione contiene troppi parametri e mi sembra disordinata. @@ -354,6 +382,7 @@ NOutArg_mod = NOutArg OutArg(1).Name = string(OutArg(1).Value); elseif ((ASTFunName == 'double') & (NInArg == 1) & (InArg(1).Dimension == 0) & (InArg(1).Scope == 'Number')) OutArg(1).Name = string(OutArg(1).Value); +<<<<<<< HEAD //elseif ASTFunName == 'disp' else [OutArg,SharedInfo] = GenOutArgNames(ASTFunName,InArg,NInArg,OutArg,NOutArg,LhsArg,NLhsArg,FileInfo,SharedInfo); @@ -361,6 +390,10 @@ NOutArg_mod = NOutArg PrintStringInfo(' returning back due logical function',ReportFileName,'file','y'); return; end +======= + else + [OutArg,SharedInfo] = GenOutArgNames(ASTFunName,InArg,NInArg,OutArg,NOutArg,LhsArg,NLhsArg,FileInfo,SharedInfo); +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 end if ((ASTFunName == 'uint8') & (NInArg == 1) & (InArg(1).Dimension == 0) & (InArg(1).Scope == 'Number')) @@ -404,8 +437,11 @@ NOutArg_mod = NOutArg // Scope already set above. elseif (ASTFunName == 'double' & NInArg == 1 & (InArg(1).Dimension == 0) & (InArg(1).Scope == 'Number')) // Scope already set above. +<<<<<<< HEAD //elseif ASTFunName == 'disp' //do nothing +======= +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 else OutArg = ST_AnalyzeScope(OutArg,NOutArg,FileInfo,SharedInfo); end @@ -424,8 +460,11 @@ NOutArg_mod = NOutArg //#RNUREM_ME A number is not inserted in the symbol table. elseif ((ASTFunName == 'double') & (NInArg == 1) & (InArg(1).Dimension == 0) & (InArg(1).Scope == 'Number')) //#RNUREM_ME A number is not inserted in the symbol table. +<<<<<<< HEAD //elseif ASTFunName == 'disp' //do nothing +======= +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 else ST_InsOutArg(OutArg,NOutArg,FileInfo,SharedInfo,'all'); end @@ -458,6 +497,7 @@ NOutArg_mod = NOutArg // -------------------------------------------- //#RNU_RES_E //disp(OutArg,InArg,ASTFunName) +<<<<<<< HEAD CFunName = C_GenerateFunName(ASTFunName,InArg,NInArg,OutArg,NOutArg_mod); @@ -465,6 +505,14 @@ NOutArg_mod = NOutArg //#RNU_RES_B PrintStringInfo(' C Function Name: '+CFunName,ReportFileName,'file','y'); if(IsArduinoFunction(ASTFunName)) +======= + CFunName = C_GenerateFunName(ASTFunName,InArg,NInArg,OutArg,NOutArg_mod); + + //#RNU_RES_B + PrintStringInfo(' C Function Name: '+CFunName,ReportFileName,'file','y'); + if(IsArduinoFunction(ASTFunName)) + //disp(ASTFunName) +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 if(IsArduinoSetupFunction(ASTFunName)) //If current function is an arduino setup function (like 'dc_motor_setup'), it //should not be converted and inserted here. It is inserted in a list now and @@ -485,8 +533,12 @@ NOutArg_mod = NOutArg else LibTypeInfo = 'USER2C'; end +<<<<<<< HEAD +======= + +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 //#RNU_RES_B // ------------------------------------------------------------------------------------ // --- Check whether the function has been already called in the current .sci file. --- @@ -533,8 +585,11 @@ NOutArg_mod = NOutArg SharedInfo.SkipNextFun > 0 | ... ((sum(mtlb_strcmp(ASTFunName,SharedInfo.Annotations.DataPrec)) > 0) & (SharedInfo.SkipNextPrec == 1))) // Do nothing +<<<<<<< HEAD //elseif ASTFunName == 'disp' // Do nothing +======= +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 else AST_CheckCommonInOutArgs(InArg,NInArg,OutArg,NOutArg,ReportFileName); end |