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