Parle\Parser::validate

Validate input

Description

public bool Parle\Parser::validate(string $data, Parle\Lexer $lexer)

Validate an input string. The string is parsed internally, thus this method is useful for the quick input validation.

Parameters

data

String to be validated.

lexer

A lexer object containing the lexing rules prepared for the particular grammar.

Return Values

Returns bool witnessing whether the input chimes or not with the defined rules.