1 19 20 package org.netbeans.lib.lexer.test.state; 21 22 import java.util.Collection ; 23 import java.util.EnumSet ; 24 import org.netbeans.api.lexer.Language; 25 import org.netbeans.api.lexer.TokenId; 26 import org.netbeans.spi.lexer.LanguageHierarchy; 27 import org.netbeans.spi.lexer.Lexer; 28 import org.netbeans.spi.lexer.LexerRestartInfo; 29 30 33 public enum StateTokenId implements TokenId { 34 35 A, 36 BMULTI, 37 ERROR; 38 39 StateTokenId() { 40 } 41 42 public String primaryCategory() { 43 return null; 44 } 45 46 47 private static final Language<StateTokenId> lang = new LanguageHierarchy<StateTokenId>() { 48 49 @Override 50 protected String mimeType() { 51 return "text/x-simple"; 52 } 53 54 @Override 55 protected Collection <StateTokenId> createTokenIds() { 56 return EnumSet.allOf(StateTokenId.class); 57 } 58 59 @Override 60 protected Lexer<StateTokenId> createLexer(LexerRestartInfo<StateTokenId> info) { 61 return new StateLexer(info); 62 } 63 64 }.language(); 65 66 public static Language<StateTokenId> language() { 67 return lang; 68 } 69 70 } 71 | Popular Tags |