kimgr / asn1ate

A Python library for translating ASN.1 into other forms.
Other
69 stars 41 forks source link

resolve imported type declarations #59

Open karlsv opened 6 years ago

karlsv commented 6 years ago

I'm not quite sure how imports are handled right now, but it seems I can't use imported types. I'm guessing types are resolved when they are referenced with their module explicitly, with a dot BasicContainer ::= SEQUENCE { someVar SomeModule.SomeType } But it should be possible to use the type without the module reference when it is imported. My guess is that this can be fixed in resolve_type_decl, line 287 in sema.py, with a loop through the imported types if type_decl.module_ref doesn't exist. Will look into it

kimgr commented 6 years ago

Thanks! I did some work on this this summer, but it's still lying around in a branch in one of my machines, and I don't think I ever finished. The challenge is the mapping from asn.1 modules to python modules and their respective symbol lookup/reference syntax.

But please do give it a shot of you have time, it can only get better :)