2 * Copyright (c) 1998-1999 Stephen Williams (steve@icarus.com)
4 * This source code is free software; you can redistribute it
5 * and/or modify it in source code form under the terms of the GNU
6 * General Public License as published by the Free Software
7 * Foundation; either version 2 of the License, or (at your option)
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
20 #ident "$Id: Statement.cc,v 1.30 2007/05/24 04:07:11 steve Exp $"
25 # include "Statement.h"
28 Statement::~Statement()
32 PAssign_::PAssign_(PExpr
*lval
, PExpr
*ex
)
33 : event_(0), lval_(lval
), rval_(ex
)
38 PAssign_::PAssign_(PExpr
*lval
, PExpr
*de
, PExpr
*ex
)
39 : event_(0), lval_(lval
), rval_(ex
)
44 PAssign_::PAssign_(PExpr
*lval
, PEventStatement
*ev
, PExpr
*ex
)
45 : event_(ev
), lval_(lval
), rval_(ex
)
56 PAssign::PAssign(PExpr
*lval
, PExpr
*ex
)
61 PAssign::PAssign(PExpr
*lval
, PExpr
*d
, PExpr
*ex
)
62 : PAssign_(lval
, d
, ex
)
66 PAssign::PAssign(PExpr
*lval
, PEventStatement
*d
, PExpr
*ex
)
67 : PAssign_(lval
, d
, ex
)
75 PAssignNB::PAssignNB(PExpr
*lval
, PExpr
*ex
)
80 PAssignNB::PAssignNB(PExpr
*lval
, PExpr
*d
, PExpr
*ex
)
81 : PAssign_(lval
, d
, ex
)
85 PAssignNB::~PAssignNB()
89 PBlock::PBlock(perm_string n
, BL_TYPE t
, const svector
<Statement
*>&st
)
90 : name_(n
), bl_type_(t
), list_(st
)
94 PBlock::PBlock(BL_TYPE t
, const svector
<Statement
*>&st
)
95 : bl_type_(t
), list_(st
)
99 PBlock::PBlock(BL_TYPE t
)
106 for (unsigned idx
= 0 ; idx
< list_
.count() ; idx
+= 1)
110 PCallTask::PCallTask(const pform_name_t
&n
, const svector
<PExpr
*>&p
)
111 : path_(n
), parms_(p
)
115 PCallTask::PCallTask(perm_string n
, const svector
<PExpr
*>&p
)
118 path_
.push_back(name_component_t(n
));
121 PCallTask::~PCallTask()
125 const pform_name_t
& PCallTask::path() const
130 PCase::PCase(NetCase::TYPE t
, PExpr
*ex
, svector
<PCase::Item
*>*l
)
131 : type_(t
), expr_(ex
), items_(l
)
138 for (unsigned idx
= 0 ; idx
< items_
->count() ; idx
+= 1)
139 if ((*items_
)[idx
]->stat
) delete (*items_
)[idx
]->stat
;
144 PCAssign::PCAssign(PExpr
*l
, PExpr
*r
)
149 PCAssign::~PCAssign()
155 PCondit::PCondit(PExpr
*ex
, Statement
*i
, Statement
*e
)
156 : expr_(ex
), if_(i
), else_(e
)
167 PDeassign::PDeassign(PExpr
*l
)
172 PDeassign::~PDeassign()
178 PDelayStatement::PDelayStatement(PExpr
*d
, Statement
*st
)
179 : delay_(d
), statement_(st
)
183 PDelayStatement::~PDelayStatement()
187 PDisable::PDisable(const pform_name_t
&sc
)
192 PDisable::~PDisable()
196 PEventStatement::PEventStatement(const svector
<PEEvent
*>&ee
)
197 : expr_(ee
), statement_(0)
199 assert(expr_
.count() > 0);
203 PEventStatement::PEventStatement(PEEvent
*ee
)
204 : expr_(1), statement_(0)
209 PEventStatement::PEventStatement(void)
214 PEventStatement::~PEventStatement()
216 // delete the events and the statement?
219 void PEventStatement::set_statement(Statement
*st
)
224 PForce::PForce(PExpr
*l
, PExpr
*r
)
235 PForever::PForever(Statement
*s
)
240 PForever::~PForever()
245 PForStatement::PForStatement(PExpr
*n1
, PExpr
*e1
, PExpr
*cond
,
246 PExpr
*n2
, PExpr
*e2
, Statement
*st
)
247 : name1_(n1
), expr1_(e1
), cond_(cond
), name2_(n2
), expr2_(e2
),
252 PForStatement::~PForStatement()
256 PProcess::~PProcess()
261 PRelease::PRelease(PExpr
*l
)
266 PRelease::~PRelease()
271 PRepeat::PRepeat(PExpr
*e
, Statement
*s
)
272 : expr_(e
), statement_(s
)
282 PTrigger::PTrigger(const pform_name_t
&e
)
287 PTrigger::~PTrigger()
291 PWhile::PWhile(PExpr
*e1
, Statement
*st
)
292 : cond_(e1
), statement_(st
)
303 * $Log: Statement.cc,v $
304 * Revision 1.30 2007/05/24 04:07:11 steve
305 * Rework the heirarchical identifier parse syntax and pform
306 * to handle more general combinations of heirarch and bit selects.
308 * Revision 1.29 2004/02/18 17:11:54 steve
309 * Use perm_strings for named langiage items.
311 * Revision 1.28 2002/08/12 01:34:58 steve
312 * conditional ident string using autoconfig.
314 * Revision 1.27 2002/04/21 22:31:02 steve
315 * Redo handling of assignment internal delays.
316 * Leave it possible for them to be calculated
319 * Revision 1.26 2002/04/21 04:59:07 steve
320 * Add support for conbinational events by finding
321 * the inputs to expressions and some statements.
322 * Get case and assignment statements working.
324 * Revision 1.25 2001/12/03 04:47:14 steve
325 * Parser and pform use hierarchical names as hname_t
326 * objects instead of encoded strings.
328 * Revision 1.24 2001/11/22 06:20:59 steve
329 * Use NetScope instead of string for scope path.
331 * Revision 1.23 2001/07/25 03:10:48 steve
332 * Create a config.h.in file to hold all the config
333 * junk, and support gcc 3.0. (Stephan Boettcher)