2 %option prefix="_lc_opt_"
7 libcore: library for basic data structures and algorithms.
8 Copyright (C) 2005 IPD Goos, Universit"at Karlsruhe, Germany
10 This library is free software; you can redistribute it and/or
11 modify it under the terms of the GNU Lesser General Public
12 License as published by the Free Software Foundation; either
13 version 2.1 of the License, or (at your option) any later version.
15 This library is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 Lesser General Public License for more details.
20 You should have received a copy of the GNU Lesser General Public
21 License along with this library; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
29 /* flex generated code wants a declaration of isatty... */
35 #include "lc_parser_t.h"
36 #include "lc_config_parser.h"
38 #define YY_NO_UNISTD_H
44 static int _lc_opt_wrap(void);
53 idcharsbegin [a-zA-Z$_]
54 idchars ({idcharsbegin}|[0-9])
55 ident {idcharsbegin}{idchars}*
68 "/*" { BEGIN(BIG_COMMENT); }
69 <BIG_COMMENT>"*/" { BEGIN(INITIAL); }
70 <BIG_COMMENT>\n PMANGLE(linenr)++;
73 ("#"|"//") { BEGIN(LINE_COMMENT); }
74 <LINE_COMMENT>\n { BEGIN(INITIAL); PMANGLE(linenr)++; }
78 <INITIAL>[=:]{ws} { BEGIN(DAT); }
79 <DAT>\" { BEGIN(STR); }
80 <DAT>\\ { BEGIN(DAT_CONT); }
81 <DAT>. { _lc_opt_add_to_data_char(PMANGLE(text)[0]); }
85 _lc_opt_add_to_data_char('\0');
88 <DAT_CONT>\n { BEGIN(DAT); PMANGLE(linenr)++; }
94 _lc_opt_add_to_data_char('\0');
98 <STR>\\n _lc_opt_add_to_data_char('\n');
99 <STR>\\r _lc_opt_add_to_data_char('\r');
100 <STR>\\t _lc_opt_add_to_data_char('\t');
101 <STR>\\b _lc_opt_add_to_data_char('\b');
102 <STR>\\f _lc_opt_add_to_data_char('\f');
103 <STR>\\. _lc_opt_add_to_data_char(yytext[1]);
104 <STR>[^\"] _lc_opt_add_to_data_char(yytext[0]);
107 PMANGLE(lval).text.str = PMANGLE(text);
108 PMANGLE(lval).text.len = PMANGLE(leng);
114 {nl} PMANGLE(linenr)++;
120 static int _lc_opt_wrap(void)