/* Copyright (C) 1997-2000 Etienne M. Gagnon, M.Sc. . All rights reserved. This work is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This work is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this work in the file "COPYING-LESSER"; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA If you have any question, send an electronic message to Etienne M. Gagnon, M.Sc. , or write to: Etienne M. Gagnon J-Meg inc. 11348 Brunet Montreal-Nord (Quebec) H1G 5G1 Canada If you you want to submit a bug report, or a patch, please visit the SableCC Grammars web site: http://sablecc.sourceforge.net/ If you want to discuss this grammar, please subscribe to the SableCC mailing list. You can find all the necessary information on the SableCC web site at: http://www.sable.mcgill.ca/sablecc/ */ package org.sablecc.sablecc2x; import org.sablecc.sablecc2x.node.*; import org.sablecc.sablecc2x.lexer.*; import org.sablecc.sablecc2x.parser.*; import org.sablecc.sablecc2x.tool.Version; import java.io.*; 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); } Lexer lexer = new Lexer( new PushbackReader( new BufferedReader( new FileReader(arguments[0])), 1024)); Parser parser = new Parser(lexer); Start ast = parser.parse(); System.out.println(ast); } catch(Exception e) { System.out.println(e); System.exit(1); } } }