ILIAS
release_5-3 Revision v5.3.23-19-g915713cf615
|
Parser parses YAML strings to convert them to PHP arrays. More...
Public Member Functions | |
__construct ($offset=0, $totalNumberOfLines=null, array $skippedLineNumbers=array()) | |
Constructor. More... | |
parse ($value, $flags=0) | |
Parses a YAML string to a PHP value. More... | |
Data Fields | |
const | TAG_PATTERN = '((?P<tag>![\w!.\/:-]+) +)?' |
const | BLOCK_SCALAR_HEADER_PATTERN = '(?P<separator>\||>)(?P<modifiers>\+|\-|\d+|\+\d+|\-\d+|\d+\+|\d+\-)?(?P<comments> +#.*)?' |
Private Member Functions | |
parseBlock ($offset, $yaml, $flags) | |
getRealCurrentLineNb () | |
Returns the current line number (takes the offset into account). More... | |
getCurrentLineIndentation () | |
Returns the current line indentation. More... | |
getNextEmbedBlock ($indentation=null, $inSequence=false) | |
Returns the next embed block of YAML. More... | |
moveToNextLine () | |
Moves the parser to the next line. More... | |
moveToPreviousLine () | |
Moves the parser to the previous line. More... | |
parseValue ($value, $flags, $context) | |
Parses a YAML value. More... | |
parseBlockScalar ($style, $chomping='', $indentation=0) | |
Parses a block scalar. More... | |
isNextLineIndented () | |
Returns true if the next line is indented. More... | |
isCurrentLineEmpty () | |
Returns true if the current line is blank or if it is a comment line. More... | |
isCurrentLineBlank () | |
Returns true if the current line is blank. More... | |
isCurrentLineComment () | |
Returns true if the current line is a comment line. More... | |
isCurrentLineLastLineInDocument () | |
cleanup ($value) | |
Cleanups a YAML string to be parsed. More... | |
isNextLineUnIndentedCollection () | |
Returns true if the next line starts unindented collection. More... | |
isStringUnIndentedCollectionItem () | |
Returns true if the string is un-indented collection item. More... | |
isBlockScalarHeader () | |
Tests whether or not the current line is the header of a block scalar. More... | |
Private Attributes | |
$offset = 0 | |
$totalNumberOfLines | |
$lines = array() | |
$currentLineNb = -1 | |
$currentLine = '' | |
$refs = array() | |
$skippedLineNumbers = array() | |
$locallySkippedLineNumbers = array() | |
Parser parses YAML strings to convert them to PHP arrays.
Definition at line 21 of file Parser.php.
Symfony\Component\Yaml\Parser::__construct | ( | $offset = 0 , |
|
$totalNumberOfLines = null , |
|||
array | $skippedLineNumbers = array() |
||
) |
Constructor.
int | $offset | The offset of YAML document (used for line numbers in error messages) |
int | null | $totalNumberOfLines | The overall number of lines being parsed |
int[] | $skippedLineNumbers Number of comment lines that have been skipped by the parser |
Definition at line 42 of file Parser.php.
References Symfony\Component\Yaml\Parser\$offset, Symfony\Component\Yaml\Parser\$skippedLineNumbers, and Symfony\Component\Yaml\Parser\$totalNumberOfLines.
|
private |
Cleanups a YAML string to be parsed.
string | $value | The input YAML string |
Definition at line 774 of file Parser.php.
References array.
Referenced by Symfony\Component\Yaml\Parser\parse().
|
private |
Returns the current line indentation.
Definition at line 383 of file Parser.php.
Referenced by Symfony\Component\Yaml\Parser\getNextEmbedBlock(), Symfony\Component\Yaml\Parser\isNextLineIndented(), Symfony\Component\Yaml\Parser\isNextLineUnIndentedCollection(), and Symfony\Component\Yaml\Parser\parse().
|
private |
Returns the next embed block of YAML.
int | $indentation | The indent level at which the block is to be read, or null for default |
bool | $inSequence | True if the enclosing data structure is a sequence |
ParseException | When indentation problem are detected |
Definition at line 398 of file Parser.php.
References $data, $key, array, Symfony\Component\Yaml\Parser\getCurrentLineIndentation(), Symfony\Component\Yaml\Parser\getRealCurrentLineNb(), Symfony\Component\Yaml\Parser\isBlockScalarHeader(), Symfony\Component\Yaml\Parser\isCurrentLineBlank(), Symfony\Component\Yaml\Parser\isCurrentLineComment(), Symfony\Component\Yaml\Parser\isCurrentLineEmpty(), Symfony\Component\Yaml\Parser\isStringUnIndentedCollectionItem(), Symfony\Component\Yaml\Parser\moveToNextLine(), and Symfony\Component\Yaml\Parser\moveToPreviousLine().
Referenced by Symfony\Component\Yaml\Parser\parse().
|
private |
Returns the current line number (takes the offset into account).
Definition at line 363 of file Parser.php.
References Symfony\Component\Yaml\Parser\$offset.
Referenced by Symfony\Component\Yaml\Parser\getNextEmbedBlock(), Symfony\Component\Yaml\Parser\parse(), and Symfony\Component\Yaml\Parser\parseValue().
|
private |
Tests whether or not the current line is the header of a block scalar.
Definition at line 852 of file Parser.php.
Referenced by Symfony\Component\Yaml\Parser\getNextEmbedBlock().
|
private |
Returns true if the current line is blank.
Definition at line 744 of file Parser.php.
Referenced by Symfony\Component\Yaml\Parser\getNextEmbedBlock(), Symfony\Component\Yaml\Parser\isCurrentLineEmpty(), and Symfony\Component\Yaml\Parser\parseBlockScalar().
|
private |
Returns true if the current line is a comment line.
Definition at line 754 of file Parser.php.
Referenced by Symfony\Component\Yaml\Parser\getNextEmbedBlock(), and Symfony\Component\Yaml\Parser\isCurrentLineEmpty().
|
private |
Returns true if the current line is blank or if it is a comment line.
Definition at line 734 of file Parser.php.
References Symfony\Component\Yaml\Parser\isCurrentLineBlank(), and Symfony\Component\Yaml\Parser\isCurrentLineComment().
Referenced by Symfony\Component\Yaml\Parser\getNextEmbedBlock(), Symfony\Component\Yaml\Parser\isNextLineIndented(), Symfony\Component\Yaml\Parser\isNextLineUnIndentedCollection(), and Symfony\Component\Yaml\Parser\parse().
|
private |
Definition at line 762 of file Parser.php.
Referenced by Symfony\Component\Yaml\Parser\parseBlockScalar().
|
private |
Returns true if the next line is indented.
Definition at line 706 of file Parser.php.
References $ret, Symfony\Component\Yaml\Parser\getCurrentLineIndentation(), Symfony\Component\Yaml\Parser\isCurrentLineEmpty(), Symfony\Component\Yaml\Parser\moveToNextLine(), and Symfony\Component\Yaml\Parser\moveToPreviousLine().
Referenced by Symfony\Component\Yaml\Parser\parse().
|
private |
Returns true if the next line starts unindented collection.
Definition at line 810 of file Parser.php.
References $ret, Symfony\Component\Yaml\Parser\getCurrentLineIndentation(), Symfony\Component\Yaml\Parser\isCurrentLineEmpty(), Symfony\Component\Yaml\Parser\isStringUnIndentedCollectionItem(), Symfony\Component\Yaml\Parser\moveToNextLine(), and Symfony\Component\Yaml\Parser\moveToPreviousLine().
Referenced by Symfony\Component\Yaml\Parser\parse().
|
private |
Returns true if the string is un-indented collection item.
Definition at line 842 of file Parser.php.
Referenced by Symfony\Component\Yaml\Parser\getNextEmbedBlock(), and Symfony\Component\Yaml\Parser\isNextLineUnIndentedCollection().
|
private |
Moves the parser to the next line.
Definition at line 508 of file Parser.php.
References Symfony\Component\Yaml\Parser\$currentLineNb, and lines.
Referenced by Symfony\Component\Yaml\Parser\getNextEmbedBlock(), Symfony\Component\Yaml\Parser\isNextLineIndented(), Symfony\Component\Yaml\Parser\isNextLineUnIndentedCollection(), Symfony\Component\Yaml\Parser\parse(), and Symfony\Component\Yaml\Parser\parseBlockScalar().
|
private |
Moves the parser to the previous line.
Definition at line 524 of file Parser.php.
References Symfony\Component\Yaml\Parser\$currentLineNb, and lines.
Referenced by Symfony\Component\Yaml\Parser\getNextEmbedBlock(), Symfony\Component\Yaml\Parser\isNextLineIndented(), Symfony\Component\Yaml\Parser\isNextLineUnIndentedCollection(), and Symfony\Component\Yaml\Parser\parseBlockScalar().
Symfony\Component\Yaml\Parser::parse | ( | $value, | |
$flags = 0 |
|||
) |
Parses a YAML string to a PHP value.
string | $value | A YAML string |
int | $flags | A bit field of PARSE_* constants to customize the YAML parser behavior |
ParseException | If the YAML is not valid |
Definition at line 59 of file Parser.php.
References $data, $error, $key, array, Symfony\Component\Yaml\Parser\cleanup(), Symfony\Component\Yaml\Parser\getCurrentLineIndentation(), Symfony\Component\Yaml\Parser\getNextEmbedBlock(), Symfony\Component\Yaml\Parser\getRealCurrentLineNb(), Symfony\Component\Yaml\Parser\isCurrentLineEmpty(), Symfony\Component\Yaml\Parser\isNextLineIndented(), Symfony\Component\Yaml\Parser\isNextLineUnIndentedCollection(), lines, Symfony\Component\Yaml\Parser\moveToNextLine(), Symfony\Component\Yaml\Inline\parse(), Symfony\Component\Yaml\Yaml\PARSE_EXCEPTION_ON_INVALID_TYPE, Symfony\Component\Yaml\Yaml\PARSE_OBJECT, Symfony\Component\Yaml\Yaml\PARSE_OBJECT_FOR_MAP, Symfony\Component\Yaml\Parser\parseBlock(), Symfony\Component\Yaml\Inline\parseScalar(), Symfony\Component\Yaml\Parser\parseValue(), Symfony\Component\Yaml\Inline\REGEX_QUOTED_STRING, Symfony\Component\Yaml\Exception\ParseException\setParsedLine(), Symfony\Component\Yaml\Exception\ParseException\setSnippet(), and string.
|
private |
Definition at line 340 of file Parser.php.
References Symfony\Component\Yaml\Parser\$offset, $parser, Symfony\Component\Yaml\Parser\$refs, Symfony\Component\Yaml\Parser\$skippedLineNumbers, and Symfony\Component\Yaml\Parser\$totalNumberOfLines.
Referenced by Symfony\Component\Yaml\Parser\parse().
|
private |
Parses a block scalar.
string | $style | The style indicator that was used to begin this block scalar (| or >) |
string | $chomping | The chomping indicator that was used to begin this block scalar (+ or -) |
int | $indentation | The indentation indicator that was used to begin this block scalar |
Definition at line 599 of file Parser.php.
References $i, $style, $text, array, Symfony\Component\Yaml\Parser\isCurrentLineBlank(), Symfony\Component\Yaml\Parser\isCurrentLineLastLineInDocument(), Symfony\Component\Yaml\Parser\moveToNextLine(), and Symfony\Component\Yaml\Parser\moveToPreviousLine().
Referenced by Symfony\Component\Yaml\Parser\parseValue().
|
private |
Parses a YAML value.
string | $value | A YAML value |
int | $flags | A bit field of PARSE_* constants to customize the YAML parser behavior |
string | $context | The parser context (either sequence or mapping) |
ParseException | When reference does not exist |
Definition at line 546 of file Parser.php.
References $data, Symfony\Component\Yaml\Inline\evaluateBinaryScalar(), Symfony\Component\Yaml\Parser\getRealCurrentLineNb(), Symfony\Component\Yaml\Inline\parse(), Symfony\Component\Yaml\Parser\parseBlockScalar(), Symfony\Component\Yaml\Exception\ParseException\setParsedLine(), and Symfony\Component\Yaml\Exception\ParseException\setSnippet().
Referenced by Symfony\Component\Yaml\Parser\parse().
|
private |
Definition at line 30 of file Parser.php.
|
private |
Definition at line 29 of file Parser.php.
Referenced by Symfony\Component\Yaml\Parser\moveToNextLine(), and Symfony\Component\Yaml\Parser\moveToPreviousLine().
|
private |
Definition at line 28 of file Parser.php.
|
private |
Definition at line 33 of file Parser.php.
|
private |
Definition at line 26 of file Parser.php.
Referenced by Symfony\Component\Yaml\Parser\__construct(), Symfony\Component\Yaml\Parser\getRealCurrentLineNb(), and Symfony\Component\Yaml\Parser\parseBlock().
|
private |
Definition at line 31 of file Parser.php.
Referenced by Symfony\Component\Yaml\Parser\parseBlock().
|
private |
Definition at line 32 of file Parser.php.
Referenced by Symfony\Component\Yaml\Parser\__construct(), and Symfony\Component\Yaml\Parser\parseBlock().
|
private |
Definition at line 27 of file Parser.php.
Referenced by Symfony\Component\Yaml\Parser\__construct(), and Symfony\Component\Yaml\Parser\parseBlock().
const Symfony\Component\Yaml\Parser::BLOCK_SCALAR_HEADER_PATTERN = '(?P<separator>\||>)(?P<modifiers>\+|\-|\d+|\+\d+|\-\d+|\d+\+|\d+\-)?(?P<comments> +#.*)?' |
Definition at line 24 of file Parser.php.
const Symfony\Component\Yaml\Parser::TAG_PATTERN = '((?P<tag>![\w!.\/:-]+) +)?' |
Definition at line 23 of file Parser.php.