MCPcopy Index your code
hub / github.com/processing/processing / TokenUtil

Class TokenUtil

java/src/processing/mode/java/preproc/TokenUtil.java:12–30  ·  view source on GitHub ↗

@author Jonathan Feinberg <jdf@pobox.com>

Source from the content-addressed store, hash-verified

10 *
11 */
12public class TokenUtil {
13 private static final String[] tokenNames= new String[200];
14 static {
15 for (int i = 0; i < tokenNames.length; i++) {
16 tokenNames[i] = "ERROR:" + i;
17 }
18 for (final Field f : PdeTokenTypes.class.getDeclaredFields()) {
19 try {
20 tokenNames[f.getInt(null)] = f.getName();
21 } catch (Exception unexpected) {
22 throw new RuntimeException(unexpected);
23 }
24 }
25 }
26
27 public static String nameOf(final AST node) {
28 return tokenNames[node.getType()];
29 }
30}

Callers

nothing calls this directly

Calls 2

getIntMethod · 0.65
getNameMethod · 0.45

Tested by

no test coverage detected