FlareStart
HomeNewsHow ToSources
FlareStart

Where developers start their day. All the tech news & tutorials that matter, in one place.

Quick Links

  • Home
  • News
  • Tutorials
  • Sources
  • Privacy Policy

Connect

© 2026 FlareStart. All rights reserved.

Back to articles
Parsing Filter Expressions in NestJS with a Context-Free Grammar
NewsWeb Development

Parsing Filter Expressions in NestJS with a Context-Free Grammar

via Dev.to WebdevRobert Ozimek3h ago

Flat query param filtering breaks down fast. ?status=active&age_gte=18 works until someone needs (status=active OR status=pending) AND age>=18 . At that point you're either inventing your own encoding convention or telling the client it can't do that. The underlying issue is that boolean logic is recursive. AND and OR nest arbitrarily, and flat key-value params have no way to express that structure. What a Grammar Actually Is A Context-Free Grammar (CFG) defines a language through production rules. Each rule describes how a named concept (non-terminal) expands into tokens (terminals) or other non-terminals. The arithmetic grammar is the classic example: expression → term ( ("+" | "-") term )* term → factor ( ("*" | "/") factor )* factor → NUMBER | "(" expression ")" Operator precedence isn't hardcoded, it falls out of the nesting. term sits inside expression , so * binds tighter than + automatically. factor → "(" expression ")" lets expressions nest to any depth. The grammar describes

Continue reading on Dev.to Webdev

Opens in a new tab

Read Full Article
0 views

Related Articles

News

Rolling Your Own DRM: A Case Study in Why You Shouldn’t

Medium Programming • 1h ago

.NET 10 vs .NET 8: Why ASP.NET Developers Should Upgrade
News

.NET 10 vs .NET 8: Why ASP.NET Developers Should Upgrade

Medium Programming • 1h ago

News

Lines of code are useful

Lobsters • 2h ago

Stuck on a Programming Assignment in Maryland? Here’s What Actually Helps
News

Stuck on a Programming Assignment in Maryland? Here’s What Actually Helps

Medium Programming • 2h ago

Tuft & Needle Promo Codes: 20% Off | March 2026
News

Tuft & Needle Promo Codes: 20% Off | March 2026

Wired • 3h ago

Discover More Articles