package metalexer.jflex;

import java.io.IOException;
import java.io.Reader;

import metalexer.ScannerTestTool;
import test.jflex.metalexer.LayoutParser;
import beaver.Scanner;

public class LayoutScannerTestTool extends ScannerTestTool {
    private LayoutScannerTestTool() {
        super(LayoutParser.Terminals.EOF, LayoutParser.Terminals.NAMES);
    }

    protected Scanner makeScanner(Reader in) {
        return ReflectionHelper.instantiateScanner("test.jflex.metalexer.LayoutScanner", in);
    }

    public static void main(String[] args) {
        if (args.length != 1) {
            System.err.println("Usage: java metalexer.jflex.LayoutScannerTestTool {basename}");
            System.exit(1);
        }
        try {
            new LayoutScannerTestTool().processFile(args[0]);
            System.exit(0);
        } catch(IOException e) {
            e.printStackTrace();
            System.exit(2);
        }
    }
}
