|
|
@ -1,3 +1,33 @@
|
|
|
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
===============================================================================
|
|
|
|
|
|
|
|
ENGR 13300 Fall 2023
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Program Description
|
|
|
|
|
|
|
|
This is the function that parses the expression. It goes through the expression, and produces a list of 'tokens', where each token represents a part of the expression. For example, '3 + 2' would yield the tokens '3', '+' and '2'. It then returns the list of tokens.
|
|
|
|
|
|
|
|
Assignment Information
|
|
|
|
|
|
|
|
Assignment: Individual Project
|
|
|
|
|
|
|
|
Author: Aadhavan Srinivasan, srini193@purdue.edu
|
|
|
|
|
|
|
|
Team ID: LC3 - 19
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Contributor: Name, login@purdue [repeat for each]
|
|
|
|
|
|
|
|
My contributor(s) helped me:
|
|
|
|
|
|
|
|
[ ] understand the assignment expectations without
|
|
|
|
|
|
|
|
telling me how they will approach it.
|
|
|
|
|
|
|
|
[ ] understand different ways to think about a solution
|
|
|
|
|
|
|
|
without helping me plan my solution.
|
|
|
|
|
|
|
|
[ ] think through the meaning of a specific error or
|
|
|
|
|
|
|
|
bug present in my code without looking at my code.
|
|
|
|
|
|
|
|
Note that if you helped somebody else with their code, you
|
|
|
|
|
|
|
|
have to list that person as a contributor here as well.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ACADEMIC INTEGRITY STATEMENT
|
|
|
|
|
|
|
|
I have not used source code obtained from any other unauthorized
|
|
|
|
|
|
|
|
source, either modified or unmodified. Neither have I provided
|
|
|
|
|
|
|
|
access to my code to another. The project I am submitting
|
|
|
|
|
|
|
|
is my own original work.
|
|
|
|
|
|
|
|
===============================================================================
|
|
|
|
|
|
|
|
"""
|
|
|
|
def parse(expr):
|
|
|
|
def parse(expr):
|
|
|
|
|
|
|
|
|
|
|
|
opers = ['+', '-', '*', '/', '=']
|
|
|
|
opers = ['+', '-', '*', '/', '=']
|
|
|
|