lexer.l (128080) | lexer.l (162128) |
---|---|
1%{ 2/* 3 * lexer.l | 1%{ 2/* 3 * lexer.l |
4 * 5 * Copyright (c) 2004 Maksim Yevmenkin <m_evmenkin@yahoo.com> | 4 */ 5 6/*- 7 * Copyright (c) 2006 Maksim Yevmenkin <m_evmenkin@yahoo.com> |
6 * All rights reserved. 7 * 8 * Redistribution and use in source and binary forms, with or without 9 * modification, are permitted provided that the following conditions 10 * are met: 11 * 1. Redistributions of source code must retain the above copyright 12 * notice, this list of conditions and the following disclaimer. 13 * 2. Redistributions in binary form must reproduce the above copyright --- 7 unchanged lines hidden (view full) --- 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 * | 8 * All rights reserved. 9 * 10 * Redistribution and use in source and binary forms, with or without 11 * modification, are permitted provided that the following conditions 12 * are met: 13 * 1. Redistributions of source code must retain the above copyright 14 * notice, this list of conditions and the following disclaimer. 15 * 2. Redistributions in binary form must reproduce the above copyright --- 7 unchanged lines hidden (view full) --- 23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 25 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 26 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 27 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 28 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29 * SUCH DAMAGE. 30 * |
29 * $Id: lexer.l,v 1.2 2004/02/13 21:46:20 max Exp $ 30 * $FreeBSD: head/usr.sbin/bluetooth/bthidd/lexer.l 128080 2004-04-10 00:18:00Z emax $ | 31 * $Id: lexer.l,v 1.3 2006/09/07 21:06:53 max Exp $ 32 * $FreeBSD: head/usr.sbin/bluetooth/bthidd/lexer.l 162128 2006-09-07 21:47:49Z emax $ |
31 */ 32 33#include <bluetooth.h> 34#include <stdlib.h> 35#include "parser.h" | 33 */ 34 35#include <bluetooth.h> 36#include <stdlib.h> 37#include "parser.h" |
38 39 int yylex (void); |
|
36%} 37 38%option yylineno noyywrap nounput 39 40delim [ \t\n] 41ws {delim}+ 42empty {delim}* 43comment \#.* --- 38 unchanged lines hidden (view full) --- 82{false_word} return (T_FALSE); 83 84{bdaddrstring} { 85 return (bt_aton(yytext, &yylval.bdaddr)? 86 T_BDADDRSTRING : T_ERROR); 87 } 88 89{hexbytestring} { | 40%} 41 42%option yylineno noyywrap nounput 43 44delim [ \t\n] 45ws {delim}+ 46empty {delim}* 47comment \#.* --- 38 unchanged lines hidden (view full) --- 86{false_word} return (T_FALSE); 87 88{bdaddrstring} { 89 return (bt_aton(yytext, &yylval.bdaddr)? 90 T_BDADDRSTRING : T_ERROR); 91 } 92 93{hexbytestring} { |
90 char *ep = NULL; | 94 char *ep; |
91 92 yylval.num = strtoul(yytext, &ep, 16); 93 94 return (*ep == '\0'? T_HEXBYTE : T_ERROR); 95 } 96 97. return (T_ERROR); 98 99%% 100 | 95 96 yylval.num = strtoul(yytext, &ep, 16); 97 98 return (*ep == '\0'? T_HEXBYTE : T_ERROR); 99 } 100 101. return (T_ERROR); 102 103%% 104 |