working on prehod 2...

This commit is contained in:
Jaka Furlan 2025-12-13 17:27:34 +01:00
parent f79aa96359
commit 6261d9fe37
6 changed files with 84 additions and 27 deletions

View file

@ -35,7 +35,7 @@ let prviPrehod (code : lineSemantic list) : int*lineSemantic list*symtab=
(*while opcode != END loop*)
let rec loop ostaliUkazi prgLen intermediateFileList =
match ostaliUkazi with
| [] -> prgLen, (List.rev intermediateFileList), simtab (*smo konec*)
| [] -> failwith "no END mnemonic at the end of the code!"
| x :: _ when x.opcode = END -> (*konec while loopa*) (*write last line to intermediate file, save the locctr - st addr as prg len*)
x.loc <- Some !locctr;
let intermediateFileList = x :: intermediateFileList in