1 20 21 package JFlex; 22 23 import java.text.MessageFormat ; 24 import java.util.MissingResourceException ; 25 import java.util.ResourceBundle ; 26 27 28 36 public class ErrorMessages { 37 private String key; 38 39 private static final ResourceBundle RESOURCE_BUNDLE = 40 ResourceBundle.getBundle("JFlex.Messages"); 41 42 private ErrorMessages(String key) { 43 this.key = key; 44 } 45 46 public static String get(ErrorMessages msg) { 47 try { 48 return RESOURCE_BUNDLE.getString(msg.key); 49 } catch (MissingResourceException e) { 50 return '!' + msg.key + '!'; 51 } 52 } 53 54 public static String get(ErrorMessages msg, String data) { 55 Object [] args = { data }; 56 return MessageFormat.format(get(msg),args); 57 } 58 59 public static String get(ErrorMessages msg, String data1, String data2) { 60 Object [] args = { data1, data2 }; 61 return MessageFormat.format(get(msg),args); 62 } 63 64 public static String get(ErrorMessages msg, int data) { 65 Object [] args = { new Integer (data) }; 66 return MessageFormat.format(get(msg),args); 67 } 68 69 public static ErrorMessages UNTERMINATED_STR = new ErrorMessages("UNTERMINATED_STR"); 71 public static ErrorMessages EOF_WO_ACTION = new ErrorMessages("EOF_WO_ACTION"); 72 public static ErrorMessages EOF_SINGLERULE = new ErrorMessages("EOF_SINGLERULE"); 73 public static ErrorMessages UNKNOWN_OPTION = new ErrorMessages("UNKNOWN_OPTION"); 74 public static ErrorMessages UNEXPECTED_CHAR = new ErrorMessages("UNEXPECTED_CHAR"); 75 public static ErrorMessages UNEXPECTED_NL = new ErrorMessages("UNEXPECTED_NL"); 76 public static ErrorMessages LEXSTATE_UNDECL = new ErrorMessages("LEXSTATE_UNDECL"); 77 public static ErrorMessages STATE_IDENT_EXP = new ErrorMessages("STATE_IDENT_EXP"); 78 public static ErrorMessages REPEAT_ZERO = new ErrorMessages("REPEAT_ZERO"); 79 public static ErrorMessages REPEAT_GREATER = new ErrorMessages("REPEAT_GREATER"); 80 public static ErrorMessages REGEXP_EXPECTED = new ErrorMessages("REGEXP_EXPECTED"); 81 public static ErrorMessages MACRO_UNDECL = new ErrorMessages("MACRO_UNDECL"); 82 public static ErrorMessages CHARSET_2_SMALL = new ErrorMessages("CHARSET_2_SMALL"); 83 public static ErrorMessages CS2SMALL_STRING = new ErrorMessages("CS2SMALL_STRING"); 84 public static ErrorMessages CS2SMALL_CHAR = new ErrorMessages("CS2SMALL_CHAR"); 85 public static ErrorMessages CHARCLASS_MACRO = new ErrorMessages("CHARCLASS_MACRO"); 86 public static ErrorMessages UNKNOWN_SYNTAX = new ErrorMessages("UNKNOWN_SYNTAX"); 87 public static ErrorMessages SYNTAX_ERROR = new ErrorMessages("SYNTAX_ERROR"); 88 public static ErrorMessages NOT_AT_BOL = new ErrorMessages("NOT_AT_BOL"); 89 public static ErrorMessages NO_MATCHING_BR = new ErrorMessages("NO_MATCHING_BR"); 90 public static ErrorMessages EOF_IN_ACTION = new ErrorMessages("EOF_IN_ACTION"); 91 public static ErrorMessages EOF_IN_COMMENT = new ErrorMessages("EOF_IN_COMMENT"); 92 public static ErrorMessages EOF_IN_STRING = new ErrorMessages("EOF_IN_STRING"); 93 public static ErrorMessages EOF_IN_MACROS = new ErrorMessages("EOF_IN_MACROS"); 94 public static ErrorMessages EOF_IN_STATES = new ErrorMessages("EOF_IN_STATES"); 95 public static ErrorMessages EOF_IN_REGEXP = new ErrorMessages("EOF_IN_REGEXP"); 96 public static ErrorMessages UNEXPECTED_EOF = new ErrorMessages("UNEXPECTED_EOF"); 97 public static ErrorMessages NO_LEX_SPEC = new ErrorMessages("NO_LEX_SPEC"); 98 public static ErrorMessages NO_LAST_ACTION = new ErrorMessages("NO_LAST_ACTION"); 99 public static ErrorMessages LOOKAHEAD_ERROR = new ErrorMessages("LOOKAHEAD_ERROR"); 100 public static ErrorMessages NO_DIRECTORY = new ErrorMessages("NO_DIRECTORY"); 101 public static ErrorMessages NO_SKEL_FILE = new ErrorMessages("NO_SKEL_FILE"); 102 public static ErrorMessages WRONG_SKELETON = new ErrorMessages("WRONG_SKELETON"); 103 public static ErrorMessages OUT_OF_MEMORY = new ErrorMessages("OUT_OF_MEMORY"); 104 public static ErrorMessages QUIL_INITTHROW = new ErrorMessages("QUIL_INITTHROW"); 105 public static ErrorMessages QUIL_EOFTHROW = new ErrorMessages("QUIL_EOFTHROW"); 106 public static ErrorMessages QUIL_YYLEXTHROW = new ErrorMessages("QUIL_YYLEXTHROW"); 107 public static ErrorMessages ZERO_STATES = new ErrorMessages("ZERO_STATES"); 108 public static ErrorMessages NO_BUFFER_SIZE = new ErrorMessages("NO_BUFFER_SIZE"); 109 public static ErrorMessages NOT_READABLE = new ErrorMessages("NOT_READABLE"); 110 public static ErrorMessages FILE_CYCLE = new ErrorMessages("FILE_CYCLE"); 111 public static ErrorMessages FILE_WRITE = new ErrorMessages("FILE_WRITE"); 112 public static ErrorMessages QUIL_SCANERROR = new ErrorMessages("QUIL_SCANERROR"); 113 public static ErrorMessages NEVER_MATCH = new ErrorMessages("NEVER_MATCH"); 114 public static ErrorMessages QUIL_THROW = new ErrorMessages("QUIL_THROW"); 115 public static ErrorMessages EOL_IN_CHARCLASS = new ErrorMessages("EOL_IN_CHARCLASS"); 116 public static ErrorMessages QUIL_CUPSYM = new ErrorMessages("QUIL_CUPSYM"); 117 public static ErrorMessages CUPSYM_AFTER_CUP = new ErrorMessages("CUPSYM_AFTER_CUP"); 118 public static ErrorMessages ALREADY_RUNNING = new ErrorMessages("ALREADY_RUNNING"); 119 public static ErrorMessages CANNOT_READ_SKEL = new ErrorMessages("CANNOT_READ_SKEL"); 120 public static ErrorMessages READING_SKEL = new ErrorMessages("READING_SKEL"); 121 public static ErrorMessages SKEL_IO_ERROR = new ErrorMessages("SKEL_IO_ERROR"); 122 public static ErrorMessages SKEL_IO_ERROR_DEFAULT = new ErrorMessages("SKEL_IO_ERROR_DEFAULT"); 123 public static ErrorMessages READING = new ErrorMessages("READING"); 124 public static ErrorMessages CANNOT_OPEN = new ErrorMessages("CANNOT_OPEN"); 125 public static ErrorMessages NFA_IS = new ErrorMessages("NFA_IS"); 126 public static ErrorMessages NFA_STATES = new ErrorMessages("NFA_STATES"); 127 public static ErrorMessages DFA_TOOK = new ErrorMessages("DFA_TOOK"); 128 public static ErrorMessages DFA_IS = new ErrorMessages("DFA_IS"); 129 public static ErrorMessages MIN_TOOK = new ErrorMessages("MIN_TOOK"); 130 public static ErrorMessages MIN_DFA_IS = new ErrorMessages("MIN_DFA_IS"); 131 public static ErrorMessages WRITE_TOOK = new ErrorMessages("WRITE_TOOK"); 132 public static ErrorMessages TOTAL_TIME = new ErrorMessages("TOTAL_TIME"); 133 public static ErrorMessages IO_ERROR = new ErrorMessages("IO_ERROR"); 134 public static ErrorMessages THIS_IS_JFLEX = new ErrorMessages("THIS_IS_JFLEX"); 135 public static ErrorMessages UNKNOWN_COMMANDLINE = new ErrorMessages("UNKNOWN_COMMANDLINE"); 136 public static ErrorMessages MACRO_CYCLE = new ErrorMessages("MACRO_CYCLE"); 137 public static ErrorMessages MACRO_DEF_MISSING = new ErrorMessages("MACRO_DEF_MISSING"); 138 public static ErrorMessages PARSING_TOOK = new ErrorMessages("PARSING_TOOK"); 139 public static ErrorMessages NFA_TOOK = new ErrorMessages("NFA_TOOK"); 140 }
| Popular Tags
|