1 /*
2 * Copyright (c) 2008-2019 Stephen Williams (steve@icarus.com)
3 *
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.
9 *
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.
14 *
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19
20 # include "PScope.h"
21
var_init_needs_explicit_lifetime() const22 bool LexicalScope::var_init_needs_explicit_lifetime() const
23 {
24 return false;
25 }
26
wires_find(perm_string name)27 PWire* LexicalScope::wires_find(perm_string name)
28 {
29 map<perm_string,PWire*>::const_iterator cur = wires.find(name);
30 if (cur == wires.end())
31 return 0;
32 else
33 return (*cur).second;
34 }
35
symbol_type() const36 PNamedItem::SymbolType LexicalScope::param_expr_t::symbol_type() const
37 {
38 return PARAM;
39 }
40
PScope(perm_string n,LexicalScope * parent)41 PScope::PScope(perm_string n, LexicalScope*parent)
42 : LexicalScope(parent), name_(n)
43 {
44 time_unit = 0;
45 time_precision = 0;
46 time_unit_is_default = true;
47 time_prec_is_default = true;
48 }
49
~PScope()50 PScope::~PScope()
51 {
52 for(map<perm_string, data_type_t*>::iterator it = typedefs.begin();
53 it != typedefs.end(); ++it)
54 delete it->second;
55 }
56
PScopeExtra(perm_string n,LexicalScope * parent)57 PScopeExtra::PScopeExtra(perm_string n, LexicalScope*parent)
58 : PScope(n, parent)
59 {
60 time_unit_is_local = false;
61 time_prec_is_local = false;
62 }
63
~PScopeExtra()64 PScopeExtra::~PScopeExtra()
65 {
66 }
67