I'm trying to parse a map given to me by a telecom for 3gpp-related data. We have constructions like the following:
Iu-ReleaseCommandIEs RANAP-PROTOCOL-IES ::= {
{ ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory },
...
}
The parser fails because the inline (aka anonymous) instance of the class cannot be parsed. The only way around this is to make a named value set, e.g.,
iuRelCmdIEConfigA RANAP-PROTOCOL-IES ::= { ID id-Cause CRITICALITY ignore TYPE Cause PRESENCE mandatory }
Iu-ReleaseCommandIEs RANAP-PROTOCOL-IES ::= {
iuRelCmdIEConfigA,
...
}
But, we have hundreds of these. So, I'm poking around in asn1p_y.y trying to figure out how to get this done automatically. I'm currently flummoxed trying to figure out which construction to modify and how to modify it without breaking the grammar as LALR parsing is not my strongest suit. Once I get through bison I can take it forward from there. Any help is appreciated.
I can see why this feature isn't already implemented. The ambiguity caused by the second { causes the parser to recurse into ValueSet. No matter what I do, the ID gets parsed as a capital reference, causing syntactic blowout at id-Cause.
Maybe we should change the grammar to output GLR now that bison supports it. But, the lexer would have to be completely de-coupled.