1 9 10 package org.netbeans.modules.languages.php; 11 12 13 import java.io.IOException ; 14 import java.io.InputStream ; 15 import java.util.List ; 16 import java.util.Map ; 17 import junit.framework.TestCase; 18 19 import org.netbeans.api.languages.ParseException; 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.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/php/PHP.nbs"); 38 try { 39 Language l = NBSLanguageReader.readLanguage ("test", is, "test/x-php"); 40 List r = l.getAnalyser ().getRules (); 41 AnalyserAnalyser.printRules (r, null); 42 Map f = Petra.first2 (r); 43 AnalyserAnalyser.printF (f, null); 46 } catch (ParseException ex) { 47 ex.printStackTrace(); 48 } catch (IOException ex) { 49 ex.printStackTrace(); 50 } 51 } 52 } 53 | Popular Tags |