]> gerrit.simantics Code Review - simantics/interop.git/blob - org.simantics.express/src/org/simantics/express/TestExpress.java
Moved /interoperability/branches/dev/* to /interoperability/trunk
[simantics/interop.git] / org.simantics.express / src / org / simantics / express / TestExpress.java
1 /*******************************************************************************\r
2  * Copyright (c) 2007- VTT Technical Research Centre of Finland.\r
3  * All rights reserved. This program and the accompanying materials\r
4  * are made available under the terms of the Eclipse Public License v1.0\r
5  * which accompanies this distribution, and is available at\r
6  * http://www.eclipse.org/legal/epl-v10.html\r
7  *\r
8  * Contributors:\r
9  *     VTT Technical Research Centre of Finland - initial API and implementation\r
10  *******************************************************************************/\r
11 package org.simantics.express;\r
12 \r
13 import java.io.File;\r
14 import java.io.FileInputStream;\r
15 import java.io.InputStream;\r
16 \r
17 import org.simantics.express.parser.ExpressParser;\r
18 \r
19 public class TestExpress {\r
20         \r
21         public static void parse(File file) {\r
22                 try {\r
23                         System.out.println("Parse " + file);\r
24         \r
25                         InputStream stream = new FileInputStream(file);\r
26                         ExpressParser parser = new ExpressParser(stream);\r
27                         parser.document();      \r
28                 } catch(Exception e) {\r
29                         e.printStackTrace();\r
30                 }\r
31         }\r
32         \r
33         public static void browse(File dir) {\r
34                 for(File f : dir.listFiles())\r
35                         if(f.isDirectory())\r
36                                 browse(f);\r
37                         else if(f.getName().endsWith(".exp"))\r
38                                 parse(f);\r
39         }\r
40         \r
41         public static void main(String[] args) {\r
42                 try {\r
43                         browse(new File("c:\\Documents and Settings\\Hannu\\My Documents\\express"));\r
44                 } catch (Exception e) {\r
45                         // TODO Auto-generated catch block\r
46                         e.printStackTrace();\r
47                 }               \r
48         }\r
49 }\r