Ugh
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@864 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -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, ...)
|
||||
|
Reference in New Issue
Block a user