2002-08-06 23:08:54 +00:00
|
|
|
%{
|
|
|
|
#include <stdio.h>
|
2002-08-07 01:45:13 +00:00
|
|
|
#include <string.h>
|
2002-08-06 23:08:54 +00:00
|
|
|
#include "yacc_parser.hh"
|
2002-08-08 03:10:54 +00:00
|
|
|
|
|
|
|
extern YYSTYPE yylval;
|
|
|
|
|
2002-08-06 23:08:54 +00:00
|
|
|
%}
|
|
|
|
|
|
|
|
%%
|
|
|
|
|
|
|
|
\{ return OBRACE;
|
|
|
|
\} return EBRACE;
|
|
|
|
; return SEMICOLON;
|
|
|
|
- return DASH;
|
2002-08-21 00:27:16 +00:00
|
|
|
Options |
|
|
|
|
options return OPTIONS;
|
2002-08-06 23:08:54 +00:00
|
|
|
Mod1 |
|
2002-08-26 06:38:02 +00:00
|
|
|
mod1 |
|
2002-08-06 23:08:54 +00:00
|
|
|
Mod2 |
|
2002-08-26 06:38:02 +00:00
|
|
|
mod2 |
|
2002-08-06 23:08:54 +00:00
|
|
|
Mod3 |
|
2002-08-26 06:38:02 +00:00
|
|
|
mod3 |
|
2002-08-06 23:08:54 +00:00
|
|
|
Mod4 |
|
2002-08-26 06:38:02 +00:00
|
|
|
mod4 |
|
2002-08-06 23:08:54 +00:00
|
|
|
Control |
|
2002-08-26 06:38:02 +00:00
|
|
|
control |
|
|
|
|
shift |
|
2002-08-07 01:45:13 +00:00
|
|
|
Shift yylval = (int) strdup(yytext); return BINDING;
|
2002-08-26 21:04:00 +00:00
|
|
|
on |
|
|
|
|
On |
|
2002-08-26 06:38:02 +00:00
|
|
|
true |
|
|
|
|
True yylval = (int) strdup(yytext); return TRUE;
|
2002-08-26 21:04:00 +00:00
|
|
|
Off |
|
|
|
|
off |
|
2002-08-26 06:38:02 +00:00
|
|
|
false |
|
|
|
|
False yylval = (int) strdup(yytext); return FALSE;
|
2002-08-07 01:45:13 +00:00
|
|
|
[0-9]+ yylval = (int) strdup(yytext); return NUMBER;
|
|
|
|
\".+\" yylval = (int) strdup(yytext); return QUOTES;
|
|
|
|
[a-zA-Z_0-9]+ yylval = (int) strdup(yytext); return WORD;
|
2002-08-06 23:08:54 +00:00
|
|
|
#.+\n /* ignore */
|
|
|
|
\n /* ignore */
|
|
|
|
[ \t]+ /* */
|
|
|
|
%%
|
|
|
|
|