interface ParserInterface (View source)

Contract for a Fusion parser

Methods

array
parse(string $sourceCode, string $contextPathAndFilename = null, array $objectTreeUntilNow = [])

Parses the given Fusion source code and returns an object tree as the result.

void
setObjectTypeNamespace(string $alias, string $namespace)

Sets the given alias to the specified namespace.

Details

array parse(string $sourceCode, string $contextPathAndFilename = null, array $objectTreeUntilNow = [])

Parses the given Fusion source code and returns an object tree as the result.

Parameters

string $sourceCode

The Fusion source code to parse

string $contextPathAndFilename

An optional path and filename to use as a prefix for inclusion of further Fusion files

array $objectTreeUntilNow

Used internally for keeping track of the built object tree

Return Value

array

A Fusion object tree, generated from the source code

Exceptions

Exception

void setObjectTypeNamespace(string $alias, string $namespace)

Sets the given alias to the specified namespace.

The namespaces defined through this setter or through a "namespace" declaration in one of the Fusions are used to resolve a fully qualified Fusion object name while parsing Fusion code.

The alias is the handle by wich the namespace can be referred to. The namespace is, by convention, a package key which must correspond to a namespace used in the prototype definitions for Fusion object types.

The special alias "default" is used as a fallback for resolution of unqualified Fusion object types.

Parameters

string $alias

An alias for the given namespace, for example "neos"

string $namespace

The namespace, for example "Neos.Neos"

Return Value

void