public function parse($template)
    {
        $parts   = preg_split('#(\{[^\}]+\})#', $template, null, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
        $nodes   = array();

        foreach($parts as $part) {
            $node = $this->createNode($part);

            // if current node has dot separator that requires a forward lookup
            // for the previous node iff previous node's operator is UnNamed
            if ($node instanceof Expression && $node->getOperator()->id === '.') {
                if (sizeof($nodes) > 0) {
                    $previousNode = $nodes[sizeof($nodes) - 1];
                    if ($previousNode instanceof Expression && $previousNode->getOperator() instanceof UnNamed) {
                        $previousNode->setForwardLookupSeparator($node->getOperator()->id);
                    }
                }
            }

            $nodes[] = $node;
        }

        return $nodes;
    }
public function parse($template)
    {
        $parts   = preg_split('#(\{[^\}]+\})#', $template, null, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY);
        $nodes   = array();

        foreach($parts as $part) {
            $node = $this->createNode($part);

            // if current node has dot separator that requires a forward lookup
            // for the previous node iff previous node's operator is UnNamed
            if ($node instanceof Expression && $node->getOperator()->id === '.') {
                if (sizeof($nodes) > 0) {
                    $previousNode = $nodes[sizeof($nodes) - 1];
                    if ($previousNode instanceof Expression && $previousNode->getOperator() instanceof UnNamed) {
                        $previousNode->setForwardLookupSeparator($node->getOperator()->id);
                    }
                }
            }

            $nodes[] = $node;
        }

        return $nodes;
    }
public function parse ( $ template ) { $ parts = preg_split ( '#(\{[^\}]+\})#' , $ template , null , PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY ) ; $ nodes = array ( ) ; foreach ( $ parts as $ part ) { $ node = $ this -> createNode ( $ part ) ; // if current node has dot separator that requires a forward lookup // for the previous node iff previous node's operator is UnNamed if ( $ node instanceof Expression && $ node -> getOperator ( ) -> id === '.' ) { if ( sizeof ( $ nodes ) > 0 ) { $ previousNode = $ nodes [ sizeof ( $ nodes ) - 1 ] ; if ( $ previousNode instanceof Expression && $ previousNode -> getOperator ( ) instanceof UnNamed ) { $ previousNode -> setForwardLookupSeparator ( $ node -> getOperator ( ) -> id ) ; } } } $ nodes [ ] = $ node ; } return $ nodes ; }
Parses URI Template and returns nodes

@param string $template
@return Node\Abstraction[]
Parses URI Template and returns nodes