Results 1 to 3 of 3
- 07-18-2011, 05:26 AM #1
Member
- Join Date
- Jun 2011
- Posts
- 46
- Rep Power
- 0
Looking for pseudocode to convert Prefix Expression & Infix Expression to expression
Title was cut off...to EXPRESSION TREE. I'm just looking for some pseudocode to convert a Prefix Expression to display the expression tree and the same thing for an Infix expression. Don't want any coding, just some pseudocode for me to work off of because I am having a hard time grasping how to go about it. I figured out the postfix expression but struggling with the other two.
Last edited by dragstang86; 07-18-2011 at 05:42 AM.
- 07-18-2011, 05:59 AM #2
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,716
- Rep Power
- 18
Wikipeding infix yielded a link to a description of the shunting yard algorithm which might be useful.
- 07-18-2011, 08:11 AM #3
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 14,422
- Blog Entries
- 7
- Rep Power
- 29
Maybe my blog article about compilers can be of help to you. Given the separation of a parser and the code generator it is a breeze to generate an ast out of your expressions.
kind regards,
JosBuild a wall around Donald Trump; I'll pay for it.
Similar Threads
-
Big-oh expression help!
By borgan in forum New To JavaReplies: 2Last Post: 01-24-2011, 05:20 PM -
cron expression
By enggvijaysingh@gmail.com in forum Advanced JavaReplies: 6Last Post: 11-23-2010, 09:18 PM -
Create program to evaluate prefix expression
By Debonairj in forum New To JavaReplies: 1Last Post: 08-12-2010, 03:35 AM -
JSF expression inside another JSF expression
By barbarabxl in forum JavaServer Faces (JSF)Replies: 2Last Post: 05-21-2010, 04:03 PM -
regular expression
By QkrspCmptPop in forum Advanced JavaReplies: 8Last Post: 01-20-2010, 04:55 AM
Bookmarks