asn1c icon indicating copy to clipboard operation
asn1c copied to clipboard

Problem parsing ISO-TS-19091-addgrp-C-2018.asn

Open MartijnHarmenzon opened this issue 2 years ago • 2 comments

Trying to parse the following: https://standards.iso.org/iso/ts/19091/ed-2/en/ISO-TS-19091-addgrp-C-2018.asn

With the statement below: asn1c ISO-TS-19091-addgrp-C-2018.asn

Resulting in: ASN.1 grammar parse error near line 244 (token "IDENTIFIED"): syntax error, unexpected TOK_capitalreference, expecting '}' Cannot parse "ISO-TS-19091-addgrp-C-2018.asn"

Any ideas? Help is much appreciated.

MartijnHarmenzon avatar Apr 15 '23 08:04 MartijnHarmenzon

Sorry, I don't know. In general, the newer "baroque"-style ASN.1 goes poorly with asn1c, which is moch better suited towards simpler ASN.1 definitions...

Maybe somebody else here could comment...?

mouse07410 avatar May 05 '23 20:05 mouse07410

The simple answer is that asn1c just doesn't support the token IDENTIFIED BY (X.681 10.7). However IDENTIFIED BY is not really a keyword. As I've been given to understand it is merely syntactic sugar that should make it more readable for humans. You might be able to parse the grammar if you just removed it.

I am also not that well versed in this style of ASN.1. Frankly I find the entire grammar confusing. Implementing 3 modules - where each module use IMPORT from eachother to get type definitions from other modules. I can't tell where one module starts and another ends. The module ´REGION´ in this case imports addGrpC and REG-EXT-ID-AND-TYPE from the module DSRC. addGrpC just seems to be value reference with a constant equal to 3. REG-EXT-ID-AND-TYPE is a CLASS

But the line

	{ConnectionManeuverAssist-addGrpC  IDENTIFIED BY addGrpC},

Suggests that the type ConnectionManeuverAssist-addGrpC which is imported from the module AddGrpC is IDENTIFIED BY the value addGrpC which was imported from DSRC. Shouldn't it have been:

	{ConnectionManeuverAssist-addGrpC  IDENTIFIED BY AddGrpC},

Or am I misunderstanding something?

kentkost avatar May 31 '23 09:05 kentkost