aboutsummaryrefslogtreecommitdiffstats
path: root/libical/src/libicalss/icalsslexer.l
diff options
context:
space:
mode:
authorHans Petter Jansson <hpj@ximian.com>2003-09-24 10:06:52 +0800
committerHans Petter <hansp@src.gnome.org>2003-09-24 10:06:52 +0800
commit9cd7b8f8ba994fc509c52028aed2d0b14bce175a (patch)
treece7a55922992f74549f4d7e4cba3b945edc65c09 /libical/src/libicalss/icalsslexer.l
parent1b5c1357dcbf4cfcd450c33d76c51c2e14252cf8 (diff)
downloadgsoc2013-evolution-9cd7b8f8ba994fc509c52028aed2d0b14bce175a.tar
gsoc2013-evolution-9cd7b8f8ba994fc509c52028aed2d0b14bce175a.tar.gz
gsoc2013-evolution-9cd7b8f8ba994fc509c52028aed2d0b14bce175a.tar.bz2
gsoc2013-evolution-9cd7b8f8ba994fc509c52028aed2d0b14bce175a.tar.lz
gsoc2013-evolution-9cd7b8f8ba994fc509c52028aed2d0b14bce175a.tar.xz
gsoc2013-evolution-9cd7b8f8ba994fc509c52028aed2d0b14bce175a.tar.zst
gsoc2013-evolution-9cd7b8f8ba994fc509c52028aed2d0b14bce175a.zip
Remove flex check. Set ICAL_ERRORS_ARE_FATAL to 0.
2003-09-23 Hans Petter Jansson <hpj@ximian.com> * configure.in: Remove flex check. Set ICAL_ERRORS_ARE_FATAL to 0. * src/libicalss/icalgauge.c (icalgauge_new_from_sql): Don't use globals struct. Remove calls to sslex_init(), _extra(), ss_scan_string(). Use a global pointer icalss_yy_gauge to hold context. Call ssparse() with no arguments. * src/libicalss/icalsslexer.l: Remove options reentrant and bison-bridge. Rename variables, change function invocations to comply with flex 2.5.4. (icalss_input): Add function to read input. * src/libicalss/icalssyacc.y (yyextra): Remove. (select_list) (from_list) (where_clause) (where_list): yyextra -> icalss_yy_gauge * src/libicalss/icalsslexer.c: * src/libicalss/icalssyacc.c: * src/libicalss/icalssyacc.h: Add generated files back to repository. They don't belong there, but that's not my problem. svn path=/trunk/; revision=22683
Diffstat (limited to 'libical/src/libicalss/icalsslexer.l')
-rw-r--r--libical/src/libicalss/icalsslexer.l34
1 files changed, 25 insertions, 9 deletions
diff --git a/libical/src/libicalss/icalsslexer.l b/libical/src/libicalss/icalsslexer.l
index be1dc553cd..fe89bfde99 100644
--- a/libical/src/libicalss/icalsslexer.l
+++ b/libical/src/libicalss/icalsslexer.l
@@ -6,7 +6,7 @@
DESCRIPTION:
- $Id: icalsslexer.l,v 1.3 2003/09/22 07:32:31 hansp Exp $
+ $Id: icalsslexer.l,v 1.4 2003/09/24 02:06:52 hansp Exp $
$Locker: $
(C) COPYRIGHT 2000, Eric Busboom, http://www.softwarestudio.org
@@ -33,8 +33,26 @@
#include <string.h> /* For strdup() */
-#undef YYPURE
-#define YYPURE
+const char* input_buffer;
+const char* input_buffer_p;
+
+#define min(a,b) ((a) < (b) ? (a) : (b))
+
+int icalss_input(char* buf, int max_size)
+{
+ int n = min(max_size,strlen(input_buffer_p));
+
+ if (n > 0){
+ memcpy(buf, input_buffer_p, n);
+ input_buffer_p += n;
+ return n;
+ } else {
+ return 0;
+ }
+}
+
+#undef YY_INPUT
+#define YY_INPUT(b,r,ms) ( r= icalss_input(b,ms))
#undef SS_FATAL_ERROR
#define SS_FATAL_ERROR(msg) sserror(msg)
@@ -57,8 +75,6 @@ digit [0-9]
%array /* Make yytext an array. Slow, but handy. HACK */
%option caseless
-%option reentrant bison-bridge
-%option yylineno
%s sql string_value
@@ -91,10 +107,10 @@ NULL { return SQLNULL; }
; { return EOL; }
\'[\@\*A-Za-z0-9\-\.\:\ ]+\' {
- int c = input(yyscanner);
+ int c = input();
unput(c);
if(c!='\''){
- yylval_param->v_string= icalmemory_tmp_copy(yytext);
+ sslval.v_string= icalmemory_tmp_copy(yytext);
return STRING;
} else {
/*ssmore();*/
@@ -102,7 +118,7 @@ NULL { return SQLNULL; }
}
[\@\*A-Za-z0-9\-\.]+ {
- yylval->v_string= icalmemory_tmp_copy(yytext);
+ sslval.v_string= icalmemory_tmp_copy(yytext);
return STRING;
}
@@ -111,7 +127,7 @@ NULL { return SQLNULL; }
%%
-int yywrap(yyscan_t yyscanner)
+int yywrap()
{
return 1;
}