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 8930179
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:49:43+00:00 2026-06-15T08:49:43+00:00

I recently learned about Pratt parsers from this excellent article and found Pratt parsers

  • 0

I recently learned about Pratt parsers from this excellent article and found Pratt parsers way simpler and much more elegant than recursive descent parsers. I tried to find a bit more info about how they compare to other parser types, but found that the Wikipedia article is barely a stub and the amount of bigger projects that use it that I could find equals two.

Why are Pratt parsers so little used? Do they have any severe limitations or disadvantages that I don’t know about? How exactly do they compare to other parser types? When should and when shouldn’t I use them?

  • 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-15T08:49:44+00:00Added an answer on June 15, 2026 at 8:49 am

    There’s very little difference between a Pratt parser and the so-called "shunting yard" parser (which has a much longer Wikipedia article attached); the main difference is that Pratt uses recursion and hence the stack, while Djikstra (the "shunting yard") keeps an explicit stack. Other than that, they do exactly the same sequence of operations. I suppose that Djikstra’s expression of the algorithm is more common because of recursophobia.

    There are some advantages to using the program stack; one of them is that it’s easier to maintain type safety, since the entire stack doesn’t have to be one type. On the other hand, many expression parsers only have one type.

    The Dragon Book includes an algorthm which will generate an operator precedence table from a grammar. As it points out, the fact that the algorithm succeeds does not necessarily imply that the operator precedence parser will parse exactly the same language. There’s more interesting information there which I’ve certainly forgotten; if you’re interested in the algorithm, that’s one of the places you could look. It includes the interesting insight that the < and > precendence relationship operators can be generated by looking at a derivation, if you surround the result of a production with < and > in the obvious way.

    On the whole, my experience is that most of the time when you find a blog post saying "My God, I’ve just stumbled upon X and it’s great and why don’t more people know about it????", the answer is "Please don’t assume that your ignorance is universal." But maybe I’m just in a cynical mood today.

    By the way, the Lua parser is a hand-built recursive descent parser which uses Pratt style parsing to parse expressions; that’s a pretty common technique, I think, and you’ll probably find it in other places, although you might have to winnow through the code to see the pattern.

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

Sidebar

Related Questions

I have recently learned about continuous integration. From my understanding, its a way to
I recently asked about functional programs having no side effects, and learned what this
I recently learned about sockets in Java and sending information back and forth from
Recently, I started learning some Java. From what I've already learned about JVM it
I recently learned about the right way to work with reverse iterators in C++
I recently learned about strides in the answer to this post , and was
I recently learned about ActivePython as a convenient way of quickly getting Python up
I recently learned about Recursive Common Table Expressions (CTEs) while looking for a way
I recently learned about IKVM.net which is a Java for Mono (.NET). So I
I've just recently learned about friend class concept in C++ (I've googled around for

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.