summaryrefslogtreecommitdiffstats
path: root/hcid/lexer.l
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2007-04-25 18:59:55 +0000
committerMarcel Holtmann <marcel@holtmann.org>2007-04-25 18:59:55 +0000
commiteefb64d927b48d2de2e100b1f7ee715bf86bbb57 (patch)
treeb554c892901c0010969e21b14198cc77a6a0c78a /hcid/lexer.l
parent748b15f0a5eb6c1078a4dff64604f042c48a7a4a (diff)
Add device ID support
Diffstat (limited to 'hcid/lexer.l')
-rw-r--r--hcid/lexer.l9
1 files changed, 8 insertions, 1 deletions
diff --git a/hcid/lexer.l b/hcid/lexer.l
index a194f708..f4559494 100644
--- a/hcid/lexer.l
+++ b/hcid/lexer.l
@@ -63,7 +63,9 @@ path (\/{fname})+
string \".*\"
hci hci[0-9]+
hextuple [0-9a-zA-Z][0-9a-zA-Z]
+hexquad {hextuple}{hextuple}
bdaddr {hextuple}:{hextuple}:{hextuple}:{hextuple}:{hextuple}:{hextuple}
+id {hexquad}:{hexquad}
%x OPTION PARAM
@@ -117,7 +119,7 @@ bdaddr {hextuple}:{hextuple}:{hextuple}:{hextuple}:{hextuple}:{hextuple}
}
{string} {
- if(yyleng > sizeof(str_buf) - 1){
+ if (yyleng > sizeof(str_buf) - 1) {
yyerror("string too long");
return 0;
}
@@ -139,6 +141,11 @@ bdaddr {hextuple}:{hextuple}:{hextuple}:{hextuple}:{hextuple}:{hextuple}
return PATH;
}
+{id} {
+ yylval.str = yytext;
+ return ID;
+}
+
. {
return *yytext;
}