Results 1 to 3 of 3
Like Tree1Likes
  • 1 Post By JosAH

Thread: Looking for pseudocode to convert Prefix Expression & Infix Expression to expression

  1. #1
    dragstang86 is offline Member
    Join Date
    Jun 2011
    Rep Power

    Default Looking for pseudocode to convert Prefix Expression & Infix Expression to expression

    Title was cut 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 04:42 AM.

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    New Zealand
    Rep Power


    Wikipeding infix yielded a link to a description of the shunting yard algorithm which might be useful.

  3. #3
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Voorschoten, the Netherlands
    Blog Entries
    Rep Power


    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,

    pbrockway2 likes this.
    The only person who got everything done by Friday was Robinson Crusoe.

Similar Threads

  1. Big-oh expression help!
    By borgan in forum New To Java
    Replies: 2
    Last Post: 01-24-2011, 05:20 PM
  2. cron expression
    By in forum Advanced Java
    Replies: 6
    Last Post: 11-23-2010, 09:18 PM
  3. Create program to evaluate prefix expression
    By Debonairj in forum New To Java
    Replies: 1
    Last Post: 08-12-2010, 02:35 AM
  4. JSF expression inside another JSF expression
    By barbarabxl in forum JavaServer Faces (JSF)
    Replies: 2
    Last Post: 05-21-2010, 03:03 PM
  5. regular expression
    By QkrspCmptPop in forum Advanced Java
    Replies: 8
    Last Post: 01-20-2010, 04:55 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts