1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
D [0-9]
L [a-zA-Z_]
%{
/* config_lexer.c
* --------------
* THIS FILE IS GENERATED, DO NOT EDIT
*/
#include <string.h>
#include "command_lexer.h"
const char * get_token( void )
{
return yytext;
}
%}
int enter_map_id = 0;
/* An identifier used in a map like command */
%x MAP_ID
%%
if (enter_map_id)
BEGIN (MAP_ID);
else
BEGIN (INITIAL);
<INITIAL>
{
#[^\n]* { /* ignore comments */ }
"unset" { return UNSET; }
"set" { return SET; }
"bind" { return BIND; }
"macro" { return MACRO; }
(yes|YES|Yes|Y|y|no|NO|No|n|N) { return BOOLEAN; }
((<({L}|{D}|[^>])*>)|({L}({L}|{D})*))+\!? { return IDENTIFIER; }
[+-]?{D}+ { return NUMBER; }
\"(\\.|[^\\"])*\" { return STRING; }
"=" { return '='; }
";" { return ';'; }
"," { return ','; }
(\r\n|\n\r|\n|\r) { return EOL; }
[ \t\v\f] { /* ignore white-space */ }
. { /* ignore bad-characters */ }
}
<MAP_ID>
{
" " { /* ignore white space */ }
[^ ]+ { return IDENTIFIER; }
. { /* ignore bad-characters */ }
}
%%
int yywrap( void )
{
{
/* Silly impossible function call to stop warning of unused functions */
if ( 0 ) {
yyunput(0, "");
}
}
return 1;
}
|