Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Regex higher IR library
#6
The closest thing I can think about in Python is the lexer in the PLY module, where tokens are also specified as regular expressions. As David Beazley explains in the documentation, ply sorts the regexes by order of decreasing length to define priority. Instead of building a DFA as logos seems to do, ply builds an master regex and invokes the re module.

Of course, you cannot expect a blazingly fast lexer in Python as you would in Rust. Apart from the regex sorting part, logos reminds me of the venerable flex from C, and I guess it has similar performances. For most uses, however, the lexer is usually not a bottleneck.
Reply


Messages In This Thread
Regex higher IR library - by DreamingInsanity - Jun-04-2022, 11:37 PM
RE: Regex higher IR library - by Gribouillis - Jun-05-2022, 05:46 AM
RE: Regex higher IR library - by DreamingInsanity - Jun-05-2022, 10:06 AM
RE: Regex higher IR library - by Gribouillis - Jun-05-2022, 03:12 PM
RE: Regex higher IR library - by DreamingInsanity - Jun-05-2022, 04:07 PM
RE: Regex higher IR library - by Gribouillis - Jun-05-2022, 06:21 PM
RE: Regex higher IR library - by DreamingInsanity - Jun-06-2022, 02:37 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Beginner Higher Lower Game wallytan 2 1,701 Sep-29-2022, 05:14 PM
Last Post: deanhystad
  finding the next higher representable floating point value Skaperen 0 2,005 Sep-13-2019, 11:16 PM
Last Post: Skaperen
  the next higher character Skaperen 13 5,099 Jun-07-2019, 01:44 PM
Last Post: heiner55
  How do I loop through a list and delete numerical elements that are 1 lower/higher? neko 4 4,378 Sep-05-2017, 02:25 PM
Last Post: ichabod801
  PyInstaller, how to create library folder instead of library.zip file ? harun2525 2 4,922 May-06-2017, 11:29 AM
Last Post: harun2525

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020