FormalGrammar
in package
Main class for interacting with formal grammar
Tags
Table of Contents
- $rootRule : RuleInterface
- Root rule
- __construct() : mixed
- Method sets rule
- validate() : bool
- Method validates string - was it formed according to the defined grammar?
Properties
$rootRule
Root rule
private
RuleInterface
$rootRule
Methods
__construct()
Method sets rule
public
__construct(RuleInterface $rule) : mixed
Parameters
- $rule : RuleInterface
-
rule to be set
Return values
mixed —validate()
Method validates string - was it formed according to the defined grammar?
public
validate(string $stringToValidate) : bool
Parameters
- $stringToValidate : string
-
string to be validated
Return values
bool —result of the validation