IncludeTreeAstBuilderVisitor implements IncludeTreeVisitorInterface

FinalYes

Main visitor that creates the TypoScript AST: When adding this visitor and traversing the IncludeTree, the final AST can be fetched using getAst().

This visitor is usually only used together with ConditionVerdictAwareIncludeTreeTraverser, and the IncludeTreeConditionMatcherVisitor is added before this visitor to determine condition verdicts, so AST is only extended for conditions with "true" verdict.

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

Tags
internal:

Internal tree structure.

Attributes
#[Autoconfigure]
$public: true
$shared: false

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
Extend current AST with given LineStream of include node.
visitBeforeChildren()  : void
Reset AST if "clear" flag is set. That's a sys_template record specific thing to restart with a new RootNode and drop any AST calculated already.

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

Reset AST if "clear" flag is set. That's a sys_template record specific thing to restart with a new RootNode and drop any AST calculated already.

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

        
On this page

Search results