// This file is copyrighted and is part of nzdis-oql package. // See the file LICENSE for copyright information and the terms and conditions for copying, distributing and modifications of nzdis-oql package. // @copyright@ package nzdis.lang.oql.app; /**/ import nzdis.lang.oql.node.Node; import nzdis.lang.oql.TreeBuilder; import java.io.FileReader; import java.io.FileNotFoundException; /** * Prints on standard output back the ascii representation * of the given OQL file. This is a toy class which demonstrates * the use of ToAscii utility class. * *@author Mariusz Nowostawski *@version @version@ $Revision: 1.1 $ */ public class ToAscii { public static void main(String[] arguments) { if(arguments.length != 1) { System.out.println("usage:"); System.out.println(" java ToAscii filename"); System.exit(1); } try{ Node ast = TreeBuilder.getNode(new FileReader(arguments[0]), true); System.out.println(nzdis.lang.oql.ToAscii.toString(ast)); }catch(Exception ex){ ex.printStackTrace(); return; } } }