1 9 10 package org.netbeans.modules.languages.javascript; 11 12 13 import java.io.IOException ; 14 import java.io.InputStream ; 15 import java.io.PrintWriter ; 16 import java.util.List ; 17 import java.util.Map ; 18 import junit.framework.TestCase; 19 import org.netbeans.modules.languages.Language; 20 import org.netbeans.modules.languages.NBSLanguageReader; 21 import org.netbeans.modules.languages.parser.AnalyserAnalyser; 22 import org.netbeans.modules.languages.parser.ParseException; 23 import org.netbeans.modules.languages.parser.Petra; 24 25 26 30 public class NBSTest extends TestCase { 31 32 public NBSTest (String testName) { 33 super (testName); 34 } 35 36 public void testFirst () { 37 InputStream is = getClass ().getClassLoader ().getResourceAsStream ("org/netbeans/modules/languages/ruby/Ruby.nbs"); 38 try { 39 Language l = NBSLanguageReader.readLanguage ("test", is, "test/mimeType"); 40 List r = l.getAnalyser ().getRules (); 41 Map f = Petra.first (r); 42 AnalyserAnalyser.printDepth (f, null); 43 AnalyserAnalyser.printConflicts (f, null); 44 } catch (ParseException ex) { 46 ex.printStackTrace(); 47 } catch (IOException ex) { 48 ex.printStackTrace(); 49 } 50 } 51 } 52 | Popular Tags |