Repopulate route style selector on PCBChanged action
[geda-pcb/whiteaudio.git] / src / res_lex.l
blob5e086660e438850023c34894f40cf6464631045d
1 /* $Id$ */
3 %{
5 #ifdef HAVE_CONFIG_H
6 #include "config.h"
7 #endif
9 #ifdef HAVE_STRING_H
10 #include <string.h>
11 #endif
13 #include "global.h"
14 #include "resource.h"
15 #include "res_parse.h"
17 #ifdef HAVE_LIBDMALLOC
18 #include <dmalloc.h>
19 #endif
21 RCSID("$Id$");
23 #define YY_NO_INPUT
24 #define YY_INPUT(buf,result,max_size) { result = res_parse_getchars(buf, max_size); }
26 #ifdef FLEX_SCANNER
27 #define yyunput ATTRIBUTE_UNUSED yyunput
28 #endif
30 extern int res_lineno;
31 extern int res_parse_getchars(char *buf, int max_size);
35 %option prefix="res"
36 %option outfile="lex.yy.c"
37 %option yylineno
38 %option noyywrap
40 PARENSTR        ([^ (){}=\"\'\t\r\n]|\([^\)]*\))+
41 INCSTR          @[a-z0-9A-Z_]+
42 COMMENT         #[^\n]*
46 \"[^"]*\"       { reslval.sval = strdup(yytext+1);
47                   reslval.sval[strlen(reslval.sval) - 1] = 0;
48                   return STRING; }
50 \'[^']*\'       { reslval.sval = strdup(yytext+1);
51                   reslval.sval[strlen(reslval.sval) - 1] = 0;
52                   return STRING; }
54 {COMMENT}\n     { res_lineno++; }
55 [ \t\r\n]       { if (yytext[0] == '\n') res_lineno++; }
57 {INCSTR}        { reslval.sval = strdup(yytext);
58                           return INCLUDE; }
60 {PARENSTR}      { reslval.sval = strdup(yytext);
61                           return STRING; }
63 .               { return yytext[0]; }
67 /* ' */