as_analyzer.h 542 B

12345678910111213141516171819202122232425
  1. #ifndef FVM_AS_ANALYZER_H_
  2. #define FVM_AS_ANALYZER_H_
  3. #include "as_parser.h"
  4. #include "utils.h"
  5. struct sym_table_entry {
  6. const char * name;
  7. size_t offset;
  8. };
  9. typedef struct sym_table_entry sym_table_entry;
  10. struct sym_table {
  11. int size;
  12. int cap;
  13. struct sym_table_entry *buf;
  14. };
  15. typedef struct sym_table sym_table;
  16. sym_table new_sym_table(allocator* alct);
  17. void sym_table_add(allocator* alct, sym_table* tbl, const char* name, int pos);
  18. sym_table analyze_prog(allocator* alct, prog* prog);
  19. #endif // FVM_AS_ANALYZER_H_