-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathParserDataStructure.py
More file actions
38 lines (29 loc) · 901 Bytes
/
Copy pathParserDataStructure.py
File metadata and controls
38 lines (29 loc) · 901 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# coding=utf-8
__author__ = 'PaulieC'
class ParserDataStructure:
def __init__(self):
self.line_declared = -1
self.line_end = -1
self.gosub_lines = []
self.goto_lines = []
self.exitto_lines = []
self.name = ""
def set_line_dec(self, num: int) -> bool:
try:
self.line_declared = num
return True
except Exception:
return False
def set_line_ret(self, num: int) -> bool:
pass
def add_gosub(self, line: int, val: str) -> bool:
pass
def add_goto(self, line: int, val: str) -> bool:
pass
def add_exit(self, line: int, val: str) -> bool:
pass
def add_subroutine(self, line: int, val: str) -> bool:
pass
def set_name(self, name: str) -> bool:
self.name = name.strip().replace("\n", "").replace(":", "")
return True