e576bb2002-10-11Martin Nilsson /* || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information. */
aedfb12002-10-09Martin Nilsson 
5267b71995-08-09Fredrik Hübinette (Hubbe) #include "global.h" #include "lex.h" #include "stuff.h"
362ba42004-11-01Martin Stjernholm #include "bignum.h"
e021fe2008-04-14Henrik Grubbström (Grubba) #include "pike_compiler.h" #include "interpret.h"
b1f4eb1998-01-13Fredrik Hübinette (Hubbe) 
5267b71995-08-09Fredrik Hübinette (Hubbe) #include <ctype.h>
78158f2020-05-31Marcus Comstedt static FLOAT_TYPE mymy_strtod(const char *nptr, char **endptr) { #if SIZEOF_FLOAT_TYPE > SIZEOF_DOUBLE FLOAT_TYPE tmp=strtold(nptr,endptr); #else double tmp=strtod(nptr,endptr); #endif if(*endptr>nptr) { if(endptr[0][-1]=='.') endptr[0]--; } return tmp; }
5267b71995-08-09Fredrik Hübinette (Hubbe) #define LEXDEBUG 0
acbf0a1999-02-20Henrik Grubbström (Grubba) /* Make lexers for shifts 0, 1 and 2. */
5267b71995-08-09Fredrik Hübinette (Hubbe) 
acbf0a1999-02-20Henrik Grubbström (Grubba) #define SHIFT 0
fe104b2000-11-25Henrik Grubbström (Grubba) #include "lexer0.h"
acbf0a1999-02-20Henrik Grubbström (Grubba) #undef SHIFT #define SHIFT 1
fe104b2000-11-25Henrik Grubbström (Grubba) #include "lexer1.h"
acbf0a1999-02-20Henrik Grubbström (Grubba) #undef SHIFT #define SHIFT 2
fe104b2000-11-25Henrik Grubbström (Grubba) #include "lexer2.h"
acbf0a1999-02-20Henrik Grubbström (Grubba) #undef SHIFT
5267b71995-08-09Fredrik Hübinette (Hubbe) 
8695cd2014-05-10Per Hedbor int parse_esc_seq_pcharp (PCHARP buf, p_wchar2 *chr, ptrdiff_t *len) { if(LIKELY(buf.shift == 0)) return parse_esc_seq0((void*)buf.ptr,chr,len); if( buf.shift == 1 ) return parse_esc_seq1((void*)buf.ptr,chr,len); return parse_esc_seq2((void*)buf.ptr,chr,len); /* UNREACHABLE */ }
b1f4eb1998-01-13Fredrik Hübinette (Hubbe) int yylex(YYSTYPE *yylval)
5267b71995-08-09Fredrik Hübinette (Hubbe) {
e021fe2008-04-14Henrik Grubbström (Grubba)  struct lex *lex; CHECK_COMPILER(); lex = &THIS_COMPILATION->lex;
acbf0a1999-02-20Henrik Grubbström (Grubba) #if LEXDEBUG>8 fprintf(stderr, "YYLEX: Calling lexer at 0x%08lx\n",
e021fe2008-04-14Henrik Grubbström (Grubba)  (long)lex->current_lexer);
acbf0a1999-02-20Henrik Grubbström (Grubba) #endif /* LEXDEBUG > 8 */
e021fe2008-04-14Henrik Grubbström (Grubba)  return(lex->current_lexer(lex, yylval));
5267b71995-08-09Fredrik Hübinette (Hubbe) }