xref: /minix3/minix/commands/devmand/usb_scan.l (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1*433d6423SLionel Sambuc /* -*- indented-text -*- */
2*433d6423SLionel Sambuc %option noinput
3*433d6423SLionel Sambuc %option nounput
4*433d6423SLionel Sambuc %{
5*433d6423SLionel Sambuc #include "y.tab.h"
6*433d6423SLionel Sambuc #include <string.h>
7*433d6423SLionel Sambuc 
8*433d6423SLionel Sambuc 
9*433d6423SLionel Sambuc #if 0
10*433d6423SLionel Sambuc #define ECHO fwrite(yytext, yyleng, 1, yyout)
11*433d6423SLionel Sambuc #else
12*433d6423SLionel Sambuc #define ECHO
13*433d6423SLionel Sambuc #endif
14*433d6423SLionel Sambuc %}
15*433d6423SLionel Sambuc BO              [{]
16*433d6423SLionel Sambuc BC              [}]
17*433d6423SLionel Sambuc NL              [\n]
18*433d6423SLionel Sambuc SC              [;]
19*433d6423SLionel Sambuc CHAR            [0-9a-zA-Z_/\-\*\.]
20*433d6423SLionel Sambuc EQ              [=]
21*433d6423SLionel Sambuc SPACE           [\032]
22*433d6423SLionel Sambuc %%
23*433d6423SLionel Sambuc 
24*433d6423SLionel Sambuc usb_driver         { ECHO; return USB_DRIVER;}
25*433d6423SLionel Sambuc devprefix          { ECHO; return DEV_PREFIX;}
26*433d6423SLionel Sambuc devtype            { ECHO; return DEV_TYPE;}
27*433d6423SLionel Sambuc char               { ECHO; return BLOCK_DEV;}
28*433d6423SLionel Sambuc block              { ECHO; return CHAR_DEV;}
29*433d6423SLionel Sambuc binary             { ECHO; return BINARY;}
30*433d6423SLionel Sambuc bInterfaceClass    { ECHO; return INTERFACE_CLASS;}
31*433d6423SLionel Sambuc bInterfaceSubClass { ECHO; return INTERFACE_SUB_CLASS;}
32*433d6423SLionel Sambuc bInterfaceProtocol { ECHO; return INTERFACE_PROTOCOL;}
33*433d6423SLionel Sambuc id                 { ECHO; return ID;}
34*433d6423SLionel Sambuc upscript           { ECHO; return UPSCRIPT;}
35*433d6423SLionel Sambuc downscript         { ECHO; return DOWNSCRIPT;}
36*433d6423SLionel Sambuc {EQ}               { ECHO; return EQUALS;}
37*433d6423SLionel Sambuc {SC}               { ECHO; return SEMICOLON;}
38*433d6423SLionel Sambuc {BO}               { ECHO; return BRACKET_OPEN;}
39*433d6423SLionel Sambuc {BC}               { ECHO; return BRACKET_CLOSE;}
40*433d6423SLionel Sambuc {CHAR}+            { ECHO; yylval.string = (char *)strdup(yytext); return STRING;}
41*433d6423SLionel Sambuc .               ;
42*433d6423SLionel Sambuc %%
43*433d6423SLionel Sambuc 
44