Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8714639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:38:48+00:00 2026-06-13T05:38:48+00:00

I see umpteen posts a day about how to do X with regexen. And

  • 0

I see umpteen posts a day about “how to do X with regexen”. And the best response to most of them seems like it would honestly be, “Why are you trying to drive a screw with a hammer?” But regexen are everywhere, and the syntax is mostly portable, particularly if you keep away from the fancy bits.

Is there anything equivalent to regexen but at the next level up in power and configurability? A “you can use it anywhere” parsing library of some variety, preferably with a gloriously concise DSL as its interface?

I’ve used Ragel somewhat, but because of the preprocessing step, I’d hesitate to recommend it to someone as “use this instead of some hairy regex”. It’s awkward to use from Obj-C, and I expect it will be terribly awkward from a language that doesn’t have compile-link-run as part of its standard operating procedure.

What I’m looking for is something that will pass the “inline-online-universal” test.

  1. (inline) You can write the notation inline with your other code, as you would with a regex..

  2. (online) You can run the resulting parser just as you would your other code, which would mean right after input to a REPL in the case of something like Python.

  3. (universal) You can move to a different language/platform and use virtually the same code for your parser, modulo dialect differences. In reality, I’d be happy with something that works from Python, Ruby, C, Java, and Haskell.

Most tools I know of fall down at “online”. They preprocess a grammar offline and spit out code in the target language (C, Python, Java, C++…). They’re standalone tools that aren’t themselves integrated into the language environment.

I’ve had suggestions of PEG parsers and lex/yacc combos. Parser combinator libraries might also be a good fit. Whatever you might propose, I’d like to see demonstrated that it meets these tests. Your answer should demonstrate that the proposed solution meets the inline-online-universal requirements by providing a working demo parser in Python, C, and Haskell. The demo example is up to the author, but it should be something painful using just regexen but trivial using a proper parser.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T05:38:51+00:00Added an answer on June 13, 2026 at 5:38 am

    https://github.com/leblancmeneses/NPEG

    Implements PEG.

    Meets all 3 … let me explain.

    It is inline only with C# and offline with all the others. C# has an offline version also.

    I currently support offline versions: C/C++/Javascript (local right now)/Java pass all unit tests – to make it universal. To add another language takes 25.84 hrs (how long it took to create the offline Javascript version)

    To make it online for every language would be to much maintenance(possible) but it took me a lot of work and time just to support the current offline versions. I can now focus my energy on building grammar optimizers and tooling to unit test grammar rules where all offline versions benefit.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

See this question. How to show popup message like in stackoverflow I am trying
See solution below, I would like some constructive feedback. what is the running time
See title. I would also like the project to redeploy after every change. I
(see jsfiddle example) When the .link_to_rule_them_all is clicked i would like to copy all
SEE LIVE MENU HERE. I am trying to figure out why the drop-down disappears
See: Placement new issue Simple question, would this solve the align problem? union {
See the second bit of code below.. code doesn't compile. Am trying to figure
See the code below - I am trying to include inline svg in my
See example on the web about the PHP Factory Pattern. In the line $kind
See question in the title! Would you 'inject' or rather 'new' a Comparator? Would

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.