equal
deleted
inserted
replaced
60 |
60 |
61 /** The names of all tokens. |
61 /** The names of all tokens. |
62 */ |
62 */ |
63 private Name[] tokenName = new Name[TokenKind.values().length]; |
63 private Name[] tokenName = new Name[TokenKind.values().length]; |
64 |
64 |
65 public static final Context.Key<Tokens> tokensKey = |
65 public static final Context.Key<Tokens> tokensKey = new Context.Key<>(); |
66 new Context.Key<Tokens>(); |
|
67 |
66 |
68 public static Tokens instance(Context context) { |
67 public static Tokens instance(Context context) { |
69 Tokens instance = context.get(tokensKey); |
68 Tokens instance = context.get(tokensKey); |
70 if (instance == null) |
69 if (instance == null) |
71 instance = new Tokens(context); |
70 instance = new Tokens(context); |
314 /** tags constants **/ |
313 /** tags constants **/ |
315 enum Tag { |
314 enum Tag { |
316 DEFAULT, |
315 DEFAULT, |
317 NAMED, |
316 NAMED, |
318 STRING, |
317 STRING, |
319 NUMERIC; |
318 NUMERIC |
320 } |
319 } |
321 |
320 |
322 /** The token kind */ |
321 /** The token kind */ |
323 public final TokenKind kind; |
322 public final TokenKind kind; |
324 |
323 |