class TestGenerator (View source)

Used for test generation.

Methods

static array<string,string|Lexer|Parser|array<string,array<int,array<int,int|string|Token>>>|null>
generate(string $query, string $type = 'parser')

Generates a test's data.

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

Builds a test.

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

Generates recursively all tests preserving the directory structure.

Details

static array<string,string|Lexer|Parser|array<string,array<int,array<int,int|string|Token>>>|null> 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<string,string|Lexer|Parser|array<string,array<int,array<int,int|string|Token>>>|null>

static void build(string $type, string $input, string $output, string $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 $debug

the debug file

bool $ansi

activate quotes ANSI mode

Return Value

void

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

Generates recursively all tests preserving the directory structure.

Parameters

string $input

the input directory

string $output

the output directory

mixed|null $debug

Return Value

void