public
/
piyacc.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Make syntax error call yyerror() rather than raising a Python exception
[piyacc.git]
/
lex-yacc-examples
/
example6.l
1
%{
2
#include <stdio.h>
3
#include "example6.tab.h" /*"y.tab.h"*/
4
%}
5
6
%%
7
8
zone return ZONETOK;
9
file return FILETOK;
10
[a-zA-Z][a-zA-Z0-9]* yylval=strdup(yytext); return WORD;
11
[a-zA-Z0-9\/.-]+ yylval=strdup(yytext); return FILENAME;
12
\" return QUOTE;
13
\{ return OBRACE;
14
\} return EBRACE;
15
; return SEMICOLON;
16
\n /* ignore EOL */;
17
[ \t]+ /* ignore whitespace */;
18
%%