public function parse(array $tokens)
    {
        $symbolNodes = $this->detectSymbols($tokens);

        $nodes = $this->createTreeByBrackets($symbolNodes);

        $nodes = $this->transformTreeByFunctions($nodes);

        $this->checkGrammar($nodes);

        // Wrap the nodes in an array node.
        $rootNode = new ContainerNode($nodes);

        return $rootNode;
    }
public function parse(array $tokens)
    {
        $symbolNodes = $this->detectSymbols($tokens);

        $nodes = $this->createTreeByBrackets($symbolNodes);

        $nodes = $this->transformTreeByFunctions($nodes);

        $this->checkGrammar($nodes);

        // Wrap the nodes in an array node.
        $rootNode = new ContainerNode($nodes);

        return $rootNode;
    }
public function parse ( array $ tokens ) { $ symbolNodes = $ this -> detectSymbols ( $ tokens ) ; $ nodes = $ this -> createTreeByBrackets ( $ symbolNodes ) ; $ nodes = $ this -> transformTreeByFunctions ( $ nodes ) ; $ this -> checkGrammar ( $ nodes ) ; // Wrap the nodes in an array node. $ rootNode = new ContainerNode ( $ nodes ) ; return $ rootNode ; }
Parses an array with tokens. Returns an array of nodes.
These nodes define a syntax tree.

@param Token[] $tokens
@return ContainerNode
Parses an array with tokens . Returns an array of nodes . These nodes define a syntax tree .