environ.h 728 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. An environ represent a stack frame block.
  3. */
  4. #ifndef ENVIRON_H
  5. #define ENVIRON_H
  6. #include "type.h"
  7. #include "decl.h"
  8. #include "label.h"
  9. class Environ{
  10. public:
  11. int level;
  12. DeclSeq *decls;
  13. DeclSeq *funcDecls;
  14. DeclSeq *typeDecls;
  15. vector<Type*> types;
  16. vector<Label*> labels;
  17. Environ *globals;
  18. Type *returnType;
  19. string funcLabel,breakLabel;
  20. list<Environ*> children; //for delete!
  21. Environ( const string &f,Type *r,int l,Environ *gs );
  22. ~Environ();
  23. Decl *findDecl( const string &s );
  24. Decl *findFunc( const string &s );
  25. Type *findType( const string &s );
  26. Label *findLabel( const string &s );
  27. Label *insertLabel( const string &s,int def,int src,int sz );
  28. string setBreak( const string &s );
  29. };
  30. #endif