#include "wx/expr.h"
-#ifdef wx_x
-extern char *malloc();
-#endif
#define Return(x) return x;
#if defined(VMS) && !defined(strdup)
static int lex_read_from_string = 0;
static int my_input(void);
-static int my_unput(char);
#ifdef FLEX_SCANNER
-#undef YY_INPUT
+# undef YY_INPUT
# define YY_INPUT(buf,result,max_size) \
if (lex_read_from_string) \
{ int c = my_input(); result = (c == 0) ? YY_NULL : ((buf)[0]=(c), 1); } \
#else
# undef unput
# define unput(_c) my_unput(_c)
+ static int my_unput(char);
#endif
%}
"'"{WORDCHAR}*"'" {int len = strlen(yytext);
yytext[len-1] = 0;
- yylval.s = strdup(yytext+1);
+ yylval.s = strdup(yytext+1);
Return(WORD);}
\"({STRINGCHAR}|\\\"|\|\\\\|\\)*\" {yylval.s = strdup(yytext); Return(STRING);}
static int lex_input() {
return input();
}
-/* # undef unput
-# define unput(_c) my_unput(_c)
-*/
# undef input
# define input() my_input()
static int my_unput(char c)
{
- if (lex_read_from_string) {
+ if (lex_read_from_string != 0) {
/* Make sure we have something */
if (lex_string_ptr) {
if (c == '\n') yylineno--;
#endif
-/* Public */
+/* Public */
void LexFromFile(FILE *fd)
{
lex_read_from_string = 0;
void wxExprCleanUp()
{
+#ifdef FLEX_SCANNER
if (yy_current_buffer)
yy_delete_buffer(yy_current_buffer);
+#endif
}