On Wed, 17 Oct 2001, Andrew Sutton wrote:
> hi,
>
> i've gotten bored so i've been working on an ASN.1 compiler based on the 97
> specifications. actually, it was going pretty well until i realized that i
> had mistyped the SymbolsImported productions. anyway, i ran into a problem
> and had some feedback or could propose an alternative syntax...
>
> it seems that the way that the SymbolsFromModuleList is constructed, you can
> run into a number of shift/reduce conflicts. if AssignedIdentifier attached
> to the GlobalModuleReference is a DefinedValue it conflicts with the first
> Symbol in the next SymbolList for multiple imports - if the first symbol is
> an abstract value (as opposed to type). if i'm just looking at this all
> wrong, let me know (like if its changed in a future version).
There is no problem if you look ahead one more token. If you see a
comma or "FROM", you know that you have a valuereference name to import,
but if you see typereference or valuereference next, you know that the
current token must be the valuereference for the AssignedIdentifier.
Paul
>
> otherwise, here's an alternative syntax that i'd propose (and implement)
>
> Exports ::=
> EXPORTS "(" SymbolList ")" ";" |
> empty
>
> and
>
> SymbolsFromModule ::=
> "(" SymbolList ")" FROM GlobalModuleReference
>
> that gets rid of any shift/reduce conflicts and gives the syntax a nice
> "mathematical-like" list structure.
This syntax has been part of the ASN.1 standard for more than a decade,
and is unlikely to be changed by the ASN.1 standards committee since there
are already many tools that implement this.
>
> there are others that i've run into like the OctetStringValue/BitStringValue
> reduce/reduce conflict, but that can be worked around by making an OCTET
> STRING capable of containing a BitStringValue... no big deal there.
Not quite sure what you mean here. The value of an OCTET STRING can be
either an "hstring" or a "bstring", but the number of bits in the value
must be a multiple of 8.
----------------------------------------------------------------------------
Paul E. Thorpe Toll Free : 1-888-OSS-ASN1
OSS Nokalva International: 1-732-302-0750
Email: [EMAIL PROTECTED] Tech Support : 1-732-302-9669
http://www.oss.com Fax : 1-732-302-0023