Neos.Fusion/Classes/Core/Parser.php
public function parse($sourceCode, $contextPathAndFilename = null, array $objectTreeUntilNow = [], $buildPrototypeHierarchy = true)
    {
        if (!is_string($sourceCode)) {
            throw new Fusion\Exception('Cannot parse Fusion - $sourceCode must be of type string!', 1180203775);
        }
        $this->initialize();
        $this->objectTree = $objectTreeUntilNow;
        $this->contextPathAndFilename = $contextPathAndFilename;
        $sourceCode = str_replace("\r\n", "\n", $sourceCode);
        $this->currentSourceCodeLines = explode(chr(10), $sourceCode);
        while (($fusionLine = $this->getNextfusionLine()) !== false) {
            $this->parseFusionLine($fusionLine);
        }

        if ($buildPrototypeHierarchy) {
            $this->buildPrototypeHierarchy();
        }
        return $this->objectTree;
    }
public function parse($sourceCode, $contextPathAndFilename = null, array $objectTreeUntilNow = [], $buildPrototypeHierarchy = true)
    {
        if (!is_string($sourceCode)) {
            throw new Fusion\Exception('Cannot parse Fusion - $sourceCode must be of type string!', 1180203775);
        }
        $this->initialize();
        $this->objectTree = $objectTreeUntilNow;
        $this->contextPathAndFilename = $contextPathAndFilename;
        $sourceCode = str_replace("\r\n", "\n", $sourceCode);
        $this->currentSourceCodeLines = explode(chr(10), $sourceCode);
        while (($fusionLine = $this->getNextfusionLine()) !== false) {
            $this->parseFusionLine($fusionLine);
        }

        if ($buildPrototypeHierarchy) {
            $this->buildPrototypeHierarchy();
        }
        return $this->objectTree;
    }
public function parse ( $ sourceCode , $ contextPathAndFilename = null , array $ objectTreeUntilNow = [ ] , $ buildPrototypeHierarchy = true ) { if ( ! is_string ( $ sourceCode ) ) { throw new Fusion \ Exception ( 'Cannot parse Fusion - $sourceCode must be of type string!' , 1180203775 ) ; } $ this -> initialize ( ) ; $ this -> objectTree = $ objectTreeUntilNow ; $ this -> contextPathAndFilename = $ contextPathAndFilename ; $ sourceCode = str_replace ( "\r\n" , "\n" , $ sourceCode ) ; $ this -> currentSourceCodeLines = explode ( chr ( 10 ) , $ sourceCode ) ; while ( ( $ fusionLine = $ this -> getNextfusionLine ( ) ) !== false ) { $ this -> parseFusionLine ( $ fusionLine ) ; } if ( $ buildPrototypeHierarchy ) { $ this -> buildPrototypeHierarchy ( ) ; } return $ this -> objectTree ; }
Parses the given Fusion source code and returns an object tree
as the result.

@param string $sourceCode The Fusion source code to parse
@param string $contextPathAndFilename An optional path and filename to use as a prefix for inclusion of further Fusion files
@param array $objectTreeUntilNow Used internally for keeping track of the built object tree
@param boolean $buildPrototypeHierarchy Merge prototype configurations or not. Will be false for includes to only do that once at the end.
@return array A Fusion object tree, generated from the source code
@throws Fusion\Exception
@api
Parses the given Fusion source code and returns an object tree as the result .