mouse07410 / asn1c

The ASN.1 Compiler
http://lionet.info/asn1c/
BSD 2-Clause "Simplified" License
101 stars 73 forks source link

Problem compiling: contains no objects #171

Open JSKim-Ranix opened 10 months ago

JSKim-Ranix commented 10 months ago

There is a "v2x.asn" file like below.

===================================================================================

V2X DEFINITIONS AUTOMATIC TAGS::= BEGIN

CommTxPDU ::= SEQUENCE { index INTEGER (1..2147483647), payload OCTET STRING }

CommRxPDU ::= SEQUENCE { psid INTEGER (0..270549119), payload OCTET STRING }

V2X-MESSAGE ::= CLASS { &id OBJECT IDENTIFIER, &MessageBody }

Message V2X-MESSAGE ::= { {&id {1 0 15784 1 0 1}, &MessageBody SEQUENCE OF CommTxPDU} | {&id {1 0 15784 1 0 2}, &MessageBody SEQUENCE OF CommRxPDU} }

EndApplicationMessage ::= SEQUENCE { endApplication-Message-id V2X-MESSAGE.&id ({Message}), endApplication-Message-msg V2X-MESSAGE.&MessageBody ({Message}{@endApplication-Message-id}) } END

===================================================================================

When I run compile, the following error occurs.

===================================================================================

./asn1c -S ./share/asn1c -D ./src -fcompound-names -fincludes-quoted -fline-refs -fwide-types -gen-autotools -pdu=EndApplicationMessage v2x.asn

FATAL: Information Object Set Message contains no objects at line 18 FATAL: Cannot compile "EndApplicationMessage" (20:1) at line 25 FATAL: Cannot compile "EndApplicationMessage" (20:1) at line 25

===================================================================================

The cause of the error is adding "({Message})" and "({Message}{@endApplication-Message-id})". However, I am unable to delete the part or request modification. First, it has been determined based on specification(standard) and is already being used by other companies. Another reason is that the syntex check shows no problems, and compilation proceeds well with other compilers (Obj-system). And, we've already done so much with the asn1c compiler. Thank you to everyone who helps. The share folder is attached. share.zip

v2x.asn.zip

mouse07410 commented 10 months ago

The cause of error is (as I understand it) inability of the free compilers like asn1c to process the new ASN.1 constructs added to the language in mid-2000.

I personally consider those additions an absolute abomination, but some standards are misguided enough to utilize them. As a result, you may be forced to use those commercial compilers - I don't have either time or skills to enhance asn1c to support them.

v0-e commented 10 months ago

Out of curiosity @JSKim-Ranix, which standard is this?

JSKim-Ranix commented 10 months ago

Out of curiosity @JSKim-Ranix, which standard is this?

It is a modification of the ISO 14827(DATEX-ASN) standard to suit C2X (Center to Everything) for C-ITS(Cooperative-Intelligent Transport Systems).

The cause of error is (as I understand it) inability of the free compilers like asn1c to process the new ASN.1 constructs added to the language in mid-2000.

I personally consider those additions an absolute abomination, but some standards are misguided enough to utilize them. As a result, you may be forced to use those commercial compilers - I don't have either time or skills to enhance asn1c to support them.

I have a question. I tested v2x.asn with the master branch, and compile was completed. Couldn't we find a way to solve the problem by compare the vlm_master branch and master branch? After developing using asn1c for 3 years, it is a very difficult decision to change to a commercial compilers. The master branch solves this problem, but has many other problems that make it difficult to use. We really want to use vlm_master branch.

v0-e commented 10 months ago

@JSKim-Ranix, the master branch may allow you to compile, but I'm doubtful that the output associated with EndApplicationMessage is useful. If you don't mind, please try my branch associated with PR #172, to see if it compiles successfully. I'm concerned about the &id's type being a OBJECT IDENTIFIER and I'm not sure if it is being compiled correctly. But that would probably be a separate issue.