#ifndef	SEQPARSE_H
#define	SEQPARSE_H

#include <v_lib.h>
#include "rgcache.h"
#include "genparse.h"

#define	GEN_VC	0
#define	GEN_FL	1
#define	GEN_FD	2

typedef struct tseq_s
{
	char	name[MAX_ID_LEN];
	vec3_t bbox[2];
	/*
	 * Number of iterators among generators.
	 * 0 - one experiment;
	 * 1 - non-nested loop;
	 * 2 - doubly nested loop;
	 * 3 - triply-nested loop.
	 */
	u32_t nesting_level;
	/*
	 * #0 - volumetric content;
	 * #1 - fiber length;
	 * #2 - fiber diameter.
	 */
	fgen_p gens[3];
	/*
	 * Indices in 'gens' pointing to iterators.
	 * Actual number of indices is equal to 'nesting_level'.
	 */
	u32_t iterators[3];
	/*
	 * There are 2 stages of modeling process.
	 * 1. Generation of the test systems. Here non-reentrant code
	 * (generators are shared between all tasks) is used.
	 *
	 * 2. Computing number of contacts. Computation-intensive stage,
	 * subject to later parallelization.
	 *
	 * Thus, total number of test systems depends on 'nesting_level' and
	 * parameters of iterators (fg->u.ilinear.steps + 1).
	 * The seqSysAmount() is for initial determination of the former.
	 */
	u32_t	num_systems;
}	tseq_t, *tseq_p;

vboolean V_GLOBAL	parseSequence(vhandle_t lex, vp_stack_p generators, vp_stack_p store);
u32_t	V_GLOBAL	seqSysAmount(tseq_p seq);
void	V_GLOBAL	seqDestroy(vp_stack_p store);
void	V_GLOBAL	seqPrint(vp_stack_p store);

#endif /* SEQPARSE_H */
