Added some of the implementation but not complete #t51
This commit is contained in:
@ -100,6 +100,8 @@ void emit_function_call(char* result, char* name){
|
|||||||
}
|
}
|
||||||
void emit_return(char* value){
|
void emit_return(char* value){
|
||||||
emit_helper();
|
emit_helper();
|
||||||
|
current->opcode = RETURN;
|
||||||
|
current->operand1 = look_up(cur, name);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
void emit_reserve(char* result, char* type_name, int size){
|
void emit_reserve(char* result, char* type_name, int size){
|
||||||
|
@ -29,8 +29,10 @@ typedef enum {
|
|||||||
CGOTO, // 5
|
CGOTO, // 5
|
||||||
LESSTHEN, // 6 rule 1 + 5
|
LESSTHEN, // 6 rule 1 + 5
|
||||||
EQUALTO, // 6 rule 1 + 5
|
EQUALTO, // 6 rule 1 + 5
|
||||||
|
CALL, // 7
|
||||||
PARAM, // 7
|
PARAM, // 7
|
||||||
CALL // 7
|
RETURN // 7
|
||||||
|
|
||||||
|
|
||||||
} Op;
|
} Op;
|
||||||
typedef struct Instruction {
|
typedef struct Instruction {
|
||||||
|
Reference in New Issue
Block a user