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