summaryrefslogtreecommitdiff
path: root/2.3-1/macros/CCodeGeneration/GetWhileCondVariable.sci
blob: ba4c7e9283c9e239d8b0db02541ad0689cb091b2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
function SharedInfo = GetWhileCondVariable(OutArg,NOutArg,FunctionName,FileInfo,SharedInfo)
// function SharedInfo = GetWhileCondVariable(OutArg,NOutArg,FunctionName,FileInfo,SharedInfo)
// -----------------------------------------------------------------
// //NUT: add description here
//
// Input data:
// //NUT: add description here
//
// Output data:
// //NUT: add description here
//
// Status:
// 26-Oct-2007 -- Raffaele Nutricato: Author.
// 26-Oct-2007 -- Alberto Morea: Test Ok.
//
// Copyright 2007 Raffaele Nutricato.
// Contact: raffaele.nutricato@tiscali.it
// -----------------------------------------------------------------

//NUT: secondo me questa funzione non serve a nulla

// ------------------------------
// --- Check input arguments. ---
// ------------------------------
SCI2CNInArgCheck(argn(2),5,5);

// -----------------------
// --- Initialization. ---
// -----------------------
nxtscifunname        = SharedInfo.NextSCIFunName;
nxtscifunnumber      = SharedInfo.NextSCIFunNumber;
ReportFileName       = FileInfo.Funct(nxtscifunnumber).ReportFileName;

// #RNU_RES_B
PrintStringInfo(' ',ReportFileName,'file','y');
PrintStringInfo('***Checking if the current function is handling while counter variables.***',ReportFileName,'file','y');
// #RNU_RES_E

// ---------------------------
// --- End Initialization. ---
// ---------------------------

// #RNU_RES_B
// -----------------------------------------------
// --- Initial Check on While counter variables. ---
// -----------------------------------------------
// #RNU_RES_E
if ((SharedInfo.WhileExpr.OnExec > 0) & (NOutArg==1))
   // #RNU_RES_B
   //NUT: se sono in una while expression devo memorizzarmi l'ultima variabile di output 
   //NUT: perche' e' quella che contiene la condizione da testare,
   //NUT: allora io me le salvo tutte e l'ultima salvata sara' quella che andra' a finire 
   //NUT: nella while.
   // #RNU_RES_E
   SharedInfo.WhileExpr.CondVar = OutArg(1).Name;
   // #RNU_RES_B
   //if (SharedInfo.WhileExpr.AssignmentFun == 0)
      //NUT: Test also that SharedInfo.WhileExpr.AssignmentFun because sometimes Equal are dummy!
      //NUT: verifica se e' giusta questa mia affermazione.
      //RNU il seguente test e' stato spostato nella AST_HandleWhileStatem.c perche'
      //RNU: secondo me la matrice finale non e' supportata dalla while, ma while(det(M)>0)
      //RNU: puo' essere benissimo supportato.
      // if (OutArg.Dimension > 0)
      //    SCI2CerrorFile('Cannot manage while with matrix conditions',ReportFileName);
      //    SharedInfo.SkipNextFun = 0; //NUT verifica se serve
      // end
   // #RNU_RES_E
      SharedInfo.WhileExpr.DimCondVar = OutArg(1).Dimension;
   ///end
end

endfunction