diff options
author | Stefan Metzmacher <metze@samba.org> | 2004-07-01 22:39:25 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:56:50 -0500 |
commit | 93a5cd8efc7b683db04e79ae521314c69855eb06 (patch) | |
tree | 6a9f234086c0646a532be589264abcafdfa06f76 /source4/build/pasn1 | |
parent | df06b3bb4912e2bedd83c438aebba5f54066f936 (diff) | |
download | samba-93a5cd8efc7b683db04e79ae521314c69855eb06.tar.gz samba-93a5cd8efc7b683db04e79ae521314c69855eb06.tar.bz2 samba-93a5cd8efc7b683db04e79ae521314c69855eb06.zip |
r1323: allow '-' in IDENTIFIERS
accept '--' comments
implement the
<name> DEFINITIONS ::=
BEGIN
...
END
syntax
metze
(This used to be commit 4422547711b9d653999433f36d48dccebc006bce)
Diffstat (limited to 'source4/build/pasn1')
-rw-r--r-- | source4/build/pasn1/asn1.yp | 52 |
1 files changed, 40 insertions, 12 deletions
diff --git a/source4/build/pasn1/asn1.yp b/source4/build/pasn1/asn1.yp index caaed4cb50..9a77bbc31a 100644 --- a/source4/build/pasn1/asn1.yp +++ b/source4/build/pasn1/asn1.yp @@ -15,15 +15,42 @@ # grammer %% -asn1: +asn1: + identifier asn1_definitions asn1_delimitter asn1_begin asn1_decls asn1_end + {{ + "OBJECT" => "ASN1_DEFINITION", + "IDENTIFIER" => $_[1], + "DATA" => $_[5] + }} +; + +asn1_delimitter: + delimitter +; + +asn1_definitions: + 'DEFINITIONS' +; + +asn1_begin: + 'BEGIN' +; + +asn1_end: + 'END' +; + +asn1_decls: asn1_def { [ $_[1] ] } - | asn1 asn1_def + | asn1_decls asn1_def { push(@{$_[1]}, $_[2]); $_[1] } ; + + asn1_def: - asn1_target asn1_delim asn1_application asn1_type + asn1_target asn1_delimitter asn1_application asn1_type {{ "OBJECT" => "ASN1_DEF", "IDENTIFIER" => $_[1], @@ -36,10 +63,6 @@ asn1_target: identifier ; -asn1_delim: - delimitter -; - asn1_application: #empty | '[' 'APPLICATION' constant ']' @@ -55,7 +78,8 @@ asn1_type: | asn1_object_identifier | asn1_real | asn1_enumerated - | asn1_sequence + | asn1_sequence + | identifier ; asn1_boolean: @@ -227,7 +251,11 @@ again: $parser->YYData->{LINE}++; goto again; } - if (s/^::=//) { + if (s/^(--.*\n)//) { + $parser->YYData->{LINE}++; + goto again; + } + if (s/^(::=)//) { $parser->YYData->{LAST_TOKEN} = $1; return('DELIMITTER',$1); } @@ -239,13 +267,13 @@ again: $parser->YYData->{LAST_TOKEN} = $1; return('CONSTANT',$1); } - if (s/^([\w_]+)//) { + if (s/^([\w_-]+)//) { $parser->YYData->{LAST_TOKEN} = $1; if ($1 =~ /^(SEQUENCE|INTEGER|OCTET|STRING| APPLICATION|OPTIONAL|NULL|COMPONENTS|OF| - BOOLEAN|ENUMERATED|CHOISE|REAL|BIT|OBJECT|IDENTIFIER - DEFAULT|FALSE|TRUE|SET)$/x) { + BOOLEAN|ENUMERATED|CHOISE|REAL|BIT|OBJECT|IDENTIFIER| + DEFAULT|FALSE|TRUE|SET|DEFINITIONS|BEGIN|END)$/x) { return $1; } return('IDENTIFIER',$1); |