@param \ViKon\Parser\Lexer\Lexer $lexer

@return $this
496697
public function prepare(Lexer $lexer) {
        $this->acceptedRuleNames = array_merge(
            $this->set->getRuleNamesByCategory(MarkdownRuleSet::CATEGORY_BLOCK),
            $this->set->getRuleNamesByCategory(MarkdownRuleSet::CATEGORY_FORMAT),
            $this->set->getRuleNamesByCategory(MarkdownRuleSet::CATEGORY_SINGLE)
        );

        return $this;
    }
1306029
public function parse(Scope $head, Scope $set, Lexer $lexer)
    {
        switch(true) {
            case ($lexer->isNextToken(Lexer::T_QUANTIFIER_PLUS)) :
                $head = $this->quantifyPlus($head,$set,$lexer);
            break;
            case ($lexer->isNextToken(Lexer::T_QUANTIFIER_QUESTION)) :
                $head = $this->quantifyQuestion($head,$set,$lexer);
            break;
            case ($lexer->isNextToken(Lexer::T_QUANTIFIER_STAR)) :
                $head = $this->quantifyStar($head,$set,$lexer);
            break;
             case ($lexer->isNextToken(Lexer::T_QUANTIFIER_OPEN)) :
                $head = $this->quantifyClosure($head,$set,$lexer);
            break;
            default :
                //do nothing no token matches found
        }
        
        return $head;
        
    }
137837
public static function create(string $recognizer): self
    {
        $recognizerDeviation = new self();

        $recognizerDeviation->type       = self::TYPE;
        $recognizerDeviation->recognizer = $recognizer;

        return $recognizerDeviation;
    }
307235
public function setParser(ParserInterface $parser)
    {
        $this->parsed = false;
        $this->parser = $parser;
        return $this;
    }
85644
private function buildFromParser(SwaggerParser $parser)
    {
        $context = new DeserializationContext();

        $context->setVersion(
            $parser->getVersion()
        );

        return $this->serializer->deserialize($parser, Swagger::class, 'json', $context);
    }
1074817
public function createParser($kind = null)
    {
        if ($this->hasKindsSupport()) {
            $originalFactory = new OriginalParserFactory();

            $kind = $kind ?: $this->getDefaultKind();

            if (!\in_array($kind, static::getPossibleKinds())) {
                throw new \InvalidArgumentException('Unknown parser kind');
            }

            $parser = $originalFactory->create(\constant('PhpParser\ParserFactory::' . $kind));
        } else {
            if ($kind !== null) {
                throw new \InvalidArgumentException('Install PHP Parser v2.x to specify parser kind');
            }

            $parser = new Parser(new Lexer());
        }

        return $parser;
    }
379205
public function setLogger($logger)
    {
        $this->logger = $logger;
        $this->connection->getConfiguration()->setSQLLogger($this->logger);
        return $this;
    }
716675
public function register(PregDateLexerInterface $lexer)
    {
        $this->regexp .= $lexer->getExpression();
        $this->lexers[] = $lexer;
    }
347964
private function ignoreObjectBlock(Lexer $lexer) : int
    {
        do {
            $code = $lexer->lex();

            // recursively ignore nested objects
            if (self::JSON_OBJECT_START === $code) {
                $this->ignoreObjectBlock($lexer);
            }
        } while (self::JSON_OBJECT_END !== $code);

        return $lexer->lex();
    }
603168
public function loader(callable $loader, string ...$types): BuilderInterface
    {
        $this->resolver->loader($loader, ...$types);

        return $this;
    }
245314
public function finish(Lexer $lexer) {
        if (is_array($this->exitPattern)) {
            foreach ($this->exitPattern as $exitPattern) {
                $lexer->addExitPattern($exitPattern, $this->name);
            }
        } else {
            $lexer->addExitPattern($this->exitPattern, $this->name);
        }

        return $this;
    }
1157107
public function parse(Scope $head, Scope $set, Lexer $lexer)
    {
        if($lexer->lookahead['type'] !== Lexer::T_SET_OPEN) {
            throw new ParserException('Opening character set token not found');
        }
        
        $peek = $lexer->glimpse();
        if($peek['type'] === Lexer::T_SET_NEGATED) {
             throw new ParserException('Negated Character Set ranges not supported at this time');
        }
        
        $normal_lexer = new Lexer($this->normalize($head,$set,$lexer));
        
        while( $normal_lexer->moveNext() && !$normal_lexer->isNextToken(Lexer::T_SET_CLOSE)) {
            $glimpse = $normal_lexer->glimpse();
         
            if($glimpse['type'] === Lexer::T_SET_RANGE) {
                continue; //value be included in range when `-` character is passed
            }
         
            switch(true) {
                case($normal_lexer->isNextToken(Lexer::T_SET_RANGE)) :
                    $range_start = $normal_lexer->token['value'];
                    
                    $normal_lexer->moveNext();
                    
                    if($normal_lexer->isNextToken(Lexer::T_ESCAPE_CHAR)) {
                        $normal_lexer->moveNext();
                    }
                    
                    $range_end =  $normal_lexer->lookahead['value'];
                    $this->fillRange($head,$range_start,$range_end);
                    
                break;    
                case($normal_lexer->isNextToken(Lexer::T_LITERAL_NUMERIC) || $normal_lexer->isNextToken(Lexer::T_LITERAL_CHAR)) :
                    $index = (integer)Utf8::ord($normal_lexer->lookahead['value']);
                    $head->setLiteral($index,$normal_lexer->lookahead['value']);
                break;
                default:
                    # ignore     
            }
        }
        
        
        $head->getLiterals()->sort();
        
        return $head;
    }
1337818
public function set(TypeConverterInterface $converter)
    {
        $this->converters[$converter->getTypeNamespace() . ':'
            . $converter->getTypeName()] = $converter;

        return $this;
    }
685560
public function registerMatcher($matcher)
    {
        if (! in_array($matcher, $this->matchers) && is_a($matcher, MatcherInterface::class, true)) {
            $this->matchers[] = $matcher;
        }

        return $this;
    }
1309498
public function setValidator(Validator $validator)
    {
        if ($validator) {
            $this->validator = $validator;
            $this->validator->setForm($this);
        }
        return $this;
    }
389378
public function setLineReader(LineReadIterator $lineReader)
    {
        $this->lineReader = $lineReader;
        if ($this->filesystem) {
            $this->lineReader->setFilesystem($this->filesystem);
        }
        if ($this->filePath) {
            $this->lineReader->setFilePath($this->filePath);
        }
        return $this;
    }
1138976
public function setValidator($validator)
    {
        $this->clearCache();
        $this->validators = [];
        $this->addValidator($validator);

        return $this;
    }