src/ViKon/Parser/lexer/Lexer.php
protected function addPattern($pattern, $ruleName, $childRuleName = null) {
        if (!isset($this->patterns[$ruleName])) {
            $this->patterns[$ruleName] = new LexerPattern($ruleName);
        }
        $this->patterns[$ruleName]->addPattern($pattern, $childRuleName);

        return $this;
    }
protected function addPattern($pattern, $ruleName, $childRuleName = null) {
        if (!isset($this->patterns[$ruleName])) {
            $this->patterns[$ruleName] = new LexerPattern($ruleName);
        }
        $this->patterns[$ruleName]->addPattern($pattern, $childRuleName);

        return $this;
    }
protected function addPattern ( $ pattern , $ ruleName , $ childRuleName = null ) { if ( ! isset ( $ this -> patterns [ $ ruleName ] ) ) { $ this -> patterns [ $ ruleName ] = new LexerPattern ( $ ruleName ) ; } $ this -> patterns [ $ ruleName ] -> addPattern ( $ pattern , $ childRuleName ) ; return $ this ; }
Add pattern to rule patterns

@param string      $pattern       regex pattern
@param string      $ruleName      rule name
@param string|null $childRuleName child rule name

@return $this
Add pattern to rule patterns