in reply to Examples or tutorials for Perl grammars?

It depends what you want to achieve. Could you be more specific?

There are various modules on CPAN to parse SQL text like

If it's just about creating your own SQL DSL , I'd suggest designing a combination of Perl functions like sub SELECT and overloaded operators to return an AST of your queries.

I did this before... °

update

and of course there is also

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

°) RFC: A DSL for SQL (part 1)

Replies are listed 'Best First'.
Re^2: Examples or tutorials for Perl grammars?
by karlgoethebier (Abbot) on Jul 09, 2021 at 09:05 UTC
    «… I did this before...»

    Any example available for free? No kidding. Best regards, Karl

    BTW, I wonder why someone jumps to the conclusion to build an SQLish language. Isn’t SQL bad enough? The world mapped to index cards 🤪

    «The Crux of the Biscuit is the Apostrophe»

        Thanx LanX. Very interesting. Best regards, Karl

        «The Crux of the Biscuit is the Apostrophe»

      The world mapped to index cards

      Many RDBMS have the JSON data type nowadays so that an all too obnoxious and rigid 'mapping' can be avoided while retrieval speed hardly suffers.

        Excuse my ignorance, but is there a standard for queries searching in JSON like nested structures?

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery

        Yes sure. And I added «obnoxious» to my Flashcards. Best regards, Karl

        «The Crux of the Biscuit is the Apostrophe»

Re^2: Examples or tutorials for Perl grammars?
by LittleJack (Sexton) on Jul 09, 2021 at 21:21 UTC

    What's an AST?

      Abstract Syntax Tree. That's the structure parsers usually return (but they don't have to, see e.g. my Marpa Enhanced Calculator where the parser directly calculates the expressions without actually building the tree).

      map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
Re^2: Examples or tutorials for Perl grammars?
by Anonymous Monk on Jul 09, 2021 at 21:18 UTC

    Thanks for that, although it's kind ot taken the question off on a tangent.

    It's not a database language or directly related to SQL. That was just an example.

      > It's not a database language or directly related to SQL.

      The better the description of your grammar the more we can help.

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery

      Oops, replied without being logged in. The above is from me. It's not a database language or directly related to SQL.