CS395: Games with flex and bison

Due: 1:00PM Friday, February 20

Develop a technique for writing Bison actions that cause a text form of a parse tree to get printed out. For example, you might use a LISP-like output like this to represent a parse tree for the expression 3+4*5:


(expression
    (expression
        (term
            (factor
                (NUMBER 3)
            )
        )
    )
    (+)
    (term
        (term
            (factor
                (NUMBER 4)
            )
        )
        (*)
        (factor
            (NUMBER 5)
        )
    )
)

You don't have to use exactly this format, but do come up with a reasonably readable tree representation and test it on a couple different grammars and input strings.