|
1 |
| |
|
2 |
| |
|
3 |
| |
|
4 |
| |
|
5 |
| |
|
6 |
| |
|
7 |
| |
|
8 |
| |
|
9 |
| |
|
10 |
| |
|
11 |
| |
|
12 |
| |
|
13 |
| |
|
14 |
| |
|
15 |
| package org.apache.hivemind.conditional; |
|
16 |
| |
|
17 |
| import org.apache.hivemind.impl.MessageFormatter; |
|
18 |
| |
|
19 |
| |
|
20 |
| |
|
21 |
| |
|
22 |
| |
|
23 |
| class ConditionalMessages |
|
24 |
| { |
|
25 |
| protected static MessageFormatter _formatter = new MessageFormatter(ConditionalMessages.class); |
|
26 |
| |
|
27 |
1
| public static String unexpectedCharacter(int position, char[] input)
|
|
28 |
| { |
|
29 |
1
| return _formatter.format(
|
|
30 |
| "unexpected-character", |
|
31 |
| new Character(input[position]), |
|
32 |
| new Integer(position + 1), |
|
33 |
| new String(input)); |
|
34 |
| } |
|
35 |
| |
|
36 |
1
| public static String unexpectedEndOfInput(String input)
|
|
37 |
| { |
|
38 |
1
| return _formatter.format("unexpected-end-of-input", input);
|
|
39 |
| } |
|
40 |
| |
|
41 |
1
| public static String unexpectedToken(TokenType expected, TokenType actual, String input)
|
|
42 |
| { |
|
43 |
1
| return _formatter.format("unexpected-token", expected, actual, input);
|
|
44 |
| } |
|
45 |
| |
|
46 |
3
| public static String unparsedToken(Token token, String input)
|
|
47 |
| { |
|
48 |
3
| return _formatter.format("unparsed-token", token, input);
|
|
49 |
| } |
|
50 |
| } |