JBBCode/Parser.php
protected function parseStartState(ElementNode $parent, Tokenizer $tokenizer)
    {
        $next = $tokenizer->next();

        if ('[' == $next) {
            return $this->parseTagOpen($parent, $tokenizer);
        } else {
            $this->createTextNode($parent, $next);
            /* Drop back into the main parse loop which will call this
             * same method again. */
            return $parent;
        }
    }
protected function parseStartState(ElementNode $parent, Tokenizer $tokenizer)
    {
        $next = $tokenizer->next();

        if ('[' == $next) {
            return $this->parseTagOpen($parent, $tokenizer);
        } else {
            $this->createTextNode($parent, $next);
            /* Drop back into the main parse loop which will call this
             * same method again. */
            return $parent;
        }
    }
protected function parseStartState ( ElementNode $ parent , Tokenizer $ tokenizer ) { $ next = $ tokenizer -> next ( ) ; if ( '[' == $ next ) { return $ this -> parseTagOpen ( $ parent , $ tokenizer ) ; } else { $ this -> createTextNode ( $ parent , $ next ) ; /* Drop back into the main parse loop which will call this
             * same method again. */ return $ parent ; } }
jBBCode parsing logic is loosely modelled after a FSM. While not every function maps
to a unique DFSM state, each function handles the logic of one or more FSM states.
This function handles the beginning parse state when we're not currently in a tag
name.

@param ElementNode  $parent the current parent node we're under
@param Tokenizer    $tokenizer the tokenizer we're using

@return ElementNode the new parent we should use for the next iteration.
jBBCode parsing logic is loosely modelled after a FSM . While not every function maps to a unique DFSM state each function handles the logic of one or more FSM states . This function handles the beginning parse state when we re not currently in a tag name .