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.

symbol_table.h 443B

12345678910111213141516171819202122232425
  1. #ifndef SYMBOL_TABLE_H_INCLUDED
  2. #define SYMBOL_TABLE_H_INCLUDED
  3. #define SYMBOL_TABLE_SIZE 100
  4. enum Type {
  5. TYPE_CONST,
  6. TYPE_INT
  7. };
  8. struct SymbolItem {
  9. enum Type type;
  10. char* name;
  11. int address;
  12. int init;
  13. };
  14. typedef struct SymbolTable {
  15. struct SymbolIte table[SYMBOL_TABLE_SIZE];
  16. int index;
  17. } SymbolTable;
  18. void add_symbol(SymbolTable table, enum Type type, char* name);
  19. #endif /* !SYMBOL_TABLE_H_INCLUDED */