Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Lexer Laravel Package

doctrine/lexer

Doctrine Lexer is a lightweight base library for building lexers used in top-down, recursive descent parsers. It powers tokenization in Doctrine projects like Annotations and ORM (DQL), providing a reusable foundation for custom language parsing.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Building custom DSLs or query languages (e.g., business rule engines, internal configuration syntax) without reinventing lexer logic
  • Integrating with Doctrine ORM/Annotations for seamless DQL or annotation parsing without custom tokenization
  • Build vs buy: choosing this over in-house implementation saves 6-12 months of development and maintenance, leveraging a proven library used by Doctrine in production
  • Use cases: products requiring robust text parsing (e.g., code analyzers, template engines, or custom query builders) where token streams are needed

When to Consider This Package

  • Adopt when: building PHP-based applications needing lexical analysis for complex syntax (beyond regex), using Doctrine components, or requiring a mature lexer for top-down recursive descent parsing
  • Avoid when: parsing needs are trivial (e.g., simple string splitting), project is non-PHP, or using a different parsing paradigm (e.g., bottom-up parsers like Yacc)
  • Also avoid if PHP version <8.1 (for 3.x) or legacy PHP support is required (use 2.x, but check compatibility)

How to Pitch It (Stakeholders)

For executives: "This MIT-licensed package is a battle-tested lexer used by Doctrine in production for ORM and annotations. It eliminates 60-80% of parsing-related development effort, reduces bug risk, and integrates seamlessly with our PHP stack—saving time and resources while ensuring reliability for customer-facing features like custom query languages."
For engineers: "Leverage this well-documented, actively maintained lexer to handle tokenization for your custom DSL or DQL extensions. It’s already integrated into Doctrine’s ecosystem, has a robust test suite, and avoids common parsing pitfalls—free

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
milesj/emojibase
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport