Printer
in package
A parse tree printer for Doctrine Query Language parser.
Tags
Table of Contents
Properties
- $_indent : int
- Current indentation level
- $_silent : bool
- Defines whether parse tree is printed (default, false) or not (true).
Methods
- __construct() : mixed
- Constructs a new parse tree printer.
- endProduction() : void
- Decreases indentation level by one and prints a closing parenthesis.
- println() : void
- Prints text indented with spaces depending on current indentation level.
- startProduction() : void
- Prints an opening parenthesis followed by production name and increases indentation level by one.
Properties
$_indent
Current indentation level
protected
int
$_indent
= 0
$_silent
Defines whether parse tree is printed (default, false) or not (true).
protected
bool
$_silent
Methods
__construct()
Constructs a new parse tree printer.
public
__construct([bool $silent = false ]) : mixed
Parameters
- $silent : bool = false
-
Parse tree will not be printed if true.
endProduction()
Decreases indentation level by one and prints a closing parenthesis.
public
endProduction() : void
This method is called after executing a production.
println()
Prints text indented with spaces depending on current indentation level.
public
println(string $str) : void
Parameters
- $str : string
-
The text.
startProduction()
Prints an opening parenthesis followed by production name and increases indentation level by one.
public
startProduction(string $name) : void
This method is called before executing a production.
Parameters
- $name : string
-
Production name.