1 19 20 package org.netbeans.modules.lexer.demo.antlr; 21 22 import org.netbeans.api.lexer.TokenCategory; 23 import org.netbeans.api.lexer.TokenId; 24 25 31 32 public class CalcLanguageUtilities { 33 34 private static final CalcLanguage language = CalcLanguage.get(); 35 36 private static final TokenCategory errorCategory = language.getCategory("error"); 37 private static final TokenCategory incompleteCategory = language.getCategory("incomplete"); 38 private static final TokenCategory operatorCategory = language.getCategory("operator"); 39 40 private CalcLanguageUtilities() { 41 } 43 44 49 public static boolean isError(TokenId id) { 50 return errorCategory.isMember(id); 51 } 52 53 58 public static boolean isIncomplete(TokenId id) { 59 return incompleteCategory.isMember(id); 60 } 61 62 67 public static boolean isOperator(TokenId id) { 68 return operatorCategory.isMember(id); 69 } 70 71 } 72 | Popular Tags |