From ec1677606d3e636a47d4fd0853f83868b3953314 Mon Sep 17 00:00:00 2001 From: ukashanoor Date: Fri, 7 Jul 2017 17:12:14 +0530 Subject: array declaration --- macros/ASTManagement/AST2Ccode.sci | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'macros/ASTManagement/AST2Ccode.sci') diff --git a/macros/ASTManagement/AST2Ccode.sci b/macros/ASTManagement/AST2Ccode.sci index 563f313..516291a 100644 --- a/macros/ASTManagement/AST2Ccode.sci +++ b/macros/ASTManagement/AST2Ccode.sci @@ -11,6 +11,7 @@ function AST2Ccode(FileInfoDatFile) // // Status: // 11-May-2007 -- Raffaele Nutricato: Author. +// 15-June-2017 -- Ukasha Noor: Revised By // // Copyright 2007 Raffaele Nutricato. // Contact: raffaele.nutricato@tiscali.it @@ -64,6 +65,8 @@ STACKDEDUG = 0; // 1 -> Every Pop and Push operation on the stack, the stack con global disp_isthere disp_isthere = 0; + +FName = null // ------------------------------------- // --- End parameter Initialization. --- // ------------------------------------- @@ -144,9 +147,13 @@ while ~meof(fidAST) case 'EndOperation' then [disp_isthere,FileInfo,SharedInfo] = AST_HandleEndGenFun(disp_isthere,FileInfo,SharedInfo,'Operation'); case 'EndFuncall' then + if rc_count > 0 & cc_count == 0 + [EqualInArgName,EqualInArgScope,EqualNInArg,FName] = AST_HandleFuncArray(FileInfo,SharedInfo); + elseif cc_count > 0 + [EqualInArgName,EqualInArgScope,EqualNInArg,FName] = AST_HandleFuncArray2D(FileInfo,SharedInfo); + else [disp_isthere,FileInfo,SharedInfo] = AST_HandleEndGenFun(disp_isthere,FileInfo,SharedInfo,'Funcall'); - disp(disp_isthere); - + end // -------------- // --- Equal. --- // -------------- @@ -156,10 +163,10 @@ while ~meof(fidAST) //NUT: ho miste ins e variabili, per esempio [c(1,1), a] = twooutfun(); //NUT: in questo caso solo una delle due equal va scartata. if rc_count > 0 & cc_count == 0 - [FileInfo,SharedInfo] = AST_HandleFunRC(FileInfo,SharedInfo); + [FileInfo,SharedInfo] = AST_HandleFunRC(FName,FileInfo,SharedInfo); rc_count = 0; elseif cc_count > 0 - [FileInfo,SharedInfo] = AST_HandleFunCC(cc_count,FileInfo,SharedInfo); + [FileInfo,SharedInfo] = AST_HandleFunCC(FName,cc_count,FileInfo,SharedInfo); rc_count = 0; cc_count = 0; else @@ -169,12 +176,12 @@ while ~meof(fidAST) end end disp_isthere = 0; + FName = null case 'Equal' then SharedInfo.Equal.Enabled = 1; // 1 means enabled -> we are inside an equal AST block. AST_PushASTStack(treeline); case 'Lhs :' then - disp(disp_isthere); if rc_count > 0 & cc_count == 0 SharedInfo.Equal.Lhs = 1; [EqualInArgName,EqualInArgScope,EqualNInArg] = AST_HandleRC(FileInfo,SharedInfo); -- cgit