-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlabel_processing.h
More file actions
38 lines (33 loc) · 1.57 KB
/
label_processing.h
File metadata and controls
38 lines (33 loc) · 1.57 KB
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
/*********************************FILE__HEADER*********************************\
* File: label_processing.h
* Authors: Daniel Brodsky & Lior Katav
* Date: August-2023
* Description: This header file provides an interface for the label processing
* functionality in an assembly language program. It contains the
* function prototypes for checking labels, updating lines in
* the program, writing labels to files, and adding external labels.
\******************************************************************************/
#ifndef MAMAN14_LABEL_PROCESSING_H
#define MAMAN14_LABEL_PROCESSING_H
#include "program_constants.h"
#include "utils.h"
/**
* Checks all labels in the assembly file for syntax and logical errors.
* Returns a Status indicating whether the operation was successful or not.
*/
Status checkLabels(char *am_file_name, ProgramState *programState);
/**
* Processes labels and lines of assembly code to update line numbers and
* corresponding label states in the program. This includes managing references to
* labels and handling line adjustments for label usage.
* The function doesn't return a value.
*/
void UpdateLines(char *words[], int num_of_words, int has_label,
ProgramState *programState);
/**
* Writes all labels into entry and external files.
* This function does not return a value.
*/
void WriteLabelsToFile(const char *ent_filename, const char *ext_filename,
ProgramState *programState);
#endif