/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This file is part of J11. * * See the file "J11-LICENSE" for Copyright information and the * * terms and conditions for copying, distribution and * * modification of J11. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ package org.sablecc.java; import java.io.*; import org.sablecc.java.node.*; import org.sablecc.java.lexer.*; import org.sablecc.java.parser.*; import org.sablecc.java.tool.Version; public class Main { public static void main(String[] arguments) { System.out.println(Version.banner()); try { if(arguments.length != 1) { System.out.println("usage:"); System.out.println(" java Main filename"); System.exit(1); } UnicodePreprocessor preprocessor = new UnicodePreprocessor( new PushbackReader( new BufferedReader( new FileReader(arguments[0])), 1024)); Lexer lexer = new Lexer(new PushbackReader(preprocessor, 1024)); Parser parser = new Parser(lexer); Start ast = parser.parse(); System.out.println(ast); } catch(Exception e) { e.printStackTrace(); System.out.println(e); System.exit(1); } } } // Just a test...