Simple Expression Parser
Bill Bauldry Dept of Mathematical Sciences Appalachian State University BauldryWC@appstate.edu
Description
This worksheet implements a simple parser for Maple expressions. The output is a nested list that describes how Maple interprets the expression. The syntax is simple: Parse(expression). The Parse function can be used to learn about expression evaluation and Maple's internal expression data structures.
Functions
The Op function replaces an item with a form: [operation, operand list]
The Parse function recursively traverses the expression generating a nested list of [operation, operands] pairs in essentially prefix notation.
Examples
A polynomial
A rational function