home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / jikepg12.zip / jikespg / examples / bnf / Main.java < prev    next >
Encoding:
Java Source  |  1999-11-04  |  1.0 KB  |  33 lines

  1. // $Id: Main.java,v 1.3 1999/11/04 14:02:16 shields Exp $
  2. // This software is subject to the terms of the IBM Jikes Compiler
  3. // License Agreement available at the following URL:
  4. // http://www.ibm.com/research/jikes.
  5. // Copyright (C) 1983, 1999, International Business Machines Corporation
  6. // and others.  All Rights Reserved.
  7. // You must accept the terms of that agreement to use this software.
  8.  
  9. public class Main
  10. {
  11.     public static void main(String[] args) throws java.io.IOException, java.io.FileNotFoundException
  12.     {
  13.         Option option = new Option(args);
  14.         if (option.filename == null)
  15.         {
  16.             System.out.println("No Input File Specified !!!");
  17.             return;
  18.         }
  19.  
  20.         LexStream lex_stream = new LexStream(option.filename);
  21.         Scanner scanner = new Scanner(option, lex_stream);
  22.         scanner.scan();
  23.  
  24.         if (option.dump)
  25.             lex_stream.dump();
  26.  
  27.         Parser parser = new Parser(lex_stream);
  28.         parser.parse();
  29.  
  30.         return;
  31.     }
  32. }
  33.