TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Parsing a Reverse Polish Expression

41 pointsby martyalainalmost 3 years ago

6 comments

Stevvoalmost 3 years ago
I've had to work with reverse polish notation on a regular basis for years yet to this day I still can't get my head around even the most basic expressions with more than a couple of operators. I've resorted to writing the required code in regular notation then using a script to reorder it to RPN; If I can't 'get it' after hundreds of hours I'm never going to 'get it'.
评论 #31456973 未加载
评论 #31456826 未加载
arjvikalmost 3 years ago
I recently wrote a Reverse Polish Notation mode for my Ti-84+CE.<p>It&#x27;s significantly more efficient when you have an entire page of calculations with tons of parentheses to get through. Try it out, especially if you&#x27;re nostalgic for your old engineering calculator—this brings the best of both worlds.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;arjvik&#x2F;RPN-Ti84" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;arjvik&#x2F;RPN-Ti84</a>
Fiahilalmost 3 years ago
Brings back memories ! One of the first parser you would write in any computer science class !
mikewarotalmost 3 years ago
Any sufficiently complete explanation of RPN contains half of a poorly written Forth implementation. ;-)<p>Seriously, this is MUCH simpler than recursive descent compilers or lex&#x2F;yacc&#x2F;bison.<p>Add a good typing system to it, and you&#x27;ve got STOIC, a programming language from the 1970s.
melonyalmost 3 years ago
Is this a reverse shunting-yard?
评论 #31457044 未加载
martyalainalmost 3 years ago
Please tlb, the website is not down. Alain Marty (marty.alain @ free.fr)
评论 #31455507 未加载