aboutsummaryrefslogtreecommitdiff
path: root/crypto/heimdal/lib/asn1/lex.l
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/heimdal/lib/asn1/lex.l')
-rw-r--r--crypto/heimdal/lib/asn1/lex.l26
1 files changed, 16 insertions, 10 deletions
diff --git a/crypto/heimdal/lib/asn1/lex.l b/crypto/heimdal/lib/asn1/lex.l
index b3fbf713b19a..ffb6fd560544 100644
--- a/crypto/heimdal/lib/asn1/lex.l
+++ b/crypto/heimdal/lib/asn1/lex.l
@@ -1,6 +1,6 @@
%{
/*
- * Copyright (c) 1997, 1998, 1999 Kungliga Tekniska Högskolan
+ * Copyright (c) 1997 - 2000 Kungliga Tekniska Högskolan
* (Royal Institute of Technology, Stockholm, Sweden).
* All rights reserved.
*
@@ -32,7 +32,7 @@
* SUCH DAMAGE.
*/
-/* $Id: lex.l,v 1.10 1999/12/02 17:05:02 joda Exp $ */
+/* $Id: lex.l,v 1.15 2000/07/02 04:08:02 assar Exp $ */
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -46,17 +46,22 @@
#endif
#include "symbol.h"
#include "parse.h"
-
-void error_message(char *, ...);
+#include "lex.h"
+#include "gen_locl.h"
static unsigned lineno = 1;
-/* ","|"{"|"}"|"("|")"|"["|"]"|"|" { return *yytext; } */
+#define YY_NO_UNPUT
+
+#undef ECHO
+
%}
%%
INTEGER { return INTEGER; }
+IMPORTS { return IMPORTS; }
+FROM { return FROM; }
SEQUENCE { return SEQUENCE; }
OF { return OF; }
OCTET { return OCTET; }
@@ -70,15 +75,16 @@ BEGIN { return TBEGIN; }
END { return END; }
DEFINITIONS { return DEFINITIONS; }
EXTERNAL { return EXTERNAL; }
-[,{}()|] { return *yytext; }
+[,;{}()|] { return *yytext; }
"[" { return *yytext; }
"]" { return *yytext; }
::= { return EEQUAL; }
---[^\n]*\n { ; }
+--[^\n]*\n { ++lineno; }
-?[0-9]+ { yylval.constant = atoi(yytext); return CONSTANT; }
[A-Za-z][-A-Za-z0-9_]* { yylval.name = strdup (yytext); return IDENTIFIER; }
[ \t] ;
-\n { lineno++; }
+\n { ++lineno; }
+\.\. { return DOTDOT; }
. { error_message("Ignoring char(%c)\n", *yytext); }
%%
@@ -91,12 +97,12 @@ yywrap ()
#endif
void
-error_message (char *format, ...)
+error_message (const char *format, ...)
{
va_list args;
va_start (args, format);
- fprintf (stderr, ":%d: ", lineno);
+ fprintf (stderr, "%s:%d: ", filename(), lineno);
vfprintf (stderr, format, args);
va_end (args);
}