KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > languages > html > NBSTest


1 /*
2  * NBSTest.java
3  *
4  * Created on September 1, 2006, 2:46 PM
5  *
6  * To change this template, choose Tools | Template Manager
7  * and open the template in the editor.
8  */

9
10 package org.netbeans.modules.languages.html;
11
12
13 import java.io.IOException JavaDoc;
14 import java.io.InputStream JavaDoc;
15 import java.util.List JavaDoc;
16 import java.util.Map JavaDoc;
17 import junit.framework.TestCase;
18
19 import org.netbeans.api.languages.ParseException;
20 import org.netbeans.api.languages.ParseException;
21 import org.netbeans.modules.languages.Language;
22 import org.netbeans.modules.languages.Language;
23 import org.netbeans.modules.languages.NBSLanguageReader;
24 import org.netbeans.modules.languages.NBSLanguageReader;
25 import org.netbeans.modules.languages.parser.AnalyserAnalyser;
26 import org.netbeans.modules.languages.parser.Petra;
27
28
29 /**
30  *
31  * @author Jan Jancura
32  */

33 public class NBSTest extends TestCase {
34     
35     public NBSTest (String JavaDoc testName) {
36         super (testName);
37     }
38     
39     public void testFirst () {
40         InputStream JavaDoc is = getClass ().getClassLoader ().getResourceAsStream ("org/netbeans/modules/languages/html/HTML.nbs");
41         try {
42             Language l = NBSLanguageReader.readLanguage ("test", is, "test/html");
43             List JavaDoc r = l.getAnalyser ().getRules ();
44             AnalyserAnalyser.printRules (r, null);
45             Map JavaDoc f = Petra.first2 (r);
46             //AnalyserAnalyser.printDepth (f, null);
47
//AnalyserAnalyser.printConflicts (f, null);
48
AnalyserAnalyser.printF (f, null);
49         } catch (ParseException ex) {
50             ex.printStackTrace();
51         } catch (IOException JavaDoc ex) {
52             ex.printStackTrace();
53         }
54     }
55 }
56
Popular Tags