Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 18 in printed book and digital formats -- plus a one-year subscription (beginning with 19.1) so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

Issue 5.6

COLUMN

An RPN Interpreter

"Hello World" For Compilers

Issue: 5.6 (September/October 2007)
Author: Charles Yeomans
Author Bio: Charles is the author of "I Declare: Calling External Functions in REALbasic", available online at http://www.declareSub.com/
Article Description: No description available.
Article Length (in bytes): 16,774
Starting Page Number: 42
Article Number: 5616
Related Web Link(s):

http://www.declareSub.com/

Excerpt of article text...

Writing an RPN interpreter is a standard five-finger exercise for computer science students. We will see why in this and several subsequent columns. But, first, what is RPN?

RPN stands for "reverse Polish notation", and is a syntax for writing mathematical expressions involving operators. The usual form of a mathematical expression is in the form operand - operator - operand; 2 + 3, for example. This is called "infix" notation. In postfix notation, an expression is written in the form operator - operator - operand. In postfix, 2 + 3 is written as 2 3 +. An example of posfix with which you may be familiar is the factorial operator -- N!.

There is also prefix notation, in which the operator comes first: + 2 3. This is also called "Polish notation", in honor of the mathematician Jan Łukasiewicz. Prefix notation came before postfix, so postfix is known as reverse Polish notation, or RPN.

...End of Excerpt. Please purchase the magazine to read the full article.