Merge branch 'master' into verilog-ams
[sverilog.git] / PFunction.cc
blobfb26c434beae057e9fbb8d9b88e6fc10b27623d8
1 /*
2 * Copyright (c) 1999-2008 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)
8 * any later version.
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 # include "config.h"
22 #include "PTask.h"
24 PFunction::PFunction(perm_string name, PScope*parent)
25 : PScope(name, parent), ports_(0), statement_(0)
27 return_type_.type = PTF_NONE;
30 PFunction::~PFunction()
34 void PFunction::set_ports(svector<PWire *>*p)
36 assert(ports_ == 0);
37 ports_ = p;
40 void PFunction::set_statement(Statement*s)
42 assert(s != 0);
43 assert(statement_ == 0);
44 statement_ = s;
47 void PFunction::set_return(PTaskFuncArg t)
49 return_type_ = t;