#include <Line.h>
Public Member Functions | |
Line () | |
Basic Constructor. | |
Line (MyString copy) | |
Constructor with initial line sent in. | |
Line (MyString copy, int number) | |
Constructor with initial line sent in. | |
void | Set_Counter (int set) |
Allows the user to set the address of the line. | |
void | Pass_One () |
Makes the Line run pass one on itself. | |
void | Pass_Two () |
Makes the Line run pass two on itself. | |
char * | Ret_Line () |
Returns the original contents of the Line. | |
char * | Ret_Label () |
Returns the label of the Line. | |
bool | Ret_If_Op () |
Returns if the line is an operation. | |
bool | Op1_Finished () |
bool | Op2_Finished () |
bool | Op3_Finished () |
bool | Op4_Finished () |
bool | All_Ops_Finished () |
int | Ret_Add_Count () |
void | Ret_Opcode (MyString &store) |
void | Ret_Operand1 (MyString &store) |
void | Ret_Operand2 (MyString &store) |
void | Ret_Operand3 (MyString &store) |
void | Ret_Operand4 (MyString &store) |
void | Set_Error (int num) |
int | Ret_Err1 () |
int | Ret_Err2 () |
int | Ret_Err3 () |
int | Ret_Command_Size () |
void | operator= (Line &toCopy) |
Private Member Functions | |
bool | checkLabel (MyString &inLabel) |
long long | pow (int x, int y) |
void | analyzeOperand (MyString &operand, MyString &type, bool &doneFlag) |
A function variable Temporarily stores the operand input so that it can be edited to test for an immediate value.A function variableA function variableA function variable The value we have calculated so far from the operand. If a number is read successfully, this will be converted into little endian hex. A function variable The last character of the operand input. A function variable Keeps track of whether there has been an illegal character in the input, when reading for immediate. A function variable Keeps track of the current Byte's decimal value. A function variable The current Byte's hex value. Needed as an intermediate step between the decimal value and the operand output.A function variable Temporary Mystring ValueA function variable Temporarily stores a value returned from the symbol table. A function variable Temporarily stores the usage of the label, so that we know whether is is MEM32 or IMM32. | |
void | to_hex (char ch, MyString &returned_string) |
void | Parse_Quotes () |
bool | removeWord (MyString &instring, MyString &word, char ch) |
void | removeWhiteSpace (MyString &instring) |
Private Attributes | |
MyString | original |
MyString | label |
bool | op_or_dir |
int | address_counter |
int | command_size |
int | line_number |
MyString | opcode |
MyString | operand_1 |
MyString | operand_2 |
MyString | operand_3 |
MyString | operand_4 |
MyString | workable_string |
bool | op1_finished |
bool | op2_finished |
bool | op3_finished |
bool | op4_finished |
int | error_1 |
int | error_2 |
int | error_3 |
|
Basic Constructor. This constructor initiallizes an empty, unedited line. All of the fields are initiallized accordingly. |
|
Constructor with initial line sent in. This constructor takes in a MyString which holds the unedited contents of the line (
|
|
Constructor with initial line sent in. This constructor takes in a MyString which holds the unedited contents of the line (param copy) and a line number to be fixed with this line (
|
|
|
|
A function variable Temporarily stores the operand input so that it can be edited to test for an immediate value.A function variableA function variableA function variable The value we have calculated so far from the operand. If a number is read successfully, this will be converted into little endian hex. A function variable The last character of the operand input. A function variable Keeps track of whether there has been an illegal character in the input, when reading for immediate. A function variable Keeps track of the current Byte's decimal value. A function variable The current Byte's hex value. Needed as an intermediate step between the decimal value and the operand output.A function variable Temporary Mystring ValueA function variable Temporarily stores a value returned from the symbol table. A function variable Temporarily stores the usage of the label, so that we know whether is is MEM32 or IMM32. Holds all possible hex values so that the pointer characters can be validated. Holds 0 so that I can use the MyString append operation. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Makes the Line run pass one on itself. This runs the various methods which parse and tokenize the line. It gets as much of the opcode finished as possible, and sets booleans to mark how much still needs to be done. It also changes other variables to match the post-pass one state of the Line. |
|
Makes the Line run pass two on itself. This runs the various methods which finalize the line and outputs it to an object file. It also changes other variables to match the post-pass two state of the Line. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Returns if the line is an operation. This function returns true if the Line is an operation. A return of false implies a derictive or an empty Line. |
|
Returns the label of the Line. This function returns the label of the Line in the form of a character string. This can be caught by a MyString by using the = operator. |
|
Returns the original contents of the Line. This function returns the original Line (or in the case is has been copied from another Line, the copied original Line) in the form of a character string. This can be caught by a MyString by using the = operator. |
|
|
|
|
|
|
|
|
|
|
|
Allows the user to set the address of the line. This procedure takes an integer (
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|