You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
1015 B
31 lines
1015 B
<?php
|
|
/** @license MIT
|
|
* Copyright 2021 Dustin Wilson et al.
|
|
* See LICENSE file for details */
|
|
|
|
declare(strict_types=1);
|
|
namespace dW\Lit\Grammar;
|
|
use dW\Lit\Grammar;
|
|
|
|
|
|
/** Contains patterns responsible for matching a portion of the document */
|
|
class Pattern extends Rule {
|
|
protected bool $_beginPattern = false;
|
|
protected ?array $_captures;
|
|
protected ?string $_contentName;
|
|
protected bool $_endPattern = false;
|
|
protected ?string $_match;
|
|
protected ?string $_name;
|
|
protected ?array $_patterns;
|
|
|
|
|
|
public function __construct(?string $name = null, ?string $contentName = null, ?string $match = null, ?array $patterns = null, ?array $captures = null, bool $beginPattern = false, bool $endPattern = false) {
|
|
$this->_beginPattern = $beginPattern;
|
|
$this->_name = $name;
|
|
$this->_contentName = $contentName;
|
|
$this->_match = $match;
|
|
$this->_patterns = $patterns;
|
|
$this->_captures = $captures;
|
|
$this->_endPattern = $endPattern;
|
|
}
|
|
}
|