1 9 10 package org.netbeans.modules.languages.velocity; 11 12 import java.io.IOException ; 13 import java.io.InputStream ; 14 import java.util.List ; 15 import java.util.Map ; 16 import junit.framework.TestCase; 17 18 import org.netbeans.api.languages.ParseException; 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.Petra; 23 24 25 29 public class NBSTest extends TestCase { 30 31 public NBSTest (String testName) { 32 super (testName); 33 } 34 35 public void testFirst () { 36 InputStream is = getClass ().getClassLoader ().getResourceAsStream ("org/netbeans/modules/languages/velocity/Velocity.nbs"); 37 try { 38 Language l = NBSLanguageReader.readLanguage ("test", is, "test/x-velocity"); 39 List r = l.getAnalyser ().getRules (); 40 AnalyserAnalyser.printRules (r, null); 41 Map f = Petra.first2 (r); 42 AnalyserAnalyser.printF (f, null); 45 } catch (ParseException ex) { 46 ex.printStackTrace(); 47 } catch (IOException ex) { 48 ex.printStackTrace(); 49 } 50 } 51 } 52 | Popular Tags |