Compare commits
3 Commits
716dbac01f
...
master
Author | SHA1 | Date | |
---|---|---|---|
d5f0c95c8c | |||
40f51658d8 | |||
5efb58b226 |
@@ -69,6 +69,8 @@ def print_error(error_code):
|
||||
case 6:
|
||||
print("Invalid expression.")
|
||||
|
||||
print("")
|
||||
|
||||
return
|
||||
|
||||
def check_errors(expr):
|
||||
@@ -199,5 +201,6 @@ def main():
|
||||
print(expr)
|
||||
if (len(variables) > 0):
|
||||
print(variables)
|
||||
print("")
|
||||
|
||||
main()
|
||||
|
30
parse.py
30
parse.py
@@ -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):
|
||||
|
||||
opers = ['+', '-', '*', '/', '=']
|
||||
|
Reference in New Issue
Block a user