PHP code example of edin / lexicon-syntax
1. Go to this page and download the library: Download edin/lexicon-syntax library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
edin / lexicon-syntax example snippets
use LexiconSyntax\GrammarParser;
use LexiconSyntax\GrammarPrinter;
use LexiconSyntax\Validation\GrammarValidator;
$document = GrammarParser::parse($source);
echo GrammarPrinter::format($document);
$result = GrammarValidator::validate($document);
foreach ($result->diagnostics as $diagnostic) {
echo $diagnostic->message, PHP_EOL;
}
bash
composer install
php bin/lsyn help