From 956aa2b9bcf6171234bc9749acbfabf8660beade Mon Sep 17 00:00:00 2001 From: ukashanoor Date: Tue, 27 Jun 2017 12:40:50 +0530 Subject: matrix complete --- macros/ASTManagement/AST_HandleFunRC.sci | 37 ++++++++++++++++++++++---------- 1 file changed, 26 insertions(+), 11 deletions(-) (limited to 'macros/ASTManagement/AST_HandleFunRC.sci') diff --git a/macros/ASTManagement/AST_HandleFunRC.sci b/macros/ASTManagement/AST_HandleFunRC.sci index a70155a..654f04d 100644 --- a/macros/ASTManagement/AST_HandleFunRC.sci +++ b/macros/ASTManagement/AST_HandleFunRC.sci @@ -1,4 +1,4 @@ -function [FileInfo,SharedInfo] = AST_HandleEndGenFun(FileInfo,SharedInfo) +function [FileInfo,SharedInfo] = AST_HandleFunRC(FileInfo,SharedInfo) // function [FileInfo,SharedInfo] = AST_HandleEndGenFun(FileInfo,SharedInfo,ASTFunType) // ----------------------------------------------------------------- // #RNU_RES_B @@ -26,10 +26,10 @@ function [FileInfo,SharedInfo] = AST_HandleEndGenFun(FileInfo,SharedInfo) // //NUT: add description here // // Status: -// 11-Apr-2007 -- Raffaele Nutricato: Author. +// 11-Apr-2007 -- Ukasha Noor: Author. // -// Copyright 2007 Raffaele Nutricato. -// Contact: raffaele.nutricato@tiscali.it +// Copyright 2017 Ukasha Noor. +// Contact: ukashanoor.iiitk@gmail.com // ----------------------------------------------------------------- // ------------------------------ @@ -74,22 +74,29 @@ end RhsField = AST_PopASTStack(); +InputArgumentNames = []; +InputArgumentScope = []; NInArg = 0; InArg = []; while (RhsField ~= 'Expression:') NInArg = NInArg + 1; - InArg(NInArg) = RhsField; + if RhsField <> 'Operands:' + [InputArgumentNames(NInArg),InputArgumentScope(NInArg)] = AST_ExtractNameAndScope(RhsField); + end + //disp(InputArgumentNames(NInArg)); + //InArg(NInArg) = RhsField; RhsField = AST_PopASTStack(); end InputArgumentNames = SCI2Cflipud(InputArgumentNames); InputArgumentScope = SCI2Cflipud(InputArgumentScope); +disp(NInArg); + // ------------------------------------- // --- Generate the InArg structure. --- // ------------------------------------- //#RNU_RES_E -InArg = []; for counterinputargs = 1:NInArg InArg(counterinputargs).Name=InputArgumentNames(counterinputargs); InArg(counterinputargs).Scope=InputArgumentScope(counterinputargs); @@ -105,6 +112,7 @@ for counteroutputargs = 1:NOutArg OutArg(counteroutputargs).Name=OutputArgumentNames(counteroutputargs); OutArg(counteroutputargs).Scope=OutputArgumentScope(counteroutputargs); end +disp(NOutArg); // ------------------------ // --- Print Some Info. --- @@ -125,8 +133,7 @@ PrintStringInfo('N Output Arguments: '+string(NOutArg),ReportFileName,'file','y' //#RNU_RES_B PrintStringInfo('Output Argument Number '+string(counteroutputargs)+': '+OutArg(counteroutputargs).Name,... ReportFileName,'file','y','n'); - PrintStringInfo(' Scope: '+OutArg(counterinputargs).Scope,... - ReportFileName,'file','y','n'); + //PrintStringInfo(' Scope: '+ OutArg(counterinputargs).Scope,ReportFileName,'file','y','n'); //#RNU_RES_E end @@ -144,14 +151,22 @@ UpdatedInArg = InArg; size_count = 0; for i = 1:NInArg - size_count = size_count + InArg(i).Size(2); + size_count = size_count + eval(InArg(i).Size(2)); +end + +com_type = 0; +for i = 1:NInArg + if InArg(i).Type == 'z' + com_type = 1; + end end + PrintStringInfo(' Generating Out Arg names.',ReportFileName,'file','y'); OutArg(1).Type = InArg(1).Type; OutArg(1).Size(1) = '1' OutArg(1).Size(2) = string(size_count); -OutArg(1).Dimension = InArg(1).Dimension; +OutArg(1).Dimension = 2; OutArg(1).Value = InArg(1).Value; OutArg(1).FindLike = InArg(1).FindLike; @@ -159,7 +174,7 @@ OutArg(1).FindLike = InArg(1).FindLike; OutArg = ST_AnalyzeScope(OutArg,NOutArg,FileInfo,SharedInfo); //--- Put the output Argument in symbol table ---// -ST_InsOutArg(OutArg,NOutArg,FileInfo,SharedInfo,'all'); +ST_InsOutArg_Dup(InArg,NInArg,OutArg,NOutArg,com_type,FileInfo,SharedInfo,'all'); endfunction -- cgit From f15ab8a9f06e3936309886b52b0eb547ab1094e0 Mon Sep 17 00:00:00 2001 From: ukashanoor Date: Tue, 27 Jun 2017 16:51:16 +0530 Subject: matrix complete1 --- macros/ASTManagement/AST_HandleFunRC.sci | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'macros/ASTManagement/AST_HandleFunRC.sci') diff --git a/macros/ASTManagement/AST_HandleFunRC.sci b/macros/ASTManagement/AST_HandleFunRC.sci index 654f04d..10f5151 100644 --- a/macros/ASTManagement/AST_HandleFunRC.sci +++ b/macros/ASTManagement/AST_HandleFunRC.sci @@ -162,13 +162,23 @@ for i = 1:NInArg end -PrintStringInfo(' Generating Out Arg names.',ReportFileName,'file','y'); -OutArg(1).Type = InArg(1).Type; -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; +if com_type == 0 + PrintStringInfo(' Generating Out Arg names.',ReportFileName,'file','y'); + OutArg(1).Type = InArg(1).Type; + 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; +else + PrintStringInfo(' Generating Out Arg names.',ReportFileName,'file','y'); + OutArg(1).Type = 'z'; + 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 ---// OutArg = ST_AnalyzeScope(OutArg,NOutArg,FileInfo,SharedInfo); -- cgit From 43592401ec4efefec61c236cd90b063a90a981b8 Mon Sep 17 00:00:00 2001 From: ukashanoor Date: Wed, 28 Jun 2017 16:30:53 +0530 Subject: float matrix done and func disp --- macros/ASTManagement/AST_HandleFunRC.sci | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'macros/ASTManagement/AST_HandleFunRC.sci') diff --git a/macros/ASTManagement/AST_HandleFunRC.sci b/macros/ASTManagement/AST_HandleFunRC.sci index 10f5151..c08c17e 100644 --- a/macros/ASTManagement/AST_HandleFunRC.sci +++ b/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 ---// -- cgit