summaryrefslogtreecommitdiff
path: root/macros/ASTManagement/AST_HandleFuncArray.sci
diff options
context:
space:
mode:
authorBrijeshcr2017-07-07 23:02:01 +0530
committerBrijeshcr2017-07-07 23:02:01 +0530
commite3bea007e2fae247b4d761bb50c7e28b16268405 (patch)
tree5e86dbf3f129aed509beb506d0926ce2427ff350 /macros/ASTManagement/AST_HandleFuncArray.sci
parentf577f255fd5c1d30bc770e9b053823ada8684528 (diff)
parentec1677606d3e636a47d4fd0853f83868b3953314 (diff)
downloadScilab2C_fossee_old-e3bea007e2fae247b4d761bb50c7e28b16268405.tar.gz
Scilab2C_fossee_old-e3bea007e2fae247b4d761bb50c7e28b16268405.tar.bz2
Scilab2C_fossee_old-e3bea007e2fae247b4d761bb50c7e28b16268405.zip
Array Declration for function
Diffstat (limited to 'macros/ASTManagement/AST_HandleFuncArray.sci')
-rw-r--r--macros/ASTManagement/AST_HandleFuncArray.sci63
1 files changed, 63 insertions, 0 deletions
diff --git a/macros/ASTManagement/AST_HandleFuncArray.sci b/macros/ASTManagement/AST_HandleFuncArray.sci
new file mode 100644
index 0000000..364e305
--- /dev/null
+++ b/macros/ASTManagement/AST_HandleFuncArray.sci
@@ -0,0 +1,63 @@
+function [RhsNames,RhsScope,NRhs,FName] = AST_HandleFuncArray(FileInfo,SharedInfo)
+// Copyright (C) 2017 - IIT Bombay - FOSSEE
+
+// This file must be used under the terms of the CeCILL.
+// This source file is licensed as described in the file COPYING, which
+// you should have received as part of this distribution. The terms
+// are also available at
+// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+// Author: Ukasha Noor
+// Organization: FOSSEE, IIT Bombay
+// Email: toolbox@scilab.in
+// This function is used for 1D array declaration.
+
+SCI2CNInArgCheck(argn(2),2,2)
+
+ReportFileName = FileInfo.Funct(nxtscifunnumber).ReportFileName;
+
+// ------------------------------
+// --- Check input arguments. ---
+// ------------------------------
+
+
+global SCI2CSTACK
+global StackPosition;
+global STACKDEDUG
+// ---------------------------
+// --- End Initialization. ---
+// ---------------------------
+
+
+// ------------------------------
+// --- Read input parameters. ---
+// ------------------------------
+cntpop = 1;
+NRhs = 0;
+RhsField(cntpop) = AST_PopASTStack();
+RhsNames = [];
+while (RhsField(cntpop) ~= 'Rhs :')
+ NRhs = NRhs + 1;
+ if RhsField(cntpop) <> 'Operands:'
+ [RhsNames(NRhs),RhsScope(NRhs)] = AST_ExtractNameAndScope(RhsField(cntpop));
+ end
+ cntpop = cntpop + 1;
+ RhsField(cntpop) = AST_PopASTStack();
+end
+first = AST_PopASTStack();
+second = AST_PopASTStack();
+
+FName = stripblanks(part(second,12:length(second)));
+
+RhsNames = SCI2Cflipud(RhsNames);
+RhsScope = SCI2Cflipud(RhsScope);
+
+// --- Repush everything into the stack. ---
+for cntpush = cntpop:-1:1
+ if RhsField(cntpush) <> 'Operands:' & RhsField(cntpush) <> 'Rhs :'
+ AST_PushASTStack(RhsField(cntpush));
+ end
+end
+
+
+
+endfunction