class Printer (View source)

A parse tree printer for Doctrine Query Language parser.

Properties

protected int $_indent Current indentation level
protected bool $_silent Defines whether parse tree is printed (default, false) or not (true).

Methods

__construct(bool $silent = false)

Constructs a new parse tree printer.

void
startProduction(string $name)

Prints an opening parenthesis followed by production name and increases indentation level by one.

void
endProduction()

Decreases indentation level by one and prints a closing parenthesis.

void
println(string $str)

Prints text indented with spaces depending on current indentation level.

Details

__construct(bool $silent = false)

Constructs a new parse tree printer.

Parameters

bool $silent Parse tree will not be printed if true.

void startProduction(string $name)

Prints an opening parenthesis followed by production name and increases indentation level by one.

This method is called before executing a production.

Parameters

string $name Production name.

Return Value

void

void endProduction()

Decreases indentation level by one and prints a closing parenthesis.

This method is called after executing a production.

Return Value

void

void println(string $str)

Prints text indented with spaces depending on current indentation level.

Parameters

string $str The text.

Return Value

void