On 1 Oct 2003, at 18:58, Graham Barr wrote:
On 1 Oct 2003, at 18:10, Chris Ridd wrote:
extnValue [UNIVERSAL 4] EXPLICIT ANY DEFINED BY extnID

But that causes a parse error as it is expecting the tag to have the
constructor bit set :(

Maybe I could add an extension so we can write

extnValue [UNIVERSAL 4] CONTAINING ANY DEFINED BY extnID

Which is identical to explicit, but does not set the constructor bit

'ANY DEFINED BY' just encodes the actual value in place of the 'ANY', as far
as I know. This X.509 stuff is different - it encodes the value and then
encodes a real OCTET STRING containing the encoded value.

I know, and that is basically what EXPLICIT does. C::ASN1 already accepts the syntax above, but it sets the constructor bit. CONTAINING would be a way around it.

OK, here is a patch to try. using the ASN.1 from x509decode change the like for extnValue to be


extnValue [UNIVERSAL 4] CONTAINING ANY DEFINED BY extnID

Then run

$asn->registeroid('2.5.29.17' => $asn->find('SubjectAltName'));

my $exts = $asn->find("Extensions");

use MIME::Base64;
my $sanBase64="MDUwMwYDVR0RBCwwKoIMdGVzdDEuaHAuY29tggx0ZXN0Mi5ocC5jb22CDHRl c3QzLmhwLmNvbQ==";
my $binSan = decode_base64($sanBase64);


asn_dump($binSan);

  use Data::Dumper;
  print Dumper($exts->decode($binSan));

and voila!

Should I add it, what do people think ?

Graham.

? y.tab.pl
? Makefile
? xxx
? contain.patch
Index: parser.y
===================================================================
RCS file: /cvsroot/perl-ldap/asn/parser.y,v
retrieving revision 1.11
diff -u -u -r1.11 parser.y
--- parser.y    7 May 2003 15:13:27 -0000       1.11
+++ parser.y    1 Oct 2003 18:27:03 -0000
@@ -18,6 +18,7 @@
 %token POSTRBRACE 18
 %token DEFINED 19
 %token BY 20
+%token CONTAINING 21
 
 %{
 # Copyright (c) 2000-2002 Graham Barr <[EMAIL PROTECTED]>. All rights reserved.
@@ -53,6 +54,7 @@
   ENUM             => [ asn_encode_tag(ASN_ENUMERATED),        opINTEGER ],
   'RELATIVE-OID'    => [ asn_encode_tag(ASN_RELATIVE_OID),     opROID    ],
 
+  CONTAINING       => [ asn_encode_tag(ASN_OCTET_STR),         opCONTAINING  ],
   SEQUENCE         => [ asn_encode_tag(ASN_SEQUENCE | ASN_CONSTRUCTOR), opSEQUENCE ],
   SET               => [ asn_encode_tag(ASN_SET      | ASN_CONSTRUCTOR), opSET ],
 
@@ -82,9 +84,10 @@
 
 sub explicit {
   my $op = shift;
+  my $type = shift;
   my @seq = @$op;
 
-  @seq[cTYPE,cCHILD,cVAR,cLOOP] = ('SEQUENCE',[$op],undef,undef);
+  @seq[cTYPE,cCHILD,cVAR,cLOOP] = ($type,[$op],undef,undef);
   @{$op}[cTAG,cOPT] = ();
 
   [EMAIL PROTECTED];
@@ -112,7 +115,7 @@
 aitem  : class plicit anyelem postrb
                {
                  $3->[cTAG] = $1;
-                 $$ = $2 ? explicit($3) : $3;
+                 $$ = $2 ? explicit($3,$2) : $3;
                }
        | celem
        ;
@@ -137,7 +140,7 @@
                {
                  $5->[cTAG] = $3;
                  @{$$ = []}[cTYPE,cCHILD,cLOOP,cOPT] = ($1, [$5], 1, $6);
-                 $$ = explicit($$) if $4;
+                 $$ = explicit($$,$4) if $4;
                }
        ;
 
@@ -204,7 +207,7 @@
 nitem  : WORD class plicit anyelem
                {
                  @{$$=$4}[cVAR,cTAG] = ($1,$2);
-                 $$ = explicit($$) if $3;
+                 $$ = explicit($$,$3) if $3;
                }
        ;
 
@@ -240,13 +243,13 @@
                {
                  @{$$=$4}[cVAR,cTAG] = ($1,$2);
                  $$->[cOPT] = $1 if $$->[cOPT];
-                 $$ = explicit($$) if $3;
+                 $$ = explicit($$,$3) if $3;
                }
        | celem
        | class plicit onelem
                {
                  @{$$=$3}[cTAG] = ($1);
-                 $$ = explicit($$) if $2;
+                 $$ = explicit($$,$2) if $2;
                }
        ;
 
@@ -260,7 +263,8 @@
        ;
 
 plicit :                       { $$ = undef; }
-       | EXPLICIT              { $$ = 1;     }
+       | EXPLICIT              { $$ = 'SEQUENCE';  }
+       | CONTAINING            { $$ = 'CONTAINING'; }
        | IMPLICIT              { $$ = 0;     }
        ;
 
@@ -294,7 +298,8 @@
   ','          => $COMMA,
   '::='         => $ASSIGN,
   'DEFINED'     => $DEFINED,
-  'BY'         => $BY
+  'BY'         => $BY,
+  'CONTAINING'  => $CONTAINING,
 );
 
 my $reserved = join("|", reverse sort grep { /\w/ } keys %reserved);
Index: lib/Convert/ASN1.pm
===================================================================
RCS file: /cvsroot/perl-ldap/asn/lib/Convert/ASN1.pm,v
retrieving revision 1.27
diff -u -u -r1.27 ASN1.pm
--- lib/Convert/ASN1.pm 12 May 2003 17:45:57 -0000      1.27
+++ lib/Convert/ASN1.pm 1 Oct 2003 18:27:03 -0000
@@ -47,7 +47,7 @@
 
   @opName = qw(
     opUNKNOWN opBOOLEAN opINTEGER opBITSTR opSTRING opNULL opOBJID opREAL
-    opSEQUENCE opSET opUTIME opGTIME opUTF8 opANY opCHOICE opROID
+    opSEQUENCE opSET opUTIME opGTIME opUTF8 opANY opCHOICE opROID opCONTAINING
   );
 
   foreach my $l ([EMAIL PROTECTED], [EMAIL PROTECTED]) {
Index: lib/Convert/ASN1/_decode.pm
===================================================================
RCS file: /cvsroot/perl-ldap/asn/lib/Convert/ASN1/_decode.pm,v
retrieving revision 1.18
diff -u -u -r1.18 _decode.pm
--- lib/Convert/ASN1/_decode.pm 7 May 2003 09:26:36 -0000       1.18
+++ lib/Convert/ASN1/_decode.pm 1 Oct 2003 18:27:03 -0000
@@ -35,6 +35,7 @@
   undef, # ANY
   undef, # CHOICE
   \&_dec_object_id,
+  \&_dec_sequence, # CONTAINING
 );
 
 my @ctr;
Index: lib/Convert/ASN1/_encode.pm
===================================================================
RCS file: /cvsroot/perl-ldap/asn/lib/Convert/ASN1/_encode.pm,v
retrieving revision 1.18
diff -u -u -r1.18 _encode.pm
--- lib/Convert/ASN1/_encode.pm 6 May 2003 21:29:07 -0000       1.18
+++ lib/Convert/ASN1/_encode.pm 1 Oct 2003 18:27:03 -0000
@@ -35,6 +35,7 @@
   \&_enc_any,
   \&_enc_choice,
   \&_enc_object_id,
+  \&_enc_sequence, # opCONTAINING
 );
 
 
Index: lib/Convert/ASN1/parser.pm
===================================================================
RCS file: /cvsroot/perl-ldap/asn/lib/Convert/ASN1/parser.pm,v
retrieving revision 1.12
diff -u -u -r1.12 parser.pm
--- lib/Convert/ASN1/parser.pm  7 May 2003 15:13:28 -0000       1.12
+++ lib/Convert/ASN1/parser.pm  1 Oct 2003 18:27:03 -0000
@@ -1,7 +1,7 @@
 # 1 "y.tab.pl"
 #$yysccsid = "@(#)yaccpar 1.8 (Berkeley) 01/20/91 (Perl 2.0 12/31/92)";
 
-# 22 "parser.y"
+# 23 "parser.y"
 
 ;# Copyright (c) 2000-2002 Graham Barr <[EMAIL PROTECTED]>. All rights reserved.
 ;# This program is free software; you can redistribute it and/or
@@ -9,7 +9,7 @@
 
 package Convert::ASN1::parser;
 
-;# $Id: parser.pm,v 1.12 2003/05/07 15:13:28 gbarr Exp $
+;# $Id: parser.y,v 1.11 2003/05/07 15:13:27 gbarr Exp $
 
 use strict;
 use Convert::ASN1 qw(:all);
@@ -36,6 +36,7 @@
   ENUM             => [ asn_encode_tag(ASN_ENUMERATED),        opINTEGER ],
   'RELATIVE-OID'    => [ asn_encode_tag(ASN_RELATIVE_OID),     opROID    ],
 
+  CONTAINING       => [ asn_encode_tag(ASN_OCTET_STR),         opCONTAINING  ],
   SEQUENCE         => [ asn_encode_tag(ASN_SEQUENCE | ASN_CONSTRUCTOR), opSEQUENCE ],
   SET               => [ asn_encode_tag(ASN_SET      | ASN_CONSTRUCTOR), opSET ],
 
@@ -65,15 +66,16 @@
 
 sub explicit {
   my $op = shift;
+  my $type = shift;
   my @seq = @$op;
 
-  @seq[cTYPE,cCHILD,cVAR,cLOOP] = ('SEQUENCE',[$op],undef,undef);
+  @seq[cTYPE,cCHILD,cVAR,cLOOP] = ($type,[$op],undef,undef);
   @{$op}[cTAG,cOPT] = ();
 
   [EMAIL PROTECTED];
 }
 
-# 74 "y.tab.pl"
+# 76 "y.tab.pl"
 
 sub constWORD () { 1 }
 sub constCLASS () { 2 }
@@ -95,6 +97,7 @@
 sub constPOSTRBRACE () { 18 }
 sub constDEFINED () { 19 }
 sub constBY () { 20 }
+sub constCONTAINING () { 21 }
 sub constYYERRCODE () { 256 }
 my @yylhs = (                                               -1,
     0,    0,    2,    2,    3,    3,    6,    6,    6,    6,
@@ -102,7 +105,7 @@
    10,   18,   18,   18,   18,   18,   19,   19,   11,   16,
    16,   20,   20,   20,   21,    1,    1,   22,   22,   22,
    24,   24,   24,   24,   23,   23,   23,   15,   15,    4,
-    4,    5,    5,    5,   17,   17,   25,    7,    7,
+    4,    5,    5,    5,    5,   17,   17,   25,    7,    7,
 );
 my @yylen = (                                                2,
     1,    1,    3,    4,    4,    1,    1,    1,    1,    1,
@@ -110,99 +113,99 @@
     4,    1,    1,    1,    2,    1,    0,    3,    1,    1,
     2,    1,    3,    3,    4,    1,    2,    1,    3,    3,
     2,    1,    1,    1,    4,    1,    3,    0,    1,    0,
-    1,    0,    1,    1,    1,    3,    2,    0,    1,
+    1,    0,    1,    1,    1,    1,    3,    2,    0,    1,
 );
 my @yydefred = (                                             0,
     0,   51,    0,    0,    1,    0,    0,   46,    0,   38,
-    0,    0,    0,    0,   54,   53,    0,    0,    0,    3,
-    0,    6,    0,   11,    0,    0,    0,    0,   47,    0,
-   39,   40,    0,   22,    0,    0,    0,    0,   44,   42,
-    0,   43,    0,   29,   45,    4,    0,    0,    0,    0,
-    7,    8,    9,   10,    0,   25,    0,   49,   41,    0,
-    0,    0,    0,    0,    0,   32,   59,    5,    0,    0,
-    0,   55,    0,   18,   19,    0,   20,    0,    0,   28,
-   57,   21,    0,    0,    0,   34,   33,   56,    0,    0,
-   17,   15,   16,    0,   35,   14,
+    0,    0,    0,    0,   55,   53,   54,    0,    0,    0,
+    3,    0,    6,    0,   11,    0,    0,    0,    0,   47,
+    0,   39,   40,    0,   22,    0,    0,    0,    0,   44,
+   42,    0,   43,    0,   29,   45,    4,    0,    0,    0,
+    0,    7,    8,    9,   10,    0,   25,    0,   49,   41,
+    0,    0,    0,    0,    0,    0,   32,   60,    5,    0,
+    0,    0,   56,    0,   18,   19,    0,   20,    0,    0,
+   28,   58,   21,    0,    0,    0,   34,   33,   57,    0,
+    0,   17,   15,   16,    0,   35,   14,
 );
 my @yydgoto = (                                              4,
-    5,    6,   20,    7,   17,   50,   68,    8,   51,   52,
-   53,   54,   43,   94,   59,   64,   71,   44,   56,   65,
-   66,    9,   10,   45,   72,
-);
-my @yysindex = (                                             7,
-    9,    0,   12,    0,    0,   19,   51,    0,   34,    0,
-   75,   51,   31,   -1,    0,    0,   90,   55,   55,    0,
-   51,    0,  114,    0,   75,   26,   53,   61,    0,   77,
-    0,    0,  114,    0,   26,   53,   64,   76,    0,    0,
-   89,    0,   96,    0,    0,    0,   55,   55,  111,  103,
-    0,    0,    0,    0,   94,    0,  130,    0,    0,   77,
-  122,  128,   77,  139,   78,    0,    0,    0,  154,  143,
-   33,    0,   51,    0,    0,   51,    0,  111,  111,    0,
-    0,    0,  130,  119,  114,    0,    0,    0,   26,   53,
-    0,    0,    0,   89,    0,    0,
-);
-my @yyrindex = (                                           149,
-  100,    0,    0,    0,    0,  159,  106,    0,   39,    0,
-  100,  133,    0,    0,    0,    0,    0,  149,  140,    0,
-  133,    0,    0,    0,  100,    0,    0,    0,    0,  100,
-    0,    0,    0,    0,   16,   29,   42,   69,    0,    0,
-   37,    0,    0,    0,    0,    0,  149,  149,    0,  125,
-    0,    0,    0,    0,    0,    0,    0,    0,    0,  100,
-    0,    0,  100,    0,  150,    0,    0,    0,    0,    0,
-    0,    0,  133,    0,    0,  133,    0,    0,  151,    0,
-    0,    0,    0,    0,    0,    0,    0,    0,   73,   88,
-    0,    0,    0,    3,    0,    0,
+    5,    6,   21,    7,   18,   51,   69,    8,   52,   53,
+   54,   55,   44,   95,   60,   65,   72,   45,   57,   66,
+   67,    9,   10,   46,   73,
+);
+my @yysindex = (                                             3,
+   81,    0,   27,    0,    0,    8,  109,    0,   31,    0,
+    6,  109,   15,   24,    0,    0,    0,  118,   59,   59,
+    0,  109,    0,  123,    0,    6,   42,   65,   67,    0,
+   77,    0,    0,  123,    0,   42,   65,   75,   95,    0,
+    0,  106,    0,  103,    0,    0,    0,   59,   59,   97,
+  122,    0,    0,    0,    0,  133,    0,  141,    0,    0,
+   77,  143,  148,   77,  149,   78,    0,    0,    0,  160,
+  147,  100,    0,  109,    0,    0,  109,    0,   97,   97,
+    0,    0,    0,  141,  128,  123,    0,    0,    0,   42,
+   65,    0,    0,    0,  106,    0,    0,
+);
+my @yyrindex = (                                            51,
+   21,    0,    0,    0,    0,  163,  145,    0,   19,    0,
+   21,  142,    0,    0,    0,    0,    0,    0,   51,   10,
+    0,  142,    0,    0,    0,   21,    0,    0,    0,    0,
+   21,    0,    0,    0,    0,   35,   39,   69,   73,    0,
+    0,  102,    0,    0,    0,    0,    0,   51,   51,    0,
+  134,    0,    0,    0,    0,    0,    0,    0,    0,    0,
+   21,    0,    0,   21,    0,  153,    0,    0,    0,    0,
+    0,    0,    0,  142,    0,    0,  142,    0,    0,  154,
+    0,    0,    0,    0,    0,    0,    0,    0,    0,   88,
+   92,    0,    0,    0,  107,    0,    0,
 );
 my @yygindex = (                                             0,
-   28,    0,  135,    1,  -11,   79,    0,    8,  -17,  -18,
-  -16,  142,    0,    0,   72,    0,    0,    0,    0,    0,
-   50,    0,  123,    0,   80,
-);
-sub constYYTABLESIZE () { 166 }
-my @yytable = (                                             29,
-   23,   12,   48,   48,   40,   39,   41,    1,    2,   33,
-    2,   21,   25,   48,   48,   23,   23,   13,   22,   14,
-   48,   12,   11,    3,   23,   21,   23,   23,   24,   24,
-   12,   24,   22,   23,   13,   47,   48,   24,   36,   24,
-   24,   27,   27,   82,   83,   18,   24,   48,   48,   36,
-   27,   19,   27,   27,   48,   30,    2,   15,   16,   27,
-   73,   84,   48,   76,   85,   92,   91,   93,   26,   26,
-   49,    3,   23,   23,   61,   62,    2,   26,    2,   26,
-   26,   23,   55,   23,   23,   57,   26,   24,   24,   78,
-   23,    3,   26,   27,   28,   79,   24,   58,   24,   24,
-   50,   60,   50,   50,   50,   24,   50,   50,   52,   52,
-   52,   63,   50,   69,   34,   50,   35,   36,   28,   34,
-   67,   89,   90,   28,   58,   58,   37,   86,   87,   38,
-   70,   37,   74,   52,   38,   52,   52,   52,   75,   37,
-   31,   32,   50,   50,   50,   52,   50,   50,   52,   77,
-   37,   50,   50,   50,   80,   50,   50,   81,    2,   46,
-   30,   31,   88,   95,   42,   96,
-);
-my @yycheck = (                                             17,
-   12,    1,    0,    1,   23,   23,   23,    1,    2,   21,
-    2,   11,   14,   11,   12,    0,    1,    6,   11,    1,
-   18,    6,   14,   17,    9,   25,   11,   12,    0,    1,
-   30,    1,   25,   18,    6,   10,    0,    9,    0,   11,
-   12,    0,    1,   11,   12,   12,   18,   11,   12,   11,
-    9,   18,   11,   12,   18,    1,    2,    7,    8,   18,
-   60,   73,   10,   63,   76,   84,   84,   84,    0,    1,
-   10,   17,    0,    1,   47,   48,    2,    9,    2,   11,
-   12,    9,   19,   11,   12,   10,   18,    0,    1,   12,
-   18,   17,    3,    4,    5,   18,    9,    9,   11,   12,
-    1,    6,    3,    4,    5,   18,    7,    8,    3,    4,
-    5,    1,   13,   20,    1,   16,    3,    4,    5,    1,
-   18,    3,    4,    5,    0,    1,   13,   78,   79,   16,
-    1,   13,   11,    1,   16,    3,    4,    5,   11,    0,
-   18,   19,    3,    4,    5,   13,    7,    8,   16,   11,
-   11,    3,    4,    5,    1,    7,    8,   15,    0,   25,
-   11,   11,   83,   85,   23,   94,
+   89,    0,  140,    1,  -11,   82,    0,   60,  -18,  -21,
+  -17,  146,    0,    0,   74,    0,    0,    0,    0,    0,
+   72,    0,  137,    0,   83,
+);
+sub constYYTABLESIZE () { 170 }
+my @yytable = (                                             30,
+   24,   12,   41,    1,    2,   40,   42,    2,   14,   37,
+   34,   22,   50,   50,   50,   25,   50,   50,   36,    3,
+   37,   50,    3,   50,   50,   50,   22,   50,   50,   36,
+   50,   12,   13,   50,   23,   23,   50,   26,   24,   24,
+   12,   50,   19,   23,   13,   23,   23,   24,   20,   24,
+   24,   48,   23,   50,   50,   50,   24,   50,   50,   31,
+    2,   74,   85,   93,   77,   86,   92,   94,   27,   27,
+   23,   50,   26,   26,   49,    3,   50,   27,    2,   27,
+   27,   26,    2,   26,   26,   23,   27,   23,   23,   79,
+   26,   24,   24,   56,   11,   80,   23,   64,   23,   23,
+   24,   48,   24,   24,   58,   23,   48,   48,   61,   24,
+   83,   84,   48,   48,   59,   15,   16,   48,   48,   48,
+   27,   28,   29,   35,   48,   36,   37,   29,   35,   17,
+   90,   91,   29,   59,   59,   38,   62,   63,   39,   68,
+   38,   71,   52,   39,   52,   52,   52,   52,   52,   52,
+   87,   88,   70,   75,   52,   32,   33,   52,   76,   78,
+   81,   82,    2,   30,   31,   47,   89,   96,   97,   43,
+);
+my @yycheck = (                                             18,
+   12,    1,   24,    1,    2,   24,   24,    2,    1,    0,
+   22,   11,    3,    4,    5,    1,    7,    8,    0,   17,
+   11,    1,   17,    3,    4,    5,   26,    7,    8,   11,
+   21,   31,    6,   13,    0,    1,   16,   14,    0,    1,
+    6,   21,   12,    9,    6,   11,   12,    9,   18,   11,
+   12,   10,   18,    3,    4,    5,   18,    7,    8,    1,
+    2,   61,   74,   85,   64,   77,   85,   85,    0,    1,
+   11,   21,    0,    1,   10,   17,   10,    9,    2,   11,
+   12,    9,    2,   11,   12,   26,   18,    0,    1,   12,
+   18,    0,    1,   19,   14,   18,    9,    1,   11,   12,
+    9,    0,   11,   12,   10,   18,    0,    1,    6,   18,
+   11,   12,   11,   12,    9,    7,    8,   11,   12,   18,
+    3,    4,    5,    1,   18,    3,    4,    5,    1,   21,
+    3,    4,    5,    0,    1,   13,   48,   49,   16,   18,
+   13,    1,    1,   16,    3,    4,    5,    3,    4,    5,
+   79,   80,   20,   11,   13,   19,   20,   16,   11,   11,
+    1,   15,    0,   11,   11,   26,   84,   86,   95,   24,
 );
 sub constYYFINAL () { 4 }
 
 
 
-sub constYYMAXTOKEN () { 20 }
-# 270 "y.tab.pl"
+sub constYYMAXTOKEN () { 21 }
+# 274 "y.tab.pl"
 
 sub yyclearin { $yychar = -1; }
 sub yyerrok { $yyerrflag = 0; }
@@ -241,7 +244,7 @@
   else
   {
     return (1) if $yychar == 0;
-# 321 "y.tab.pl"
+# 325 "y.tab.pl"
 
     $yychar = -1;
     next yyloop;
@@ -273,7 +276,7 @@
       if ($yychar < 0)
       {
         if (($yychar = &yylex) < 0) { $yychar = 0; }
-# 360 "y.tab.pl"
+# 364 "y.tab.pl"
 
       }
       if (($yyn = $yysindex[$yystate]) && ($yyn += $yychar) >= 0 &&
@@ -313,13 +316,13 @@
 goto $label if exists $yystate{$label};
 last switch;
 State1: {
-# 96 "parser.y"
+# 99 "parser.y"
 
 { $yyval = { '' => $yyvs[$yyvsp-0] }; 
 last switch;
 } }
 State3: {
-# 101 "parser.y"
+# 104 "parser.y"
 
 {
                  $yyval = { $yyvs[$yyvsp-2], [$yyvs[$yyvsp-0]] };
@@ -327,7 +330,7 @@
 last switch;
 } }
 State4: {
-# 105 "parser.y"
+# 108 "parser.y"
 
 {
                  $yyval=$yyvs[$yyvsp-3];
@@ -336,16 +339,16 @@
 last switch;
 } }
 State5: {
-# 112 "parser.y"
+# 115 "parser.y"
 
 {
                  $yyvs[$yyvsp-1]->[cTAG] = $yyvs[$yyvsp-3];
-                 $yyval = $yyvs[$yyvsp-2] ? explicit($yyvs[$yyvsp-1]) : 
$yyvs[$yyvsp-1];
+                 $yyval = $yyvs[$yyvsp-2] ? explicit($yyvs[$yyvsp-1],$yyvs[$yyvsp-2]) 
: $yyvs[$yyvsp-1];
                
 last switch;
 } }
 State11: {
-# 126 "parser.y"
+# 129 "parser.y"
 
 {
                  @{$yyval = []}[cTYPE,cCHILD] = ('COMPONENTS', $yyvs[$yyvsp-0]);
@@ -353,17 +356,17 @@
 last switch;
 } }
 State14: {
-# 136 "parser.y"
+# 139 "parser.y"
 
 {
                  $yyvs[$yyvsp-1]->[cTAG] = $yyvs[$yyvsp-3];
                  @{$yyval = []}[cTYPE,cCHILD,cLOOP,cOPT] = ($yyvs[$yyvsp-5], 
[$yyvs[$yyvsp-1]], 1, $yyvs[$yyvsp-0]);
-                 $yyval = explicit($yyval) if $yyvs[$yyvsp-2];
+                 $yyval = explicit($yyval,$yyvs[$yyvsp-2]) if $yyvs[$yyvsp-2];
                
 last switch;
 } }
 State18: {
-# 149 "parser.y"
+# 152 "parser.y"
 
 {
                  @{$yyval = []}[cTYPE,cCHILD] = ('SEQUENCE', $yyvs[$yyvsp-1]);
@@ -371,7 +374,7 @@
 last switch;
 } }
 State19: {
-# 153 "parser.y"
+# 156 "parser.y"
 
 {
                  @{$yyval = []}[cTYPE,cCHILD] = ('SET', $yyvs[$yyvsp-1]);
@@ -379,7 +382,7 @@
 last switch;
 } }
 State20: {
-# 157 "parser.y"
+# 160 "parser.y"
 
 {
                  @{$yyval = []}[cTYPE,cCHILD] = ('CHOICE', $yyvs[$yyvsp-1]);
@@ -387,7 +390,7 @@
 last switch;
 } }
 State21: {
-# 163 "parser.y"
+# 166 "parser.y"
 
 {
                  @{$yyval = []}[cTYPE] = ('ENUM');
@@ -395,25 +398,25 @@
 last switch;
 } }
 State22: {
-# 168 "parser.y"
+# 171 "parser.y"
 
 { @{$yyval = []}[cTYPE] = $yyvs[$yyvsp-0]; 
 last switch;
 } }
 State23: {
-# 169 "parser.y"
+# 172 "parser.y"
 
 { @{$yyval = []}[cTYPE] = $yyvs[$yyvsp-0]; 
 last switch;
 } }
 State24: {
-# 170 "parser.y"
+# 173 "parser.y"
 
 { @{$yyval = []}[cTYPE] = $yyvs[$yyvsp-0]; 
 last switch;
 } }
 State25: {
-# 172 "parser.y"
+# 175 "parser.y"
 
 {
                  @{$yyval = []}[cTYPE,cCHILD,cDEFINE] = ('ANY',undef,$yyvs[$yyvsp-0]);
@@ -421,37 +424,37 @@
 last switch;
 } }
 State26: {
-# 175 "parser.y"
+# 178 "parser.y"
 
 { @{$yyval = []}[cTYPE] = $yyvs[$yyvsp-0]; 
 last switch;
 } }
 State27: {
-# 178 "parser.y"
+# 181 "parser.y"
 
 { $yyval=undef; 
 last switch;
 } }
 State28: {
-# 179 "parser.y"
+# 182 "parser.y"
 
 { $yyval=$yyvs[$yyvsp-0]; 
 last switch;
 } }
 State30: {
-# 185 "parser.y"
+# 188 "parser.y"
 
 { $yyval = $yyvs[$yyvsp-0]; 
 last switch;
 } }
 State31: {
-# 186 "parser.y"
+# 189 "parser.y"
 
 { $yyval = $yyvs[$yyvsp-1]; 
 last switch;
 } }
 State32: {
-# 190 "parser.y"
+# 193 "parser.y"
 
 {
                  $yyval = [ $yyvs[$yyvsp-0] ];
@@ -459,7 +462,7 @@
 last switch;
 } }
 State33: {
-# 194 "parser.y"
+# 197 "parser.y"
 
 {
                  push @{$yyval=$yyvs[$yyvsp-2]}, $yyvs[$yyvsp-0];
@@ -467,7 +470,7 @@
 last switch;
 } }
 State34: {
-# 198 "parser.y"
+# 201 "parser.y"
 
 {
                  push @{$yyval=$yyvs[$yyvsp-2]}, $yyvs[$yyvsp-0];
@@ -475,28 +478,28 @@
 last switch;
 } }
 State35: {
-# 204 "parser.y"
+# 207 "parser.y"
 
 {
                  @{$yyval=$yyvs[$yyvsp-0]}[cVAR,cTAG] = 
($yyvs[$yyvsp-3],$yyvs[$yyvsp-2]);
-                 $yyval = explicit($yyval) if $yyvs[$yyvsp-1];
+                 $yyval = explicit($yyval,$yyvs[$yyvsp-1]) if $yyvs[$yyvsp-1];
                
 last switch;
 } }
 State36: {
-# 211 "parser.y"
+# 214 "parser.y"
 
 { $yyval = $yyvs[$yyvsp-0]; 
 last switch;
 } }
 State37: {
-# 212 "parser.y"
+# 215 "parser.y"
 
 { $yyval = $yyvs[$yyvsp-1]; 
 last switch;
 } }
 State38: {
-# 216 "parser.y"
+# 219 "parser.y"
 
 {
                  $yyval = [ $yyvs[$yyvsp-0] ];
@@ -504,7 +507,7 @@
 last switch;
 } }
 State39: {
-# 220 "parser.y"
+# 223 "parser.y"
 
 {
                  push @{$yyval=$yyvs[$yyvsp-2]}, $yyvs[$yyvsp-0];
@@ -512,7 +515,7 @@
 last switch;
 } }
 State40: {
-# 224 "parser.y"
+# 227 "parser.y"
 
 {
                  push @{$yyval=$yyvs[$yyvsp-2]}, $yyvs[$yyvsp-0];
@@ -520,7 +523,7 @@
 last switch;
 } }
 State41: {
-# 230 "parser.y"
+# 233 "parser.y"
 
 {
                  @{$yyval=$yyvs[$yyvsp-1]}[cOPT] = ($yyvs[$yyvsp-0]);
@@ -528,91 +531,97 @@
 last switch;
 } }
 State45: {
-# 239 "parser.y"
+# 242 "parser.y"
 
 {
                  @{$yyval=$yyvs[$yyvsp-0]}[cVAR,cTAG] = 
($yyvs[$yyvsp-3],$yyvs[$yyvsp-2]);
                  $yyval->[cOPT] = $yyvs[$yyvsp-3] if $yyval->[cOPT];
-                 $yyval = explicit($yyval) if $yyvs[$yyvsp-1];
+                 $yyval = explicit($yyval,$yyvs[$yyvsp-1]) if $yyvs[$yyvsp-1];
                
 last switch;
 } }
 State47: {
-# 246 "parser.y"
+# 249 "parser.y"
 
 {
                  @{$yyval=$yyvs[$yyvsp-0]}[cTAG] = ($yyvs[$yyvsp-2]);
-                 $yyval = explicit($yyval) if $yyvs[$yyvsp-1];
+                 $yyval = explicit($yyval,$yyvs[$yyvsp-1]) if $yyvs[$yyvsp-1];
                
 last switch;
 } }
 State48: {
-# 252 "parser.y"
+# 255 "parser.y"
 
 { $yyval = undef; 
 last switch;
 } }
 State49: {
-# 253 "parser.y"
+# 256 "parser.y"
 
 { $yyval = 1;     
 last switch;
 } }
 State50: {
-# 257 "parser.y"
+# 260 "parser.y"
 
 { $yyval = undef; 
 last switch;
 } }
 State52: {
-# 261 "parser.y"
+# 264 "parser.y"
 
 { $yyval = undef; 
 last switch;
 } }
 State53: {
-# 262 "parser.y"
+# 265 "parser.y"
 
-{ $yyval = 1;     
+{ $yyval = 'SEQUENCE';  
 last switch;
 } }
 State54: {
-# 263 "parser.y"
+# 266 "parser.y"
 
-{ $yyval = 0;     
+{ $yyval = 'CONTAINING'; 
 last switch;
 } }
 State55: {
-# 266 "parser.y"
+# 267 "parser.y"
 
-{
+{ $yyval = 0;     
 last switch;
 } }
 State56: {
-# 267 "parser.y"
+# 270 "parser.y"
 
 {
 last switch;
 } }
 State57: {
-# 270 "parser.y"
+# 271 "parser.y"
 
 {
 last switch;
 } }
 State58: {
-# 273 "parser.y"
+# 274 "parser.y"
 
 {
 last switch;
 } }
 State59: {
-# 274 "parser.y"
+# 277 "parser.y"
 
 {
 last switch;
 } }
-# 653 "y.tab.pl"
+State60: {
+# 278 "parser.y"
+
+{
+last switch;
+} }
+# 662 "y.tab.pl"
 
     } # switch
     $yyssp -= $yym;
@@ -631,7 +640,7 @@
       if ($yychar < 0)
       {
         if (($yychar = &yylex) < 0) { $yychar = 0; }
-# 679 "y.tab.pl"
+# 688 "y.tab.pl"
 
       }
       return $yyvs[$yyvsp] if $yychar == 0;
@@ -652,7 +661,7 @@
     $yyvs[++$yyvsp] = $yyval;
   } # yyloop
 } # yyparse
-# 278 "parser.y"
+# 282 "parser.y"
 
 
 my %reserved = (
@@ -672,7 +681,8 @@
   ','          => constCOMMA(),
   '::='         => constASSIGN(),
   'DEFINED'     => constDEFINED(),
-  'BY'         => constBY()
+  'BY'         => constBY(),
+  'CONTAINING'  => constCONTAINING(),
 );
 
 my $reserved = join("|", reverse sort grep { /\w/ } keys %reserved);
@@ -955,7 +965,7 @@
 
 1;
 
-# 1001 "y.tab.pl"
+# 1011 "y.tab.pl"
 
 %yystate = ('State11','','State30','','State31','','State50','','State32',
 '','State14','','State33','','State52','','State34','','State53','',
@@ -963,7 +973,8 @@
 '','State19','','State56','','State38','','State57','','State39','',
 'State58','','State59','','State1','','State3','','State4','','State5','',
 'State20','','State21','','State22','','State40','','State23','','State41',
-'','State24','','State25','','State26','','State27','','State45','',
-'State28','','State47','','State48','','State49','');
+'','State60','','State24','','State25','','State26','','State27','',
+'State45','','State28','','State47','','State48','','State49',
+'');
 
 1;

Reply via email to