Commit ccf5d42d authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Support vdm composite types

parent ca562004
......@@ -194,9 +194,10 @@ def vdm_to_swig(vdm, dest, sort, ASN1Swig, ASN1_AST, var=None):
ptr = ptr[int(split[1])]
def rec(inp, outp, sort):
''' Recursively fill up the value '''
if sort.kind == 'ReferenceType':
kind = sort.kind
if kind == 'ReferenceType':
sort = ASN1_AST[sort.ReferencedTypeName]
kind = sort.type.kind
kind = sort.type.kind
if kind in ('SequenceOfType', 'SetOfType'):
# get the path to the sequence of
_, params, path = outp.GetState()
......@@ -276,9 +277,7 @@ def vdm_to_swig(vdm, dest, sort, ASN1Swig, ASN1_AST, var=None):
_, params, path = outp.GetState()
if path:
path = path.strip('.').split('.')
for field, data in zip(sort.type.Children.viewkeys(), inp['Seq']):
# Yikes! Ordering of fiels in the Sequence is not guaranteed
# in a normal dict....
for field, data in zip(outp.children_ordered, inp['Seq']):
outp.Reset()
for each in path:
# Reach the path, including indexes
......@@ -293,6 +292,7 @@ def vdm_to_swig(vdm, dest, sort, ASN1Swig, ASN1_AST, var=None):
reach(path[0], outp)
else:
# Unsupported type
print 'unsupported type: ', kind
pass
rec(var, dest, sort)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment