bcc.cpp 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #include "std.h"
  2. #include "parser.h"
  3. #include "output.h"
  4. #include "config.h"
  5. using namespace CG;
  6. int main( int argc,char *argv[] ){
  7. stdutil_init( argc,argv );
  8. int demo_days=demoDays();
  9. if( !opt_infile.size() ){
  10. if( demo_days<0 ){
  11. cout<<"BlitzMax Release Version "<<BCC_VERSION<<endl;
  12. }else if( demo_days<30 ){
  13. cout<<"BlitzMax Demo Version "<<BCC_VERSION<<" ("<<(30-demo_days)<<(demo_days<29 ? " days" : " day")<<" remaining)"<<endl;
  14. }else{
  15. cout<<"BlitzMax Demo Version "<<BCC_VERSION<<" (expired)"<<endl;
  16. }
  17. exit(0);
  18. }
  19. if( demo_days>=30 ){
  20. cout<<"BlitzMax demo has expired. Please visit www.blitzbasic.com to buy the full version of BlitzMax."<<endl;
  21. exit(0);
  22. }
  23. if( !ftime(opt_infile) ) fail( "Input file not found" );
  24. bool t_debug=opt_debug;
  25. Parser parser;
  26. if( opt_verbose ) cout<<"Parsing..."<<endl;
  27. parser.parse();
  28. if( opt_verbose ) cout<<"Resolving types..."<<endl;
  29. Type::resolveTypes();
  30. if( opt_verbose ) cout<<"Resolving decls..."<<endl;
  31. Decl::resolveDecls();
  32. if( opt_verbose ) cout<<"Resolving blocks..."<<endl;
  33. Block::resolveBlocks();
  34. if( opt_verbose ) cout<<"Evaluating fun blocks..."<<endl;
  35. Block::evalFunBlocks();
  36. opt_debug=t_debug;
  37. opt_release=!opt_debug;
  38. if( opt_verbose ) cout<<"Generating assembly..."<<endl;
  39. FunBlock::genAssem();
  40. if( opt_verbose ) cout<<"Generating interface..."<<endl;
  41. FunBlock::genInterface();
  42. return 0;
  43. }