class Parser (View source)

The Fusion Parser

Properties

static list<string> $reservedParseTreeKeys

Reserved parse tree keys for internal usage.

protected DslFactory $dslFactory
protected ParserCache $parserCache

Methods

parseFromSource(FusionSourceCodeCollection $sourceCode)

Parses the given Fusion source code, resolves includes and returns a merged array tree as the result.

array
parse(string $sourceCode, string|null $contextPathAndFilename = null, array $mergedArrayTreeUntilNow = []) deprecated

Parses the given Fusion source code, resolves includes and returns a merged array tree as the result.

void
handleFileInclude(MergedArrayTree $mergedArrayTree, string $filePattern, string|null $contextPathAndFilename)

No description

mixed
handleDslTranspile(string $identifier, string $code)

No description

parseToFusionFile(FusionSourceCode $fusionCode)

No description

Details

FusionConfiguration parseFromSource(FusionSourceCodeCollection $sourceCode)

Parses the given Fusion source code, resolves includes and returns a merged array tree as the result.

Parameters

FusionSourceCodeCollection $sourceCode

The Fusion source code to parse

Return Value

FusionConfiguration

The fusion configuration for the Fusion runtime

Exceptions

Exception

array parse(string $sourceCode, string|null $contextPathAndFilename = null, array $mergedArrayTreeUntilNow = []) deprecated

deprecated with Neos 8.3 – will be removed with Neos 9.0, use {@link parseFromSource} instead

Parses the given Fusion source code, resolves includes and returns a merged array tree as the result.

Parameters

string $sourceCode

The Fusion source code to parse

string|null $contextPathAndFilename

An optional path and filename used for relative Fusion file includes

array $mergedArrayTreeUntilNow

Used internally for keeping track of the built merged array tree

Return Value

array

The merged array tree for the Fusion runtime, generated from the source code

Exceptions

Exception

protected void handleFileInclude(MergedArrayTree $mergedArrayTree, string $filePattern, string|null $contextPathAndFilename)

No description

Parameters

MergedArrayTree $mergedArrayTree
string $filePattern
string|null $contextPathAndFilename

Return Value

void

protected mixed handleDslTranspile(string $identifier, string $code)

No description

Parameters

string $identifier
string $code

Return Value

mixed

protected MergedArrayTreeVisitor getMergedArrayTreeVisitor(MergedArrayTree $mergedArrayTree)

No description

Parameters

MergedArrayTree $mergedArrayTree

Return Value

MergedArrayTreeVisitor

protected FusionFile parseToFusionFile(FusionSourceCode $fusionCode)

No description

Parameters

FusionSourceCode $fusionCode

Return Value

FusionFile