Re: Grammars, Ambiguous, ASN.1

Rajappa Iyer <rsi@lucent.com>
27 Jun 1999 00:01:33 -0400

          From comp.compilers

Related articles
Grammars, Ambiguous, ASN.1 sge@acm.org (1999-06-19)
Re: Grammars, Ambiguous, ASN.1 dmitrik@my-deja.com (Dmitri Katchalov) (1999-06-27)
Re: Grammars, Ambiguous, ASN.1 rsi@lucent.com (Rajappa Iyer) (1999-06-27)
Re: Grammars, Ambiguous, ASN.1 robin.hansen@irisa.fr (Robin Edgar Hansen) (1999-06-27)
Re: Grammars, Ambiguous, ASN.1 Christian.Rinderknecht@int-evry.fr (Christian Rinderknecht) (1999-06-29)
Re: Grammars, Ambiguous, ASN.1 Christian.Rinderknecht@int-evry.fr (Christian Rinderknecht) (1999-07-01)
Re: Grammars, Ambiguous, ASN.1 sge@acm.org (1999-07-05)
Re: Grammars, Ambiguous, ASN.1 elgey@dstc.qut.edu.au (Geoff Elgey) (1999-07-10)
| List of all articles for this month |

From: Rajappa Iyer <rsi@lucent.com>
Newsgroups: comp.compilers
Date: 27 Jun 1999 00:01:33 -0400
Organization: Totally disorganized!
References: 99-06-072
Keywords: parse

sge@acm.org (Steve Elkins) writes:


> 3. What other advice do the readers of this newsgroup have to offer
> me?


Bear in mind that the ASN.1 grammar is ambiguous and cannot be parsed
completely with LALR(1). It needs lexical tie-ins for disambiguation.
Also, while writing a compiler from scratch is a lot of fun (I've done
it in Perl, using Yapp a Perl-only Yacc replacement), it is a lot of
work. I'd suggest starting with the freely available ASN.1 compiler
SNACC. Last I looked, it generated C and C++ encoders and decoders
and could be extended for other languages as well.


Also, macros are horrendously hard, if not downright impossible, to
implement with Yacc and friends since macros can change the grammar
midstream. If you must have the SNMP macros, it is far better to
hard-code them---this is what SNACC does... a sensible approach IMHO.


Snacc may be found at:


http://www.fokus.gmd.de/ovma/freeware/snacc/entry.html


Regards,
Rajappa
--
Rajappa Iyer <rsi@lucent.com> #include <std_disclaimer.h>
We're too busy mopping the floor to turn off the faucet.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.