FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
processing/java/src/processing/mode/java/preproc/TokenUtil.java at master · kybr/processing · GitHub
kybr
processing
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
processing
/
java
/
src
/
processing
/
mode
/
java
/
preproc
/
TokenUtil.java
Copy path
More file actions
More file actions
Latest commit
History
History
History
30 lines (27 loc) · 737 Bytes
Breadcrumbs
processing
/
java
/
src
/
processing
/
mode
/
java
/
preproc
/
TokenUtil.java
Copy path
File metadata and controls
30 lines (27 loc) · 737 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package
processing
.
mode
.
java
.
preproc
;
import
java
.
lang
.
reflect
.
Field
;
import
antlr
.
collections
.
AST
;
import
processing
.
mode
.
java
.
preproc
.
PdeTokenTypes
;
/**
*
* @author Jonathan Feinberg <jdf@pobox.com>
*
*/
public
class
TokenUtil
{
private
static
final
String
[]
tokenNames
=
new
String
[
200
];
static
{
for
(
int
i
=
0
;
i
<
tokenNames
.
length
;
i
++) {
tokenNames
[
i
] =
"ERROR:"
+
i
;
}
for
(
final
Field
f
:
PdeTokenTypes
.
class
.
getDeclaredFields
()) {
try
{
tokenNames
[
f
.
getInt
(
null
)] =
f
.
getName
();
}
catch
(
Exception
unexpected
) {
throw
new
RuntimeException
(
unexpected
);
}
}
}
public
static
String
nameOf
(
final
AST
node
) {
return
tokenNames
[
node
.
getType
()];
}
}
Back
|
FazBrowse Home
|
New Git URL