summaryrefslogtreecommitdiff
path: root/macros/ASTManagement/AST_HandleCC.sci
diff options
context:
space:
mode:
authorsiddhu89902017-06-30 11:35:55 +0530
committersiddhu89902017-06-30 11:35:55 +0530
commitbee6bf6e37f6c36fb18b6132702e1528b7edafc2 (patch)
tree1090789e0205f0054c6b31b356b9417c8707176b /macros/ASTManagement/AST_HandleCC.sci
parent2c3b9e1055c8c9dfe874df3b7743c4a765042316 (diff)
parent7325b038e06f1571402a63caef2d75db30bd13c1 (diff)
downloadscilab2c-bee6bf6e37f6c36fb18b6132702e1528b7edafc2.tar.gz
scilab2c-bee6bf6e37f6c36fb18b6132702e1528b7edafc2.tar.bz2
scilab2c-bee6bf6e37f6c36fb18b6132702e1528b7edafc2.zip
Matrix declaration modified
Diffstat (limited to 'macros/ASTManagement/AST_HandleCC.sci')
-rw-r--r--macros/ASTManagement/AST_HandleCC.sci69
1 files changed, 69 insertions, 0 deletions
diff --git a/macros/ASTManagement/AST_HandleCC.sci b/macros/ASTManagement/AST_HandleCC.sci
new file mode 100644
index 00000000..cc411549
--- /dev/null
+++ b/macros/ASTManagement/AST_HandleCC.sci
@@ -0,0 +1,69 @@
+// 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
+
+function [RhsNames,RhsScope,NRhs] = AST_HandleCC(FileInfo,SharedInfo)
+
+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) ~= 'Expression:')
+ if RhsField(cntpop) <> 'Operands:' & RhsField(cntpop) <> 'Begin:'
+ NRhs = NRhs + 1;
+
+ [RhsNames(NRhs),RhsScope(NRhs)] = AST_ExtractNameAndScope(RhsField(cntpop));
+ end
+ cntpop = cntpop + 1;
+ RhsField(cntpop) = AST_PopASTStack();
+end
+RhsNames = SCI2Cflipud(RhsNames);
+RhsScope = SCI2Cflipud(RhsScope);
+
+// --- Repush everything into the stack. ---
+for cntpush = cntpop:-1:1
+ if RhsField(cntpush) <> 'Operands:' & RhsField(cntpush) <> 'Begin:'
+ PrintStringInfo(' ' + RhsField(cntpush),ReportFileName,'file','y');
+ AST_PushASTStack(RhsField(cntpush));
+ end
+end
+
+
+//for counterinputargs = 1:NRhs
+ //#RNU_RES_B
+ //disp(counterinputargs);
+ //PrintStringInfo('Input Argument Number '+string(counterinputargs)+': '+RhsNames(counterinputargs).Name,...
+ // ReportFileName,'file','y');
+ //PrintStringInfo(' Scope: '+RhsNames(counterinputargs).Scope,...
+ // ReportFileName,'file','y');
+ //#RNU_RES_E
+//end
+
+endfunction