1
//////////////////////////////////////////////////////////////////////////
3
// pgScript - PostgreSQL Tools
4
// RCS-ID: $Id: pgsWhileStmt.cpp 7758 2009-03-26 20:49:59Z dpage $
5
// Copyright (C) 2002 - 2009, The pgAdmin Development Team
6
// This software is released under the BSD Licence
8
//////////////////////////////////////////////////////////////////////////
12
#include "pgscript/statements/pgsWhileStmt.h"
14
#include "pgscript/exceptions/pgsBreakException.h"
15
#include "pgscript/exceptions/pgsContinueException.h"
16
#include "pgscript/exceptions/pgsInterruptException.h"
17
#include "pgscript/utilities/pgsThread.h"
19
pgsWhileStmt::pgsWhileStmt(const pgsExpression * cond, const pgsStmt * stmt_list,
21
pgsStmt(app), m_cond(cond), m_stmt_list(stmt_list)
26
pgsWhileStmt::~pgsWhileStmt()
32
void pgsWhileStmt::eval(pgsVarMap & vars) const
35
if (m_cond->eval(vars)->pgs_is_true())
39
m_stmt_list->eval(vars);
41
catch (const pgsBreakException &)
45
catch (const pgsContinueException &)
49
if (m_app != 0 && m_app->TestDestroy())
50
throw pgsInterruptException();