1
+ // COMPILE THIS FILE WITH GRAMMARKIT PLUGIN FOR INTELLIJ
2
+ // (JFLEX 1.7.0)
3
+ // OR ELSE IT WON'T FUCKING WORK
1
4
package club.bytecode.the.jda.gui.fileviewer ;
2
5
3
6
import java.io.* ;
4
7
import javax.swing.text.Segment ;
5
8
6
9
import org.fife.ui.rsyntaxtextarea.* ;
7
10
8
-
9
11
/**
10
12
* Scanner the JDA Bytecode.<p >
11
13
*
@@ -64,7 +66,6 @@ import org.fife.ui.rsyntaxtextarea.*;
64
66
public BytecodeTokenizer() {
65
67
}
66
68
67
-
68
69
/**
69
70
* Adds the token specified to the current linked list of tokens.
70
71
*
@@ -73,7 +74,7 @@ import org.fife.ui.rsyntaxtextarea.*;
73
74
*/
74
75
private void addHyperlinkToken(int start, int end, int tokenType) {
75
76
int so = start + offsetShift;
76
- addToken(zzBuffer, start,end, tokenType, so, true );
77
+ addToken(zzBuffer. toString() . toCharArray() , start,end, tokenType, so, true );
77
78
}
78
79
79
80
@@ -95,7 +96,7 @@ import org.fife.ui.rsyntaxtextarea.*;
95
96
*/
96
97
private void addToken(int start, int end, int tokenType) {
97
98
int so = start + offsetShift;
98
- addToken(zzBuffer, start,end, tokenType, so, false );
99
+ addToken(zzBuffer. toString() . toCharArray() , start,end, tokenType, so, false );
99
100
}
100
101
101
102
@@ -142,27 +143,26 @@ import org.fife.ui.rsyntaxtextarea.*;
142
143
public Token getTokenList(Segment text, int initialTokenType, int startOffset) {
143
144
144
145
resetTokenList();
145
- this . offsetShift = - text . offset + startOffset;
146
+ this . offsetShift = startOffset;
146
147
147
148
// Start off in the proper state.
148
149
int state = Token . NULL ;
149
150
switch (initialTokenType) {
150
151
case Token . COMMENT_MULTILINE:
151
152
state = MLC ;
152
- start = text . offset ;
153
+ start = 0 ;
153
154
break ;
154
155
case Token . COMMENT_DOCUMENTATION:
155
156
state = DOCCOMMENT ;
156
- start = text . offset ;
157
+ start = 0 ;
157
158
break ;
158
159
default :
159
160
state = Token . NULL ;
160
161
}
161
162
162
163
s = text;
163
164
try {
164
- yyreset(zzReader);
165
- yybegin(state);
165
+ reset(text, 0 , text. count, state);
166
166
return yylex();
167
167
} catch (IOException ioe) {
168
168
ioe. printStackTrace();
@@ -172,51 +172,6 @@ import org.fife.ui.rsyntaxtextarea.*;
172
172
}
173
173
174
174
175
- /**
176
- * Refills the input buffer.
177
- *
178
- * Note: this is the correct zzRefill. Delete the other one.
179
- *
180
- * @return <code >true</code> if EOF was reached, otherwise
181
- * <code >false</code>.
182
- */
183
- private boolean zzRefill() {
184
- return zzCurrentPos>= s. offset+ s. count;
185
- }
186
-
187
-
188
- /**
189
- * Resets the scanner to read from a new input stream.
190
- * Does not close the old reader.
191
- *
192
- * All internal variables are reset, the old input stream
193
- * <b >cannot</b> be reused (internal buffer is discarded and lost).
194
- * Lexical state is set to <tt >YY_INITIAL</tt>.
195
- *
196
- * Note: this is the correct yyreset. Delete the other one.
197
- *
198
- * @param reader the new input stream
199
- */
200
- public final void yyreset(Reader reader) {
201
- // 's' has been updated.
202
- zzBuffer = s. array;
203
- /*
204
- * We replaced the line below with the two below it because zzRefill
205
- * no longer "refills" the buffer (since the way we do it, it's always
206
- * "full" the first time through, since it points to the segment's
207
- * array). So, we assign zzEndRead here.
208
- */
209
- zzStartRead = zzEndRead = s. offset;
210
- zzStartRead = s. offset;
211
- zzEndRead = zzStartRead + s. count - 1 ;
212
- zzCurrentPos = zzMarkedPos = s. offset;
213
- zzLexicalState = YYINITIAL ;
214
- zzReader = reader;
215
- zzAtBOL = true ;
216
- zzAtEOF = false ;
217
- }
218
-
219
-
220
175
%}
221
176
222
177
Letter = ( [ A- Za- z] )
@@ -346,6 +301,7 @@ URL = (((https?|f(tp|ile))"://"|"www.")({URLCharacters}{URLEndCharacter})?)
346
301
"super" |
347
302
"switch" |
348
303
"synchronized" |
304
+ "synthetic" |
349
305
"this" |
350
306
"throw" |
351
307
"throws" |
0 commit comments