diff options
author | siddhu8990 | 2016-03-29 22:11:40 +0530 |
---|---|---|
committer | siddhu8990 | 2016-03-29 22:11:40 +0530 |
commit | d0dae962944e7fdb42bca7d0aa80055c44881b45 (patch) | |
tree | e315bbe940e601a177d4ff584976fb05ff05e08c /2.3-1/macros/ASTManagement | |
parent | 7198d73fe85d35ef63a88e3c5cc87dc9bbd24ccb (diff) | |
download | Scilab2C-d0dae962944e7fdb42bca7d0aa80055c44881b45.tar.gz Scilab2C-d0dae962944e7fdb42bca7d0aa80055c44881b45.tar.bz2 Scilab2C-d0dae962944e7fdb42bca7d0aa80055c44881b45.zip |
Function conversion using scilab2c call (not working)
Diffstat (limited to '2.3-1/macros/ASTManagement')
-rw-r--r-- | 2.3-1/macros/ASTManagement/AST_HandleEndGenFun.bin | bin | 81800 -> 84704 bytes | |||
-rw-r--r-- | 2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci | 20 | ||||
-rw-r--r-- | 2.3-1/macros/ASTManagement/AST_HandleHeader.bin | bin | 38100 -> 40524 bytes | |||
-rw-r--r-- | 2.3-1/macros/ASTManagement/AST_HandleHeader.sci | 21 |
4 files changed, 31 insertions, 10 deletions
diff --git a/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.bin b/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.bin Binary files differindex 13eec962..5baa2e21 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 4dfaec9a..3a6d225a 100644 --- a/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci +++ b/2.3-1/macros/ASTManagement/AST_HandleEndGenFun.sci @@ -193,11 +193,15 @@ global STACKDEDUG FileInfo.GlobalVarFileName); end else - //Change the scope of function name from variable to string, - //as it is passed as string to C function. Also enter this function - //in conversion list also. + //If a function is passed as input argument, Change the scope of function name from variable to string, + //as it is passed as string to C function. Also enter this function in conversion list also. if(ASTFunName == 'ode') - InArg(4).Scope = 'String'; + disp(NInArg) + if NInArg == 4 + InArg(4).Scope = 'String'; + ODEFunName = InArg(4).Name; + disp(ODEFunName) + end end [InArg,SharedInfo] = ST_GetInArgInfo(InArg,NInArg,FileInfo,SharedInfo); end @@ -469,4 +473,12 @@ global STACKDEDUG //NUT: e' piu' ordinato. //#RNU_RES_E + //If current function being converted is 'ode', call 'scilab2c' again to convert + //function containing differential equations. It is passed as one of the input + //arguements to 'ode'. + if ASTFunName == 'ode' then + temp = ODEFunName + '.sci' + scilab2c( '/home/siddhesh/Documents/Scilab/ODE/ODE_test/try_ode.sci', FileInfo.OutCCCodeDir, FileInfo.UserSciFilesPaths,'FunCall','make','AVR') + end + endfunction diff --git a/2.3-1/macros/ASTManagement/AST_HandleHeader.bin b/2.3-1/macros/ASTManagement/AST_HandleHeader.bin Binary files differindex b2ef8575..b5e33b67 100644 --- a/2.3-1/macros/ASTManagement/AST_HandleHeader.bin +++ b/2.3-1/macros/ASTManagement/AST_HandleHeader.bin diff --git a/2.3-1/macros/ASTManagement/AST_HandleHeader.sci b/2.3-1/macros/ASTManagement/AST_HandleHeader.sci index 661c740f..7346f321 100644 --- a/2.3-1/macros/ASTManagement/AST_HandleHeader.sci +++ b/2.3-1/macros/ASTManagement/AST_HandleHeader.sci @@ -95,7 +95,6 @@ else NOutArg = size(OutNames,1); end - //#RNU_RES_B // ------------------------------------- // --- Load the C function dat file. --- @@ -108,6 +107,16 @@ 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 + disp(SharedInfo.CurrentFunInfo.FunSizeAnnot) + disp(SharedInfo.CurrentFunInfo.FunTypeAnnot) +end //#RNU_RES_B // ----------------------------------------------------------------------------- // --- Check coherence between In/Out names and In/Out Arg structure loaded. --- @@ -119,13 +128,15 @@ else NInArgDat = 0; end -if (NInArgDat == NInArg) + +if ((NInArgDat == NInArg)|(nxtscifunname == SharedInfo.SCIMainFunName)) for tmpcnt = 1:NInArg SharedInfo.CurrentFunInfo.InArg(tmpcnt).Name = InNames(tmpcnt); if (SharedInfo.CurrentFunInfo.InArg(tmpcnt).Dimension == 0) SharedInfo.CurrentFunInfo.InArg(tmpcnt).Size(1) = '1'; SharedInfo.CurrentFunInfo.InArg(tmpcnt).Size(2) = '1'; SharedInfo.CurrentFunInfo.InArg(tmpcnt).Value = %nan; + SharedInfo.CurrentFunInfo.InArg(tmpcnt).FindLike = 0; else //#RNU_RES_B //NUT: using approach 1: Setting for input and output arguments symbolic sizes. @@ -133,14 +144,14 @@ if (NInArgDat == NInArg) SharedInfo.CurrentFunInfo.InArg(tmpcnt).Size(1) = '__'+SharedInfo.CurrentFunInfo.InArg(tmpcnt).Name+'Size[0]'; SharedInfo.CurrentFunInfo.InArg(tmpcnt).Size(2) = '__'+SharedInfo.CurrentFunInfo.InArg(tmpcnt).Name+'Size[1]'; SharedInfo.CurrentFunInfo.InArg(tmpcnt).Value = %nan; + SharedInfo.CurrentFunInfo.InArg(tmpcnt).FindLike = 0; end end else error(9999, 'Number of input arguments specified in AST is different from the number specified in .dat file.'); end - -if (SharedInfo.CurrentFunInfo.NOutArg == NOutArg) +if ((SharedInfo.CurrentFunInfo.NOutArg == NOutArg)|(nxtscifunname == SharedInfo.SCIMainFunName)) for tmpcnt = 1:NOutArg SharedInfo.CurrentFunInfo.OutArg(tmpcnt).Name = OutNames(tmpcnt); end @@ -160,7 +171,6 @@ SharedInfo.CurrentFunInfo.OutArg = ... SharedInfo,... SharedInfo.CurrentFunInfo.FunPrecSpecifier,... SharedInfo.CurrentFunInfo.FunTypeAnnot,SharedInfo.CurrentFunInfo.FunSizeAnnot,ReportFileName); - //#RNU_RES_B // ------------------------------------------------------------------------- // --- Stores InArg structure into the temporary variables symbol table. --- @@ -206,7 +216,6 @@ for tmpcnt = 1:NOutArg PrintStringInfo(' Setting symbol ""'+SharedInfo.CurrentFunInfo.OutArg(tmpcnt).Name+'"" in '+SymbTableFileName+'.',ReportFileName,'file','y'); //#RNU_RES_E - ST_Set(SharedInfo.CurrentFunInfo.OutArg(tmpcnt).Name,... SharedInfo.CurrentFunInfo.OutArg(tmpcnt).Type,... SharedInfo.CurrentFunInfo.OutArg(tmpcnt).Size,... |