#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"

#include "deflex.h"
#include "parser.h"

static int
not_here(char *s)
{
    croak("%s not implemented on this architecture", s);
    return -1;
}

static double
constant(char *name, int arg)
{
    errno = 0;
    switch (*name) {
    }
    errno = EINVAL;
    return 0;

not_there:
    errno = ENOENT;
    return 0;
}


MODULE = Search::OpenFTS::Parser               PACKAGE = Search::OpenFTS::Parser


double
constant(name,arg)
        char *          name
        int             arg

PROTOTYPES: DISABLE

void
getdescript(n, td)
	int 	n
        SV *    td
	CODE:
	 sv_setpv( td, ( n>0 && n<=LASTNUM ) ? descr[n] : "" );
	OUTPUT:
	 td

void
get_word(obj)
	SV * obj
	PPCODE:
	 int typeid  = fts_yylex();

	 PUSHs( sv_2mortal(newSViv(typeid)) );
	 if ( typeid )
	 	PUSHs( sv_2mortal(newSVpv(token,strlen(token))) );

void
end_parser(obj)
	SV * obj
	CODE:
	 end_parse();

void
start_parse_str(str)
 	char * 	str	
	CODE:
	start_parse_str(str);

void
start_parse_fh(fh,limit)
        FILE * 	fh
	int	limit
	CODE:
	 start_parse_fh(fh,limit);
