summaryrefslogtreecommitdiff
path: root/macros/ASTManagement/AST_HandleWhileStatem.sci
diff options
context:
space:
mode:
Diffstat (limited to 'macros/ASTManagement/AST_HandleWhileStatem.sci')
-rw-r--r--macros/ASTManagement/AST_HandleWhileStatem.sci42
1 files changed, 42 insertions, 0 deletions
diff --git a/macros/ASTManagement/AST_HandleWhileStatem.sci b/macros/ASTManagement/AST_HandleWhileStatem.sci
index 79fb516..9b5dce1 100644
--- a/macros/ASTManagement/AST_HandleWhileStatem.sci
+++ b/macros/ASTManagement/AST_HandleWhileStatem.sci
@@ -36,6 +36,11 @@ global SCI2CSTACK
global StackPosition;
global STACKDEDUG
+<<<<<<< HEAD
+IfCondArg = [];
+NIfCondArg = 0;
+=======
+>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
// ------------------------------
// --- Check input arguments. ---
@@ -70,6 +75,42 @@ PrintStringInfo(' Redirecting C code to: '+FileInfo.Funct(nxtscifunnumber).CPa
// --- Generate C code. ---
// ------------------------
//#RNU_RES_E
+<<<<<<< HEAD
+flagendpop = 0;
+IfExprField = AST_PopASTStack();
+
+NOp=0;
+Op=[];
+while (flagendpop == 0)
+ if (IfExprField~='<EOL>')
+ if (IfExprField=='WhileExpression:')
+ flagendpop = 1;
+ // Pop Again the If tag from the AST.
+ IfExprField = AST_PopASTStack();
+ elseif (IfExprField=='Operands:')
+ flagendpop = 0;
+ g = AST_PopASTStack();
+ else
+ if (IfExprField=='&&' | IfExprField=='||')
+ NOp = NOp + 1;
+ Op(NOp) = IfExprField;
+ //PrintStringInfo('operators are '+Op(NOp),ReportFileName,'file','y');
+ else
+ NIfCondArg = NIfCondArg + 1;
+ IfCondArg(NIfCondArg) = IfExprField;
+ end
+ //[IfCondArg(NIfCondArg),tmpscope] = AST_ExtractNameAndScope(IfExprField);
+ //[IfCondArg(NIfCondArg),tmpscope] = AST_ExtractNameAndScope(IfExprField);
+ end
+ end
+ IfExprField = AST_PopASTStack();
+ PrintStringInfo('operators are '+IfExprField,ReportFileName,'file','y');
+end
+
+IfCondArg = SCI2Cflipud(IfCondArg);
+
+SharedInfo = C_WhileExpression(IfCondArg,NIfCondArg,Op,NOp,FileInfo,SharedInfo);
+=======
if(SharedInfo.WhileExpr.CondVar == '')
//#RNU_RES_B
// It means that we are handling something like while(a) or while(1)
@@ -100,6 +141,7 @@ elseif (SharedInfo.WhileExpr.DimCondVar > 0)
error(9999, 'Cannot manage while with matrix conditions');
end
SharedInfo = C_WhileExpression(FileInfo,SharedInfo);
+>>>>>>> 9e5793a7b05b23e6044a6d7a9ddd5db39ba375f0
// --------------------------
// --- Update SharedInfo. ---