mirror of
https://github.com/mudabbir-ahmad/UNI-PROG3-CW2-DYOPL.git
synced 2026-10-08 04:00:20 +00:00
Refactor RobotLangVisitorUser to improve student ID extraction and clean up code
This commit is contained in:
1 parent
ad6935723e
commit
99e8b68078
3 files changed
+2
-9
No files matched your search
@@ -11,13 +11,9 @@ def main(argv):
|
||||
inpname = argv[1]
|
||||
inpstream = FileStream(inpname)
|
||||
lexer = RobotLangLexer(inpstream)
|
||||
#Create a stream of tokens
|
||||
tokstream = CommonTokenStream(lexer)
|
||||
#Parser produces the abstract syntax tree
|
||||
parser = RobotLangParser(tokstream)
|
||||
#Start parsing from the top rule
|
||||
tree = parser.prog()
|
||||
#execute script
|
||||
visitor = RobotLangVisitorUser()
|
||||
visitor.visit(tree)
|
||||
|
||||
|
||||
Reference in new issue
Block a user