mouse07410 / asn1c

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

(token "::="): syntax error and (token "}"): syntax error #187

Closed fabpiaf closed 2 months ago

fabpiaf commented 4 months ago

Hi, I tried several forks of asn1c - yours is the most successful which is why I post the issue here:

for i in *asn1.txt ; do asn1c -E $i; done

ASN.1 grammar parse error near 36523-1-i30_s08_04-s08_09.asn1.txt:3 (token "::="): syntax error
Cannot parse "36523-1-i30_s08_04-s08_09.asn1.txt"
ASN.1 grammar parse error near 36523-1-i30_s22-s24.asn1.txt:3 (token "::="): syntax error
Cannot parse "36523-1-i30_s22-s24.asn1.txt"
ASN.1 grammar parse error near 38331-i00.asn1.txt:4887 (token "}"): syntax error
Cannot parse "38331-i00.asn1.txt"
ASN.1 grammar parse error near 38523-1-h51_s08-s08161.asn1.txt:4 (token "::="): syntax error
Cannot parse "38523-1-h51_s08-s08161.asn1.txt"

36523-1-i30_s08_04-s08_09.asn1.txt 36523-1-i30_s22-s24.asn1.txt 38523-1-h51_s08-s08161.asn1.txt 38331-i00.asn1.txt

maybe you can look into this?

velichkov commented 4 months ago

Hi @fabpiaf,

ASN.1 grammar parse error near 36523-1-i30_s08_04-s08_09.asn1.txt:3 (token "::="): syntax error ASN.1 grammar parse error near 36523-1-i30_s22-s24.asn1.txt:3 (token "::="): syntax error ASN.1 grammar parse error near 38523-1-h51_s08-s08161.asn1.txt:4 (token "::="): syntax error

These 3 asn.1 modules are missing DEFINITIONS, BEGIN and END statements and because of this are invalid.

MyModule DEFINITIONS AUTOMATIC TAGS ::= BEGIN

END

ASN.1 grammar parse error near 38523-1-h51_s08-s08161.asn1.txt:4 (token "::="): syntax error

There is one trailing comma on line 4885 that you need to remove

     pathlossReferenceRS-Id-r18              PathlossReferenceRS-Id-r17                                   OPTIONAL,   -- Need R

The comma after OPTIONAL and before the comment --

mouse07410 commented 4 months ago

@velichkov thank you!

mouse07410 commented 4 months ago

@fabpiaf if the above suggestion by @velichkov fixes your problem - would you mind closing this issue? Otherwise, please provide more info.

mouse07410 commented 2 months ago

No response, and no feedback. Closing.