/*
 * Copyright © 2014 <code@io7m.com> http://io7m.com
 * 
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
 * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

package com.io7m.jparasol.lexer;

import java.io.IOException;
import java.io.InputStream;

import com.io7m.jequality.annotations.EqualityReference;

/**
 * A simple lexer test program.
 */

@EqualityReference public final class LexerTestMain
{
  /**
   * The main entry point.
   * 
   * @param args
   *          Command line arguments
   * @throws IOException
   *           On I/O errors
   * @throws LexerError
   *           On lexical errors
   */

  public static void main(
    final String[] args)
    throws IOException,
      LexerError
  {
    final InputStream s = System.in;
    assert s != null;
    final Lexer lex = new Lexer(s);

    for (;;) {
      final Token t = lex.token();
      System.out.println(t);
      if (t.getType() == Token.Type.TOKEN_EOF) {
        break;
      }
    }
  }

  private LexerTestMain()
  {

  }
}
