systemc-clang
2.0.0
Parsing SystemC constructs
Loading...
Searching...
No Matches
plugins
hdl
parselib
compound.py
Go to the documentation of this file.
1
"""Compound type"""
2
# aggregated type?
3
# Aggregated types better created within the class
4
5
6
class
aggregate
(object):
7
def
__init__
(self, params, fields):
8
self.
fields
fields
= fields
9
self.
params
= params
10
pass
11
12
def
to_str
(self, var_name, context=None):
13
stmts = []
14
idx = 0
15
for
x, t
in
self.
fields
fields
:
16
pref = var_name +
'_'
+ x
17
if
idx == len(self.
fields
fields
) - 1:
18
if
context
and
context.suffix:
19
context.suffix =
''
20
stmts.append(t.to_str(pref, context=context))
21
idx = idx + 1
22
# assert context is not None
23
# TODO: need some context for input/output
24
return
'\n'
.join(stmts)
25
26
parselib.compound.aggregate
Definition
compound.py:6
parselib.compound.aggregate.fields
str fields
Definition
compound.py:15
parselib.compound.aggregate.params
params
Definition
compound.py:9
parselib.compound.aggregate.__init__
__init__(self, params, fields)
Definition
compound.py:7
parselib.compound.aggregate.fields
fields
Definition
compound.py:8
parselib.compound.aggregate.to_str
to_str(self, var_name, context=None)
Definition
compound.py:12
Generated by
1.12.0