Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
Final Year Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Esteban Prince, Liam (UG - Computer Science)
Final Year Project
Commits
576b2a2a
Commit
576b2a2a
authored
5 years ago
by
Esteban Prince, Liam (UG - Computer Science)
Browse files
Options
Downloads
Patches
Plain Diff
Update parser.py
parent
73ea40dd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
parser.py
+13
-6
13 additions, 6 deletions
parser.py
with
13 additions
and
6 deletions
parser.py
+
13
−
6
View file @
576b2a2a
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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment