esa / asn1scc

ASN1SCC: An open source ASN.1 compiler for embedded systems
https://www.thanassis.space/asn1.html
Other
272 stars 58 forks source link

Can't compile gsm_map asn files to C sources #223

Closed snowy-owll closed 2 years ago

snowy-owll commented 2 years ago

Hello! I took asn files from Wireshark sources . Except for Ericsson.asn and Nokia.asn files. I also added the necessary from ros. To compile I use the following commands:

$gsm_map = (Get-ChildItem d:\gsm_map -File).FullName
asn1scc.exe -c -uPER -XER -o d:\gsm_map_out $gsm_map

After execution, I get the following error: D:\gsm_map\GSMMAP.asn:747:2: error: missing DOT at 'SendParametersArg' Is it possible to do something about this and compile these asn files? All hope for your compiler :)

OS: Windows 10 asn1scc.exe compiled from master branch.

maxime-esa commented 2 years ago

This module is using Object Information Classes, which is an ASN.1 construct that our compiler currently does not support:

image

snowy-owll commented 2 years ago

Thanks for the quick response! That is, there are only paid compilers left or somehow pulling decoders from the Wireshark source codes?

maxime-esa commented 2 years ago

I am not sure about that, as I am not too familiar with all features of other open-source compilers. Did you check them out already?

This construct (Object Information Classes) is mostly related to the description of interfaces (like function prototypes) and not directly to the description of messages (which is done via ASN.1 types). This is why we do not support it, as it goes a bit out of the scope of the language and somehow overlaps with other modelling techniques that we use.

An option is to remove these constructs from the input grammars and keep only the ASN.1 types - after all, they are the part that matters to get binary encoders and decoders.

snowy-owll commented 2 years ago

I have tried the asn1c compiler. In questions on the github, I met that he also does not support Object Information Classes. And it also gives an error when trying to compile. I did not find any other free compilers in C/C++ with uPER support. Thanks for the advice! I will try to understand and remove these constructs.