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
c603f107
Commit
c603f107
authored
Jan 23, 2005
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ignoring spaces within tags
parent
8f9d2bd6
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
1934 additions
and
2039 deletions
+1934
-2039
libasn1parser/Makefile.in
libasn1parser/Makefile.in
+2
-2
libasn1parser/asn1p_l.c
libasn1parser/asn1p_l.c
+1523
-1623
libasn1parser/asn1p_l.l
libasn1parser/asn1p_l.l
+5
-49
libasn1parser/asn1p_y.c
libasn1parser/asn1p_y.c
+381
-352
libasn1parser/asn1p_y.h
libasn1parser/asn1p_y.h
+0
-1
libasn1parser/asn1p_y.y
libasn1parser/asn1p_y.y
+23
-12
No files found.
libasn1parser/Makefile.in
View file @
c603f107
...
...
@@ -447,9 +447,9 @@ distclean-generic:
maintainer-clean-generic
:
@
echo
"This command is intended for maintainers to use"
@
echo
"it deletes files that may require special tools to rebuild."
-
rm
-f
asn1p_l.c
-
rm
-f
asn1p_y.h
-
rm
-f
asn1p_y.c
-
rm
-f
asn1p_y.h
-
rm
-f
asn1p_l.c
clean
:
clean-am
clean-am
:
clean-generic clean-libtool clean-noinstLTLIBRARIES
\
...
...
libasn1parser/asn1p_l.c
View file @
c603f107
This source diff could not be displayed because it is too large. You can
view the blob
instead.
libasn1parser/asn1p_l.l
View file @
c603f107
...
...
@@ -24,7 +24,7 @@ int asn1p_lexer_pedantic_1990 = 0;
int asn1p_lexer_types_year = 0;
int asn1p_lexer_constructs_year = 0;
static int _check_dashes(char *ptr);
static asn1_integer_t asn1p_atoi(char *ptr); /* errno is either 0 or ERANGE */
static asn1
c
_integer_t asn1p_atoi(char *ptr); /* errno is either 0 or ERANGE */
/*
* Check that the type is defined in the year of the standard choosen.
...
...
@@ -240,50 +240,6 @@ WSP [\t\r\v\f\n ]
return TOK_number;
}
/*
* Tags
*/
\[(UNIVERSAL[ \t\r\v\f\n]+|APPLICATION[ \t\r\v\f\n]+|PRIVATE[ \t\r\v\f\n]+)?[0-9]+\] {
char *p;
memset(&asn1p_lval.a_tag, 0, sizeof(asn1p_lval.a_tag));
switch(yytext[1]) {
case 'U':
asn1p_lval.a_tag.tag_class = TC_UNIVERSAL;
p = yytext + sizeof("UNIVERSAL") + 1;
break;
case 'A':
asn1p_lval.a_tag.tag_class = TC_APPLICATION;
p = yytext + sizeof("APPLICATION") + 1;
break;
case 'P':
asn1p_lval.a_tag.tag_class = TC_PRIVATE;
p = yytext + sizeof("PRIVATE") + 1;
break;
default:
assert(yytext[1] >= '0' && yytext[1] <= '9');
asn1p_lval.a_tag.tag_class = TC_CONTEXT_SPECIFIC;
p = yytext + 1;
break;
}
asn1p_lval.a_tag.tag_value = asn1p_atoi(p);
if(*p == '0' && asn1p_lval.a_tag.tag_value) {
fprintf(stderr,
"Tag value at line %d "
"cannot start with zero "
"and have multiple digits: \"%s\"\n",
yylineno, yytext);
return -1;
}
return TOK_tag;
}
\[[A-Z]+[ \t\r\v\f\n]+[0-9]+\] {
fprintf(stderr,
"Unsupported tag syntax at line %d: \"%s\"\n",
yylineno, yytext);
return -1;
}
ABSENT return TOK_ABSENT;
/*
ABSTRACT-SYNTAX return TOK_ABSTRACT_SYNTAX;
...
...
@@ -443,10 +399,10 @@ WITH return TOK_WITH;
"..." return TOK_ThreeDots;
".." return TOK_TwoDots;
[(){},;:|!.&@\[\]] return yytext[0];
{WSP}+ /* Ignore whitespace */
[(){},;:|!.&@\[\]] return yytext[0];
[^A-Za-z0-9:=,{}<.@()[]'\"|&^*;!-] {
if(TYPE_LIFETIME(1994, 0))
fprintf(stderr, "ERROR: ");
...
...
@@ -550,9 +506,9 @@ _check_dashes(char *ptr) {
return 0;
}
static asn1_integer_t
static asn1
c
_integer_t
asn1p_atoi(char *ptr) {
asn1_integer_t value;
asn1
c
_integer_t value;
errno = 0; /* Clear the error code */
if(sizeof(value) <= sizeof(int)) {
...
...
libasn1parser/asn1p_y.c
View file @
c603f107
This diff is collapsed.
Click to expand it.
libasn1parser/asn1p_y.h
View file @
c603f107
...
...
@@ -128,7 +128,6 @@ typedef union {
#define TOK_UNION 352
#define TOK_TwoDots 353
#define TOK_ThreeDots 354
#define TOK_tag 355
extern
YYSTYPE
asn1p_lval
;
libasn1parser/asn1p_y.y
View file @
c603f107
...
...
@@ -196,7 +196,6 @@ static asn1p_value_t *
/* Misc tags */
%token TOK_TwoDots /* .. */
%token TOK_ThreeDots /* ... */
%token <a_tag> TOK_tag /* [0] */
/*
...
...
@@ -266,7 +265,8 @@ static asn1p_value_t *
%type <a_type> BasicString
%type <tv_opaque> Opaque
//%type <tv_opaque> StringValue
%type <a_tag> Tag /* [UNIVERSAL 0] IMPLICIT */
%type <a_tag> Tag /* [UNIVERSAL 0] IMPLICIT */
%type <a_tag> TagClass TagTypeValue TagPlicit
%type <a_tag> optTag /* [UNIVERSAL 0] IMPLICIT */
%type <a_constr> optConstraints
%type <a_constr> Constraints
...
...
@@ -1942,20 +1942,31 @@ optTag:
;
Tag:
T
OK_tag
{
T
agTypeValue TagPlicit
{
$$ = $1;
$$.tag_mode = TM_DEFAULT;
}
| TOK_tag TOK_IMPLICIT {
$$ = $1;
$$.tag_mode = TM_IMPLICIT;
}
| TOK_tag TOK_EXPLICIT {
$$ = $1;
$$.tag_mode = TM_EXPLICIT;
$$.tag_mode = $2.tag_mode;
}
;
TagTypeValue:
'[' TagClass TOK_number ']' {
$$ = $2;
$$.tag_value = $3;
};
TagClass:
{ $$.tag_class = TC_CONTEXT_SPECIFIC; }
| TOK_UNIVERSAL { $$.tag_class = TC_UNIVERSAL; }
| TOK_APPLICATION { $$.tag_class = TC_APPLICATION; }
| TOK_PRIVATE { $$.tag_class = TC_PRIVATE; }
;
TagPlicit:
{ $$.tag_mode = TM_DEFAULT; }
| TOK_IMPLICIT { $$.tag_mode = TM_IMPLICIT; }
| TOK_EXPLICIT { $$.tag_mode = TM_EXPLICIT; }
;
TypeRefName:
TOK_typereference {
checkmem($1);
...
...
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