class TestGenerator (View source)

Used for test generation.

Methods

static array
generate(string $query, string $type = 'parser')

Generates a test's data.

static void
build(string $type, string $input, string $output, string|null $debug = null, bool $ansi = false)

Builds a test.

static void
buildAll(string $input, string $output, mixed $debug = null)

Generates recursively all tests preserving the directory structure.

Details

static array generate(string $query, string $type = 'parser')

Generates a test's data.

Parameters

string $query

the query to be analyzed

string $type

test's type (may be lexer or parser)

Return Value

array

static void build(string $type, string $input, string $output, string|null $debug = null, bool $ansi = false)

Builds a test.

Reads the input file, generates the data and writes it back.

Parameters

string $type

the type of this test

string $input

the input file

string $output

the output file

string|null $debug

the debug file

bool $ansi

activate quotes ANSI mode

Return Value

void

static void buildAll(string $input, string $output, mixed $debug = null)

Generates recursively all tests preserving the directory structure.

Parameters

string $input

the input directory

string $output

the output directory

mixed $debug

Return Value

void