Project

General

Profile

Some Details » History » Version 3

Alexander Kamkin, 08/01/2014 12:01 PM

1 1 Alexander Kamkin
h1. Some Details
2
3
h2. Variable Declarations
4
5
Each declaration has a set of namesakes (declarations with the same name). Take a look to an example below.
6
7
<pre><code class="c">
8 3 Alexander Kamkin
// A variable can be an _output_ and a _register_ (or a _wire_) at the same time.
9 1 Alexander Kamkin
output var;
10
reg var;
11
</code></pre>
12
13
In this case, two declarations will be created:
14
15
# &lang; _ID_ ~1~, _name_ = "var", _type_ = "output", _namesakes_ = { _ID_ ~2~ } &rang;
16
# &lang; _ID_ ~2~, _name_ = "var", _type_ = "output", _namesakes_ = { _ID_ ~1~ } &rang;
17 3 Alexander Kamkin
18
The job is carried out by the _redefiniton handler_ attached to the symbol table. Being requested with some name, the table checks whether it contains an entity with the given name. if it does, the redefinition handler is invoked, which does nothing unless the entities are declarations; for declarations, it updates the sets of namesakes.