-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patherrorsHeader.h
More file actions
96 lines (51 loc) · 4.85 KB
/
Copy patherrorsHeader.h
File metadata and controls
96 lines (51 loc) · 4.85 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#ifndef MAMAN14_ERRORSHEADER_H
#define MAMAN14_ERRORSHEADER_H
/*---------------------------- includes ----------------------------*/
#include <stdio.h>
/*---------------------------- defines ----------------------------*/
#define VALID 1
#define ERROR (-1)
#define EXIT 0
#define MAX_ROW_LENGTH 81
#define MAX_LABEL_LENGTH 31
/*-------------------- functions declarations ---------------------*/
#define ERROR_MEMORY_MAXED_OUT(X) printf("ERROR: Memory ran out, couldn't save data from line %d in the file\n",X)
#define ERROR_NO_FILES printf("ERROR: no file was entered\n")
#define ERROR_FILE_IS_EMPTY(X) printf("ERROR: the file \"%s\" is empty.\n",X)
#define ERROR_WRONG_EXTENSION(X) printf("ERROR: the file \"%s\" has incompatible extension , please provide a valid assembly file.\n",X)
#define ERROR_FILE_DONT_EXIST(X) printf("ERROR: the file \"%s\" doesn't exist in the directory, please make sure the name is valid.\n",X)
#define ERROR_IMPROPER_DOT(X) printf("ERROR: In line %d, an improper dot was found\n",X)
#define ERROR_CONSECUTIVE_DOT(X) printf("ERROR: In line %d, multiple consecutive dot were found\n",X)
#define ERROR_MAX_PROG(X) printf("ERROR: In line %d, the file Exceeded the max memory size\n",X)
#define ERROR_LABEL_NAME(X) printf("ERROR: In line %d, a label that was given as an argument had an invalid name\n",X)
#define ERROR_MISSING_LABEL(X) printf("ERROR: In line %d, a label that was required as an argument was missing\n",X)
#define ERROR_IMPROPER_INSTRUCTION_NAME(X) printf("ERROR: In line %d, an improper instruction name was found\n",X)
#define ERROR_IMPROPER_DIRECTIVE_NAME(X) printf("ERROR: In line %d, an improper directive word was found\n",X)
#define ERROR_INVALID_CHAR(X,Y) printf("ERROR: In line %d, extraneous text starts with the char \"%c\" was found\n",X,Y)
#define ERROR_INVALID_ASCIZ(X) printf("ERROR: In line %d, an invalid asciz char was given\n",X)
#define ERROR_LABEL_LENGTH(X) printf("ERROR: In line %d, the label given exceeded the maximum length of a valid label\n",X)
#define ERROR_EXTERN_ENTRY_MIX(X,Y) printf("ERROR: In line %d, the label \"%s\" was assigned for the second time and is now assigned both extern and entry\n",X,Y)
#define ERROR_INVALID_DIRECTIVE_ARG(X) printf("ERROR: In line %d,a an invalid directive arg was inserted\n",X)
#define ERROR_INVALID_INSTRUCTION_ARG(X) printf("ERROR: In line %d,a an invalid instruction arg was inserted\n",X)
#define ERROR_MISSING_COMMA(X) printf("ERROR: In line %d, a comma that was required, was missing\n",X)
#define ERROR_FIRST_LETTER_DIGIT(X) printf("ERROR: In line %d, an argument was started invalidly with a digit\n",X)
#define ERROR_REG_OUT_OF_BOUNDS(X) printf("ERROR: In line %d, registry given as an arg is out of the reg bounds\n",X)
#define ERROR_INVALID_REG_NAME(X) printf("ERROR: In line %d, an invalid registry name was given\n",X)
#define ERROR_EXTRANEOUS_END_OF_CMD(X) printf("ERROR: In line %d, extraneous text after end of command was found\n",X)
#define COMMA_WITHOUT_DATA(X) printf("ERROR: In line %d, a comma was given without a data prior to it\n",X)
#define ERROR_LABEL_WITHOUT_SPACE(X) printf("ERROR: In line %d,a line that started with label didn't have space after\n",X)
#define ERROR_EMPTY_LABEL(X) printf("ERROR: In line %d,a line that started with label didn't have any arguments\n",X)
#define ERROR_EMPTY_INSTRUCTION(X) printf("ERROR: In line %d,instruction received no arguments while needed\n",X)
#define ERROR_OP_WITHOUT_DIGIT(X) printf("ERROR: In line %d,a arithmetic operator was given without a following digit\n",X)
#define ERROR_IMPROPER_ARIT_OPS(X) printf("ERROR: In line %d, arithmetic signs were improperly placed\n",X)
#define ERROR_NUMBER_OUT_OF_BOUNDS(X) printf("ERROR: In line %d,the number that was given was out of bounds\n",X)
#define ERROR_MISSING_OP_QUOTATION(X) printf("ERROR: In line %d, quotation were missing from the beginning of the asciz argument\n",X)
#define ERROR_MISSING_CL_QUOTATION(X) printf("ERROR: In line %d, quotation were missing from the end of the asciz argument\n",X)
#define ERROR_UNUSED_LABEL(X) printf("ERROR: In line %d, a label that was given as an argument was never defined\n",X)
#define ERROR_ATTRIBUTE_ASSIGN(X) printf("ERROR: In line %d,an invalid attribute assign to an existing label was found\n",X)
#define ERROR_EXTERN_I_BRANCH(X,Y) printf("ERROR: In line %d the label \"%s\" was defined as external yet tried to be jumped to locally\n",X,Y)
#define ERROR_JUMP_OUT_OF_BOUNDS(X) printf("ERROR: In line %d the jumping destination was out of bounds",X)
#define ERROR_MEMORY_ALLOCATION(X) printf("ERROR: system couldn't allocate space for \"%s\" file on the disk\n",X)
#define ERROR_MISSING_REG(X) printf("ERROR: In line %d, a parameter of registry was missing from the instruction\n",X)
#define ERROR_MISSING_DIRECTIVE_ARG(X) printf("ERROR: In line %d, a directive needed arguments but received none\n",X)
#endif /*MAMAN14_ERRORSHEADER_H*/