‪TYPO3CMS  ‪main
TYPO3\CMS\Core\TypoScript\IncludeTree\Visitor\IncludeTreeCommentAwareAstBuilderVisitor Class Reference
Inheritance diagram for TYPO3\CMS\Core\TypoScript\IncludeTree\Visitor\IncludeTreeCommentAwareAstBuilderVisitor:
TYPO3\CMS\Core\TypoScript\IncludeTree\Visitor\IncludeTreeVisitorInterface

Public Member Functions

 __construct (private readonly CommentAwareAstBuilder $astBuilder)
 
 setFlatConstants (array $flatConstants)
 
 getAst ()
 
 visitBeforeChildren (IncludeInterface $include, int $currentDepth)
 
 visit (IncludeInterface $include, int $currentDepth)
 

Private Attributes

RootNode $ast
 
array $flatConstants = []
 

Detailed Description

Secondary visitor that creates the TypoScript AST: When adding this visitor and traversing the IncludeTree, the final AST can be fetched using getAst(). This is an "extended" version of IncludeTreeAstBuilderVisitor that uses the CommentAwareAstBuilder instead of the AstBuilder to build the AST: This special AST builder is comment aware and adds TypoScript comments to nodes.

This visitor is used in ext:tstemplate TypoScript modules and ext:backend page TSconfig to allow implementation of the "comment" related functionality.

When parsing "setup", "flattened" constants should be assigned to this visitor, so the AstBuilder can resolve constants.

: Internal tree structure.

Definition at line 40 of file IncludeTreeCommentAwareAstBuilderVisitor.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\TypoScript\IncludeTree\Visitor\IncludeTreeCommentAwareAstBuilderVisitor::__construct ( private readonly CommentAwareAstBuilder  $astBuilder)

Definition at line 49 of file IncludeTreeCommentAwareAstBuilderVisitor.php.

Member Function Documentation

◆ getAst()

TYPO3\CMS\Core\TypoScript\IncludeTree\Visitor\IncludeTreeCommentAwareAstBuilderVisitor::getAst ( )

◆ setFlatConstants()

TYPO3\CMS\Core\TypoScript\IncludeTree\Visitor\IncludeTreeCommentAwareAstBuilderVisitor::setFlatConstants ( array  $flatConstants)

When 'setup' is parsed, setting resolved flat constants here will make the AST builder substitute these constants.

Parameters
array<string,string>‪$flatConstants

Definition at line 60 of file IncludeTreeCommentAwareAstBuilderVisitor.php.

References TYPO3\CMS\Core\TypoScript\IncludeTree\Visitor\IncludeTreeCommentAwareAstBuilderVisitor\$flatConstants.

◆ visit()

TYPO3\CMS\Core\TypoScript\IncludeTree\Visitor\IncludeTreeCommentAwareAstBuilderVisitor::visit ( IncludeInterface  $include,
int  $currentDepth 
)

◆ visitBeforeChildren()

TYPO3\CMS\Core\TypoScript\IncludeTree\Visitor\IncludeTreeCommentAwareAstBuilderVisitor::visitBeforeChildren ( IncludeInterface  $include,
int  $currentDepth 
)

Gets called by the traversers before children are traversed. Useful for instance for the IncludeTreeConditionMatcherVisitor to evaluate a condition verdict before children are traversed (or not).

Implements TYPO3\CMS\Core\TypoScript\IncludeTree\Visitor\IncludeTreeVisitorInterface.

Definition at line 70 of file IncludeTreeCommentAwareAstBuilderVisitor.php.

References TYPO3\CMS\Core\TypoScript\IncludeTree\IncludeNode\IncludeInterface\isClear().

Member Data Documentation

◆ $ast

RootNode TYPO3\CMS\Core\TypoScript\IncludeTree\Visitor\IncludeTreeCommentAwareAstBuilderVisitor::$ast
private

◆ $flatConstants

array TYPO3\CMS\Core\TypoScript\IncludeTree\Visitor\IncludeTreeCommentAwareAstBuilderVisitor::$flatConstants = []
private