Post Reply 
My own infix to prefix approach. What do you think?
04-30-2014, 12:30 PM
Post: #15
RE: My own infix to prefix approach. What do you think?
(04-30-2014 10:43 AM)HP67 Wrote:  The shunting-yard algorithm doesn't parse anything. It is a relatively dumb state machine. If the input token stream represents a valid arithmetic infix expression the machine produces a representative postfix expression as a token stream. It is up to the implementer to write his own scanner and various other pieces. As far as the algorithm goes, and even as far as implementing it goes, parsing is not part of the discussion.

Wow. For anyone who knows what a parser is and does, not to mention the relationship between lexers, finite state machines and regular languages, I don't really need to add anything to that ball of wax. For those who don't, just read the first sentence of the linked Wikipedia page on the shunting-yard algorithm.

I will just note that Matt didn't ask, "What is an algorithm for converting infix into prefix notation?". He described his ideas and asked if they were "plausible and valid". I replied that they were, and described a way in which they could be easily implemented (including the scanner [lexer]), experimented with and taken further, if he chose to do so. I stand by that.

--- Les
[http://www.lesbell.com.au]
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: My own infix to prefix approach. What do you think? - Les Bell - 04-30-2014 12:30 PM



User(s) browsing this thread: 1 Guest(s)