le compilateur super performant
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

yacc_util.h 1.2KB

  1. #include "symbol_table.h"
  2. #include "asm_instructions.h"
  3. #ifndef COMPILATOR_2000_YACC_UTIL_H
  4. #define COMPILATOR_2000_YACC_UTIL_H
  5. typedef struct Condition {
  6. Instruction instruction;
  7. int not;
  8. } Condition;
  9. void write_affectation(SymbolTable* symbolTable, InstructionTable *instructionTable, char* symbol_dest, SymbolItem* src);
  10. const SymbolItem* write_op(SymbolTable* symbol_table, InstructionTable *instruction_table, Instruction instruction, SymbolItem *op1, SymbolItem *op2);
  11. const SymbolItem* write_negation(SymbolTable* symbol_table, InstructionTable *instruction_table, SymbolItem *op2);
  12. const SymbolItem* init_temp_symbol(SymbolTable* symbol_table, InstructionTable *instruction_table, int constant);
  13. void write_print(InstructionTable *instruction_table, SymbolItem *src);
  14. int update_jmf(InstructionTable *table, int address);
  15. int write_jmf(InstructionTable *table, SymbolItem* cond);
  16. const SymbolItem* write_not_condition(SymbolTable* symbol_table, InstructionTable *table, const SymbolItem* cond);
  17. const SymbolItem* write_condition(SymbolTable* symbol_table, InstructionTable *table, Condition* op, SymbolItem* cond1, SymbolItem* cond2);
  18. #endif //COMPILATOR_2000_YACC_UTIL_H