Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
asn1c
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
asn1c
Commits
5c541f11
Commit
5c541f11
authored
Oct 18, 2006
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PatterConstraint parsing
parent
5bcbda55
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
880 additions
and
784 deletions
+880
-784
libasn1fix/asn1fix_constraint_compat.c
libasn1fix/asn1fix_constraint_compat.c
+4
-0
libasn1parser/asn1p_constr.c
libasn1parser/asn1p_constr.c
+2
-0
libasn1parser/asn1p_constr.h
libasn1parser/asn1p_constr.h
+1
-0
libasn1parser/asn1p_y.c
libasn1parser/asn1p_y.c
+825
-784
libasn1parser/asn1p_y.y
libasn1parser/asn1p_y.y
+20
-0
libasn1print/asn1print.c
libasn1print/asn1print.c
+5
-0
tests/122-pattern-OK.asn1
tests/122-pattern-OK.asn1
+23
-0
No files found.
libasn1fix/asn1fix_constraint_compat.c
View file @
5c541f11
...
...
@@ -95,6 +95,10 @@ asn1constraint_compatible(asn1p_expr_type_e expr_type,
default:
return
0
;
}
case
ACT_CT_PATTERN
:
if
(
expr_type
&
ASN_STRING_MASK
)
return
1
;
return
0
;
case
ACT_CA_SET
:
case
ACT_CA_CRC
:
case
ACT_CA_CSV
:
...
...
libasn1parser/asn1p_constr.c
View file @
5c541f11
...
...
@@ -171,6 +171,8 @@ asn1p_constraint_type2str(enum asn1p_constraint_type_e type) {
return
"UserDefinedConstraint"
;
case
ACT_CT_CTNG
:
return
"ContentsConstraint"
;
case
ACT_CT_PATTERN
:
return
"PatternConstraint"
;
case
ACT_CA_SET
:
return
"SET"
;
case
ACT_CA_CRC
:
...
...
libasn1parser/asn1p_constr.h
View file @
5c541f11
...
...
@@ -27,6 +27,7 @@ typedef struct asn1p_constraint_s {
ACT_CT_WCOMPS
,
/* WITH COMPONENTS */
ACT_CT_CTDBY
,
/* CONSTRAINED BY */
ACT_CT_CTNG
,
/* CONTAINING Type */
ACT_CT_PATTERN
,
/* PATTERN Value */
/*
* Arrays of constraints.
*/
...
...
libasn1parser/asn1p_y.c
View file @
5c541f11
This source diff could not be displayed because it is too large. You can
view the blob
instead.
libasn1parser/asn1p_y.y
View file @
5c541f11
...
...
@@ -325,6 +325,7 @@ static asn1p_module_t *currentModule;
%type <a_constr> UserDefinedConstraint
%type <a_constr> TableConstraint
%type <a_constr> ContentsConstraint
%type <a_constr> PatternConstraint
%type <a_constr> InnerTypeConstraint
%type <a_constr> WithComponentsList
%type <a_constr> WithComponentsElement
...
...
@@ -1850,6 +1851,25 @@ ConstraintSubtypeElement:
| InnerTypeConstraint {
$$ = $1;
}
| PatternConstraint {
$$ = $1;
}
;
PatternConstraint:
TOK_PATTERN TOK_cstring {
$$ = asn1p_constraint_new(yylineno);
$$->type = ACT_CT_PATTERN;
$$->value = asn1p_value_frombuf($2.buf, $2.len, 0);
}
| TOK_PATTERN Identifier {
asn1p_ref_t *ref;
$$ = asn1p_constraint_new(yylineno);
$$->type = ACT_CT_PATTERN;
ref = asn1p_ref_new(yylineno);
asn1p_ref_add_component(ref, $2, RLT_lowercase);
$$->value = asn1p_value_fromref(ref, 0);
}
;
ConstraintSpec:
...
...
libasn1print/asn1print.c
View file @
5c541f11
...
...
@@ -368,6 +368,11 @@ asn1print_constraint(asn1p_constraint_t *ct, enum asn1print_flags flags) {
flags
,
1
);
printf
(
")"
);
break
;
case
ACT_CT_PATTERN
:
printf
(
"(PATTERN "
);
asn1print_value
(
ct
->
value
,
flags
);
printf
(
")"
);
break
;
case
ACT_CA_SET
:
symno
++
;
case
ACT_CA_CRC
:
symno
++
;
case
ACT_CA_CSV
:
symno
++
;
...
...
tests/122-pattern-OK.asn1
0 → 100644
View file @
5c541f11
-- OK: Everything is fine
-- iso.org.dod.internet.private.enterprise (1.3.6.1.4.1)
-- .spelio.software.asn1c.test (9363.1.5.1)
-- .122
ModulePatternConstraint
{ iso org(3) dod(6) internet (1) private(4) enterprise(1)
spelio(9363) software(1) asn1c(5) test(1) 122 }
DEFINITIONS AUTOMATIC TAGS ::=
BEGIN
Language ::= VisibleString (FROM ("a".."z" | "A".."Z" | "-" | "0".."9"))
(PATTERN "[a-zA-Z]#(1,8)(-[a-zA-Z0-9]#(1,8))*")
PatternByRef1 ::= VisibleString (PATTERN refPattern1)
PatternByRef2 ::= VisibleString (PATTERN refPattern2)
refPattern1 UniversalString ::= "[a-zA-Z]#(1,8)(-[a-zA-Z0-9]#(1,8))*"
refPattern2 UTF8String ::= "[a-zA-Z]#(1,8)(-[a-zA-Z0-9]#(1,8))*"
END
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment