git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@864 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
1996-10-20 16:47:54 +00:00
parent 309846037c
commit dbdb412ba0
25 changed files with 595 additions and 479 deletions

View File

@@ -10,10 +10,15 @@
#include "symbol.h"
#include "parse.h"
char *strdup(char *);
void error_message(char *, ...);
static unsigned lineno = 1;
static char filename[256];
%}
%%
INTEGER { return INTEGER; }
SEQUENCE { return SEQUENCE; }
@@ -28,21 +33,23 @@ OPTIONAL { return OPTIONAL; }
BEGIN { return TBEGIN; }
END { return END; }
DEFINITIONS { return DEFINITIONS; }
[][|{},()] { return *yytext; }
,|\{|\}|\(|\)|\[|\]|\| { return *yytext; }
::= { return EEQUAL; }
--[^\n]*\n { ; }
-?[0-9]+ { yylval.constant = atoi(yytext); return CONSTANT; }
[A-Za-z][-A-Za-z0-9_]* { yylval.name = strdup (yytext); return IDENTIFIER; }
[ \t] ;
\n { lineno++; }
. { fprintf(stderr, "Ignoring char(%c)\n", *yytext); }
. { error_message("Ignoring char(%c)\n", *yytext); }
%%
#ifndef yywrap /* XXX */
int
yywrap ()
{
return 1;
}
#endif
void
error_message (char *format, ...)