IncludeTreeCommentAwareAstBuilderVisitor implements IncludeTreeVisitorInterface

FinalYes

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.

Tags
internal:

Internal tree structure.

Table of Contents

Interfaces

IncludeTreeVisitorInterface
A visitor that can be attached to IncludeTreeTraverser's.

Methods

__construct()  : mixed
getAst()  : RootNode
setFlatConstants()  : void
When 'setup' is parsed, setting resolved flat constants here will make the AST builder substitute these constants.
visit()  : void
Main visit method called for each node.
visitBeforeChildren()  : void
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).

Methods

setFlatConstants()

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

public setFlatConstants(array<string, string> $flatConstants) : void
Parameters
$flatConstants : array<string, string>

visitBeforeChildren()

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).

public visitBeforeChildren(IncludeInterface $include, int $currentDepth) : void
Parameters
$include : IncludeInterface
$currentDepth : int

        
On this page

Search results