Guest User

Untitled

a guest
Jan 30th, 2015
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.38 KB | None | 0 0
  1. /* Syntax: */
  2. /* ^; == code flow up, v; == code flow down, o == 0 code flow down else up. Use C just as normal but only
  3.  * can goto, labels and if be used for control flow. Can not define o or c variable. */
  4.  
  5. #include "main.h"
  6. #include "limitedCompilerO.h"
  7.  
  8.  
  9. const char *CDataTypes[CDataTypesSize] = {
  10.     "char", "int",
  11.     "float", "double",
  12.     "long", "short",
  13.     "signed", "unsigned",
  14.     "const", "static", "auto" // Scope
  15. };
  16.  
  17.  
  18. int main(int argc, char *argv[])
  19. {
  20.     if (argc == 2)
  21.     {
  22.         try
  23.         {
  24.             OCompiler Compiler(&(argv[1]));
  25.             Compiler.RunOCompiler();
  26.         }
  27.         catch (int n)
  28.         {
  29.             switch (n)
  30.             {
  31.                 case 0:
  32.                     cout << "ERROR0:Could not open input file!" << endl;
  33.                     break;
  34.                 case 1:
  35.                     cout << "ERROR1:Can not create a new file" << endl;
  36.                     break;
  37.                     //case 2:
  38.                     //break;
  39.                 default:
  40.                     cout << "Unknown error code:" << n << endl;
  41.                     break;
  42.             }
  43.         }
  44.         catch (exception& e)
  45.         {
  46.             cout << "Standard exception:" << e.what() << endl;
  47.         }
  48.         catch (...)
  49.         {
  50.             cout << "Some unknown exception happened." << endl;
  51.         }
  52.     }
  53.     else
  54.     {
  55.         cout << "This O programing languges compiler needs one file that it needs to compile!\n";
  56.         cout << "Syntax:\n^; == code flow up, v; == code flow down, o == 0 code flow down else up. Use C just as normal but only\ncan goto, labels and if be used for control flow. Can not define o or c variable.";
  57.     }
  58.    
  59.     return 0;
  60. }
Advertisement
Add Comment
Please, Sign In to add comment