summaryrefslogtreecommitdiffabout
path: root/libical/src/libicalss/icalsslexer.l
authorzautrix <zautrix>2004-06-26 19:01:18 (UTC)
committer zautrix <zautrix>2004-06-26 19:01:18 (UTC)
commitb9aad1f15dc600e4dbe4c62d3fcced6363188ba3 (patch) (unidiff)
tree2c3d4004fb21c72cba65793859f9bcd8ffd3a49c /libical/src/libicalss/icalsslexer.l
downloadkdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.zip
kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.gz
kdepimpi-b9aad1f15dc600e4dbe4c62d3fcced6363188ba3.tar.bz2
Initial revision
Diffstat (limited to 'libical/src/libicalss/icalsslexer.l') (more/less context) (ignore whitespace changes)
-rw-r--r--libical/src/libicalss/icalsslexer.l113
1 files changed, 113 insertions, 0 deletions
diff --git a/libical/src/libicalss/icalsslexer.l b/libical/src/libicalss/icalsslexer.l
new file mode 100644
index 0000000..58aa162
--- a/dev/null
+++ b/libical/src/libicalss/icalsslexer.l
@@ -0,0 +1,113 @@
1%{
2/* -*- Mode: C -*-
3 ======================================================================
4 FILE: icalsslexer.l
5 CREATOR: eric 8 Aug 2000
6
7 DESCRIPTION:
8
9 $Id$
10 $Locker$
11
12(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
13
14 This program is free software; you can redistribute it and/or modify
15 it under the terms of either:
16
17 The LGPL as published by the Free Software Foundation, version
18 2.1, available at: http://www.fsf.org/copyleft/lesser.html
19
20 Or:
21
22 The Mozilla Public License Version 1.0. You may obtain a copy of
23 the License at http://www.mozilla.org/MPL/
24
25 The Original Code is eric. The Initial Developer of the Original
26 Code is Eric Busboom
27
28 ======================================================================*/
29
30#include "icalssyacc.h"
31#include "icalgaugeimpl.h"
32#include "assert.h"
33
34#include <string.h> /* For strdup() */
35
36int icalparser_flex_input(char* buf, int max_size);
37void icalparser_clear_flex_input();
38
39#undef YY_INPUT
40#define YY_INPUT(b,r,ms) ( r= icalparser_flex_input(b,ms))
41
42#undef SS_FATAL_ERROR
43#define SS_FATAL_ERROR(msg) sserror(msg)
44
45
46%}
47
48 crlf \x0D?\x0A
49 space [ ]
50 qsafechar[^\x00-\x1F\"]
51 safechar[^\x00-\x1F\"\:\;\,]
52 tsafechar[\x20-\x21\x23-\x2B\x2D-\x39\x3C-\x5B\x5D-\x7E]
53 valuechar[^\x00-\x08\x10-\x1F]
54 xname X-[a-zA-Z0-9\-]+
55xname2 [a-zA-Z0-9\-\ ]
56 paramtext{safechar}+
57 value {valuechar}+
58 quotedstring\"{qsafechar}+\"
59 digit [0-9]
60
61%array /* Make yytext an array. Slow, but handy. HACK */
62
63%option caseless
64
65%s sql string_value
66
67
68
69%%
70
71%{
72%}
73
74
75 SELECT { return SELECT; }
76 FROM { return FROM; }
77 WHERE { return WHERE; }
78 , { return COMMA; }
79 "=" { return EQUALS; }
80 "!=" { return NOTEQUALS; }
81 "<" { return LESS; }
82 ">" { return GREATER; }
83 "<=" { return LESSEQUALS; }
84 ">=" { return GREATEREQUALS; }
85 AND { return AND; }
86 OR { return OR; }
87\' { return QUOTE; }
88 [ \t\n\r]+ ;
89 ; { return EOL; }
90\'[\*A-Za-z0-9\-\.]+\' {
91 int c = input();
92 unput(c);
93 if(c!='\''){
94 sslval.v_string= icalmemory_tmp_copy(sstext);
95 return STRING;
96 } else {
97 /*ssmore();*/
98 }
99}
100
101 [\*A-Za-z0-9\-\.]+ { sslval.v_string= icalmemory_tmp_copy(sstext);
102 return STRING; }
103
104
105 . { return yytext[0]; }
106
107%%
108
109int sswrap()
110{
111 return 1;
112}
113