debuggers.hg

view tools/libxl/libxlu_cfg_l.l @ 21067:b4a1832a916f

Update Xen version to 4.0.0-rc6
author Keir Fraser <keir.fraser@citrix.com>
date Tue Mar 09 18:18:05 2010 +0000 (2010-03-09)
parents 71af69a9d393
children e5a9221bdd3f
line source
1 /* -*- fundamental -*- */
3 %{
4 #include "libxlu_cfg_i.h"
6 #define ctx ((CfgParseContext*)yyextra)
7 #define YY_NO_INPUT
9 #define GOT(x) do{ \
10 yylloc->first_line= yylineno; \
11 return (x); \
12 }while(0)
14 %}
16 %option warn
17 %option nodefault
18 %option batch
19 %option 8bit
20 %option yylineno
21 %option noyywrap
22 %option bison-bridge
23 %option bison-locations
24 %option reentrant
25 %option prefix="xlu__cfg_yy"
26 %option nounput
28 %x lexerr
30 %%
32 [a-z][_0-9a-z]* {
33 yylval->string= xlu__cfgl_strdup(ctx,yytext);
34 GOT(IDENT);
35 }
36 [0-9][0-9a-fx]* {
37 yylval->string= xlu__cfgl_strdup(ctx,yytext);
38 GOT(NUMBER);
39 }
41 [ \t]
43 , { GOT(','); }
44 \[ { GOT('['); }
45 \] { GOT(']'); }
46 \= { GOT('='); }
47 \; { GOT(';'); }
49 \n|\#.*\n { yylloc->first_line= yylineno-1; return NEWLINE; }
51 \'([^\'\\\n]|\\.)*\' {
52 yylval->string= xlu__cfgl_dequote(ctx,yytext);
53 GOT(STRING);
54 }
55 \"([^\"\\\n]|\\.)*\" {
56 yylval->string= xlu__cfgl_dequote(ctx,yytext);
57 GOT(STRING);
58 }
60 . {
61 BEGIN(lexerr);
62 yymore();
63 }
65 <lexerr>[^ \t\n]*|[ \t] {
66 xlu__cfgl_lexicalerror(ctx,"lexical error");
67 BEGIN(0);
68 }
70 <lexerr>\n {
71 xlu__cfgl_lexicalerror(ctx,"lexical error");
72 BEGIN(0);
73 GOT(NEWLINE);
74 }