IncludeTreeAstBuilderVisitor implements IncludeTreeVisitorInterface
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
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
__construct()
public
__construct(AstBuilderInterface $astBuilder) : mixed
Parameters
- $astBuilder : AstBuilderInterface
getAst()
public
getAst() : RootNode
Return values
RootNodesetFlatConstants()
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>
visit()
Extend current AST with given LineStream of include node.
public
visit(IncludeInterface $include, int $currentDepth) : void
Parameters
- $include : IncludeInterface
- $currentDepth : int
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