systemc-clang 2.0.0
Parsing SystemC constructs
Loading...
Searching...
No Matches
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
6class aggregate(object):
7 def __init__(self, params, fields):
8 self.fieldsfields = 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.fieldsfields:
16 pref = var_name + '_' + x
17 if idx == len(self.fieldsfields) - 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
__init__(self, params, fields)
Definition compound.py:7
to_str(self, var_name, context=None)
Definition compound.py:12