Made minor changes in pass 1 code and moved it to it's own folder since it also has a source file.
This commit is contained in:
parent
ebebe4b0cb
commit
06b12bac85
@ -1,11 +1,12 @@
|
||||
#Original Code, Engineered by Afan Shaikh. no AI.
|
||||
# Assignment-A1
|
||||
|
||||
try:
|
||||
source = open('source.txt','r')
|
||||
data = source.read()
|
||||
print('File read successfully bro \n\n')
|
||||
print('File read successfully\n\n')
|
||||
source.seek(0)
|
||||
except FileNotFoundError: #A little bit of exception handling
|
||||
print('\n\n\nFile Not found. Create a source.txt first! u dummy!\n\n\n ')
|
||||
print('\n\n\nFile Not found. Create a source.txt first.\n\n\n ')
|
||||
except IOError:
|
||||
print('There was an IO error')
|
||||
LT_index = 0 #index of LT table
|
||||
@ -42,8 +43,6 @@ def handle_start():
|
||||
print("No Start Statement! Abort!\n")
|
||||
return 0
|
||||
|
||||
|
||||
|
||||
def pass1():
|
||||
add=handle_start()
|
||||
if not add:
|
||||
@ -107,4 +106,4 @@ def intermediate():
|
||||
print(entry)
|
||||
|
||||
pass1()
|
||||
intermediate()
|
||||
intermediate()
|
Loading…
Reference in New Issue
Block a user