IdentType.h 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. #pragma once
  2. #include "ast.h"
  3. #include "types.h"
  4. #include "machine_x86.h"
  5. struct IDENTTYPE
  6. {
  7. condId idType;
  8. regType regiType; /* for REGISTER only */
  9. union _idNode {
  10. int regiIdx; /* index into localId, REGISTER */
  11. int globIdx; /* index into symtab for GLOB_VAR */
  12. int localIdx; /* idx into localId, LOCAL_VAR */
  13. int paramIdx; /* idx into args symtab, PARAMS */
  14. int idxGlbIdx; /* idx into localId, GLOB_VAR_IDX */
  15. struct _kte
  16. { /* for CONSTANT only */
  17. uint32_t kte; /* value of the constant */
  18. uint8_t size; /* #bytes size constant */
  19. } kte;
  20. uint32_t strIdx; /* idx into image, for STRING */
  21. int longIdx; /* idx into LOCAL_ID table, LONG_VAR*/
  22. struct _call { /* for FUNCTION only */
  23. Function *proc;
  24. STKFRAME *args;
  25. } call;
  26. struct { /* for OTHER; tmp struct */
  27. eReg seg; /* segment */
  28. eReg regi; /* index mode */
  29. int16_t off; /* offset */
  30. } other;
  31. } idNode;
  32. };