Date: | Tue, 6 May 2003 16:50:30 +0100 |
From: | Graham Barr <gbarr [...] pobox.com> |
To: | bug-Convert-ASN1 [...] rt.cpan.org |
Subject: | SET OF xxxx OPTIONAL |
----- Forwarded message from "perl-ldap-dev@lists.com.ar" <perl-ldap-dev@lists.com.ar> -----
Date: Tue, 25 Feb 2003 17:16:45 -0300 (ART)
To: <perl-ldap-dev@lists.sourceforge.net>
From: "perl-ldap-dev@lists.com.ar" <perl-ldap-dev@lists.com.ar>
Subject: Convert::ASN1
Hi
Excuse me if this isn't the correct list for the
Convert::ASN1 module.
I was using the library Convert::ASN1 and
get an error trying to prepare a "SET OF xxxx OPTIONAL".
A little example:
--------------------------------------
#!/usr/local/bin/perl -w
use Convert::ASN1;
my $asn = Convert::ASN1->new;
$asn->prepare( q<
foo ::= SET
{
bar [0] SET OF INTEGER OPTIONAL
}
Show quoted text
>) or die "Convert::ASN1 ERROR " . $asn->error . "\n";
print "OK \n";
---------------------------------------
The problem seems to be only "SET OF xxxx OPTIONAL", because
the same statement works without the "OPTIONAL" keyword.
Am I doing something wrong?
It's a valid construction?
I found in the grammar file: 'parser.y'
in the line 134
selem : seqset OF class plicit sselem
Shouldn't it said something like
selem : seqset OF class plicit sselem optional ?
I will search if there are any side efects.
Thanks for your attention
Leonardo A. Helman
Pert Consultores
lhelman@pert.com.ar
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
Show quoted text----- End forwarded message -----
----- Forwarded message from Graham Barr <gbarr@pobox.com> -----
Date: Tue, 25 Feb 2003 20:31:36 +0000
To: "perl-ldap-dev@lists.com.ar" <perl-ldap-dev@lists.com.ar>
Cc: perl-ldap-dev@lists.sourceforge.net
From: Graham Barr <gbarr@pobox.com>
Subject: Re: Convert::ASN1
On Tue, Feb 25, 2003 at 05:16:45PM -0300, perl-ldap-dev@lists.com.ar wrote:
> Hi
>
> Excuse me if this isn't the correct list for the
> Convert::ASN1 module.
Well Convert::ASN1 does not have its own list, so here is as good as any.
> I was using the library Convert::ASN1 and
> get an error trying to prepare a "SET OF xxxx OPTIONAL".
> The problem seems to be only "SET OF xxxx OPTIONAL", because
> the same statement works without the "OPTIONAL" keyword.
>
> Am I doing something wrong?
probably not
> It's a valid construction?
It probably should be.
> I found in the grammar file: 'parser.y'
> in the line 134
> selem : seqset OF class plicit sselem
>
> Shouldn't it said something like
> selem : seqset OF class plicit sselem optional ?
>
> I will search if there are any side efects.
I cannot think of any side effects. But to compile the parser
you will need a version of byacc that can generate perl code.
You can get it from http://www.cpan.org/src/misc/perl-byacc1.8.2.tar.gz
To rebuild the parser run make run_byacc
Graham.
----- End forwarded message -----
----- Forwarded message from "perl-ldap-dev@lists.com.ar" <perl-ldap-dev@lists.com.ar> -----
Date: Wed, 26 Feb 2003 11:27:45 -0300 (ART)
To: "perl-ldap-dev@lists.sf.net" <perl-ldap-dev@lists.sourceforge.net>
From: "perl-ldap-dev@lists.com.ar" <perl-ldap-dev@lists.com.ar>
Subject: Re: Convert::ASN1
Hi
> > get an error trying to prepare a "SET OF xxxx OPTIONAL".
Here is (i think) a solution.
I added in the parser.y file, for the selem definition
the optional keyword, and added the cOPT definition
to the element.
I've tried, and seems to be working.
(there are two warning whith the perl_byacc
and the test t/05time.t failed (with/without my patch))
The patch
--- ../Convert-ASN1-0.16/parser.y Mon Aug 19 23:51:37 2002
+++ parser.y Wed Feb 26 14:15:01 2003
@@ -131,10 +131,10 @@
| SET
;
-selem : seqset OF class plicit sselem
+selem : seqset OF class plicit sselem optional
{
$5->[cTAG] = $3;
- @{$$ = []}[cTYPE,cCHILD,cLOOP] = ($1, [$5], 1);
+ @{$$ = []}[cTYPE,cCHILD,cLOOP,cOPT] = ($1, [$5], 1, $6);
$$ = explicit($$) if $4;
}
;
Thank you very much
Lenardo A. Helman
Pert Consultores
lhelman@pert.com.ar
-------------------------------------------------------
This SF.net email is sponsored by: Scholarships for Techies!
Can't afford IT training? All 2003 ictp students receive scholarships.
Get hands-on training in Microsoft, Cisco, Sun, Linux/UNIX, and more.
www.ictp.com/training/sourceforge.asp
----- End forwarded message -----