Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on May 8, 2024 via composer

doctrine/lexer 3.0.0

PHP Doctrine Lexer parser library that can be used in Top-Down, Recursive Descent Parsers.
Package summary
Share
0
issues
1
license
1
MIT
Package created
12 Jan 2013
Version published
15 Dec 2022
Maintainers
1
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
doctrine/lexer@3.0.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of doctrine/lexer 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does doctrine/lexer do?

Doctrine/Lexer positions itself as a robust PHP Lexical analyzer, indispensable for creating top-down or recursive descent parsers. This Lexer forms the backbone of Doctrine's Annotations and ORM (DQL) capabilities and is designed to simplify your parsing experience with its innate functionalities.

How do you use doctrine/lexer?

To incorporate Doctrine/Lexer in your PHP project, you'll need to add the package via Composer first. Simply run the following command in your project directory:

composer require doctrine/lexer

After installation, you may use the lexer to tokenize your input. Here's a generic usage example:

<?php
use Doctrine\Common\Lexer\AbstractLexer;

class MyLexer extends AbstractLexer {

    const MY_TOKEN = 1;

    protected function getCatchablePatterns(): array
    {
        return array(
            '[a-z]+',
        );
    }

    protected function getNonCatchablePatterns(): array
    {
        return array(
            '\s+',
        );
    }

    protected function getType(&$value)
    {
        return self::MY_TOKEN;
    }
}

$lexer = new MyLexer();
$lexer->setInput('abc def');

Always remember to extend the AbstractLexer and define your custom getCatchablePatterns, getNonCatchablePatterns, and getType methods.

Where are the doctrine/lexer docs?

The comprehensive documentation for the Doctrine/Lexer, which spans from installation guide to usage instructions, can be accessed on Doctrine's official website at Doctrine Project. The online guide provides extensive insight into the vast capabilities of the Doctrine/Lexer to help both beginner and advanced users navigate through its functionalities.