PHP Class SqlParser\Tools\ContextGenerator

Author: Dan Ungureanu ([email protected])
ファイルを表示 Open project: phpmyadmin/sql-parser

Public Properties

Property Type Description
$LABELS_FLAGS array Labels and flags that may be used when defining keywords.
$LINKS array Documentation links for each context.

Public Methods

Method Description
build ( string $input, string $output ) : void Builds a test.
buildAll ( string $input, string $output ) : void Generates recursively all tests preserving the directory structure.
generate ( array $options ) : string Generates a context's class.
printWords ( array $words, integer $spaces = 8, integer $line = 80 ) : string Prints an array of a words in PHP format.
readWords ( array $files ) : array Reads a list of words and sorts it by type, length and keyword.
sortWords ( array &$arr ) : array Sorts an array of words.

Method Details

build() public static method

Reads the input file, generates the data and writes it back.
public static build ( string $input, string $output ) : void
$input string The input file.
$output string The output directory.
return void

buildAll() public static method

Generates recursively all tests preserving the directory structure.
public static buildAll ( string $input, string $output ) : void
$input string The input directory.
$output string The output directory.
return void

generate() public static method

Generates a context's class.
public static generate ( array $options ) : string
$options array The options that are used in generating this context.
return string

printWords() public static method

Prints an array of a words in PHP format.
public static printWords ( array $words, integer $spaces = 8, integer $line = 80 ) : string
$words array The list of words to be formatted.
$spaces integer The number of spaces that starts every line.
$line integer The length of a line.
return string

readWords() public static method

Reads a list of words and sorts it by type, length and keyword.
public static readWords ( array $files ) : array
$files array
return array

sortWords() public static method

Sorts an array of words.
public static sortWords ( array &$arr ) : array
$arr array
return array

Property Details

$LABELS_FLAGS public_oe static_oe property

Labels and flags that may be used when defining keywords.
public static array $LABELS_FLAGS
return array