1 2 package org.netbeans.modules.lexer.demo.handcoded.link; 3 4 import org.netbeans.api.lexer.Lexer; 5 import org.netbeans.api.lexer.TokenId; 6 import org.netbeans.spi.lexer.AbstractLanguage; 7 8 public class LinkLanguage extends AbstractLanguage { 9 10 11 private static LinkLanguage INSTANCE; 12 13 14 public static synchronized LinkLanguage get() { 15 if (INSTANCE == null) 16 INSTANCE = new LinkLanguage(); 17 18 return INSTANCE; 19 } 20 21 public static final int TEXT_INT = 1; 22 public static final int HTTP_URI_INT = 2; 23 public static final int FTP_URI_INT = 3; 24 public static final int URI_INT = 4; 25 26 27 public static final TokenId FTP_URI = new TokenId("ftp-uri", FTP_URI_INT, new String []{"uri"}); public static final TokenId HTTP_URI = new TokenId("http-uri", HTTP_URI_INT, new String []{"uri"}); public static final TokenId TEXT = new TokenId("text", TEXT_INT); public static final TokenId URI = new TokenId("uri", URI_INT, new String []{"uri"}); 32 LinkLanguage() { 33 } 34 35 public Lexer createLexer() { 36 return new LinkLexer(); 37 } 38 39 } 40 | Popular Tags |