1 19 20 package org.netbeans.modules.db.sql.editor; 21 22 import org.netbeans.editor.BaseTokenCategory; 23 import org.netbeans.editor.BaseTokenID; 24 import org.netbeans.editor.TokenID; 25 import org.netbeans.editor.TokenContext; 26 import org.netbeans.editor.TokenContextPath; 27 import org.netbeans.editor.Utilities; 28 29 35 36 public class SQLTokenContext extends TokenContext { 37 38 public static final int ERRORS_ID = 0; 41 public static final int WHITESPACE_ID = ERRORS_ID + 1; public static final int LINE_COMMENT_ID = WHITESPACE_ID + 1; public static final int BLOCK_COMMENT_ID = LINE_COMMENT_ID + 1; public static final int STRING_ID = BLOCK_COMMENT_ID + 1; public static final int INCOMPLETE_STRING_ID = STRING_ID + 1; public static final int IDENTIFIER_ID = INCOMPLETE_STRING_ID + 1; public static final int OPERATOR_ID = IDENTIFIER_ID + 1; public static final int INVALID_COMMENT_END_ID = OPERATOR_ID + 1; public static final int INT_LITERAL_ID = INVALID_COMMENT_END_ID + 1; public static final int DOUBLE_LITERAL_ID = INT_LITERAL_ID + 1; public static final int DOT_ID = DOUBLE_LITERAL_ID + 1; public static final int KEYWORD_ID = DOT_ID + 1; 54 55 public static final BaseTokenCategory ERRORS = 57 new BaseTokenCategory("errors", ERRORS_ID); 59 public static final BaseTokenID WHITESPACE = 61 new BaseTokenID( "whitespace", WHITESPACE_ID ); public static final BaseTokenID LINE_COMMENT = 63 new BaseTokenID( "line-comment", LINE_COMMENT_ID ); public static final BaseTokenID BLOCK_COMMENT = 65 new BaseTokenID( "block-comment", BLOCK_COMMENT_ID ); public static final BaseTokenID STRING = 67 new BaseTokenID( "string-literal", STRING_ID ); public static final BaseTokenID INCOMPLETE_STRING = 69 new BaseTokenID( "incomplete-string-literal", INCOMPLETE_STRING_ID, ERRORS ); public static final BaseTokenID IDENTIFIER = 71 new BaseTokenID( "identifier", IDENTIFIER_ID ); public static final BaseTokenID OPERATOR = 73 new BaseTokenID( "operator", OPERATOR_ID ); public static final BaseTokenID INVALID_COMMENT_END = 75 new BaseTokenID( "invalid-comment-end", INVALID_COMMENT_END_ID, ERRORS ); public static final BaseTokenID INT_LITERAL = 77 new BaseTokenID( "int-literal", INT_LITERAL_ID ); public static final BaseTokenID DOUBLE_LITERAL = 79 new BaseTokenID( "double-literal", DOUBLE_LITERAL_ID ); public static final BaseTokenID DOT = 81 new BaseTokenID( "dot", DOT_ID ); public static final BaseTokenID KEYWORD = 83 new BaseTokenID( "keyword", KEYWORD_ID ); 85 public static final SQLTokenContext context = new SQLTokenContext(); 87 public static final TokenContextPath contextPath = context.getContextPath(); 88 89 92 private SQLTokenContext() { 93 super("sql-"); 95 try { 96 addDeclaredTokenIDs(); 97 } catch (Exception e) { 98 Utilities.annotateLoggable(e); 99 } 100 101 } 102 } 103 | Popular Tags |