in reply to Parsing and executing a psuedo-language

I've been rather successful using a simple and efficient Polish notation (aka: prefix notation) parsing algorithm under which precedence is not an issue. Operators precede their operands, so 1 + {3} * 5 is expressed as + 1 * {3} 5.

I've written a relatively light-weight user-extensible token parser based on Polish notation (complete with if/elsif/else, switch/case, try/catch, etc...) which, if nothing else, demonstrates its potential as the basis for a scripting language.

Replies are listed 'Best First'.
Re^2: Parsing and executing a psuedo-language
by BUU (Prior) on May 25, 2005 at 22:52 UTC
    This is more or less a "me too" type post, but I've also written a simple token based interpreter. Note that it's really very easy to execute prefix notation code (have an operator stack and a data stack, push operator, push data, pop operator, pop data, push result) and it's really fairly easy to go from infix to prefix.