NaifyView\Dialect\Naify\NaifyControlDirectiveParser クラス

NaifyControlDirectiveParser — Naify dialect の Naify Control Directive Parser

Native template 構文の parser / evaluator / runtime contract を担当する。 Twig / Smarty 互換文化を混ぜず、Naify として持つ構文 surface をここで固定する。

使用例

// Naify dialect の parser / expression / runtime helper として使う。
// 通常は NaifyParser や compiler/executor から間接的に呼ばれる。

プロパティ

名前型説明
private $loopExpressionParser NaifyLoopExpressionParser
private $loopExpressionInspector NaifyLoopExpressionInspector
private $consumeToken Closure
private $currentToken Closure
private $parseNestedNodes Closure
private $parseLoopScopedNodes Closure
private $readOptionalIdentifierAttribute Closure
private $normalizeExpressionSurface Closure
private $mergeSpan Closure
private $buildParserException Closure

メソッド

メソッド説明
public __construct(NaifyLoopExpressionParser $loopExpressionParser, NaifyLoopExpressionInspector $loopExpressionInspector, Closure $consumeToken, Closure $currentToken, Closure $parseNestedNodes, Closure $parseLoopScopedNodes, Closure $readOptionalIdentifierAttribute, Closure $normalizeExpressionSurface, Closure $mergeSpan, Closure $buildParserException): void インスタンスを初期化する
public parseIfNode(): IfNode `parseIfNode()` を実行する
public parseForEachNode(): ForEachNode `parseForEachNode()` を実行する
public parseForRangeNode(): ForRangeNode `parseForRangeNode()` を実行する
public parseIncludeNode(): IncludeNode `parseIncludeNode()` を実行する
private normalizeIncludeBundleMode(mixed $bundleMode, Token $token): string `normalizeIncludeBundleMode()` を実行する
public parseExtendsNode(): ExtendsNode `parseExtendsNode()` を実行する
private parseForEachExpression(string $expression, Token $token): array `parseForEachExpression()` を実行する
private parseForRangeExpression(string $expression, Token $token): array `parseForRangeExpression()` を実行する
private buildIfBranch(string $branchType, ?Token $token): IfBranchNode `buildIfBranch()` を実行する
private consumeToken(): ?Token `consumeToken()` を実行する
private currentToken(): ?Token `currentToken()` を実行する
private parseNestedNodes(callable $shouldStop): array `parseNestedNodes()` を実行する
private parseLoopScopedNodes(callable $shouldStop): array `parseLoopScopedNodes()` を実行する
private readOptionalIdentifierAttribute(Token $token, string $attributeName, string $invalidMessagePrefix, string $invalidCode, string $invalidKey): ?string `readOptionalIdentifierAttribute()` を実行する
private normalizeExpressionSurface(string $expression, ?Token $token, string $label): string `normalizeExpressionSurface()` を実行する
private mergeSpan(mixed $start, mixed $end): mixed `mergeSpan()` を実行する
private parserException(string $message, string $errorCode, string $messageKey, ?Token $token, array $payload = '...'): NaifyViewException `parserException()` を実行する