home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 20 / AACD20.BIN / AACD / Programming / Jikes / Source / src / jikes.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2001-03-03  |  4.6 KB  |  110 lines

  1. // $Id: jikes.cpp,v 1.79 2001/02/27 20:22:52 mdejong Exp $
  2. //
  3. // This software is subject to the terms of the IBM Jikes Compiler
  4. // License Agreement available at the following URL:
  5. // http://www.ibm.com/research/jikes.
  6. // Copyright (C) 1996, 1999, International Business Machines Corporation
  7. // and others.  All Rights Reserved.
  8. // You must accept the terms of that agreement to use this software.
  9. //
  10.  
  11. /*
  12. #include <iostream.h>
  13. #include <assert.h>
  14. #include <stdio.h>
  15. */
  16.  
  17. #include "platform.h"
  18. #include "jikesapi.h"
  19.  
  20. #ifdef    HAVE_JIKES_NAMESPACE
  21. using namespace Jikes;
  22. #endif
  23.  
  24. #ifdef __amigaos__
  25. // Jikes definitely needs more than the default 4K stack. Without ICU support,
  26. // about 8K seem to be enough. With ICU support stack requirements rise to
  27. // about 26K, so we round this value up to 30K to play it safe.
  28. extern "C" {
  29.   unsigned long __stack = 30000;
  30. }
  31. #endif
  32.  
  33. int main(int argc, char *argv[])
  34. {
  35.     // Here we are creating instance of default API
  36.     JikesAPI *compiler = new JikesAPI();
  37.  
  38.     int    return_code;    
  39.     char **files = compiler->parseOptions(argc, argv);
  40.     
  41.     if (files)
  42.     {
  43.         return_code = compiler->compile(files);
  44.     }
  45.     else
  46.     {
  47.         fprintf(stderr,
  48.                 "\nJikes Compiler"
  49.                 "\n(C) Copyright IBM Corp. 1997, 2001.\n"
  50.                 "- Licensed Materials - Program Property of IBM - All Rights Reserved.\n\n");
  51.         fprintf(stderr, "%s", StringConstant::U8S_command_format);
  52.         fprintf(stderr,
  53.                 "\n\n"
  54.                 "-classpath path    use path for CLASSPATH\n"
  55.                 "-d dir             write class files in directory dir\n"
  56.                 "-debug             no effect (recognized for compatibility)\n"
  57.                 "-depend | -Xdepend recompile all used classes\n"
  58.                 "-deprecation       report uses of deprecated features\n"
  59. #if defined(HAVE_LIB_ICU_UC) || defined(HAVE_ICONV_H)
  60.                 "-encoding encoding use specified encoding to read source files\n"
  61. # if defined(HAVE_LIB_ICU_UC)
  62.                 "                   this binary requires the ICU library\n"
  63. # endif
  64. #endif
  65.                 "-g                 debug (generate LocalVariableTable)\n"
  66.                 "-nowarn            do not issue warning messages\n"
  67.                 "-nowrite           do not write any class files\n"
  68.                 "-O                 do not write LineNumberTable\n"
  69.                 "-verbose           list files read and written\n"
  70.                 "-Xstdout           redirect output listings to stdout\n"
  71.                 "++                 compile in incremental mode\n"
  72.                 "+B                 do not invoke bytecode generator\n"
  73.                 "+c                 do not discard comments from lexer output\n"
  74.                 "+OLDCSO            perform original Jikes classpath order for compatibility\n"
  75.                 "+D                 report errors immediately in emacs-form without buffering\n"
  76.                 "+DR=filename       generate dependence report in filename\n"
  77.                 "+E                 list errors in emacs-form\n"
  78.                 "+F                 do full dependence check except for Zip and Jar files\n"
  79.                 "+Kname=TypeKeyWord map name to type keyword\n"
  80.                 "+M                 generate makefile dependencies\n"
  81.                 "+P                 pedantic compilation - issues lots of warnings\n"
  82.                 "+Td...d            set value of tab d...d spaces; each d is a decimal digit\n"
  83.                 "+U                 do full dependence check including Zip and Jar files\n"
  84.                 "+Z                 treat cautions as errors\n"
  85. #ifdef JIKES_DEBUG
  86.                 "Debugging options:\n"
  87.                 "+A                 dump AST to standard output\n"
  88.                 "+C                 dump bytecodes to standard output\n"
  89.                 "+L                 dump lexer output (stream of tokens)\n"
  90.                 "+O numbytes        call no-op op_trap() for bytecodes of the given length\n"
  91.                 "+u                 unparse AST; produces Java code for the AST\n"
  92.                 "+ud                unparse AST, with extra debugging information\n"
  93. #endif
  94.                 "\n"
  95.         JIKES_VERSION_STRING
  96.         "\n"
  97.                 "Originally written by Philippe Charles and David Shields \n"
  98.                 "of IBM Research, Jikes is now maintained and refined by the\n"
  99.                 "Jikes Project at:\n"
  100.                 "http://oss.software.ibm.com/developerworks/opensource/jikes\n"
  101.                 "Please consult this URL for more information and to learn \n"
  102.                 "how to report problems.\n");
  103.  
  104.         return_code = 1;
  105.     }
  106.  
  107.     delete compiler;
  108.     return return_code;
  109. }
  110.