diff options
Diffstat (limited to 'macros/ASTManagement/AST_HandleEndGenFun.sci')
-rw-r--r-- | macros/ASTManagement/AST_HandleEndGenFun.sci | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/macros/ASTManagement/AST_HandleEndGenFun.sci b/macros/ASTManagement/AST_HandleEndGenFun.sci index fec79532..6c2abed3 100644 --- a/macros/ASTManagement/AST_HandleEndGenFun.sci +++ b/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 [FileInfo,SharedInfo] = AST_HandleEndGenFun(FileInfo,SharedInfo,ASTFunT // ------------------------------ // --- Check input arguments. --- // ------------------------------ +<<<<<<< HEAD +SCI2CNInArgCheck(argn(2),4,4); +======= SCI2CNInArgCheck(argn(2),3,3); +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 // ----------------------- // --- Initialization. --- @@ -61,6 +69,11 @@ PrintStepInfo('Handling Funcall/Operation/Equal',FileInfo.Funct(nxtscifunnumber) global SCI2CSTACK global StackPosition; global STACKDEDUG +<<<<<<< HEAD + +disp_isthere = 0; +======= +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 // --------------------------- // --- End Initialization. --- // --------------------------- @@ -72,11 +85,28 @@ global STACKDEDUG //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('&&'); + return ; + end + if ASTFunName == 'OpLogOr' + AST_PushASTStack('||'); + return; + end + + if ASTFunName == 'disp' + 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 @@ -116,6 +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 @@ -123,6 +158,16 @@ NOutArg_mod = NOutArg // --- Read the function annotations. --- // -------------------------------------- // #RNU_RES_E +<<<<<<< HEAD + if ASTFunName == '%k' + ASTFunName='modk'; + end + + if ASTFunName == '%sn' + ASTFunName='modsn'; + end +======= +>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0 if (ASTFunName == 'OpEqual') FunTypeAnnot = ''; @@ -136,6 +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. @@ -333,8 +382,18 @@ 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); + if ( ASTFunName == 'OpLogGt' | ASTFunName == 'OpLogLt' | ASTFunName == 'OpLogLe' | ASTFunName == 'OpLogGe' | ASTFunName == 'OpLogNe' | ASTFunName == 'OpLogEq') + 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')) @@ -378,6 +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 @@ -396,6 +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 @@ -428,12 +497,22 @@ NOutArg_mod = NOutArg // -------------------------------------------- //#RNU_RES_E //disp(OutArg,InArg,ASTFunName) +<<<<<<< HEAD + + + CFunName = C_GenerateFunName(ASTFunName,InArg,NInArg,OutArg,NOutArg_mod); + + //#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 @@ -454,7 +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. --- @@ -501,6 +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 |