decl.h 722 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef DECL_H
  2. #define DECL_H
  3. #include "val.h"
  4. struct Exp;
  5. struct ExpSeq;
  6. struct Decl{
  7. string ident; //real ident
  8. Val* val; //value of decl
  9. string meta; //meta data
  10. Decl( string id,Val *v );
  11. Decl( string id,Type *ty,CGExp *cg );
  12. void debugDecl( CGDat *d,int blockKind );
  13. void setMetaData( string meta );
  14. string debugEncoding();
  15. static void resolveDecls();
  16. };
  17. struct FunDecl : public Decl{
  18. string sourceinfo;
  19. Scope *scope;
  20. ExpSeq *defaults;
  21. FunDecl( string id,FunType *ty,CGExp *cg,Scope *sc,ExpSeq *defs );
  22. void resolve();
  23. };
  24. struct ConstDecl : public Decl{
  25. string sourceinfo;
  26. Scope *scope;
  27. Exp *exp;
  28. ConstDecl( string id,Type *ty,Scope *sc,Exp *e );
  29. void resolve();
  30. };
  31. #endif