summaryrefslogtreecommitdiff
path: root/fpcsrc/utils/sim_pasc/runs.h
blob: b8dcf4504e563c4679b20d5256f62845ae9f0bf5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*	This file is part of the software similarity tester SIM.
	Written by Dick Grune, Vrije Universiteit, Amsterdam.
	$Id: runs.h,v 1.2 2001/11/08 12:30:30 dick Exp $
*/

/*	Although all other segments of data in this program are described by
	giving the position of the first in the segment and that of the
	first not in the segment (so the size is the difference of the two),
	a `chunk' is given by first and last. This is done because later on we
	are interested in the actual position of the last token of it, and
	the position of the first token not in the segment gives no
	indication about that.
*/

struct chunk {
	/* a chunk of text in various representations */
	struct text *ch_text;		/* pointer to the file */
	struct position ch_first;	/* first in chunk */
	struct position ch_last;	/* last in chunk */
};

struct run {				/* a 'run' of coincident tokens */
	struct chunk rn_cn0;		/* chunk in left file */
	struct chunk rn_cn1;		/* chunk in right file */
	unsigned int rn_size;
};

#define	AISO_TYPE	struct run *
#define	AISO_ITERATOR

#define	add_to_runs(r)	InsertAiso(r)

#include	"aiso.spc"