std.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef STD_H
  2. #define STD_H
  3. #include "stdutil.h"
  4. #include "declseq.h"
  5. #include "../codegen/codegen.h"
  6. struct Decl;
  7. struct FunBlock;
  8. struct ClassBlock;
  9. struct ModuleType;
  10. extern int strictMode; //strict option : 1=strict, 2=superstrict!
  11. extern FunBlock* mainFun; //main function
  12. extern DeclSeq rootScope; //root scope - moduletype decls
  13. extern DeclSeq objectExports; //exports from this object file
  14. extern DeclSeq moduleExports; //exports from this and imported object files
  15. extern vector<string> objectImports; //'import' directives for object
  16. extern vector<string> moduleImports; //'import' directives for module
  17. extern vector<string> moduleInfos; //'ModuleInfo' directives
  18. extern set<string> importedSources; //source files already imported
  19. extern string globalIdent;
  20. string fixIdent( string id );
  21. void publish( Decl *d );
  22. Val* findGlobal( string id );
  23. CGDat* genCString( string t );
  24. CGDat* genBBString( bstring t );
  25. CGDat* genBBString2( bstring t );
  26. CGDat* genDebugStm( string t );
  27. string mungGlobal( string decl_id );
  28. string mungMember( string class_id,string decl_id );
  29. string mungObjectEntry( string path );
  30. string mungModuleEntry( string modname );
  31. bstring escapeString( bstring t );
  32. bstring unescapeString( bstring t );
  33. void dupid( string id,const char *fmt="Duplicate identifier '%s'" );
  34. void badid( string id,const char *fmt="Identifier '%s' not found" );
  35. void badty( string id,const char *fmt="Type '%s' not found" );
  36. void badmod( string id,const char *fmt="Module '%s' not found" );
  37. #endif