lang.l (133248) | lang.l (134542) |
---|---|
1%{ 2/*- 3 * Copyright (c) 1980, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 14 unchanged lines hidden (view full) --- 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 * 30 * @(#)lang.l 8.1 (Berkeley) 6/6/93 | 1%{ 2/*- 3 * Copyright (c) 1980, 1993 4 * The Regents of the University of California. All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 14 unchanged lines hidden (view full) --- 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 * 30 * @(#)lang.l 8.1 (Berkeley) 6/6/93 |
31 * $FreeBSD: head/usr.sbin/config/lang.l 133248 2004-08-07 04:19:37Z imp $ | 31 * $FreeBSD: head/usr.sbin/config/lang.l 134542 2004-08-30 23:03:58Z peter $ |
32 */ 33 34#include <assert.h> 35#include <ctype.h> 36#include <string.h> 37#include "y.tab.h" 38#include "config.h" 39 --- 44 unchanged lines hidden (view full) --- 84static int endinclude(void); 85int include(const char *, int); 86int kw_lookup(char *); 87unsigned int octal(const char *); 88unsigned int hex(const char *); 89int yyerror(const char *); 90 91%} | 32 */ 33 34#include <assert.h> 35#include <ctype.h> 36#include <string.h> 37#include "y.tab.h" 38#include "config.h" 39 --- 44 unchanged lines hidden (view full) --- 84static int endinclude(void); 85int include(const char *, int); 86int kw_lookup(char *); 87unsigned int octal(const char *); 88unsigned int hex(const char *); 89int yyerror(const char *); 90 91%} |
92WORD [A-Za-z_][-A-Za-z_]* | |
93ID [A-Za-z_][-A-Za-z_0-9]* | 92ID [A-Za-z_][-A-Za-z_0-9]* |
94%START NONUM TOEOL | 93%START TOEOL |
95%% | 94%% |
96<NONUM>{WORD} { | 95{ID} { |
97 int i; 98 99 BEGIN 0; 100 if ((i = kw_lookup(yytext)) == -1) 101 { 102 yylval.str = strdup(yytext); 103 return ID; 104 } 105 return i; 106 } | 96 int i; 97 98 BEGIN 0; 99 if ((i = kw_lookup(yytext)) == -1) 100 { 101 yylval.str = strdup(yytext); 102 return ID; 103 } 104 return i; 105 } |
107<INITIAL>{WORD}/[0-9]* { 108 int i; 109 110 if ((i = kw_lookup(yytext)) == -1) 111 REJECT; 112 if (i == DEVICE || i == NODEVICE) 113 BEGIN NONUM; 114 return i; 115 } 116<INITIAL>{ID} { 117 BEGIN 0; 118 yylval.str = strdup(yytext); 119 return ID; 120 } | |
121\\\"[^"]+\\\" { 122 BEGIN 0; 123 yytext[yyleng-2] = '"'; 124 yytext[yyleng-1] = '\0'; 125 yylval.str = strdup(yytext + 1); 126 return ID; 127 } 128\"[^"]+\" { --- 146 unchanged lines hidden --- | 106\\\"[^"]+\\\" { 107 BEGIN 0; 108 yytext[yyleng-2] = '"'; 109 yytext[yyleng-1] = '\0'; 110 yylval.str = strdup(yytext + 1); 111 return ID; 112 } 113\"[^"]+\" { --- 146 unchanged lines hidden --- |