1 Update Snowball sources
2 Makefile fixes
This commit is contained in:
parent
3b0453b24f
commit
f82b853b47
@ -49,7 +49,7 @@ snb_en_init(PG_FUNCTION_ARGS)
|
|||||||
PG_FREE_IF_COPY(in, 0);
|
PG_FREE_IF_COPY(in, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
d->z = english_create_env();
|
d->z = english_ISO_8859_1_create_env();
|
||||||
if (!d->z)
|
if (!d->z)
|
||||||
{
|
{
|
||||||
freestoplist(&(d->stoplist));
|
freestoplist(&(d->stoplist));
|
||||||
@ -57,7 +57,7 @@ snb_en_init(PG_FUNCTION_ARGS)
|
|||||||
(errcode(ERRCODE_OUT_OF_MEMORY),
|
(errcode(ERRCODE_OUT_OF_MEMORY),
|
||||||
errmsg("out of memory")));
|
errmsg("out of memory")));
|
||||||
}
|
}
|
||||||
d->stem = english_stem;
|
d->stem = english_ISO_8859_1_stem;
|
||||||
|
|
||||||
PG_RETURN_POINTER(d);
|
PG_RETURN_POINTER(d);
|
||||||
}
|
}
|
||||||
@ -83,7 +83,7 @@ snb_ru_init(PG_FUNCTION_ARGS)
|
|||||||
PG_FREE_IF_COPY(in, 0);
|
PG_FREE_IF_COPY(in, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
d->z = russian_create_env();
|
d->z = russian_KOI8_R_create_env();
|
||||||
if (!d->z)
|
if (!d->z)
|
||||||
{
|
{
|
||||||
freestoplist(&(d->stoplist));
|
freestoplist(&(d->stoplist));
|
||||||
@ -91,7 +91,7 @@ snb_ru_init(PG_FUNCTION_ARGS)
|
|||||||
(errcode(ERRCODE_OUT_OF_MEMORY),
|
(errcode(ERRCODE_OUT_OF_MEMORY),
|
||||||
errmsg("out of memory")));
|
errmsg("out of memory")));
|
||||||
}
|
}
|
||||||
d->stem = russian_stem;
|
d->stem = russian_KOI8_R_stem;
|
||||||
|
|
||||||
PG_RETURN_POINTER(d);
|
PG_RETURN_POINTER(d);
|
||||||
}
|
}
|
||||||
|
@ -50,7 +50,7 @@ Example 1:
|
|||||||
|
|
||||||
2. Create template files for Portuguese
|
2. Create template files for Portuguese
|
||||||
|
|
||||||
./config.sh -n pt -s -p portuguese -v -C'Snowball stemmer for Portuguese'
|
./config.sh -n pt -s -p portuguese_ISO_8859_1 -v -C'Snowball stemmer for Portuguese'
|
||||||
|
|
||||||
Note, that argument for -p option should be *the same* as name of stemming
|
Note, that argument for -p option should be *the same* as name of stemming
|
||||||
function in stem.c (without _stem)
|
function in stem.c (without _stem)
|
||||||
@ -82,8 +82,9 @@ Example 1:
|
|||||||
|
|
||||||
psql -d testdict -c "select * from pg_ts_dict where dict_name='pt';"
|
psql -d testdict -c "select * from pg_ts_dict where dict_name='pt';"
|
||||||
dict_name | dict_init | dict_initoption | dict_lexize | dict_comment
|
dict_name | dict_init | dict_initoption | dict_lexize | dict_comment
|
||||||
-----------+-----------+-----------------+-------------+---------------------------------
|
-----------+--------------------+-----------------+---------------------------------------+---------------------------------
|
||||||
pt | 7177806 | | 7159330 | Snowball stemmer for Portuguese
|
pt | dinit_pt(internal) | | snb_lexize(internal,internal,integer) | Snowball stemmer for Portuguese
|
||||||
|
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
|
|
||||||
|
@ -131,11 +131,18 @@ fi
|
|||||||
if [ ${#cfile} -ne 0 ] || [ ${#hfile} -ne 0 ] ; then
|
if [ ${#cfile} -ne 0 ] || [ ${#hfile} -ne 0 ] ; then
|
||||||
[ $verbose = "yes" ] && echo -n 'Copy source and header files... '
|
[ $verbose = "yes" ] && echo -n 'Copy source and header files... '
|
||||||
if [ ${#cfile} -ne 0 ] ; then
|
if [ ${#cfile} -ne 0 ] ; then
|
||||||
|
if [ $stemmode = "yes" ] ; then
|
||||||
|
for cfn in $cfile
|
||||||
|
do
|
||||||
|
sed s#../runtime/## < $cfn > ../../$dir/$cfn
|
||||||
|
done
|
||||||
|
else
|
||||||
if ! cp $cfile ../../$dir ; then
|
if ! cp $cfile ../../$dir ; then
|
||||||
echo "Cant cp all or one of files: $cfile"
|
echo "Can't cp all or one of files: $cfile"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
if [ ${#hfile} -ne 0 ] ; then
|
if [ ${#hfile} -ne 0 ] ; then
|
||||||
if ! cp $hfile ../../$dir ; then
|
if ! cp $hfile ../../$dir ; then
|
||||||
echo "Cant cp all or one of files: $hfile"
|
echo "Cant cp all or one of files: $hfile"
|
||||||
|
@ -1,20 +1,24 @@
|
|||||||
# $PostgreSQL: pgsql/contrib/tsearch2/ispell/Makefile,v 1.6 2004/06/23 11:06:11 teodor Exp $
|
# $PostgreSQL: pgsql/contrib/tsearch2/ispell/Makefile,v 1.7 2005/09/15 11:14:18 teodor Exp $
|
||||||
|
|
||||||
subdir = contrib/tsearch2/ispell
|
PG_CPPFLAGS = -I$(srcdir)/..
|
||||||
|
SUBOBJS = spell.o regis.o
|
||||||
|
EXTRA_CLEAN = SUBSYS.o $(SUBOBJS)
|
||||||
|
|
||||||
|
ifdef USE_PGXS
|
||||||
|
PGXS = $(shell pg_config --pgxs)
|
||||||
|
include $(PGXS)
|
||||||
|
else
|
||||||
|
subdir = contrib/tsearch2
|
||||||
top_builddir = ../../..
|
top_builddir = ../../..
|
||||||
include $(top_builddir)/src/Makefile.global
|
include $(top_builddir)/src/Makefile.global
|
||||||
|
include $(top_srcdir)/contrib/contrib-global.mk
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
PG_CPPFLAGS = -I$(srcdir)/.. $(CPPFLAGS)
|
|
||||||
override CFLAGS += $(CFLAGS_SL)
|
override CFLAGS += $(CFLAGS_SL)
|
||||||
|
|
||||||
SUBOBJS = spell.o regis.o
|
|
||||||
|
|
||||||
all: SUBSYS.o
|
all: SUBSYS.o
|
||||||
|
|
||||||
SUBSYS.o: $(SUBOBJS)
|
SUBSYS.o: $(SUBOBJS)
|
||||||
$(LD) $(LDREL) $(LDOUT) $@ $^
|
$(LD) $(LDREL) $(LDOUT) $@ $^
|
||||||
|
|
||||||
EXTRA_CLEAN = SUBSYS.o $(SUBOBJS)
|
|
||||||
|
|
||||||
include $(top_srcdir)/contrib/contrib-global.mk
|
|
||||||
|
@ -1,20 +1,25 @@
|
|||||||
# $PostgreSQL: pgsql/contrib/tsearch2/snowball/Makefile,v 1.5 2003/11/29 19:51:36 pgsql Exp $
|
# $PostgreSQL: pgsql/contrib/tsearch2/snowball/Makefile,v 1.6 2005/09/15 11:14:18 teodor Exp $
|
||||||
|
|
||||||
subdir = contrib/tsearch2/snowball
|
|
||||||
top_builddir = ../../..
|
|
||||||
include $(top_builddir)/src/Makefile.global
|
|
||||||
|
|
||||||
|
|
||||||
PG_CPPFLAGS = -I$(srcdir)/..
|
PG_CPPFLAGS = -I$(srcdir)/..
|
||||||
override CFLAGS += $(CFLAGS_SL)
|
|
||||||
|
|
||||||
SUBOBJS = english_stem.o api.o russian_stem.o utilities.o
|
SUBOBJS = english_stem.o api.o russian_stem.o utilities.o
|
||||||
|
EXTRA_CLEAN = SUBSYS.o $(SUBOBJS)
|
||||||
|
|
||||||
|
ifdef USE_PGXS
|
||||||
|
PGXS = $(shell pg_config --pgxs)
|
||||||
|
include $(PGXS)
|
||||||
|
else
|
||||||
|
subdir = contrib/tsearch2
|
||||||
|
top_builddir = ../../..
|
||||||
|
include $(top_builddir)/src/Makefile.global
|
||||||
|
include $(top_srcdir)/contrib/contrib-global.mk
|
||||||
|
endif
|
||||||
|
|
||||||
|
override CFLAGS += $(CFLAGS_SL)
|
||||||
|
|
||||||
all: SUBSYS.o
|
all: SUBSYS.o
|
||||||
|
|
||||||
SUBSYS.o: $(SUBOBJS)
|
SUBSYS.o: $(SUBOBJS)
|
||||||
$(LD) $(LDREL) $(LDOUT) $@ $^
|
$(LD) $(LDREL) $(LDOUT) $@ $^
|
||||||
|
|
||||||
EXTRA_CLEAN = SUBSYS.o $(SUBOBJS)
|
|
||||||
|
|
||||||
include $(top_srcdir)/contrib/contrib-global.mk
|
|
||||||
|
@ -1,89 +1,69 @@
|
|||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
|
#include <stdlib.h> /* for calloc, free */
|
||||||
#include "header.h"
|
#include "header.h"
|
||||||
|
|
||||||
struct SN_env *
|
extern struct SN_env * SN_create_env(int S_size, int I_size, int B_size)
|
||||||
SN_create_env(int S_size, int I_size, int B_size)
|
|
||||||
{
|
{
|
||||||
struct SN_env * z = (struct SN_env *) calloc(1, sizeof(struct SN_env));
|
struct SN_env * z = (struct SN_env *) calloc(1, sizeof(struct SN_env));
|
||||||
struct SN_env *z2 = z;
|
if (z == NULL) return NULL;
|
||||||
|
|
||||||
if (!z)
|
|
||||||
return z;
|
|
||||||
|
|
||||||
z->p = create_s();
|
z->p = create_s();
|
||||||
if (!z->p)
|
if (z->p == NULL) goto error;
|
||||||
z = NULL;
|
if (S_size)
|
||||||
|
|
||||||
if (z && S_size)
|
|
||||||
{
|
|
||||||
if ((z->S = (symbol * *) calloc(S_size, sizeof(symbol *))))
|
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
z->S = (symbol * *) calloc(S_size, sizeof(symbol *));
|
||||||
|
if (z->S == NULL) goto error;
|
||||||
|
|
||||||
for (i = 0; i < S_size; i++)
|
for (i = 0; i < S_size; i++)
|
||||||
{
|
{
|
||||||
if (!(z->S[i] = create_s()))
|
z->S[i] = create_s();
|
||||||
{
|
if (z->S[i] == NULL) goto error;
|
||||||
z = NULL;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
z->S_size = S_size;
|
||||||
z2->S_size = i;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
z = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (z && I_size)
|
if (I_size)
|
||||||
{
|
{
|
||||||
z->I = (int *) calloc(I_size, sizeof(int));
|
z->I = (int *) calloc(I_size, sizeof(int));
|
||||||
if (z->I)
|
if (z->I == NULL) goto error;
|
||||||
z->I_size = I_size;
|
z->I_size = I_size;
|
||||||
else
|
|
||||||
z = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (z && B_size)
|
if (B_size)
|
||||||
{
|
{
|
||||||
z->B = (symbol *) calloc(B_size, sizeof(symbol));
|
z->B = (symbol *) calloc(B_size, sizeof(symbol));
|
||||||
if (z->B)
|
if (z->B == NULL) goto error;
|
||||||
z->B_size = B_size;
|
z->B_size = B_size;
|
||||||
else
|
|
||||||
z = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!z)
|
|
||||||
SN_close_env(z2);
|
|
||||||
|
|
||||||
return z;
|
return z;
|
||||||
|
error:
|
||||||
|
SN_close_env(z);
|
||||||
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
extern void SN_close_env(struct SN_env * z)
|
||||||
SN_close_env(struct SN_env * z)
|
|
||||||
{
|
|
||||||
if (z->S && z->S_size)
|
|
||||||
{
|
{
|
||||||
|
if (z == NULL) return;
|
||||||
|
if (z->S_size)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < z->S_size; i++)
|
for (i = 0; i < z->S_size; i++)
|
||||||
|
{
|
||||||
lose_s(z->S[i]);
|
lose_s(z->S[i]);
|
||||||
}
|
}
|
||||||
free(z->S);
|
free(z->S);
|
||||||
}
|
}
|
||||||
if (z->I_size)
|
if (z->I_size) free(z->I);
|
||||||
free(z->I);
|
if (z->B_size) free(z->B);
|
||||||
if (z->B_size)
|
if (z->p) lose_s(z->p);
|
||||||
free(z->B);
|
|
||||||
if (z->p)
|
|
||||||
lose_s(z->p);
|
|
||||||
free(z);
|
free(z);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
extern int SN_set_current(struct SN_env * z, int size, const symbol * s)
|
||||||
SN_set_current(struct SN_env * z, int size, const symbol * s)
|
|
||||||
{
|
{
|
||||||
replace_s(z, 0, z->l, size, s);
|
int err = replace_s(z, 0, z->l, size, s, NULL);
|
||||||
z->c = 0;
|
z->c = 0;
|
||||||
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -11,18 +11,10 @@ typedef unsigned char symbol;
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
struct SN_env
|
struct SN_env {
|
||||||
{
|
|
||||||
symbol * p;
|
symbol * p;
|
||||||
int c;
|
int c; int a; int l; int lb; int bra; int ket;
|
||||||
int a;
|
int S_size; int I_size; int B_size;
|
||||||
int l;
|
|
||||||
int lb;
|
|
||||||
int bra;
|
|
||||||
int ket;
|
|
||||||
int S_size;
|
|
||||||
int I_size;
|
|
||||||
int B_size;
|
|
||||||
symbol * * S;
|
symbol * * S;
|
||||||
int * I;
|
int * I;
|
||||||
symbol * B;
|
symbol * B;
|
||||||
@ -31,4 +23,5 @@ struct SN_env
|
|||||||
extern struct SN_env * SN_create_env(int S_size, int I_size, int B_size);
|
extern struct SN_env * SN_create_env(int S_size, int I_size, int B_size);
|
||||||
extern void SN_close_env(struct SN_env * z);
|
extern void SN_close_env(struct SN_env * z);
|
||||||
|
|
||||||
extern void SN_set_current(struct SN_env * z, int size, const symbol * s);
|
extern int SN_set_current(struct SN_env * z, int size, const symbol * s);
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -1,7 +1,16 @@
|
|||||||
|
|
||||||
/* This file was generated automatically by the Snowball to ANSI C compiler */
|
/* This file was generated automatically by the Snowball to ANSI C compiler */
|
||||||
|
|
||||||
extern struct SN_env *english_create_env(void);
|
#ifdef __cplusplus
|
||||||
extern void english_close_env(struct SN_env * z);
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern struct SN_env * english_ISO_8859_1_create_env(void);
|
||||||
|
extern void english_ISO_8859_1_close_env(struct SN_env * z);
|
||||||
|
|
||||||
|
extern int english_ISO_8859_1_stem(struct SN_env * z);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
extern int english_stem(struct SN_env * z);
|
|
||||||
|
@ -1,5 +1,11 @@
|
|||||||
|
|
||||||
|
#include <limits.h>
|
||||||
|
|
||||||
#include "api.h"
|
#include "api.h"
|
||||||
|
|
||||||
|
#define MAXINT INT_MAX
|
||||||
|
#define MININT INT_MIN
|
||||||
|
|
||||||
#define HEAD 2*sizeof(int)
|
#define HEAD 2*sizeof(int)
|
||||||
|
|
||||||
#define SIZE(p) ((int *)(p))[-1]
|
#define SIZE(p) ((int *)(p))[-1]
|
||||||
@ -7,8 +13,7 @@
|
|||||||
#define CAPACITY(p) ((int *)(p))[-2]
|
#define CAPACITY(p) ((int *)(p))[-2]
|
||||||
|
|
||||||
struct among
|
struct among
|
||||||
{
|
{ int s_size; /* number of chars in string */
|
||||||
int s_size; /* number of chars in string */
|
|
||||||
symbol * s; /* search string */
|
symbol * s; /* search string */
|
||||||
int substring_i;/* index to longest matching substring */
|
int substring_i;/* index to longest matching substring */
|
||||||
int result; /* result of the lookup */
|
int result; /* result of the lookup */
|
||||||
@ -18,16 +23,18 @@ struct among
|
|||||||
extern symbol * create_s(void);
|
extern symbol * create_s(void);
|
||||||
extern void lose_s(symbol * p);
|
extern void lose_s(symbol * p);
|
||||||
|
|
||||||
|
extern int skip_utf8(const symbol * p, int c, int lb, int l, int n);
|
||||||
|
|
||||||
|
extern int in_grouping_U(struct SN_env * z, unsigned char * s, int min, int max);
|
||||||
|
extern int in_grouping_b_U(struct SN_env * z, unsigned char * s, int min, int max);
|
||||||
|
extern int out_grouping_U(struct SN_env * z, unsigned char * s, int min, int max);
|
||||||
|
extern int out_grouping_b_U(struct SN_env * z, unsigned char * s, int min, int max);
|
||||||
|
|
||||||
extern int in_grouping(struct SN_env * z, unsigned char * s, int min, int max);
|
extern int in_grouping(struct SN_env * z, unsigned char * s, int min, int max);
|
||||||
extern int in_grouping_b(struct SN_env * z, unsigned char * s, int min, int max);
|
extern int in_grouping_b(struct SN_env * z, unsigned char * s, int min, int max);
|
||||||
extern int out_grouping(struct SN_env * z, unsigned char * s, int min, int max);
|
extern int out_grouping(struct SN_env * z, unsigned char * s, int min, int max);
|
||||||
extern int out_grouping_b(struct SN_env * z, unsigned char * s, int min, int max);
|
extern int out_grouping_b(struct SN_env * z, unsigned char * s, int min, int max);
|
||||||
|
|
||||||
extern int in_range(struct SN_env * z, int min, int max);
|
|
||||||
extern int in_range_b(struct SN_env * z, int min, int max);
|
|
||||||
extern int out_range(struct SN_env * z, int min, int max);
|
|
||||||
extern int out_range_b(struct SN_env * z, int min, int max);
|
|
||||||
|
|
||||||
extern int eq_s(struct SN_env * z, int s_size, symbol * s);
|
extern int eq_s(struct SN_env * z, int s_size, symbol * s);
|
||||||
extern int eq_s_b(struct SN_env * z, int s_size, symbol * s);
|
extern int eq_s_b(struct SN_env * z, int s_size, symbol * s);
|
||||||
extern int eq_v(struct SN_env * z, symbol * p);
|
extern int eq_v(struct SN_env * z, symbol * p);
|
||||||
@ -36,16 +43,16 @@ extern int eq_v_b(struct SN_env * z, symbol * p);
|
|||||||
extern int find_among(struct SN_env * z, struct among * v, int v_size);
|
extern int find_among(struct SN_env * z, struct among * v, int v_size);
|
||||||
extern int find_among_b(struct SN_env * z, struct among * v, int v_size);
|
extern int find_among_b(struct SN_env * z, struct among * v, int v_size);
|
||||||
|
|
||||||
extern symbol *increase_size(symbol * p, int n);
|
extern int replace_s(struct SN_env * z, int c_bra, int c_ket, int s_size, const symbol * s, int * adjustment);
|
||||||
extern int replace_s(struct SN_env * z, int c_bra, int c_ket, int s_size, const symbol * s);
|
extern int slice_from_s(struct SN_env * z, int s_size, symbol * s);
|
||||||
extern void slice_from_s(struct SN_env * z, int s_size, symbol * s);
|
extern int slice_from_v(struct SN_env * z, symbol * p);
|
||||||
extern void slice_from_v(struct SN_env * z, symbol * p);
|
extern int slice_del(struct SN_env * z);
|
||||||
extern void slice_del(struct SN_env * z);
|
|
||||||
|
|
||||||
extern void insert_s(struct SN_env * z, int bra, int ket, int s_size, symbol * s);
|
extern int insert_s(struct SN_env * z, int bra, int ket, int s_size, symbol * s);
|
||||||
extern void insert_v(struct SN_env * z, int bra, int ket, symbol * p);
|
extern int insert_v(struct SN_env * z, int bra, int ket, symbol * p);
|
||||||
|
|
||||||
extern symbol * slice_to(struct SN_env * z, symbol * p);
|
extern symbol * slice_to(struct SN_env * z, symbol * p);
|
||||||
extern symbol * assign_to(struct SN_env * z, symbol * p);
|
extern symbol * assign_to(struct SN_env * z, symbol * p);
|
||||||
|
|
||||||
extern void debug(struct SN_env * z, int number, int line_count);
|
extern void debug(struct SN_env * z, int number, int line_count);
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
#include "header.h"
|
#include "header.h"
|
||||||
|
|
||||||
extern int russian_stem(struct SN_env * z);
|
extern int russian_KOI8_R_stem(struct SN_env * z);
|
||||||
static int r_tidy_up(struct SN_env * z);
|
static int r_tidy_up(struct SN_env * z);
|
||||||
static int r_derivational(struct SN_env * z);
|
static int r_derivational(struct SN_env * z);
|
||||||
static int r_noun(struct SN_env * z);
|
static int r_noun(struct SN_env * z);
|
||||||
@ -15,18 +15,18 @@ static int r_perfective_gerund(struct SN_env * z);
|
|||||||
static int r_R2(struct SN_env * z);
|
static int r_R2(struct SN_env * z);
|
||||||
static int r_mark_regions(struct SN_env * z);
|
static int r_mark_regions(struct SN_env * z);
|
||||||
|
|
||||||
extern struct SN_env *russian_create_env(void);
|
extern struct SN_env * russian_KOI8_R_create_env(void);
|
||||||
extern void russian_close_env(struct SN_env * z);
|
extern void russian_KOI8_R_close_env(struct SN_env * z);
|
||||||
|
|
||||||
static symbol s_0_0[3] = {215, 219, 201};
|
static symbol s_0_0[3] = { 0xD7, 0xDB, 0xC9 };
|
||||||
static symbol s_0_1[4] = {201, 215, 219, 201};
|
static symbol s_0_1[4] = { 0xC9, 0xD7, 0xDB, 0xC9 };
|
||||||
static symbol s_0_2[4] = {217, 215, 219, 201};
|
static symbol s_0_2[4] = { 0xD9, 0xD7, 0xDB, 0xC9 };
|
||||||
static symbol s_0_3[1] = {215};
|
static symbol s_0_3[1] = { 0xD7 };
|
||||||
static symbol s_0_4[2] = {201, 215};
|
static symbol s_0_4[2] = { 0xC9, 0xD7 };
|
||||||
static symbol s_0_5[2] = {217, 215};
|
static symbol s_0_5[2] = { 0xD9, 0xD7 };
|
||||||
static symbol s_0_6[5] = {215, 219, 201, 211, 216};
|
static symbol s_0_6[5] = { 0xD7, 0xDB, 0xC9, 0xD3, 0xD8 };
|
||||||
static symbol s_0_7[6] = {201, 215, 219, 201, 211, 216};
|
static symbol s_0_7[6] = { 0xC9, 0xD7, 0xDB, 0xC9, 0xD3, 0xD8 };
|
||||||
static symbol s_0_8[6] = {217, 215, 219, 201, 211, 216};
|
static symbol s_0_8[6] = { 0xD9, 0xD7, 0xDB, 0xC9, 0xD3, 0xD8 };
|
||||||
|
|
||||||
static struct among a_0[9] =
|
static struct among a_0[9] =
|
||||||
{
|
{
|
||||||
@ -41,32 +41,32 @@ static struct among a_0[9] =
|
|||||||
/* 8 */ { 6, s_0_8, 6, 2, 0}
|
/* 8 */ { 6, s_0_8, 6, 2, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
static symbol s_1_0[2] = {192, 192};
|
static symbol s_1_0[2] = { 0xC0, 0xC0 };
|
||||||
static symbol s_1_1[2] = {197, 192};
|
static symbol s_1_1[2] = { 0xC5, 0xC0 };
|
||||||
static symbol s_1_2[2] = {207, 192};
|
static symbol s_1_2[2] = { 0xCF, 0xC0 };
|
||||||
static symbol s_1_3[2] = {213, 192};
|
static symbol s_1_3[2] = { 0xD5, 0xC0 };
|
||||||
static symbol s_1_4[2] = {197, 197};
|
static symbol s_1_4[2] = { 0xC5, 0xC5 };
|
||||||
static symbol s_1_5[2] = {201, 197};
|
static symbol s_1_5[2] = { 0xC9, 0xC5 };
|
||||||
static symbol s_1_6[2] = {207, 197};
|
static symbol s_1_6[2] = { 0xCF, 0xC5 };
|
||||||
static symbol s_1_7[2] = {217, 197};
|
static symbol s_1_7[2] = { 0xD9, 0xC5 };
|
||||||
static symbol s_1_8[2] = {201, 200};
|
static symbol s_1_8[2] = { 0xC9, 0xC8 };
|
||||||
static symbol s_1_9[2] = {217, 200};
|
static symbol s_1_9[2] = { 0xD9, 0xC8 };
|
||||||
static symbol s_1_10[3] = {201, 205, 201};
|
static symbol s_1_10[3] = { 0xC9, 0xCD, 0xC9 };
|
||||||
static symbol s_1_11[3] = {217, 205, 201};
|
static symbol s_1_11[3] = { 0xD9, 0xCD, 0xC9 };
|
||||||
static symbol s_1_12[2] = {197, 202};
|
static symbol s_1_12[2] = { 0xC5, 0xCA };
|
||||||
static symbol s_1_13[2] = {201, 202};
|
static symbol s_1_13[2] = { 0xC9, 0xCA };
|
||||||
static symbol s_1_14[2] = {207, 202};
|
static symbol s_1_14[2] = { 0xCF, 0xCA };
|
||||||
static symbol s_1_15[2] = {217, 202};
|
static symbol s_1_15[2] = { 0xD9, 0xCA };
|
||||||
static symbol s_1_16[2] = {197, 205};
|
static symbol s_1_16[2] = { 0xC5, 0xCD };
|
||||||
static symbol s_1_17[2] = {201, 205};
|
static symbol s_1_17[2] = { 0xC9, 0xCD };
|
||||||
static symbol s_1_18[2] = {207, 205};
|
static symbol s_1_18[2] = { 0xCF, 0xCD };
|
||||||
static symbol s_1_19[2] = {217, 205};
|
static symbol s_1_19[2] = { 0xD9, 0xCD };
|
||||||
static symbol s_1_20[3] = {197, 199, 207};
|
static symbol s_1_20[3] = { 0xC5, 0xC7, 0xCF };
|
||||||
static symbol s_1_21[3] = {207, 199, 207};
|
static symbol s_1_21[3] = { 0xCF, 0xC7, 0xCF };
|
||||||
static symbol s_1_22[2] = {193, 209};
|
static symbol s_1_22[2] = { 0xC1, 0xD1 };
|
||||||
static symbol s_1_23[2] = {209, 209};
|
static symbol s_1_23[2] = { 0xD1, 0xD1 };
|
||||||
static symbol s_1_24[3] = {197, 205, 213};
|
static symbol s_1_24[3] = { 0xC5, 0xCD, 0xD5 };
|
||||||
static symbol s_1_25[3] = {207, 205, 213};
|
static symbol s_1_25[3] = { 0xCF, 0xCD, 0xD5 };
|
||||||
|
|
||||||
static struct among a_1[26] =
|
static struct among a_1[26] =
|
||||||
{
|
{
|
||||||
@ -98,14 +98,14 @@ static struct among a_1[26] =
|
|||||||
/* 25 */ { 3, s_1_25, -1, 1, 0}
|
/* 25 */ { 3, s_1_25, -1, 1, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
static symbol s_2_0[2] = {197, 205};
|
static symbol s_2_0[2] = { 0xC5, 0xCD };
|
||||||
static symbol s_2_1[2] = {206, 206};
|
static symbol s_2_1[2] = { 0xCE, 0xCE };
|
||||||
static symbol s_2_2[2] = {215, 219};
|
static symbol s_2_2[2] = { 0xD7, 0xDB };
|
||||||
static symbol s_2_3[3] = {201, 215, 219};
|
static symbol s_2_3[3] = { 0xC9, 0xD7, 0xDB };
|
||||||
static symbol s_2_4[3] = {217, 215, 219};
|
static symbol s_2_4[3] = { 0xD9, 0xD7, 0xDB };
|
||||||
static symbol s_2_5[1] = {221};
|
static symbol s_2_5[1] = { 0xDD };
|
||||||
static symbol s_2_6[2] = {192, 221};
|
static symbol s_2_6[2] = { 0xC0, 0xDD };
|
||||||
static symbol s_2_7[3] = {213, 192, 221};
|
static symbol s_2_7[3] = { 0xD5, 0xC0, 0xDD };
|
||||||
|
|
||||||
static struct among a_2[8] =
|
static struct among a_2[8] =
|
||||||
{
|
{
|
||||||
@ -119,8 +119,8 @@ static struct among a_2[8] =
|
|||||||
/* 7 */ { 3, s_2_7, 6, 2, 0}
|
/* 7 */ { 3, s_2_7, 6, 2, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
static symbol s_3_0[2] = {211, 209};
|
static symbol s_3_0[2] = { 0xD3, 0xD1 };
|
||||||
static symbol s_3_1[2] = {211, 216};
|
static symbol s_3_1[2] = { 0xD3, 0xD8 };
|
||||||
|
|
||||||
static struct among a_3[2] =
|
static struct among a_3[2] =
|
||||||
{
|
{
|
||||||
@ -128,52 +128,52 @@ static struct among a_3[2] =
|
|||||||
/* 1 */ { 2, s_3_1, -1, 1, 0}
|
/* 1 */ { 2, s_3_1, -1, 1, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
static symbol s_4_0[1] = {192};
|
static symbol s_4_0[1] = { 0xC0 };
|
||||||
static symbol s_4_1[2] = {213, 192};
|
static symbol s_4_1[2] = { 0xD5, 0xC0 };
|
||||||
static symbol s_4_2[2] = {204, 193};
|
static symbol s_4_2[2] = { 0xCC, 0xC1 };
|
||||||
static symbol s_4_3[3] = {201, 204, 193};
|
static symbol s_4_3[3] = { 0xC9, 0xCC, 0xC1 };
|
||||||
static symbol s_4_4[3] = {217, 204, 193};
|
static symbol s_4_4[3] = { 0xD9, 0xCC, 0xC1 };
|
||||||
static symbol s_4_5[2] = {206, 193};
|
static symbol s_4_5[2] = { 0xCE, 0xC1 };
|
||||||
static symbol s_4_6[3] = {197, 206, 193};
|
static symbol s_4_6[3] = { 0xC5, 0xCE, 0xC1 };
|
||||||
static symbol s_4_7[3] = {197, 212, 197};
|
static symbol s_4_7[3] = { 0xC5, 0xD4, 0xC5 };
|
||||||
static symbol s_4_8[3] = {201, 212, 197};
|
static symbol s_4_8[3] = { 0xC9, 0xD4, 0xC5 };
|
||||||
static symbol s_4_9[3] = {202, 212, 197};
|
static symbol s_4_9[3] = { 0xCA, 0xD4, 0xC5 };
|
||||||
static symbol s_4_10[4] = {197, 202, 212, 197};
|
static symbol s_4_10[4] = { 0xC5, 0xCA, 0xD4, 0xC5 };
|
||||||
static symbol s_4_11[4] = {213, 202, 212, 197};
|
static symbol s_4_11[4] = { 0xD5, 0xCA, 0xD4, 0xC5 };
|
||||||
static symbol s_4_12[2] = {204, 201};
|
static symbol s_4_12[2] = { 0xCC, 0xC9 };
|
||||||
static symbol s_4_13[3] = {201, 204, 201};
|
static symbol s_4_13[3] = { 0xC9, 0xCC, 0xC9 };
|
||||||
static symbol s_4_14[3] = {217, 204, 201};
|
static symbol s_4_14[3] = { 0xD9, 0xCC, 0xC9 };
|
||||||
static symbol s_4_15[1] = {202};
|
static symbol s_4_15[1] = { 0xCA };
|
||||||
static symbol s_4_16[2] = {197, 202};
|
static symbol s_4_16[2] = { 0xC5, 0xCA };
|
||||||
static symbol s_4_17[2] = {213, 202};
|
static symbol s_4_17[2] = { 0xD5, 0xCA };
|
||||||
static symbol s_4_18[1] = {204};
|
static symbol s_4_18[1] = { 0xCC };
|
||||||
static symbol s_4_19[2] = {201, 204};
|
static symbol s_4_19[2] = { 0xC9, 0xCC };
|
||||||
static symbol s_4_20[2] = {217, 204};
|
static symbol s_4_20[2] = { 0xD9, 0xCC };
|
||||||
static symbol s_4_21[2] = {197, 205};
|
static symbol s_4_21[2] = { 0xC5, 0xCD };
|
||||||
static symbol s_4_22[2] = {201, 205};
|
static symbol s_4_22[2] = { 0xC9, 0xCD };
|
||||||
static symbol s_4_23[2] = {217, 205};
|
static symbol s_4_23[2] = { 0xD9, 0xCD };
|
||||||
static symbol s_4_24[1] = {206};
|
static symbol s_4_24[1] = { 0xCE };
|
||||||
static symbol s_4_25[2] = {197, 206};
|
static symbol s_4_25[2] = { 0xC5, 0xCE };
|
||||||
static symbol s_4_26[2] = {204, 207};
|
static symbol s_4_26[2] = { 0xCC, 0xCF };
|
||||||
static symbol s_4_27[3] = {201, 204, 207};
|
static symbol s_4_27[3] = { 0xC9, 0xCC, 0xCF };
|
||||||
static symbol s_4_28[3] = {217, 204, 207};
|
static symbol s_4_28[3] = { 0xD9, 0xCC, 0xCF };
|
||||||
static symbol s_4_29[2] = {206, 207};
|
static symbol s_4_29[2] = { 0xCE, 0xCF };
|
||||||
static symbol s_4_30[3] = {197, 206, 207};
|
static symbol s_4_30[3] = { 0xC5, 0xCE, 0xCF };
|
||||||
static symbol s_4_31[3] = {206, 206, 207};
|
static symbol s_4_31[3] = { 0xCE, 0xCE, 0xCF };
|
||||||
static symbol s_4_32[2] = {192, 212};
|
static symbol s_4_32[2] = { 0xC0, 0xD4 };
|
||||||
static symbol s_4_33[3] = {213, 192, 212};
|
static symbol s_4_33[3] = { 0xD5, 0xC0, 0xD4 };
|
||||||
static symbol s_4_34[2] = {197, 212};
|
static symbol s_4_34[2] = { 0xC5, 0xD4 };
|
||||||
static symbol s_4_35[3] = {213, 197, 212};
|
static symbol s_4_35[3] = { 0xD5, 0xC5, 0xD4 };
|
||||||
static symbol s_4_36[2] = {201, 212};
|
static symbol s_4_36[2] = { 0xC9, 0xD4 };
|
||||||
static symbol s_4_37[2] = {209, 212};
|
static symbol s_4_37[2] = { 0xD1, 0xD4 };
|
||||||
static symbol s_4_38[2] = {217, 212};
|
static symbol s_4_38[2] = { 0xD9, 0xD4 };
|
||||||
static symbol s_4_39[2] = {212, 216};
|
static symbol s_4_39[2] = { 0xD4, 0xD8 };
|
||||||
static symbol s_4_40[3] = {201, 212, 216};
|
static symbol s_4_40[3] = { 0xC9, 0xD4, 0xD8 };
|
||||||
static symbol s_4_41[3] = {217, 212, 216};
|
static symbol s_4_41[3] = { 0xD9, 0xD4, 0xD8 };
|
||||||
static symbol s_4_42[3] = {197, 219, 216};
|
static symbol s_4_42[3] = { 0xC5, 0xDB, 0xD8 };
|
||||||
static symbol s_4_43[3] = {201, 219, 216};
|
static symbol s_4_43[3] = { 0xC9, 0xDB, 0xD8 };
|
||||||
static symbol s_4_44[2] = {206, 217};
|
static symbol s_4_44[2] = { 0xCE, 0xD9 };
|
||||||
static symbol s_4_45[3] = {197, 206, 217};
|
static symbol s_4_45[3] = { 0xC5, 0xCE, 0xD9 };
|
||||||
|
|
||||||
static struct among a_4[46] =
|
static struct among a_4[46] =
|
||||||
{
|
{
|
||||||
@ -225,42 +225,42 @@ static struct among a_4[46] =
|
|||||||
/* 45 */ { 3, s_4_45, 44, 2, 0}
|
/* 45 */ { 3, s_4_45, 44, 2, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
static symbol s_5_0[1] = {192};
|
static symbol s_5_0[1] = { 0xC0 };
|
||||||
static symbol s_5_1[2] = {201, 192};
|
static symbol s_5_1[2] = { 0xC9, 0xC0 };
|
||||||
static symbol s_5_2[2] = {216, 192};
|
static symbol s_5_2[2] = { 0xD8, 0xC0 };
|
||||||
static symbol s_5_3[1] = {193};
|
static symbol s_5_3[1] = { 0xC1 };
|
||||||
static symbol s_5_4[1] = {197};
|
static symbol s_5_4[1] = { 0xC5 };
|
||||||
static symbol s_5_5[2] = {201, 197};
|
static symbol s_5_5[2] = { 0xC9, 0xC5 };
|
||||||
static symbol s_5_6[2] = {216, 197};
|
static symbol s_5_6[2] = { 0xD8, 0xC5 };
|
||||||
static symbol s_5_7[2] = {193, 200};
|
static symbol s_5_7[2] = { 0xC1, 0xC8 };
|
||||||
static symbol s_5_8[2] = {209, 200};
|
static symbol s_5_8[2] = { 0xD1, 0xC8 };
|
||||||
static symbol s_5_9[3] = {201, 209, 200};
|
static symbol s_5_9[3] = { 0xC9, 0xD1, 0xC8 };
|
||||||
static symbol s_5_10[1] = {201};
|
static symbol s_5_10[1] = { 0xC9 };
|
||||||
static symbol s_5_11[2] = {197, 201};
|
static symbol s_5_11[2] = { 0xC5, 0xC9 };
|
||||||
static symbol s_5_12[2] = {201, 201};
|
static symbol s_5_12[2] = { 0xC9, 0xC9 };
|
||||||
static symbol s_5_13[3] = {193, 205, 201};
|
static symbol s_5_13[3] = { 0xC1, 0xCD, 0xC9 };
|
||||||
static symbol s_5_14[3] = {209, 205, 201};
|
static symbol s_5_14[3] = { 0xD1, 0xCD, 0xC9 };
|
||||||
static symbol s_5_15[4] = {201, 209, 205, 201};
|
static symbol s_5_15[4] = { 0xC9, 0xD1, 0xCD, 0xC9 };
|
||||||
static symbol s_5_16[1] = {202};
|
static symbol s_5_16[1] = { 0xCA };
|
||||||
static symbol s_5_17[2] = {197, 202};
|
static symbol s_5_17[2] = { 0xC5, 0xCA };
|
||||||
static symbol s_5_18[3] = {201, 197, 202};
|
static symbol s_5_18[3] = { 0xC9, 0xC5, 0xCA };
|
||||||
static symbol s_5_19[2] = {201, 202};
|
static symbol s_5_19[2] = { 0xC9, 0xCA };
|
||||||
static symbol s_5_20[2] = {207, 202};
|
static symbol s_5_20[2] = { 0xCF, 0xCA };
|
||||||
static symbol s_5_21[2] = {193, 205};
|
static symbol s_5_21[2] = { 0xC1, 0xCD };
|
||||||
static symbol s_5_22[2] = {197, 205};
|
static symbol s_5_22[2] = { 0xC5, 0xCD };
|
||||||
static symbol s_5_23[3] = {201, 197, 205};
|
static symbol s_5_23[3] = { 0xC9, 0xC5, 0xCD };
|
||||||
static symbol s_5_24[2] = {207, 205};
|
static symbol s_5_24[2] = { 0xCF, 0xCD };
|
||||||
static symbol s_5_25[2] = {209, 205};
|
static symbol s_5_25[2] = { 0xD1, 0xCD };
|
||||||
static symbol s_5_26[3] = {201, 209, 205};
|
static symbol s_5_26[3] = { 0xC9, 0xD1, 0xCD };
|
||||||
static symbol s_5_27[1] = {207};
|
static symbol s_5_27[1] = { 0xCF };
|
||||||
static symbol s_5_28[1] = {209};
|
static symbol s_5_28[1] = { 0xD1 };
|
||||||
static symbol s_5_29[2] = {201, 209};
|
static symbol s_5_29[2] = { 0xC9, 0xD1 };
|
||||||
static symbol s_5_30[2] = {216, 209};
|
static symbol s_5_30[2] = { 0xD8, 0xD1 };
|
||||||
static symbol s_5_31[1] = {213};
|
static symbol s_5_31[1] = { 0xD5 };
|
||||||
static symbol s_5_32[2] = {197, 215};
|
static symbol s_5_32[2] = { 0xC5, 0xD7 };
|
||||||
static symbol s_5_33[2] = {207, 215};
|
static symbol s_5_33[2] = { 0xCF, 0xD7 };
|
||||||
static symbol s_5_34[1] = {216};
|
static symbol s_5_34[1] = { 0xD8 };
|
||||||
static symbol s_5_35[1] = {217};
|
static symbol s_5_35[1] = { 0xD9 };
|
||||||
|
|
||||||
static struct among a_5[36] =
|
static struct among a_5[36] =
|
||||||
{
|
{
|
||||||
@ -302,8 +302,8 @@ static struct among a_5[36] =
|
|||||||
/* 35 */ { 1, s_5_35, -1, 1, 0}
|
/* 35 */ { 1, s_5_35, -1, 1, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
static symbol s_6_0[3] = {207, 211, 212};
|
static symbol s_6_0[3] = { 0xCF, 0xD3, 0xD4 };
|
||||||
static symbol s_6_1[4] = {207, 211, 212, 216};
|
static symbol s_6_1[4] = { 0xCF, 0xD3, 0xD4, 0xD8 };
|
||||||
|
|
||||||
static struct among a_6[2] =
|
static struct among a_6[2] =
|
||||||
{
|
{
|
||||||
@ -311,10 +311,10 @@ static struct among a_6[2] =
|
|||||||
/* 1 */ { 4, s_6_1, -1, 1, 0}
|
/* 1 */ { 4, s_6_1, -1, 1, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
static symbol s_7_0[4] = {197, 202, 219, 197};
|
static symbol s_7_0[4] = { 0xC5, 0xCA, 0xDB, 0xC5 };
|
||||||
static symbol s_7_1[1] = {206};
|
static symbol s_7_1[1] = { 0xCE };
|
||||||
static symbol s_7_2[1] = {216};
|
static symbol s_7_2[1] = { 0xD8 };
|
||||||
static symbol s_7_3[3] = {197, 202, 219};
|
static symbol s_7_3[3] = { 0xC5, 0xCA, 0xDB };
|
||||||
|
|
||||||
static struct among a_7[4] =
|
static struct among a_7[4] =
|
||||||
{
|
{
|
||||||
@ -326,183 +326,144 @@ static struct among a_7[4] =
|
|||||||
|
|
||||||
static unsigned char g_v[] = { 35, 130, 34, 18 };
|
static unsigned char g_v[] = { 35, 130, 34, 18 };
|
||||||
|
|
||||||
static symbol s_0[] = {193};
|
static symbol s_0[] = { 0xC1 };
|
||||||
static symbol s_1[] = {209};
|
static symbol s_1[] = { 0xD1 };
|
||||||
static symbol s_2[] = {193};
|
static symbol s_2[] = { 0xC1 };
|
||||||
static symbol s_3[] = {209};
|
static symbol s_3[] = { 0xD1 };
|
||||||
static symbol s_4[] = {193};
|
static symbol s_4[] = { 0xC1 };
|
||||||
static symbol s_5[] = {209};
|
static symbol s_5[] = { 0xD1 };
|
||||||
static symbol s_6[] = {206};
|
static symbol s_6[] = { 0xCE };
|
||||||
static symbol s_7[] = {206};
|
static symbol s_7[] = { 0xCE };
|
||||||
static symbol s_8[] = {206};
|
static symbol s_8[] = { 0xCE };
|
||||||
static symbol s_9[] = {201};
|
static symbol s_9[] = { 0xC9 };
|
||||||
|
|
||||||
static int
|
static int r_mark_regions(struct SN_env * z) {
|
||||||
r_mark_regions(struct SN_env * z)
|
|
||||||
{
|
|
||||||
z->I[0] = z->l;
|
z->I[0] = z->l;
|
||||||
z->I[1] = z->l;
|
z->I[1] = z->l;
|
||||||
{
|
{ int c = z->c; /* do, line 63 */
|
||||||
int c = z->c; /* do, line 100 */
|
while(1) { /* gopast, line 64 */
|
||||||
|
if (!(in_grouping(z, g_v, 192, 220))) goto lab1;
|
||||||
while (1)
|
|
||||||
{ /* gopast, line 101 */
|
|
||||||
if (!(in_grouping(z, g_v, 192, 220)))
|
|
||||||
goto lab1;
|
|
||||||
break;
|
break;
|
||||||
lab1:
|
lab1:
|
||||||
if (z->c >= z->l)
|
if (z->c >= z->l) goto lab0;
|
||||||
goto lab0;
|
z->c++; /* gopast, line 64 */
|
||||||
z->c++;
|
|
||||||
}
|
}
|
||||||
z->I[0] = z->c; /* setmark pV, line 101 */
|
z->I[0] = z->c; /* setmark pV, line 64 */
|
||||||
while (1)
|
while(1) { /* gopast, line 64 */
|
||||||
{ /* gopast, line 101 */
|
if (!(out_grouping(z, g_v, 192, 220))) goto lab2;
|
||||||
if (!(out_grouping(z, g_v, 192, 220)))
|
|
||||||
goto lab2;
|
|
||||||
break;
|
break;
|
||||||
lab2:
|
lab2:
|
||||||
if (z->c >= z->l)
|
if (z->c >= z->l) goto lab0;
|
||||||
goto lab0;
|
z->c++; /* gopast, line 64 */
|
||||||
z->c++;
|
|
||||||
}
|
}
|
||||||
while (1)
|
while(1) { /* gopast, line 65 */
|
||||||
{ /* gopast, line 102 */
|
if (!(in_grouping(z, g_v, 192, 220))) goto lab3;
|
||||||
if (!(in_grouping(z, g_v, 192, 220)))
|
|
||||||
goto lab3;
|
|
||||||
break;
|
break;
|
||||||
lab3:
|
lab3:
|
||||||
if (z->c >= z->l)
|
if (z->c >= z->l) goto lab0;
|
||||||
goto lab0;
|
z->c++; /* gopast, line 65 */
|
||||||
z->c++;
|
|
||||||
}
|
}
|
||||||
while (1)
|
while(1) { /* gopast, line 65 */
|
||||||
{ /* gopast, line 102 */
|
if (!(out_grouping(z, g_v, 192, 220))) goto lab4;
|
||||||
if (!(out_grouping(z, g_v, 192, 220)))
|
|
||||||
goto lab4;
|
|
||||||
break;
|
break;
|
||||||
lab4:
|
lab4:
|
||||||
if (z->c >= z->l)
|
if (z->c >= z->l) goto lab0;
|
||||||
goto lab0;
|
z->c++; /* gopast, line 65 */
|
||||||
z->c++;
|
|
||||||
}
|
}
|
||||||
z->I[1] = z->c; /* setmark p2, line 102 */
|
z->I[1] = z->c; /* setmark p2, line 65 */
|
||||||
lab0:
|
lab0:
|
||||||
z->c = c;
|
z->c = c;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int r_R2(struct SN_env * z) {
|
||||||
r_R2(struct SN_env * z)
|
if (!(z->I[1] <= z->c)) return 0;
|
||||||
{
|
|
||||||
if (!(z->I[1] <= z->c))
|
|
||||||
return 0;
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int r_perfective_gerund(struct SN_env * z) {
|
||||||
r_perfective_gerund(struct SN_env * z)
|
|
||||||
{
|
|
||||||
int among_var;
|
int among_var;
|
||||||
|
z->ket = z->c; /* [, line 74 */
|
||||||
z->ket = z->c; /* [, line 111 */
|
among_var = find_among_b(z, a_0, 9); /* substring, line 74 */
|
||||||
among_var = find_among_b(z, a_0, 9); /* substring, line 111 */
|
if (!(among_var)) return 0;
|
||||||
if (!(among_var))
|
z->bra = z->c; /* ], line 74 */
|
||||||
return 0;
|
switch(among_var) {
|
||||||
z->bra = z->c; /* ], line 111 */
|
case 0: return 0;
|
||||||
switch (among_var)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
return 0;
|
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{ int m = z->l - z->c; (void) m; /* or, line 78 */
|
||||||
int m = z->l - z->c; /* or, line 115 */
|
if (!(eq_s_b(z, 1, s_0))) goto lab1;
|
||||||
|
|
||||||
if (!(eq_s_b(z, 1, s_0)))
|
|
||||||
goto lab1;
|
|
||||||
goto lab0;
|
goto lab0;
|
||||||
lab1:
|
lab1:
|
||||||
z->c = z->l - m;
|
z->c = z->l - m;
|
||||||
if (!(eq_s_b(z, 1, s_1)))
|
if (!(eq_s_b(z, 1, s_1))) return 0;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
lab0:
|
lab0:
|
||||||
slice_del(z); /* delete, line 115 */
|
{ int ret;
|
||||||
|
ret = slice_del(z); /* delete, line 78 */
|
||||||
|
if (ret < 0) return ret;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
slice_del(z); /* delete, line 122 */
|
{ int ret;
|
||||||
|
ret = slice_del(z); /* delete, line 85 */
|
||||||
|
if (ret < 0) return ret;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int r_adjective(struct SN_env * z) {
|
||||||
r_adjective(struct SN_env * z)
|
|
||||||
{
|
|
||||||
int among_var;
|
int among_var;
|
||||||
|
z->ket = z->c; /* [, line 90 */
|
||||||
z->ket = z->c; /* [, line 127 */
|
among_var = find_among_b(z, a_1, 26); /* substring, line 90 */
|
||||||
among_var = find_among_b(z, a_1, 26); /* substring, line 127 */
|
if (!(among_var)) return 0;
|
||||||
if (!(among_var))
|
z->bra = z->c; /* ], line 90 */
|
||||||
return 0;
|
switch(among_var) {
|
||||||
z->bra = z->c; /* ], line 127 */
|
case 0: return 0;
|
||||||
switch (among_var)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
return 0;
|
|
||||||
case 1:
|
case 1:
|
||||||
slice_del(z); /* delete, line 136 */
|
{ int ret;
|
||||||
|
ret = slice_del(z); /* delete, line 99 */
|
||||||
|
if (ret < 0) return ret;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int r_adjectival(struct SN_env * z) {
|
||||||
r_adjectival(struct SN_env * z)
|
|
||||||
{
|
|
||||||
int among_var;
|
int among_var;
|
||||||
|
{ int ret = r_adjective(z);
|
||||||
if (!r_adjective(z))
|
if (ret == 0) return 0; /* call adjective, line 104 */
|
||||||
return 0; /* call adjective, line 141 */
|
if (ret < 0) return ret;
|
||||||
{
|
|
||||||
int m = z->l - z->c; /* try, line 148 */
|
|
||||||
|
|
||||||
z->ket = z->c; /* [, line 149 */
|
|
||||||
among_var = find_among_b(z, a_2, 8); /* substring, line 149 */
|
|
||||||
if (!(among_var))
|
|
||||||
{
|
|
||||||
z->c = z->l - m;
|
|
||||||
goto lab0;
|
|
||||||
}
|
|
||||||
z->bra = z->c; /* ], line 149 */
|
|
||||||
switch (among_var)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
{
|
|
||||||
z->c = z->l - m;
|
|
||||||
goto lab0;
|
|
||||||
}
|
}
|
||||||
|
{ int m = z->l - z->c; (void) m; /* try, line 111 */
|
||||||
|
z->ket = z->c; /* [, line 112 */
|
||||||
|
among_var = find_among_b(z, a_2, 8); /* substring, line 112 */
|
||||||
|
if (!(among_var)) { z->c = z->l - m; goto lab0; }
|
||||||
|
z->bra = z->c; /* ], line 112 */
|
||||||
|
switch(among_var) {
|
||||||
|
case 0: { z->c = z->l - m; goto lab0; }
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{ int m = z->l - z->c; (void) m; /* or, line 117 */
|
||||||
int m = z->l - z->c; /* or, line 154 */
|
if (!(eq_s_b(z, 1, s_2))) goto lab2;
|
||||||
|
|
||||||
if (!(eq_s_b(z, 1, s_2)))
|
|
||||||
goto lab2;
|
|
||||||
goto lab1;
|
goto lab1;
|
||||||
lab2:
|
lab2:
|
||||||
z->c = z->l - m;
|
z->c = z->l - m;
|
||||||
if (!(eq_s_b(z, 1, s_3)))
|
if (!(eq_s_b(z, 1, s_3))) { z->c = z->l - m; goto lab0; }
|
||||||
{
|
|
||||||
z->c = z->l - m;
|
|
||||||
goto lab0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
lab1:
|
lab1:
|
||||||
slice_del(z); /* delete, line 154 */
|
{ int ret;
|
||||||
|
ret = slice_del(z); /* delete, line 117 */
|
||||||
|
if (ret < 0) return ret;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
slice_del(z); /* delete, line 161 */
|
{ int ret;
|
||||||
|
ret = slice_del(z); /* delete, line 124 */
|
||||||
|
if (ret < 0) return ret;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
lab0:
|
lab0:
|
||||||
@ -511,204 +472,188 @@ lab0:
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int r_reflexive(struct SN_env * z) {
|
||||||
r_reflexive(struct SN_env * z)
|
|
||||||
{
|
|
||||||
int among_var;
|
int among_var;
|
||||||
|
z->ket = z->c; /* [, line 131 */
|
||||||
z->ket = z->c; /* [, line 168 */
|
among_var = find_among_b(z, a_3, 2); /* substring, line 131 */
|
||||||
among_var = find_among_b(z, a_3, 2); /* substring, line 168 */
|
if (!(among_var)) return 0;
|
||||||
if (!(among_var))
|
z->bra = z->c; /* ], line 131 */
|
||||||
return 0;
|
switch(among_var) {
|
||||||
z->bra = z->c; /* ], line 168 */
|
case 0: return 0;
|
||||||
switch (among_var)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
return 0;
|
|
||||||
case 1:
|
case 1:
|
||||||
slice_del(z); /* delete, line 171 */
|
{ int ret;
|
||||||
|
ret = slice_del(z); /* delete, line 134 */
|
||||||
|
if (ret < 0) return ret;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int r_verb(struct SN_env * z) {
|
||||||
r_verb(struct SN_env * z)
|
|
||||||
{
|
|
||||||
int among_var;
|
int among_var;
|
||||||
|
z->ket = z->c; /* [, line 139 */
|
||||||
z->ket = z->c; /* [, line 176 */
|
among_var = find_among_b(z, a_4, 46); /* substring, line 139 */
|
||||||
among_var = find_among_b(z, a_4, 46); /* substring, line 176 */
|
if (!(among_var)) return 0;
|
||||||
if (!(among_var))
|
z->bra = z->c; /* ], line 139 */
|
||||||
return 0;
|
switch(among_var) {
|
||||||
z->bra = z->c; /* ], line 176 */
|
case 0: return 0;
|
||||||
switch (among_var)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
return 0;
|
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{ int m = z->l - z->c; (void) m; /* or, line 145 */
|
||||||
int m = z->l - z->c; /* or, line 182 */
|
if (!(eq_s_b(z, 1, s_4))) goto lab1;
|
||||||
|
|
||||||
if (!(eq_s_b(z, 1, s_4)))
|
|
||||||
goto lab1;
|
|
||||||
goto lab0;
|
goto lab0;
|
||||||
lab1:
|
lab1:
|
||||||
z->c = z->l - m;
|
z->c = z->l - m;
|
||||||
if (!(eq_s_b(z, 1, s_5)))
|
if (!(eq_s_b(z, 1, s_5))) return 0;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
lab0:
|
lab0:
|
||||||
slice_del(z); /* delete, line 182 */
|
{ int ret;
|
||||||
|
ret = slice_del(z); /* delete, line 145 */
|
||||||
|
if (ret < 0) return ret;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
slice_del(z); /* delete, line 190 */
|
{ int ret;
|
||||||
|
ret = slice_del(z); /* delete, line 153 */
|
||||||
|
if (ret < 0) return ret;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int r_noun(struct SN_env * z) {
|
||||||
r_noun(struct SN_env * z)
|
|
||||||
{
|
|
||||||
int among_var;
|
int among_var;
|
||||||
|
z->ket = z->c; /* [, line 162 */
|
||||||
z->ket = z->c; /* [, line 199 */
|
among_var = find_among_b(z, a_5, 36); /* substring, line 162 */
|
||||||
among_var = find_among_b(z, a_5, 36); /* substring, line 199 */
|
if (!(among_var)) return 0;
|
||||||
if (!(among_var))
|
z->bra = z->c; /* ], line 162 */
|
||||||
return 0;
|
switch(among_var) {
|
||||||
z->bra = z->c; /* ], line 199 */
|
case 0: return 0;
|
||||||
switch (among_var)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
return 0;
|
|
||||||
case 1:
|
case 1:
|
||||||
slice_del(z); /* delete, line 206 */
|
{ int ret;
|
||||||
|
ret = slice_del(z); /* delete, line 169 */
|
||||||
|
if (ret < 0) return ret;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int r_derivational(struct SN_env * z) {
|
||||||
r_derivational(struct SN_env * z)
|
|
||||||
{
|
|
||||||
int among_var;
|
int among_var;
|
||||||
|
z->ket = z->c; /* [, line 178 */
|
||||||
z->ket = z->c; /* [, line 215 */
|
among_var = find_among_b(z, a_6, 2); /* substring, line 178 */
|
||||||
among_var = find_among_b(z, a_6, 2); /* substring, line 215 */
|
if (!(among_var)) return 0;
|
||||||
if (!(among_var))
|
z->bra = z->c; /* ], line 178 */
|
||||||
return 0;
|
{ int ret = r_R2(z);
|
||||||
z->bra = z->c; /* ], line 215 */
|
if (ret == 0) return 0; /* call R2, line 178 */
|
||||||
if (!r_R2(z))
|
if (ret < 0) return ret;
|
||||||
return 0; /* call R2, line 215 */
|
}
|
||||||
switch (among_var)
|
switch(among_var) {
|
||||||
{
|
case 0: return 0;
|
||||||
case 0:
|
|
||||||
return 0;
|
|
||||||
case 1:
|
case 1:
|
||||||
slice_del(z); /* delete, line 218 */
|
{ int ret;
|
||||||
|
ret = slice_del(z); /* delete, line 181 */
|
||||||
|
if (ret < 0) return ret;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int r_tidy_up(struct SN_env * z) {
|
||||||
r_tidy_up(struct SN_env * z)
|
|
||||||
{
|
|
||||||
int among_var;
|
int among_var;
|
||||||
|
z->ket = z->c; /* [, line 186 */
|
||||||
z->ket = z->c; /* [, line 223 */
|
among_var = find_among_b(z, a_7, 4); /* substring, line 186 */
|
||||||
among_var = find_among_b(z, a_7, 4); /* substring, line 223 */
|
if (!(among_var)) return 0;
|
||||||
if (!(among_var))
|
z->bra = z->c; /* ], line 186 */
|
||||||
return 0;
|
switch(among_var) {
|
||||||
z->bra = z->c; /* ], line 223 */
|
case 0: return 0;
|
||||||
switch (among_var)
|
|
||||||
{
|
|
||||||
case 0:
|
|
||||||
return 0;
|
|
||||||
case 1:
|
case 1:
|
||||||
slice_del(z); /* delete, line 227 */
|
{ int ret;
|
||||||
z->ket = z->c; /* [, line 228 */
|
ret = slice_del(z); /* delete, line 190 */
|
||||||
if (!(eq_s_b(z, 1, s_6)))
|
if (ret < 0) return ret;
|
||||||
return 0;
|
}
|
||||||
z->bra = z->c; /* ], line 228 */
|
z->ket = z->c; /* [, line 191 */
|
||||||
if (!(eq_s_b(z, 1, s_7)))
|
if (!(eq_s_b(z, 1, s_6))) return 0;
|
||||||
return 0;
|
z->bra = z->c; /* ], line 191 */
|
||||||
slice_del(z); /* delete, line 228 */
|
if (!(eq_s_b(z, 1, s_7))) return 0;
|
||||||
|
{ int ret;
|
||||||
|
ret = slice_del(z); /* delete, line 191 */
|
||||||
|
if (ret < 0) return ret;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
if (!(eq_s_b(z, 1, s_8)))
|
if (!(eq_s_b(z, 1, s_8))) return 0;
|
||||||
return 0;
|
{ int ret;
|
||||||
slice_del(z); /* delete, line 231 */
|
ret = slice_del(z); /* delete, line 194 */
|
||||||
|
if (ret < 0) return ret;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
slice_del(z); /* delete, line 233 */
|
{ int ret;
|
||||||
|
ret = slice_del(z); /* delete, line 196 */
|
||||||
|
if (ret < 0) return ret;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern int
|
extern int russian_KOI8_R_stem(struct SN_env * z) {
|
||||||
russian_stem(struct SN_env * z)
|
{ int c = z->c; /* do, line 203 */
|
||||||
{
|
{ int ret = r_mark_regions(z);
|
||||||
{
|
if (ret == 0) goto lab0; /* call mark_regions, line 203 */
|
||||||
int c = z->c; /* do, line 240 */
|
if (ret < 0) return ret;
|
||||||
|
}
|
||||||
if (!r_mark_regions(z))
|
|
||||||
goto lab0; /* call mark_regions, line 240 */
|
|
||||||
lab0:
|
lab0:
|
||||||
z->c = c;
|
z->c = c;
|
||||||
}
|
}
|
||||||
z->lb = z->c;
|
z->lb = z->c; z->c = z->l; /* backwards, line 204 */
|
||||||
z->c = z->l; /* backwards, line 241 */
|
|
||||||
|
|
||||||
{
|
{ int m3; /* setlimit, line 204 */
|
||||||
int m = z->l - z->c; /* setlimit, line 241 */
|
int m = z->l - z->c; (void) m;
|
||||||
int m3;
|
if (z->c < z->I[0]) return 0;
|
||||||
|
z->c = z->I[0]; /* tomark, line 204 */
|
||||||
if (z->c < z->I[0])
|
m3 = z->lb; z->lb = z->c;
|
||||||
return 0;
|
|
||||||
z->c = z->I[0]; /* tomark, line 241 */
|
|
||||||
m3 = z->lb;
|
|
||||||
z->lb = z->c;
|
|
||||||
z->c = z->l - m;
|
z->c = z->l - m;
|
||||||
{
|
{ int m = z->l - z->c; (void) m; /* do, line 205 */
|
||||||
int m = z->l - z->c; /* do, line 242 */
|
{ int m = z->l - z->c; (void) m; /* or, line 206 */
|
||||||
|
{ int ret = r_perfective_gerund(z);
|
||||||
{
|
if (ret == 0) goto lab3; /* call perfective_gerund, line 206 */
|
||||||
int m = z->l - z->c; /* or, line 243 */
|
if (ret < 0) return ret;
|
||||||
|
}
|
||||||
if (!r_perfective_gerund(z))
|
|
||||||
goto lab3; /* call perfective_gerund, line 243 */
|
|
||||||
goto lab2;
|
goto lab2;
|
||||||
lab3:
|
lab3:
|
||||||
z->c = z->l - m;
|
z->c = z->l - m;
|
||||||
{
|
{ int m = z->l - z->c; (void) m; /* try, line 207 */
|
||||||
int m = z->l - z->c; /* try, line 244 */
|
{ int ret = r_reflexive(z);
|
||||||
|
if (ret == 0) { z->c = z->l - m; goto lab4; } /* call reflexive, line 207 */
|
||||||
if (!r_reflexive(z))
|
if (ret < 0) return ret;
|
||||||
{
|
}
|
||||||
z->c = z->l - m;
|
|
||||||
goto lab4;
|
|
||||||
} /* call reflexive, line 244 */
|
|
||||||
lab4:
|
lab4:
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
{
|
{ int m = z->l - z->c; (void) m; /* or, line 208 */
|
||||||
int m = z->l - z->c; /* or, line 245 */
|
{ int ret = r_adjectival(z);
|
||||||
|
if (ret == 0) goto lab6; /* call adjectival, line 208 */
|
||||||
if (!r_adjectival(z))
|
if (ret < 0) return ret;
|
||||||
goto lab6; /* call adjectival, line 245 */
|
}
|
||||||
goto lab5;
|
goto lab5;
|
||||||
lab6:
|
lab6:
|
||||||
z->c = z->l - m;
|
z->c = z->l - m;
|
||||||
if (!r_verb(z))
|
{ int ret = r_verb(z);
|
||||||
goto lab7; /* call verb, line 245 */
|
if (ret == 0) goto lab7; /* call verb, line 208 */
|
||||||
|
if (ret < 0) return ret;
|
||||||
|
}
|
||||||
goto lab5;
|
goto lab5;
|
||||||
lab7:
|
lab7:
|
||||||
z->c = z->l - m;
|
z->c = z->l - m;
|
||||||
if (!r_noun(z))
|
{ int ret = r_noun(z);
|
||||||
goto lab1; /* call noun, line 245 */
|
if (ret == 0) goto lab1; /* call noun, line 208 */
|
||||||
|
if (ret < 0) return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
lab5:
|
lab5:
|
||||||
;
|
;
|
||||||
@ -717,33 +662,30 @@ lab0:
|
|||||||
lab1:
|
lab1:
|
||||||
z->c = z->l - m;
|
z->c = z->l - m;
|
||||||
}
|
}
|
||||||
{
|
{ int m = z->l - z->c; (void) m; /* try, line 211 */
|
||||||
int m = z->l - z->c; /* try, line 248 */
|
z->ket = z->c; /* [, line 211 */
|
||||||
|
if (!(eq_s_b(z, 1, s_9))) { z->c = z->l - m; goto lab8; }
|
||||||
z->ket = z->c; /* [, line 248 */
|
z->bra = z->c; /* ], line 211 */
|
||||||
if (!(eq_s_b(z, 1, s_9)))
|
{ int ret;
|
||||||
{
|
ret = slice_del(z); /* delete, line 211 */
|
||||||
z->c = z->l - m;
|
if (ret < 0) return ret;
|
||||||
goto lab8;
|
|
||||||
}
|
}
|
||||||
z->bra = z->c; /* ], line 248 */
|
|
||||||
slice_del(z); /* delete, line 248 */
|
|
||||||
lab8:
|
lab8:
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
{
|
{ int m = z->l - z->c; (void) m; /* do, line 214 */
|
||||||
int m = z->l - z->c; /* do, line 251 */
|
{ int ret = r_derivational(z);
|
||||||
|
if (ret == 0) goto lab9; /* call derivational, line 214 */
|
||||||
if (!r_derivational(z))
|
if (ret < 0) return ret;
|
||||||
goto lab9; /* call derivational, line 251 */
|
}
|
||||||
lab9:
|
lab9:
|
||||||
z->c = z->l - m;
|
z->c = z->l - m;
|
||||||
}
|
}
|
||||||
{
|
{ int m = z->l - z->c; (void) m; /* do, line 215 */
|
||||||
int m = z->l - z->c; /* do, line 252 */
|
{ int ret = r_tidy_up(z);
|
||||||
|
if (ret == 0) goto lab10; /* call tidy_up, line 215 */
|
||||||
if (!r_tidy_up(z))
|
if (ret < 0) return ret;
|
||||||
goto lab10; /* call tidy_up, line 252 */
|
}
|
||||||
lab10:
|
lab10:
|
||||||
z->c = z->l - m;
|
z->c = z->l - m;
|
||||||
}
|
}
|
||||||
@ -753,14 +695,7 @@ lab0:
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern struct SN_env *
|
extern struct SN_env * russian_KOI8_R_create_env(void) { return SN_create_env(0, 2, 0); }
|
||||||
russian_create_env(void)
|
|
||||||
{
|
extern void russian_KOI8_R_close_env(struct SN_env * z) { SN_close_env(z); }
|
||||||
return SN_create_env(0, 2, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
extern void
|
|
||||||
russian_close_env(struct SN_env * z)
|
|
||||||
{
|
|
||||||
SN_close_env(z);
|
|
||||||
}
|
|
||||||
|
@ -1,7 +1,16 @@
|
|||||||
|
|
||||||
/* This file was generated automatically by the Snowball to ANSI C compiler */
|
/* This file was generated automatically by the Snowball to ANSI C compiler */
|
||||||
|
|
||||||
extern struct SN_env *russian_create_env(void);
|
#ifdef __cplusplus
|
||||||
extern void russian_close_env(struct SN_env * z);
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern struct SN_env * russian_KOI8_R_create_env(void);
|
||||||
|
extern void russian_KOI8_R_close_env(struct SN_env * z);
|
||||||
|
|
||||||
|
extern int russian_KOI8_R_stem(struct SN_env * z);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
extern int russian_stem(struct SN_env * z);
|
|
||||||
|
@ -9,193 +9,180 @@
|
|||||||
|
|
||||||
#define CREATE_SIZE 1
|
#define CREATE_SIZE 1
|
||||||
|
|
||||||
symbol *
|
extern symbol * create_s(void) {
|
||||||
create_s(void)
|
symbol * p;
|
||||||
{
|
void * mem = malloc(HEAD + (CREATE_SIZE + 1) * sizeof(symbol));
|
||||||
symbol *p = (symbol *) (HEAD + (char *) malloc(HEAD + (CREATE_SIZE + 1) * sizeof(symbol)));
|
if (mem == NULL) return NULL;
|
||||||
|
p = (symbol *) (HEAD + (char *) mem);
|
||||||
if (p == (symbol *) (HEAD))
|
|
||||||
return NULL;
|
|
||||||
CAPACITY(p) = CREATE_SIZE;
|
CAPACITY(p) = CREATE_SIZE;
|
||||||
SET_SIZE(p, CREATE_SIZE);
|
SET_SIZE(p, CREATE_SIZE);
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
extern void lose_s(symbol * p) {
|
||||||
lose_s(symbol * p)
|
if (p == NULL) return;
|
||||||
{
|
|
||||||
free((char *) p - HEAD);
|
free((char *) p - HEAD);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
/*
|
||||||
in_grouping(struct SN_env * z, unsigned char *s, int min, int max)
|
new_p = X_skip_utf8(p, c, lb, l, n); skips n characters forwards from p + c
|
||||||
{
|
if n +ve, or n characters backwards from p +c - 1 if n -ve. new_p is the new
|
||||||
if (z->c >= z->l)
|
position, or 0 on failure.
|
||||||
return 0;
|
|
||||||
{
|
|
||||||
int ch = z->p[z->c];
|
|
||||||
|
|
||||||
if
|
-- used to implement hop and next in the utf8 case.
|
||||||
(ch > max || (ch -= min) < 0 ||
|
*/
|
||||||
(s[ch >> 3] & (0X1 << (ch & 0X7))) == 0)
|
|
||||||
return 0;
|
extern int skip_utf8(const symbol * p, int c, int lb, int l, int n) {
|
||||||
|
int b;
|
||||||
|
if (n >= 0) {
|
||||||
|
for (; n > 0; n--) {
|
||||||
|
if (c >= l) return -1;
|
||||||
|
b = p[c++];
|
||||||
|
if (b >= 0xC0) { /* 1100 0000 */
|
||||||
|
while (c < l) {
|
||||||
|
b = p[c];
|
||||||
|
if (b >= 0xC0 || b < 0x80) break;
|
||||||
|
/* break unless b is 10------ */
|
||||||
|
c++;
|
||||||
}
|
}
|
||||||
z->c++;
|
}
|
||||||
return 1;
|
}
|
||||||
|
} else {
|
||||||
|
for (; n < 0; n++) {
|
||||||
|
if (c <= lb) return -1;
|
||||||
|
b = p[--c];
|
||||||
|
if (b >= 0x80) { /* 1000 0000 */
|
||||||
|
while (c > lb) {
|
||||||
|
b = p[c];
|
||||||
|
if (b >= 0xC0) break; /* 1100 0000 */
|
||||||
|
c--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return c;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
/* Code for character groupings: utf8 cases */
|
||||||
in_grouping_b(struct SN_env * z, unsigned char *s, int min, int max)
|
|
||||||
{
|
|
||||||
if (z->c <= z->lb)
|
|
||||||
return 0;
|
|
||||||
{
|
|
||||||
int ch = z->p[z->c - 1];
|
|
||||||
|
|
||||||
if
|
static int get_utf8(const symbol * p, int c, int l, int * slot) {
|
||||||
(ch > max || (ch -= min) < 0 ||
|
int b0, b1;
|
||||||
(s[ch >> 3] & (0X1 << (ch & 0X7))) == 0)
|
if (c >= l) return 0;
|
||||||
return 0;
|
b0 = p[c++];
|
||||||
|
if (b0 < 0xC0 || c == l) { /* 1100 0000 */
|
||||||
|
* slot = b0; return 1;
|
||||||
}
|
}
|
||||||
z->c--;
|
b1 = p[c++];
|
||||||
return 1;
|
if (b0 < 0xE0 || c == l) { /* 1110 0000 */
|
||||||
|
* slot = (b0 & 0x1F) << 6 | (b1 & 0x3F); return 2;
|
||||||
|
}
|
||||||
|
* slot = (b0 & 0xF) << 12 | (b1 & 0x3F) << 6 | (*p & 0x3F); return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
static int get_b_utf8(const symbol * p, int c, int lb, int * slot) {
|
||||||
out_grouping(struct SN_env * z, unsigned char *s, int min, int max)
|
int b0, b1;
|
||||||
{
|
if (c <= lb) return 0;
|
||||||
if (z->c >= z->l)
|
b0 = p[--c];
|
||||||
return 0;
|
if (b0 < 0x80 || c == lb) { /* 1000 0000 */
|
||||||
{
|
* slot = b0; return 1;
|
||||||
int ch = z->p[z->c];
|
|
||||||
|
|
||||||
unless
|
|
||||||
(ch > max || (ch -= min) < 0 ||
|
|
||||||
(s[ch >> 3] & (0X1 << (ch & 0X7))) == 0) return 0;
|
|
||||||
}
|
}
|
||||||
z->c++;
|
b1 = p[--c];
|
||||||
return 1;
|
if (b1 >= 0xC0 || c == lb) { /* 1100 0000 */
|
||||||
|
* slot = (b1 & 0x1F) << 6 | (b0 & 0x3F); return 2;
|
||||||
|
}
|
||||||
|
* slot = (*p & 0xF) << 12 | (b1 & 0x3F) << 6 | (b0 & 0x3F); return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
extern int in_grouping_U(struct SN_env * z, unsigned char * s, int min, int max) {
|
||||||
out_grouping_b(struct SN_env * z, unsigned char *s, int min, int max)
|
int ch;
|
||||||
{
|
int w = get_utf8(z->p, z->c, z->l, & ch);
|
||||||
if (z->c <= z->lb)
|
unless (w) return 0;
|
||||||
return 0;
|
if (ch > max || (ch -= min) < 0 || (s[ch >> 3] & (0X1 << (ch & 0X7))) == 0) return 0;
|
||||||
{
|
z->c += w; return 1;
|
||||||
int ch = z->p[z->c - 1];
|
|
||||||
|
|
||||||
unless
|
|
||||||
(ch > max || (ch -= min) < 0 ||
|
|
||||||
(s[ch >> 3] & (0X1 << (ch & 0X7))) == 0) return 0;
|
|
||||||
}
|
|
||||||
z->c--;
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern int in_grouping_b_U(struct SN_env * z, unsigned char * s, int min, int max) {
|
||||||
int
|
int ch;
|
||||||
in_range(struct SN_env * z, int min, int max)
|
int w = get_b_utf8(z->p, z->c, z->lb, & ch);
|
||||||
{
|
unless (w) return 0;
|
||||||
if (z->c >= z->l)
|
if (ch > max || (ch -= min) < 0 || (s[ch >> 3] & (0X1 << (ch & 0X7))) == 0) return 0;
|
||||||
return 0;
|
z->c -= w; return 1;
|
||||||
{
|
|
||||||
int ch = z->p[z->c];
|
|
||||||
|
|
||||||
if
|
|
||||||
(ch > max || ch < min)
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
z->c++;
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
extern int out_grouping_U(struct SN_env * z, unsigned char * s, int min, int max) {
|
||||||
in_range_b(struct SN_env * z, int min, int max)
|
int ch;
|
||||||
{
|
int w = get_utf8(z->p, z->c, z->l, & ch);
|
||||||
if (z->c <= z->lb)
|
unless (w) return 0;
|
||||||
return 0;
|
unless (ch > max || (ch -= min) < 0 || (s[ch >> 3] & (0X1 << (ch & 0X7))) == 0) return 0;
|
||||||
{
|
z->c += w; return 1;
|
||||||
int ch = z->p[z->c - 1];
|
|
||||||
|
|
||||||
if
|
|
||||||
(ch > max || ch < min)
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
z->c--;
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
extern int out_grouping_b_U(struct SN_env * z, unsigned char * s, int min, int max) {
|
||||||
out_range(struct SN_env * z, int min, int max)
|
int ch;
|
||||||
{
|
int w = get_b_utf8(z->p, z->c, z->lb, & ch);
|
||||||
if (z->c >= z->l)
|
unless (w) return 0;
|
||||||
return 0;
|
unless (ch > max || (ch -= min) < 0 || (s[ch >> 3] & (0X1 << (ch & 0X7))) == 0) return 0;
|
||||||
{
|
z->c -= w; return 1;
|
||||||
int ch = z->p[z->c];
|
|
||||||
|
|
||||||
unless
|
|
||||||
(ch > max || ch < min) return 0;
|
|
||||||
}
|
|
||||||
z->c++;
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
/* Code for character groupings: non-utf8 cases */
|
||||||
out_range_b(struct SN_env * z, int min, int max)
|
|
||||||
{
|
|
||||||
if (z->c <= z->lb)
|
|
||||||
return 0;
|
|
||||||
{
|
|
||||||
int ch = z->p[z->c - 1];
|
|
||||||
|
|
||||||
unless
|
extern int in_grouping(struct SN_env * z, unsigned char * s, int min, int max) {
|
||||||
(ch > max || ch < min) return 0;
|
int ch;
|
||||||
}
|
if (z->c >= z->l) return 0;
|
||||||
z->c--;
|
ch = z->p[z->c];
|
||||||
return 1;
|
if (ch > max || (ch -= min) < 0 || (s[ch >> 3] & (0X1 << (ch & 0X7))) == 0) return 0;
|
||||||
|
z->c++; return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
extern int in_grouping_b(struct SN_env * z, unsigned char * s, int min, int max) {
|
||||||
eq_s(struct SN_env * z, int s_size, symbol * s)
|
int ch;
|
||||||
{
|
if (z->c <= z->lb) return 0;
|
||||||
if (z->l - z->c < s_size ||
|
ch = z->p[z->c - 1];
|
||||||
memcmp(z->p + z->c, s, s_size * sizeof(symbol)) != 0)
|
if (ch > max || (ch -= min) < 0 || (s[ch >> 3] & (0X1 << (ch & 0X7))) == 0) return 0;
|
||||||
return 0;
|
z->c--; return 1;
|
||||||
z->c += s_size;
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
extern int out_grouping(struct SN_env * z, unsigned char * s, int min, int max) {
|
||||||
eq_s_b(struct SN_env * z, int s_size, symbol * s)
|
int ch;
|
||||||
{
|
if (z->c >= z->l) return 0;
|
||||||
if (z->c - z->lb < s_size ||
|
ch = z->p[z->c];
|
||||||
memcmp(z->p + z->c - s_size, s, s_size * sizeof(symbol)) != 0)
|
unless (ch > max || (ch -= min) < 0 || (s[ch >> 3] & (0X1 << (ch & 0X7))) == 0) return 0;
|
||||||
return 0;
|
z->c++; return 1;
|
||||||
z->c -= s_size;
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
extern int out_grouping_b(struct SN_env * z, unsigned char * s, int min, int max) {
|
||||||
eq_v(struct SN_env * z, symbol * p)
|
int ch;
|
||||||
{
|
if (z->c <= z->lb) return 0;
|
||||||
|
ch = z->p[z->c - 1];
|
||||||
|
unless (ch > max || (ch -= min) < 0 || (s[ch >> 3] & (0X1 << (ch & 0X7))) == 0) return 0;
|
||||||
|
z->c--; return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern int eq_s(struct SN_env * z, int s_size, symbol * s) {
|
||||||
|
if (z->l - z->c < s_size || memcmp(z->p + z->c, s, s_size * sizeof(symbol)) != 0) return 0;
|
||||||
|
z->c += s_size; return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern int eq_s_b(struct SN_env * z, int s_size, symbol * s) {
|
||||||
|
if (z->c - z->lb < s_size || memcmp(z->p + z->c - s_size, s, s_size * sizeof(symbol)) != 0) return 0;
|
||||||
|
z->c -= s_size; return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern int eq_v(struct SN_env * z, symbol * p) {
|
||||||
return eq_s(z, SIZE(p), p);
|
return eq_s(z, SIZE(p), p);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
extern int eq_v_b(struct SN_env * z, symbol * p) {
|
||||||
eq_v_b(struct SN_env * z, symbol * p)
|
|
||||||
{
|
|
||||||
return eq_s_b(z, SIZE(p), p);
|
return eq_s_b(z, SIZE(p), p);
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
extern int find_among(struct SN_env * z, struct among * v, int v_size) {
|
||||||
find_among(struct SN_env * z, struct among * v, int v_size)
|
|
||||||
{
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int j = v_size;
|
int j = v_size;
|
||||||
|
|
||||||
int c = z->c;
|
int c = z->c; int l = z->l;
|
||||||
int l = z->l;
|
|
||||||
symbol * q = z->p + c;
|
symbol * q = z->p + c;
|
||||||
|
|
||||||
struct among * w;
|
struct among * w;
|
||||||
@ -205,89 +192,57 @@ find_among(struct SN_env * z, struct among * v, int v_size)
|
|||||||
|
|
||||||
int first_key_inspected = 0;
|
int first_key_inspected = 0;
|
||||||
|
|
||||||
while (1)
|
while(1) {
|
||||||
{
|
|
||||||
int k = i + ((j - i) >> 1);
|
int k = i + ((j - i) >> 1);
|
||||||
int diff = 0;
|
int diff = 0;
|
||||||
int common = common_i < common_j ? common_i : common_j; /* smaller */
|
int common = common_i < common_j ? common_i : common_j; /* smaller */
|
||||||
|
|
||||||
w = v + k;
|
w = v + k;
|
||||||
{
|
{
|
||||||
int i;
|
int i; for (i = common; i < w->s_size; i++) {
|
||||||
|
if (c + common == l) { diff = -1; break; }
|
||||||
for (i = common; i < w->s_size; i++)
|
|
||||||
{
|
|
||||||
if (c + common == l)
|
|
||||||
{
|
|
||||||
diff = -1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
diff = q[common] - w->s[i];
|
diff = q[common] - w->s[i];
|
||||||
if (diff != 0)
|
if (diff != 0) break;
|
||||||
break;
|
|
||||||
common++;
|
common++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (diff < 0)
|
if (diff < 0) { j = k; common_j = common; }
|
||||||
{
|
else { i = k; common_i = common; }
|
||||||
j = k;
|
if (j - i <= 1) {
|
||||||
common_j = common;
|
if (i > 0) break; /* v->s has been inspected */
|
||||||
}
|
if (j == i) break; /* only one item in v */
|
||||||
else
|
|
||||||
{
|
|
||||||
i = k;
|
|
||||||
common_i = common;
|
|
||||||
}
|
|
||||||
if (j - i <= 1)
|
|
||||||
{
|
|
||||||
if (i > 0)
|
|
||||||
break; /* v->s has been inspected */
|
|
||||||
if (j == i)
|
|
||||||
break; /* only one item in v */
|
|
||||||
|
|
||||||
/*
|
/* - but now we need to go round once more to get
|
||||||
* - but now we need to go round once more to get v->s
|
v->s inspected. This looks messy, but is actually
|
||||||
* inspected. This looks messy, but is actually the optimal
|
the optimal approach. */
|
||||||
* approach.
|
|
||||||
*/
|
|
||||||
|
|
||||||
if (first_key_inspected)
|
if (first_key_inspected) break;
|
||||||
break;
|
|
||||||
first_key_inspected = 1;
|
first_key_inspected = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (1)
|
while(1) {
|
||||||
{
|
|
||||||
w = v + i;
|
w = v + i;
|
||||||
if (common_i >= w->s_size)
|
if (common_i >= w->s_size) {
|
||||||
{
|
|
||||||
z->c = c + w->s_size;
|
z->c = c + w->s_size;
|
||||||
if (w->function == 0)
|
if (w->function == 0) return w->result;
|
||||||
return w->result;
|
|
||||||
{
|
{
|
||||||
int res = w->function(z);
|
int res = w->function(z);
|
||||||
|
|
||||||
z->c = c + w->s_size;
|
z->c = c + w->s_size;
|
||||||
if (res)
|
if (res) return w->result;
|
||||||
return w->result;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
i = w->substring_i;
|
i = w->substring_i;
|
||||||
if (i < 0)
|
if (i < 0) return 0;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* find_among_b is for backwards processing. Same comments apply */
|
/* find_among_b is for backwards processing. Same comments apply */
|
||||||
|
|
||||||
int
|
extern int find_among_b(struct SN_env * z, struct among * v, int v_size) {
|
||||||
find_among_b(struct SN_env * z, struct among * v, int v_size)
|
|
||||||
{
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int j = v_size;
|
int j = v_size;
|
||||||
|
|
||||||
int c = z->c;
|
int c = z->c; int lb = z->lb;
|
||||||
int lb = z->lb;
|
|
||||||
symbol * q = z->p + c - 1;
|
symbol * q = z->p + c - 1;
|
||||||
|
|
||||||
struct among * w;
|
struct among * w;
|
||||||
@ -297,222 +252,195 @@ find_among_b(struct SN_env * z, struct among * v, int v_size)
|
|||||||
|
|
||||||
int first_key_inspected = 0;
|
int first_key_inspected = 0;
|
||||||
|
|
||||||
while (1)
|
while(1) {
|
||||||
{
|
|
||||||
int k = i + ((j - i) >> 1);
|
int k = i + ((j - i) >> 1);
|
||||||
int diff = 0;
|
int diff = 0;
|
||||||
int common = common_i < common_j ? common_i : common_j;
|
int common = common_i < common_j ? common_i : common_j;
|
||||||
|
|
||||||
w = v + k;
|
w = v + k;
|
||||||
{
|
{
|
||||||
int i;
|
int i; for (i = w->s_size - 1 - common; i >= 0; i--) {
|
||||||
|
if (c - common == lb) { diff = -1; break; }
|
||||||
for (i = w->s_size - 1 - common; i >= 0; i--)
|
|
||||||
{
|
|
||||||
if (c - common == lb)
|
|
||||||
{
|
|
||||||
diff = -1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
diff = q[- common] - w->s[i];
|
diff = q[- common] - w->s[i];
|
||||||
if (diff != 0)
|
if (diff != 0) break;
|
||||||
break;
|
|
||||||
common++;
|
common++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (diff < 0)
|
if (diff < 0) { j = k; common_j = common; }
|
||||||
{
|
else { i = k; common_i = common; }
|
||||||
j = k;
|
if (j - i <= 1) {
|
||||||
common_j = common;
|
if (i > 0) break;
|
||||||
}
|
if (j == i) break;
|
||||||
else
|
if (first_key_inspected) break;
|
||||||
{
|
|
||||||
i = k;
|
|
||||||
common_i = common;
|
|
||||||
}
|
|
||||||
if (j - i <= 1)
|
|
||||||
{
|
|
||||||
if (i > 0)
|
|
||||||
break;
|
|
||||||
if (j == i)
|
|
||||||
break;
|
|
||||||
if (first_key_inspected)
|
|
||||||
break;
|
|
||||||
first_key_inspected = 1;
|
first_key_inspected = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
while (1)
|
while(1) {
|
||||||
{
|
|
||||||
w = v + i;
|
w = v + i;
|
||||||
if (common_i >= w->s_size)
|
if (common_i >= w->s_size) {
|
||||||
{
|
|
||||||
z->c = c - w->s_size;
|
z->c = c - w->s_size;
|
||||||
if (w->function == 0)
|
if (w->function == 0) return w->result;
|
||||||
return w->result;
|
|
||||||
{
|
{
|
||||||
int res = w->function(z);
|
int res = w->function(z);
|
||||||
|
|
||||||
z->c = c - w->s_size;
|
z->c = c - w->s_size;
|
||||||
if (res)
|
if (res) return w->result;
|
||||||
return w->result;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
i = w->substring_i;
|
i = w->substring_i;
|
||||||
if (i < 0)
|
if (i < 0) return 0;
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
symbol *
|
/* Increase the size of the buffer pointed to by p to at least n symbols.
|
||||||
increase_size(symbol * p, int n)
|
* If insufficient memory, returns NULL and frees the old buffer.
|
||||||
{
|
*/
|
||||||
|
static symbol * increase_size(symbol * p, int n) {
|
||||||
|
symbol * q;
|
||||||
int new_size = n + 20;
|
int new_size = n + 20;
|
||||||
symbol *q = (symbol *) (HEAD + (char *) malloc(HEAD + (new_size + 1) * sizeof(symbol)));
|
void * mem = realloc((char *) p - HEAD,
|
||||||
|
HEAD + (new_size + 1) * sizeof(symbol));
|
||||||
CAPACITY(q) = new_size;
|
if (mem == NULL) {
|
||||||
memmove(q, p, CAPACITY(p) * sizeof(symbol));
|
|
||||||
lose_s(p);
|
lose_s(p);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
q = (symbol *) (HEAD + (char *)mem);
|
||||||
|
CAPACITY(q) = new_size;
|
||||||
return q;
|
return q;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* to replace symbols between c_bra and c_ket in z->p by the
|
/* to replace symbols between c_bra and c_ket in z->p by the
|
||||||
s_size symbols at s
|
s_size symbols at s.
|
||||||
|
Returns 0 on success, -1 on error.
|
||||||
|
Also, frees z->p (and sets it to NULL) on error.
|
||||||
*/
|
*/
|
||||||
|
extern int replace_s(struct SN_env * z, int c_bra, int c_ket, int s_size, const symbol * s, int * adjptr)
|
||||||
int
|
|
||||||
replace_s(struct SN_env * z, int c_bra, int c_ket, int s_size, const symbol * s)
|
|
||||||
{
|
{
|
||||||
int adjustment = s_size - (c_ket - c_bra);
|
int adjustment;
|
||||||
int len = SIZE(z->p);
|
int len;
|
||||||
|
if (z->p == NULL) {
|
||||||
if (adjustment != 0)
|
z->p = create_s();
|
||||||
{
|
if (z->p == NULL) return -1;
|
||||||
if (adjustment + len > CAPACITY(z->p))
|
}
|
||||||
|
adjustment = s_size - (c_ket - c_bra);
|
||||||
|
len = SIZE(z->p);
|
||||||
|
if (adjustment != 0) {
|
||||||
|
if (adjustment + len > CAPACITY(z->p)) {
|
||||||
z->p = increase_size(z->p, adjustment + len);
|
z->p = increase_size(z->p, adjustment + len);
|
||||||
memmove(z->p + c_ket + adjustment, z->p + c_ket, (len - c_ket) * sizeof(symbol));
|
if (z->p == NULL) return -1;
|
||||||
|
}
|
||||||
|
memmove(z->p + c_ket + adjustment,
|
||||||
|
z->p + c_ket,
|
||||||
|
(len - c_ket) * sizeof(symbol));
|
||||||
SET_SIZE(z->p, adjustment + len);
|
SET_SIZE(z->p, adjustment + len);
|
||||||
z->l += adjustment;
|
z->l += adjustment;
|
||||||
if (z->c >= c_ket)
|
if (z->c >= c_ket)
|
||||||
z->c += adjustment;
|
z->c += adjustment;
|
||||||
else if (z->c > c_bra)
|
else
|
||||||
|
if (z->c > c_bra)
|
||||||
z->c = c_bra;
|
z->c = c_bra;
|
||||||
}
|
}
|
||||||
unless (s_size == 0) memmove(z->p + c_bra, s, s_size * sizeof(symbol));
|
unless (s_size == 0) memmove(z->p + c_bra, s, s_size * sizeof(symbol));
|
||||||
return adjustment;
|
if (adjptr != NULL)
|
||||||
|
*adjptr = adjustment;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static int slice_check(struct SN_env * z) {
|
||||||
slice_check(struct SN_env * z)
|
|
||||||
{
|
if (z->bra < 0 ||
|
||||||
if (!(0 <= z->bra &&
|
z->bra > z->ket ||
|
||||||
z->bra <= z->ket &&
|
z->ket > z->l ||
|
||||||
z->ket <= z->l &&
|
z->p == NULL ||
|
||||||
z->l <= SIZE(z->p))) /* this line could be removed */
|
z->l > SIZE(z->p)) /* this line could be removed */
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
fprintf(stderr, "faulty slice operation:\n");
|
fprintf(stderr, "faulty slice operation:\n");
|
||||||
debug(z, -1, 0);
|
debug(z, -1, 0);
|
||||||
exit(1);
|
#endif
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
extern int slice_from_s(struct SN_env * z, int s_size, symbol * s) {
|
||||||
slice_from_s(struct SN_env * z, int s_size, symbol * s)
|
if (slice_check(z)) return -1;
|
||||||
{
|
return replace_s(z, z->bra, z->ket, s_size, s, NULL);
|
||||||
slice_check(z);
|
|
||||||
replace_s(z, z->bra, z->ket, s_size, s);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
extern int slice_from_v(struct SN_env * z, symbol * p) {
|
||||||
slice_from_v(struct SN_env * z, symbol * p)
|
return slice_from_s(z, SIZE(p), p);
|
||||||
{
|
|
||||||
slice_from_s(z, SIZE(p), p);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
extern int slice_del(struct SN_env * z) {
|
||||||
slice_del(struct SN_env * z)
|
return slice_from_s(z, 0, 0);
|
||||||
{
|
|
||||||
slice_from_s(z, 0, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
extern int insert_s(struct SN_env * z, int bra, int ket, int s_size, symbol * s) {
|
||||||
insert_s(struct SN_env * z, int bra, int ket, int s_size, symbol * s)
|
int adjustment;
|
||||||
{
|
if (replace_s(z, bra, ket, s_size, s, &adjustment))
|
||||||
int adjustment = replace_s(z, bra, ket, s_size, s);
|
return -1;
|
||||||
|
if (bra <= z->bra) z->bra += adjustment;
|
||||||
if (bra <= z->bra)
|
if (bra <= z->ket) z->ket += adjustment;
|
||||||
z->bra += adjustment;
|
return 0;
|
||||||
if (bra <= z->ket)
|
|
||||||
z->ket += adjustment;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
extern int insert_v(struct SN_env * z, int bra, int ket, symbol * p) {
|
||||||
insert_v(struct SN_env * z, int bra, int ket, symbol * p)
|
int adjustment;
|
||||||
{
|
if (replace_s(z, bra, ket, SIZE(p), p, &adjustment))
|
||||||
int adjustment = replace_s(z, bra, ket, SIZE(p), p);
|
return -1;
|
||||||
|
if (bra <= z->bra) z->bra += adjustment;
|
||||||
if (bra <= z->bra)
|
if (bra <= z->ket) z->ket += adjustment;
|
||||||
z->bra += adjustment;
|
return 0;
|
||||||
if (bra <= z->ket)
|
|
||||||
z->ket += adjustment;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
symbol *
|
extern symbol * slice_to(struct SN_env * z, symbol * p) {
|
||||||
slice_to(struct SN_env * z, symbol * p)
|
if (slice_check(z)) {
|
||||||
{
|
lose_s(p);
|
||||||
slice_check(z);
|
return NULL;
|
||||||
|
}
|
||||||
{
|
{
|
||||||
int len = z->ket - z->bra;
|
int len = z->ket - z->bra;
|
||||||
|
if (CAPACITY(p) < len) {
|
||||||
if (CAPACITY(p) < len)
|
|
||||||
p = increase_size(p, len);
|
p = increase_size(p, len);
|
||||||
|
if (p == NULL)
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
memmove(p, z->p + z->bra, len * sizeof(symbol));
|
memmove(p, z->p + z->bra, len * sizeof(symbol));
|
||||||
SET_SIZE(p, len);
|
SET_SIZE(p, len);
|
||||||
}
|
}
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
symbol *
|
extern symbol * assign_to(struct SN_env * z, symbol * p) {
|
||||||
assign_to(struct SN_env * z, symbol * p)
|
|
||||||
{
|
|
||||||
int len = z->l;
|
int len = z->l;
|
||||||
|
if (CAPACITY(p) < len) {
|
||||||
if (CAPACITY(p) < len)
|
|
||||||
p = increase_size(p, len);
|
p = increase_size(p, len);
|
||||||
|
if (p == NULL)
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
memmove(p, z->p, len * sizeof(symbol));
|
memmove(p, z->p, len * sizeof(symbol));
|
||||||
SET_SIZE(p, len);
|
SET_SIZE(p, len);
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
#if 0
|
||||||
debug(struct SN_env * z, int number, int line_count)
|
extern void debug(struct SN_env * z, int number, int line_count) {
|
||||||
{
|
|
||||||
int i;
|
int i;
|
||||||
int limit = SIZE(z->p);
|
int limit = SIZE(z->p);
|
||||||
|
|
||||||
/*if (number >= 0) printf("%3d (line %4d): '", number, line_count);*/
|
/*if (number >= 0) printf("%3d (line %4d): '", number, line_count);*/
|
||||||
if (number >= 0)
|
if (number >= 0) printf("%3d (line %4d): [%d]'", number, line_count,limit);
|
||||||
printf("%3d (line %4d): [%d]'", number, line_count, limit);
|
for (i = 0; i <= limit; i++) {
|
||||||
for (i = 0; i <= limit; i++)
|
if (z->lb == i) printf("{");
|
||||||
{
|
if (z->bra == i) printf("[");
|
||||||
if (z->lb == i)
|
if (z->c == i) printf("|");
|
||||||
printf("{");
|
if (z->ket == i) printf("]");
|
||||||
if (z->bra == i)
|
if (z->l == i) printf("}");
|
||||||
printf("[");
|
|
||||||
if (z->c == i)
|
|
||||||
printf("|");
|
|
||||||
if (z->ket == i)
|
|
||||||
printf("]");
|
|
||||||
if (z->l == i)
|
|
||||||
printf("}");
|
|
||||||
if (i < limit)
|
if (i < limit)
|
||||||
{
|
{ int ch = z->p[i];
|
||||||
int ch = z->p[i];
|
if (ch == 0) ch = '#';
|
||||||
|
|
||||||
if (ch == 0)
|
|
||||||
ch = '#';
|
|
||||||
printf("%c", ch);
|
printf("%c", ch);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printf("'\n");
|
printf("'\n");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
@ -1,14 +1,21 @@
|
|||||||
# $PostgreSQL: pgsql/contrib/tsearch2/wordparser/Makefile,v 1.5 2003/11/29 19:51:36 pgsql Exp $
|
# $PostgreSQL: pgsql/contrib/tsearch2/wordparser/Makefile,v 1.6 2005/09/15 11:14:18 teodor Exp $
|
||||||
|
|
||||||
subdir = contrib/tsearch2/wordparser
|
|
||||||
top_builddir = ../../..
|
|
||||||
include $(top_builddir)/src/Makefile.global
|
|
||||||
|
|
||||||
|
|
||||||
PG_CPPFLAGS = -I$(srcdir)/..
|
PG_CPPFLAGS = -I$(srcdir)/..
|
||||||
override CFLAGS += $(CFLAGS_SL)
|
|
||||||
|
|
||||||
SUBOBJS = parser.o deflex.o
|
SUBOBJS = parser.o deflex.o
|
||||||
|
EXTRA_CLEAN = SUBSYS.o $(SUBOBJS) parser.c
|
||||||
|
|
||||||
|
ifdef USE_PGXS
|
||||||
|
PGXS = $(shell pg_config --pgxs)
|
||||||
|
include $(PGXS)
|
||||||
|
else
|
||||||
|
subdir = contrib/tsearch2
|
||||||
|
top_builddir = ../../..
|
||||||
|
include $(top_builddir)/src/Makefile.global
|
||||||
|
include $(top_srcdir)/contrib/contrib-global.mk
|
||||||
|
endif
|
||||||
|
|
||||||
|
override CFLAGS += $(CFLAGS_SL)
|
||||||
|
|
||||||
all: SUBSYS.o
|
all: SUBSYS.o
|
||||||
|
|
||||||
@ -22,6 +29,4 @@ endif
|
|||||||
SUBSYS.o: $(SUBOBJS)
|
SUBSYS.o: $(SUBOBJS)
|
||||||
$(LD) $(LDREL) $(LDOUT) $@ $^
|
$(LD) $(LDREL) $(LDOUT) $@ $^
|
||||||
|
|
||||||
EXTRA_CLEAN = SUBSYS.o $(SUBOBJS) parser.c
|
|
||||||
|
|
||||||
include $(top_srcdir)/contrib/contrib-global.mk
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user