summaryrefslogtreecommitdiff
path: root/macros/ASTManagement/AST_HandleCC.sci
diff options
context:
space:
mode:
authorukashanoor2017-06-27 12:40:50 +0530
committerukashanoor2017-06-27 12:40:50 +0530
commit956aa2b9bcf6171234bc9749acbfabf8660beade (patch)
treeffc914d9f15bbcce2154c4bcc702cb691004250f /macros/ASTManagement/AST_HandleCC.sci
parent785e19f097f7ca1964edaf159c9adfe2eda733b5 (diff)
downloadscilab2c-956aa2b9bcf6171234bc9749acbfabf8660beade.tar.gz
scilab2c-956aa2b9bcf6171234bc9749acbfabf8660beade.tar.bz2
scilab2c-956aa2b9bcf6171234bc9749acbfabf8660beade.zip
matrix complete
Diffstat (limited to 'macros/ASTManagement/AST_HandleCC.sci')
-rw-r--r--macros/ASTManagement/AST_HandleCC.sci88
1 files changed, 88 insertions, 0 deletions
diff --git a/macros/ASTManagement/AST_HandleCC.sci b/macros/ASTManagement/AST_HandleCC.sci
new file mode 100644
index 00000000..d0a2244b
--- /dev/null
+++ b/macros/ASTManagement/AST_HandleCC.sci
@@ -0,0 +1,88 @@
+function [RhsNames,RhsScope,NRhs] = AST_HandleCC(FileInfo,SharedInfo)
+// function [FileInfo,SharedInfo] = AST_HandleEndGenFun(FileInfo,SharedInfo,ASTFunType)
+// -----------------------------------------------------------------
+// #RNU_RES_B
+// Handles the EndFuncall, EndOperation and EndEqual tags of the AST.
+// ASTFunType can be 'Funcall', 'Operation', 'Equal'
+// Structure of Funcall:
+// overloading function for "funcall" type tlist string function
+// this is a node of the AST
+// fields:
+// rhs : a list
+// name : string, the name of the function
+// lhsnb: number, the number of function lhs
+// txt=['Funcall : '+F.name
+// ' #lhs : '+string(F.lhsnb)
+// ' Rhs : '
+// ' '+objectlist2string(F.rhs)
+// 'EndFuncall'
+// ]
+// #RNU_RES_E
+//
+// Input data:
+// //NUT: add description here
+//
+// Output data:
+// //NUT: add description here
+//
+// Status:
+// 11-Apr-2007 -- Raffaele Nutricato: Author.
+//
+// Copyright 2007 Raffaele Nutricato.
+// Contact: raffaele.nutricato@tiscali.it
+// -----------------------------------------------------------------
+
+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