]> Dogcows Code - chaz/openbox/blob - plugins/keyboard/keysrc.l
08989f496a793b47bd9527fa7b6473856eb22bf7
[chaz/openbox] / plugins / keyboard / keysrc.l
1 %{
2 #include <glib.h>
3 #include "y.tab.h"
4
5 extern void kparseerror(char *s);
6 int kparselineno;
7 %}
8
9 field [A-Za-z0-9][-A-Za-z0-9]*
10 number [0-9]+
11 string \"[^"\n]*\"
12
13 %%
14
15 ^[ \t]*#.*\n kparselineno++;
16 {number} kparselval.integer = atoi(kparsetext); return INTEGER;
17 {field} kparselval.string = g_strdup(kparsetext); return FIELD;
18 {string} {
19 /* drop the quotes */
20 kparselval.string = g_strdup(kparsetext+1);
21 if (kparselval.string[kparseleng-2] != '"') {
22 g_warning("improperly terminated string on line %d\n",
23 kparselineno);
24 kparseerror("");
25 } else
26 kparselval.string[kparseleng-2] = '\0';
27 return STRING;
28 }
29
30 [ \t]
31 \n kparselineno++; return *yytext;
32 . kparseerror("");
33
34 %%
35
36 int kparsewrap() {
37 return 1;
38 }
This page took 0.040313 seconds and 3 git commands to generate.