kimgr / asn1ate

A Python library for translating ASN.1 into other forms.
Other
69 stars 41 forks source link

single value and range constraint with both '..' and '|' #61

Open mungayree opened 6 years ago

mungayree commented 6 years ago

is the following grammar syntax supported by asn1ate in 0.6.0, I see this failing -

 pcie-bus-defs  ::= SEQUENCE {
    pcie-bus-number    INTEGER (0 .. 255), 
    pcie-lane    INTEGER ( 0 | 1 | 2 | 4 | 8 | 16 ),
    pcie-slot-speed    INTEGER ( 0 | 2500 | 5000 | 8000 ),   -- in Mbps, per lane
    pcie-flags    OCTECT STRING (SIZE(4 | 12..16)),     -- pcie flags space
    ...
}

seem like (a|b|c|d) is incorrectly parsed in released version.

kimgr commented 6 years ago

See #40 (that you yourself has commented on), closing as duplicate.

mungayree commented 6 years ago

I think the checkin are totally broken during merge made by Fred. Please try above asn1 on latest asn1ate==0.6.0. The creation of py file fail with multiple pyparsing errors for '|' construct. '..' works fine.

kimgr commented 5 years ago

Support for alternate values separated by | is implemented now, but for mixed value and range we need to implement full support for element sets per X.680, item 50.