Skip to content
Snippets Groups Projects
Commit 576b2a2a authored by Esteban Prince, Liam (UG - Computer Science)'s avatar Esteban Prince, Liam (UG - Computer Science)
Browse files

Update parser.py

parent 73ea40dd
No related branches found
No related tags found
No related merge requests found
def preprocess(): def preprocess():
# Return the next token from the input # Return the next token from the input
def getToken(): def lex(input):
int lastChar = ' ' tokens = []
for c in input:
lastChar = c if c != ' ' while len(input.split()):
if input is not None:
continue
if input[0] in ingredients:
input = input[1:]
else:
raise Exception('Don\'t know what this is: {}'.format(input[0]))
def parse(): def parse():
preprocess(): preprocess()
tokenise() lex(input)
isValid() isValid()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment