Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
asn1-value-editor
Commits
ccf5d42d
Commit
ccf5d42d
authored
Jul 17, 2015
by
Maxime Perrotin
Browse files
Support vdm composite types
parent
ca562004
Changes
1
Hide whitespace changes
Inline
Side-by-side
asn1_value_editor/vdm_vn.py
View file @
ccf5d42d
...
...
@@ -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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment