1 19 20 package org.netbeans.lib.lexer; 21 22 import org.netbeans.api.lexer.Language; 23 import org.netbeans.api.lexer.TokenChange; 24 import org.netbeans.api.lexer.TokenHierarchyEvent; 25 import org.netbeans.api.lexer.TokenHierarchy; 26 import org.netbeans.api.lexer.TokenId; 27 import org.netbeans.lib.lexer.inc.TokenChangeInfo; 28 import org.netbeans.lib.lexer.inc.TokenHierarchyEventInfo; 29 import org.netbeans.spi.lexer.LanguageHierarchy; 30 31 32 38 39 public abstract class LexerApiPackageAccessor { 40 41 private static LexerApiPackageAccessor INSTANCE; 42 43 public static LexerApiPackageAccessor get() { 44 return INSTANCE; 45 } 46 47 53 public static void register(LexerApiPackageAccessor accessor) { 54 if (INSTANCE != null) { 55 throw new IllegalStateException ("Already registered"); } 57 INSTANCE = accessor; 58 } 59 60 public abstract <T extends TokenId> Language<T> createLanguage( 61 LanguageHierarchy<T> languageHierarchy); 62 63 public abstract <T extends TokenId> LanguageHierarchy<T> languageHierarchy( 64 Language<T> language); 65 66 public abstract <I> TokenHierarchy<I> createTokenHierarchy( 67 TokenHierarchyOperation<I,?> tokenHierarchyOperation); 68 69 public abstract TokenHierarchyEvent createTokenChangeEvent( 70 TokenHierarchyEventInfo info); 71 72 public abstract <T extends TokenId> TokenChange<T> createTokenChange( 73 TokenChangeInfo<T> info); 74 75 public abstract <T extends TokenId> TokenChangeInfo<T> tokenChangeInfo( 76 TokenChange<T> tokenChange); 77 78 public abstract <I> TokenHierarchyOperation<I,?> tokenHierarchyOperation( 79 TokenHierarchy<I> tokenHierarchy); 80 81 } 82 | Popular Tags |