IdentType.h 1.0 KB

123456789101112131415161718192021222324252627282930
  1. #pragma once
  2. #include "ast.h"
  3. #include "types.h"
  4. #include "machine_x86.h"
  5. struct GlobalVariable;
  6. struct AstIdent;
  7. struct IDENTTYPE
  8. {
  9. friend struct GlobalVariable;
  10. friend struct Constant;
  11. friend struct AstIdent;
  12. protected:
  13. condId idType;
  14. public:
  15. condId type() {return idType;}
  16. void type(condId t) {idType=t;}
  17. union _idNode {
  18. int localIdx; /* idx into localId, LOCAL_VAR */
  19. int paramIdx; /* idx into args symtab, PARAMS */
  20. uint32_t strIdx; /* idx into image, for STRING */
  21. int longIdx; /* idx into LOCAL_ID table, LONG_VAR*/
  22. struct { /* for OTHER; tmp struct */
  23. eReg seg; /* segment */
  24. eReg regi; /* index mode */
  25. int16_t off; /* offset */
  26. } other;
  27. } idNode;
  28. IDENTTYPE() : idType(UNDEF)
  29. {}
  30. };