/******************************************************************************* * Copyright (c) 2007- VTT Technical Research Centre of Finland. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * VTT Technical Research Centre of Finland - initial API and implementation *******************************************************************************/ package org.simantics.express; import java.io.File; import java.io.FileInputStream; import java.io.InputStream; import org.simantics.express.parser.ExpressParser; public class TestExpress { public static void parse(File file) { try { System.out.println("Parse " + file); InputStream stream = new FileInputStream(file); ExpressParser parser = new ExpressParser(stream); parser.document(); } catch(Exception e) { e.printStackTrace(); } } public static void browse(File dir) { for(File f : dir.listFiles()) if(f.isDirectory()) browse(f); else if(f.getName().endsWith(".exp")) parse(f); } public static void main(String[] args) { try { browse(new File("c:\\Documents and Settings\\Hannu\\My Documents\\express")); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } }