Add 0001-Updates-BstLexer-and-BstParser-based-on-an-ANTLR-run.patch
[debian/jabref.git] / debian / patches / 0001-Updates-BstLexer-and-BstParser-based-on-an-ANTLR-run.patch
1 From a3358c3585f41dd795d8c3ba14bbd8412d7c8c57 Mon Sep 17 00:00:00 2001
2 From: Oliver Kopp <olly98@users.sourceforge.net>
3 Date: Sun, 28 Oct 2012 23:51:22 +0100
4 Subject: [PATCH] Updates BstLexer and BstParser based on an ANTLR run on
5  Bst.g  * renames bst.g to Bst.g  * enables ANTLRv3 in the
6  gradle build. Issue "gradlew generateGrammarSource" to use
7  it.  * Adds Bst.tokens to .gitignore. It is a temporary
8  file.
9
10 ---
11  jabref/build.gradle                              |   25 +
12  jabref/src/java/net/sf/jabref/bst/.gitignore     |    1 +
13  jabref/src/java/net/sf/jabref/bst/Bst.g          |   96 ++
14  jabref/src/java/net/sf/jabref/bst/BstLexer.java  | 1713 ++++++++--------------
15  jabref/src/java/net/sf/jabref/bst/BstParser.java | 1396 ++++++++++--------
16  jabref/src/java/net/sf/jabref/bst/bst.g          |   94 --
17  6 files changed, 1583 insertions(+), 1742 deletions(-)
18  create mode 100644 jabref/src/java/net/sf/jabref/bst/.gitignore
19  create mode 100644 jabref/src/java/net/sf/jabref/bst/Bst.g
20  delete mode 100644 jabref/src/java/net/sf/jabref/bst/bst.g
21
22 --- /dev/null
23 +++ b/src/java/net/sf/jabref/bst/Bst.g
24 @@ -0,0 +1,96 @@
25 +grammar Bst;
26 +
27 +options {
28 +    output=AST;
29 +}
30 +
31 +tokens {
32 +       IDLIST;
33 +       STACK;
34 +       ENTRY;
35 +       COMMANDS;
36 +}
37 +
38 +// applies only to the parser:
39 +@header {// Generated by ANTLR
40 +package net.sf.jabref.bst;}
41 +
42 +// applies only to the lexer:
43 +@lexer::header {// Generated by ANTLR
44 +package net.sf.jabref.bst;}
45 +
46 +program : commands+ -> ^(COMMANDS commands+);
47 +
48 +commands
49 +       : STRINGS^ idList
50 +       | INTEGERS^ idList
51 +       | FUNCTION^ id stack
52 +       | MACRO^ id '{'! STRING '}'!
53 +       | READ^
54 +       | EXECUTE^ '{'! function '}'!
55 +       | ITERATE^ '{'! function '}'!
56 +       | REVERSE^ '{'! function '}'!
57 +       | ENTRY^ idList0 idList0 idList0
58 +       | SORT^;
59 +
60 +identifier
61 +       : IDENTIFIER;
62 +
63 +id
64 +       : '{'! identifier '}'!;
65 +
66 +idList
67 +       : '{' identifier+ '}' -> ^(IDLIST identifier+);
68 +
69 +idList0
70 +       : '{' identifier* '}' -> ^(IDLIST identifier*);
71 +
72 +function
73 +       : '<' | '>' | '=' | '+' | '-' | ':=' | '*' | identifier;
74 +
75 +stack
76 +       : '{' stackitem+ '}' -> ^(STACK stackitem+);
77 +
78 +stackitem
79 +       : function
80 +       | STRING
81 +       | INTEGER
82 +       | QUOTED
83 +       | stack;
84 +
85 +STRINGS : 'STRINGS';
86 +INTEGERS : 'INTEGERS';
87 +FUNCTION : 'FUNCTION';
88 +EXECUTE : 'EXECUTE';
89 +SORT : 'SORT';
90 +ITERATE : 'ITERATE';
91 +REVERSE : 'REVERSE';
92 +ENTRY : 'ENTRY';
93 +READ : 'READ';
94 +MACRO : 'MACRO';
95 +
96 +QUOTED
97 +       : '\'' IDENTIFIER;
98 +
99 +IDENTIFIER
100 +       : LETTER (LETTER|NUMERAL)* ;
101 +
102 +fragment LETTER
103 +       : ('a'..'z'|'A'..'Z'|'.'|'$');
104 +
105 +STRING
106 +       : '"' (~('"'))* '"';
107 +
108 +INTEGER
109 +       : '#' ('+'|'-')? NUMERAL+ ;
110 +
111 +fragment NUMERAL
112 +       : ('0'..'9');
113 +
114 +WS
115 +       : (' '|'\t'|'\n')+ {_channel=99;} ;
116 +
117 +LINE_COMMENT
118 +    : '%' ~('\n'|'\r')* '\r'? '\n' {_channel=99;}
119 +    ;
120 +
121 --- a/src/java/net/sf/jabref/bst/BstLexer.java
122 +++ b/src/java/net/sf/jabref/bst/BstLexer.java
123 @@ -1,701 +1,541 @@
124 -/*  Copyright (C) 2003-2011 JabRef contributors.
125 -    This program is free software; you can redistribute it and/or modify
126 -    it under the terms of the GNU General Public License as published by
127 -    the Free Software Foundation; either version 2 of the License, or
128 -    (at your option) any later version.
129 -
130 -    This program is distributed in the hope that it will be useful,
131 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
132 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
133 -    GNU General Public License for more details.
134 -
135 -    You should have received a copy of the GNU General Public License along
136 -    with this program; if not, write to the Free Software Foundation, Inc.,
137 -    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
138 -*/
139 +// $ANTLR 3.4 C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g 2012-10-28 23:48:28
140 +// Generated by ANTLR
141  package net.sf.jabref.bst;
142  
143 -// $ANTLR 3.0b5 Bst.g 2006-11-23 23:20:24
144 -
145 -import org.antlr.runtime.CharStream;
146 -import org.antlr.runtime.EarlyExitException;
147 -import org.antlr.runtime.Lexer;
148 -import org.antlr.runtime.MismatchedSetException;
149 -import org.antlr.runtime.NoViableAltException;
150 -import org.antlr.runtime.RecognitionException;
151 -import org.antlr.runtime.Token;
152 +import org.antlr.runtime.*;
153 +import java.util.Stack;
154 +import java.util.List;
155 +import java.util.ArrayList;
156  
157 +@SuppressWarnings({"all", "warnings", "unchecked"})
158  public class BstLexer extends Lexer {
159 -    public static final int LETTER=21;
160 -    public static final int T29=29;
161 -    public static final int T33=33;
162 -    public static final int INTEGERS=9;
163 -    public static final int ENTRY=6;
164 -    public static final int WS=23;
165 -    public static final int COMMANDS=7;
166 -    public static final int STRING=12;
167 -    public static final int T28=28;
168 -    public static final int EXECUTE=14;
169 -    public static final int LINE_COMMENT=24;
170 -    public static final int SORT=17;
171 -    public static final int STACK=5;
172 -    public static final int REVERSE=16;
173 -    public static final int QUOTED=20;
174 -    public static final int T25=25;
175 -    public static final int INTEGER=19;
176 -    public static final int ITERATE=15;
177 -    public static final int FUNCTION=10;
178 -    public static final int T26=26;
179      public static final int EOF=-1;
180 -    public static final int T32=32;
181 -    public static final int Tokens=34;
182 -    public static final int STRINGS=8;
183 -    public static final int T31=31;
184 -    public static final int T27=27;
185 -    public static final int IDENTIFIER=18;
186 -    public static final int MACRO=11;
187 -    public static final int T30=30;
188 -    public static final int IDLIST=4;
189 -    public static final int NUMERAL=22;
190 -    public static final int READ=13;
191 -    public BstLexer() {
192 -        
193 -    } 
194 +    public static final int T__25=25;
195 +    public static final int T__26=26;
196 +    public static final int T__27=27;
197 +    public static final int T__28=28;
198 +    public static final int T__29=29;
199 +    public static final int T__30=30;
200 +    public static final int T__31=31;
201 +    public static final int T__32=32;
202 +    public static final int T__33=33;
203 +    public static final int COMMANDS=4;
204 +    public static final int ENTRY=5;
205 +    public static final int EXECUTE=6;
206 +    public static final int FUNCTION=7;
207 +    public static final int IDENTIFIER=8;
208 +    public static final int IDLIST=9;
209 +    public static final int INTEGER=10;
210 +    public static final int INTEGERS=11;
211 +    public static final int ITERATE=12;
212 +    public static final int LETTER=13;
213 +    public static final int LINE_COMMENT=14;
214 +    public static final int MACRO=15;
215 +    public static final int NUMERAL=16;
216 +    public static final int QUOTED=17;
217 +    public static final int READ=18;
218 +    public static final int REVERSE=19;
219 +    public static final int SORT=20;
220 +    public static final int STACK=21;
221 +    public static final int STRING=22;
222 +    public static final int STRINGS=23;
223 +    public static final int WS=24;
224 +
225 +    // delegates
226 +    // delegators
227 +    public Lexer[] getDelegates() {
228 +        return new Lexer[] {};
229 +    }
230 +
231 +    public BstLexer() {}
232      public BstLexer(CharStream input) {
233 -        super(input);
234 +        this(input, new RecognizerSharedState());
235      }
236 -    public String getGrammarFileName() { return "Bst.g"; }
237 +    public BstLexer(CharStream input, RecognizerSharedState state) {
238 +        super(input,state);
239 +    }
240 +    public String getGrammarFileName() { return "C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g"; }
241  
242 -    // $ANTLR start T25
243 -    public void mT25() throws RecognitionException {
244 +    // $ANTLR start "T__25"
245 +    public final void mT__25() throws RecognitionException {
246          try {
247 -            ruleNestingLevel++;
248 -            int _type = T25;
249 -            int _start = getCharIndex();
250 -            int _line = getLine();
251 -            int _charPosition = getCharPositionInLine();
252 -            int _channel = Token.DEFAULT_CHANNEL;
253 -            // Bst.g:3:7: ( '{' )
254 -            // Bst.g:3:7: '{'
255 +            int _type = T__25;
256 +            int _channel = DEFAULT_TOKEN_CHANNEL;
257 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:5:7: ( '*' )
258 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:5:9: '*'
259              {
260 -            match('{'); 
261 +            match('*');
262  
263              }
264  
265 -
266 -
267 -                    if ( token==null && ruleNestingLevel==1 ) {
268 -                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
269 -                    }
270 -
271 -                        }
272 +            state.type = _type;
273 +            state.channel = _channel;
274 +        }
275          finally {
276 -            ruleNestingLevel--;
277 +               // do for sure before leaving
278          }
279      }
280 -    // $ANTLR end T25
281 +    // $ANTLR end "T__25"
282  
283 -    // $ANTLR start T26
284 -    public void mT26() throws RecognitionException {
285 +    // $ANTLR start "T__26"
286 +    public final void mT__26() throws RecognitionException {
287          try {
288 -            ruleNestingLevel++;
289 -            int _type = T26;
290 -            int _start = getCharIndex();
291 -            int _line = getLine();
292 -            int _charPosition = getCharPositionInLine();
293 -            int _channel = Token.DEFAULT_CHANNEL;
294 -            // Bst.g:4:7: ( '}' )
295 -            // Bst.g:4:7: '}'
296 +            int _type = T__26;
297 +            int _channel = DEFAULT_TOKEN_CHANNEL;
298 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:6:7: ( '+' )
299 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:6:9: '+'
300              {
301 -            match('}'); 
302 +            match('+');
303  
304              }
305  
306 -
307 -
308 -                    if ( token==null && ruleNestingLevel==1 ) {
309 -                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
310 -                    }
311 -
312 -                        }
313 +            state.type = _type;
314 +            state.channel = _channel;
315 +        }
316          finally {
317 -            ruleNestingLevel--;
318 +               // do for sure before leaving
319          }
320      }
321 -    // $ANTLR end T26
322 +    // $ANTLR end "T__26"
323  
324 -    // $ANTLR start T27
325 -    public void mT27() throws RecognitionException {
326 +    // $ANTLR start "T__27"
327 +    public final void mT__27() throws RecognitionException {
328          try {
329 -            ruleNestingLevel++;
330 -            int _type = T27;
331 -            int _start = getCharIndex();
332 -            int _line = getLine();
333 -            int _charPosition = getCharPositionInLine();
334 -            int _channel = Token.DEFAULT_CHANNEL;
335 -            // Bst.g:5:7: ( '<' )
336 -            // Bst.g:5:7: '<'
337 +            int _type = T__27;
338 +            int _channel = DEFAULT_TOKEN_CHANNEL;
339 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:7:7: ( '-' )
340 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:7:9: '-'
341              {
342 -            match('<'); 
343 +            match('-');
344  
345              }
346  
347 -
348 -
349 -                    if ( token==null && ruleNestingLevel==1 ) {
350 -                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
351 -                    }
352 -
353 -                        }
354 +            state.type = _type;
355 +            state.channel = _channel;
356 +        }
357          finally {
358 -            ruleNestingLevel--;
359 +               // do for sure before leaving
360          }
361      }
362 -    // $ANTLR end T27
363 +    // $ANTLR end "T__27"
364  
365 -    // $ANTLR start T28
366 -    public void mT28() throws RecognitionException {
367 +    // $ANTLR start "T__28"
368 +    public final void mT__28() throws RecognitionException {
369          try {
370 -            ruleNestingLevel++;
371 -            int _type = T28;
372 -            int _start = getCharIndex();
373 -            int _line = getLine();
374 -            int _charPosition = getCharPositionInLine();
375 -            int _channel = Token.DEFAULT_CHANNEL;
376 -            // Bst.g:6:7: ( '>' )
377 -            // Bst.g:6:7: '>'
378 +            int _type = T__28;
379 +            int _channel = DEFAULT_TOKEN_CHANNEL;
380 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:8:7: ( ':=' )
381 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:8:9: ':='
382              {
383 -            match('>'); 
384 -
385 -            }
386 +            match(":=");
387  
388  
389  
390 -                    if ( token==null && ruleNestingLevel==1 ) {
391 -                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
392 -                    }
393 +            }
394  
395 -                        }
396 +            state.type = _type;
397 +            state.channel = _channel;
398 +        }
399          finally {
400 -            ruleNestingLevel--;
401 +               // do for sure before leaving
402          }
403      }
404 -    // $ANTLR end T28
405 +    // $ANTLR end "T__28"
406  
407 -    // $ANTLR start T29
408 -    public void mT29() throws RecognitionException {
409 +    // $ANTLR start "T__29"
410 +    public final void mT__29() throws RecognitionException {
411          try {
412 -            ruleNestingLevel++;
413 -            int _type = T29;
414 -            int _start = getCharIndex();
415 -            int _line = getLine();
416 -            int _charPosition = getCharPositionInLine();
417 -            int _channel = Token.DEFAULT_CHANNEL;
418 -            // Bst.g:7:7: ( '=' )
419 -            // Bst.g:7:7: '='
420 +            int _type = T__29;
421 +            int _channel = DEFAULT_TOKEN_CHANNEL;
422 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:9:7: ( '<' )
423 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:9:9: '<'
424              {
425 -            match('='); 
426 +            match('<');
427  
428              }
429  
430 -
431 -
432 -                    if ( token==null && ruleNestingLevel==1 ) {
433 -                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
434 -                    }
435 -
436 -                        }
437 +            state.type = _type;
438 +            state.channel = _channel;
439 +        }
440          finally {
441 -            ruleNestingLevel--;
442 +               // do for sure before leaving
443          }
444      }
445 -    // $ANTLR end T29
446 +    // $ANTLR end "T__29"
447  
448 -    // $ANTLR start T30
449 -    public void mT30() throws RecognitionException {
450 +    // $ANTLR start "T__30"
451 +    public final void mT__30() throws RecognitionException {
452          try {
453 -            ruleNestingLevel++;
454 -            int _type = T30;
455 -            int _start = getCharIndex();
456 -            int _line = getLine();
457 -            int _charPosition = getCharPositionInLine();
458 -            int _channel = Token.DEFAULT_CHANNEL;
459 -            // Bst.g:8:7: ( '+' )
460 -            // Bst.g:8:7: '+'
461 +            int _type = T__30;
462 +            int _channel = DEFAULT_TOKEN_CHANNEL;
463 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:10:7: ( '=' )
464 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:10:9: '='
465              {
466 -            match('+'); 
467 +            match('=');
468  
469              }
470  
471 -
472 -
473 -                    if ( token==null && ruleNestingLevel==1 ) {
474 -                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
475 -                    }
476 -
477 -                        }
478 +            state.type = _type;
479 +            state.channel = _channel;
480 +        }
481          finally {
482 -            ruleNestingLevel--;
483 +               // do for sure before leaving
484          }
485      }
486 -    // $ANTLR end T30
487 +    // $ANTLR end "T__30"
488  
489 -    // $ANTLR start T31
490 -    public void mT31() throws RecognitionException {
491 +    // $ANTLR start "T__31"
492 +    public final void mT__31() throws RecognitionException {
493          try {
494 -            ruleNestingLevel++;
495 -            int _type = T31;
496 -            int _start = getCharIndex();
497 -            int _line = getLine();
498 -            int _charPosition = getCharPositionInLine();
499 -            int _channel = Token.DEFAULT_CHANNEL;
500 -            // Bst.g:9:7: ( '-' )
501 -            // Bst.g:9:7: '-'
502 +            int _type = T__31;
503 +            int _channel = DEFAULT_TOKEN_CHANNEL;
504 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:11:7: ( '>' )
505 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:11:9: '>'
506              {
507 -            match('-'); 
508 +            match('>');
509  
510              }
511  
512 -
513 -
514 -                    if ( token==null && ruleNestingLevel==1 ) {
515 -                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
516 -                    }
517 -
518 -                        }
519 +            state.type = _type;
520 +            state.channel = _channel;
521 +        }
522          finally {
523 -            ruleNestingLevel--;
524 +               // do for sure before leaving
525          }
526      }
527 -    // $ANTLR end T31
528 +    // $ANTLR end "T__31"
529  
530 -    // $ANTLR start T32
531 -    public void mT32() throws RecognitionException {
532 +    // $ANTLR start "T__32"
533 +    public final void mT__32() throws RecognitionException {
534          try {
535 -            ruleNestingLevel++;
536 -            int _type = T32;
537 -            int _start = getCharIndex();
538 -            int _line = getLine();
539 -            int _charPosition = getCharPositionInLine();
540 -            int _channel = Token.DEFAULT_CHANNEL;
541 -            // Bst.g:10:7: ( ':=' )
542 -            // Bst.g:10:7: ':='
543 +            int _type = T__32;
544 +            int _channel = DEFAULT_TOKEN_CHANNEL;
545 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:12:7: ( '{' )
546 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:12:9: '{'
547              {
548 -            match(":="); 
549 -
550 +            match('{');
551  
552              }
553  
554 -
555 -
556 -                    if ( token==null && ruleNestingLevel==1 ) {
557 -                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
558 -                    }
559 -
560 -                        }
561 +            state.type = _type;
562 +            state.channel = _channel;
563 +        }
564          finally {
565 -            ruleNestingLevel--;
566 +               // do for sure before leaving
567          }
568      }
569 -    // $ANTLR end T32
570 +    // $ANTLR end "T__32"
571  
572 -    // $ANTLR start T33
573 -    public void mT33() throws RecognitionException {
574 +    // $ANTLR start "T__33"
575 +    public final void mT__33() throws RecognitionException {
576          try {
577 -            ruleNestingLevel++;
578 -            int _type = T33;
579 -            int _start = getCharIndex();
580 -            int _line = getLine();
581 -            int _charPosition = getCharPositionInLine();
582 -            int _channel = Token.DEFAULT_CHANNEL;
583 -            // Bst.g:11:7: ( '*' )
584 -            // Bst.g:11:7: '*'
585 +            int _type = T__33;
586 +            int _channel = DEFAULT_TOKEN_CHANNEL;
587 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:13:7: ( '}' )
588 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:13:9: '}'
589              {
590 -            match('*'); 
591 +            match('}');
592  
593              }
594  
595 -
596 -
597 -                    if ( token==null && ruleNestingLevel==1 ) {
598 -                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
599 -                    }
600 -
601 -                        }
602 +            state.type = _type;
603 +            state.channel = _channel;
604 +        }
605          finally {
606 -            ruleNestingLevel--;
607 +               // do for sure before leaving
608          }
609      }
610 -    // $ANTLR end T33
611 +    // $ANTLR end "T__33"
612  
613 -    // $ANTLR start STRINGS
614 -    public void mSTRINGS() throws RecognitionException {
615 +    // $ANTLR start "STRINGS"
616 +    public final void mSTRINGS() throws RecognitionException {
617          try {
618 -            ruleNestingLevel++;
619              int _type = STRINGS;
620 -            int _start = getCharIndex();
621 -            int _line = getLine();
622 -            int _charPosition = getCharPositionInLine();
623 -            int _channel = Token.DEFAULT_CHANNEL;
624 -            // Bst.g:53:11: ( 'STRINGS' )
625 -            // Bst.g:53:11: 'STRINGS'
626 +            int _channel = DEFAULT_TOKEN_CHANNEL;
627 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:61:9: ( 'STRINGS' )
628 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:61:11: 'STRINGS'
629              {
630              match("STRINGS"); 
631  
632  
633 -            }
634 -
635 -
636  
637 -                    if ( token==null && ruleNestingLevel==1 ) {
638 -                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
639 -                    }
640 +            }
641  
642 -                        }
643 +            state.type = _type;
644 +            state.channel = _channel;
645 +        }
646          finally {
647 -            ruleNestingLevel--;
648 +               // do for sure before leaving
649          }
650      }
651 -    // $ANTLR end STRINGS
652 +    // $ANTLR end "STRINGS"
653  
654 -    // $ANTLR start INTEGERS
655 -    public void mINTEGERS() throws RecognitionException {
656 +    // $ANTLR start "INTEGERS"
657 +    public final void mINTEGERS() throws RecognitionException {
658          try {
659 -            ruleNestingLevel++;
660              int _type = INTEGERS;
661 -            int _start = getCharIndex();
662 -            int _line = getLine();
663 -            int _charPosition = getCharPositionInLine();
664 -            int _channel = Token.DEFAULT_CHANNEL;
665 -            // Bst.g:54:12: ( 'INTEGERS' )
666 -            // Bst.g:54:12: 'INTEGERS'
667 +            int _channel = DEFAULT_TOKEN_CHANNEL;
668 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:62:10: ( 'INTEGERS' )
669 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:62:12: 'INTEGERS'
670              {
671              match("INTEGERS"); 
672  
673  
674 -            }
675 -
676 -
677  
678 -                    if ( token==null && ruleNestingLevel==1 ) {
679 -                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
680 -                    }
681 +            }
682  
683 -                        }
684 +            state.type = _type;
685 +            state.channel = _channel;
686 +        }
687          finally {
688 -            ruleNestingLevel--;
689 +               // do for sure before leaving
690          }
691      }
692 -    // $ANTLR end INTEGERS
693 +    // $ANTLR end "INTEGERS"
694  
695 -    // $ANTLR start FUNCTION
696 -    public void mFUNCTION() throws RecognitionException {
697 +    // $ANTLR start "FUNCTION"
698 +    public final void mFUNCTION() throws RecognitionException {
699          try {
700 -            ruleNestingLevel++;
701              int _type = FUNCTION;
702 -            int _start = getCharIndex();
703 -            int _line = getLine();
704 -            int _charPosition = getCharPositionInLine();
705 -            int _channel = Token.DEFAULT_CHANNEL;
706 -            // Bst.g:55:12: ( 'FUNCTION' )
707 -            // Bst.g:55:12: 'FUNCTION'
708 +            int _channel = DEFAULT_TOKEN_CHANNEL;
709 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:63:10: ( 'FUNCTION' )
710 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:63:12: 'FUNCTION'
711              {
712              match("FUNCTION"); 
713  
714  
715 -            }
716 -
717 -
718  
719 -                    if ( token==null && ruleNestingLevel==1 ) {
720 -                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
721 -                    }
722 +            }
723  
724 -                        }
725 +            state.type = _type;
726 +            state.channel = _channel;
727 +        }
728          finally {
729 -            ruleNestingLevel--;
730 +               // do for sure before leaving
731          }
732      }
733 -    // $ANTLR end FUNCTION
734 +    // $ANTLR end "FUNCTION"
735  
736 -    // $ANTLR start EXECUTE
737 -    public void mEXECUTE() throws RecognitionException {
738 +    // $ANTLR start "EXECUTE"
739 +    public final void mEXECUTE() throws RecognitionException {
740          try {
741 -            ruleNestingLevel++;
742              int _type = EXECUTE;
743 -            int _start = getCharIndex();
744 -            int _line = getLine();
745 -            int _charPosition = getCharPositionInLine();
746 -            int _channel = Token.DEFAULT_CHANNEL;
747 -            // Bst.g:56:11: ( 'EXECUTE' )
748 -            // Bst.g:56:11: 'EXECUTE'
749 +            int _channel = DEFAULT_TOKEN_CHANNEL;
750 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:64:9: ( 'EXECUTE' )
751 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:64:11: 'EXECUTE'
752              {
753              match("EXECUTE"); 
754  
755  
756 -            }
757 -
758 -
759  
760 -                    if ( token==null && ruleNestingLevel==1 ) {
761 -                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
762 -                    }
763 +            }
764  
765 -                        }
766 +            state.type = _type;
767 +            state.channel = _channel;
768 +        }
769          finally {
770 -            ruleNestingLevel--;
771 +               // do for sure before leaving
772          }
773      }
774 -    // $ANTLR end EXECUTE
775 +    // $ANTLR end "EXECUTE"
776  
777 -    // $ANTLR start SORT
778 -    public void mSORT() throws RecognitionException {
779 +    // $ANTLR start "SORT"
780 +    public final void mSORT() throws RecognitionException {
781          try {
782 -            ruleNestingLevel++;
783              int _type = SORT;
784 -            int _start = getCharIndex();
785 -            int _line = getLine();
786 -            int _charPosition = getCharPositionInLine();
787 -            int _channel = Token.DEFAULT_CHANNEL;
788 -            // Bst.g:57:8: ( 'SORT' )
789 -            // Bst.g:57:8: 'SORT'
790 +            int _channel = DEFAULT_TOKEN_CHANNEL;
791 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:65:6: ( 'SORT' )
792 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:65:8: 'SORT'
793              {
794              match("SORT"); 
795  
796  
797 -            }
798 -
799 -
800  
801 -                    if ( token==null && ruleNestingLevel==1 ) {
802 -                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
803 -                    }
804 +            }
805  
806 -                        }
807 +            state.type = _type;
808 +            state.channel = _channel;
809 +        }
810          finally {
811 -            ruleNestingLevel--;
812 +               // do for sure before leaving
813          }
814      }
815 -    // $ANTLR end SORT
816 +    // $ANTLR end "SORT"
817  
818 -    // $ANTLR start ITERATE
819 -    public void mITERATE() throws RecognitionException {
820 +    // $ANTLR start "ITERATE"
821 +    public final void mITERATE() throws RecognitionException {
822          try {
823 -            ruleNestingLevel++;
824              int _type = ITERATE;
825 -            int _start = getCharIndex();
826 -            int _line = getLine();
827 -            int _charPosition = getCharPositionInLine();
828 -            int _channel = Token.DEFAULT_CHANNEL;
829 -            // Bst.g:58:11: ( 'ITERATE' )
830 -            // Bst.g:58:11: 'ITERATE'
831 +            int _channel = DEFAULT_TOKEN_CHANNEL;
832 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:66:9: ( 'ITERATE' )
833 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:66:11: 'ITERATE'
834              {
835              match("ITERATE"); 
836  
837  
838 -            }
839 -
840 -
841  
842 -                    if ( token==null && ruleNestingLevel==1 ) {
843 -                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
844 -                    }
845 +            }
846  
847 -                        }
848 +            state.type = _type;
849 +            state.channel = _channel;
850 +        }
851          finally {
852 -            ruleNestingLevel--;
853 +               // do for sure before leaving
854          }
855      }
856 -    // $ANTLR end ITERATE
857 +    // $ANTLR end "ITERATE"
858  
859 -    // $ANTLR start REVERSE
860 -    public void mREVERSE() throws RecognitionException {
861 +    // $ANTLR start "REVERSE"
862 +    public final void mREVERSE() throws RecognitionException {
863          try {
864 -            ruleNestingLevel++;
865              int _type = REVERSE;
866 -            int _start = getCharIndex();
867 -            int _line = getLine();
868 -            int _charPosition = getCharPositionInLine();
869 -            int _channel = Token.DEFAULT_CHANNEL;
870 -            // Bst.g:59:11: ( 'REVERSE' )
871 -            // Bst.g:59:11: 'REVERSE'
872 +            int _channel = DEFAULT_TOKEN_CHANNEL;
873 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:67:9: ( 'REVERSE' )
874 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:67:11: 'REVERSE'
875              {
876              match("REVERSE"); 
877  
878  
879 -            }
880 -
881 -
882  
883 -                    if ( token==null && ruleNestingLevel==1 ) {
884 -                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
885 -                    }
886 +            }
887  
888 -                        }
889 +            state.type = _type;
890 +            state.channel = _channel;
891 +        }
892          finally {
893 -            ruleNestingLevel--;
894 +               // do for sure before leaving
895          }
896      }
897 -    // $ANTLR end REVERSE
898 +    // $ANTLR end "REVERSE"
899  
900 -    // $ANTLR start ENTRY
901 -    public void mENTRY() throws RecognitionException {
902 +    // $ANTLR start "ENTRY"
903 +    public final void mENTRY() throws RecognitionException {
904          try {
905 -            ruleNestingLevel++;
906              int _type = ENTRY;
907 -            int _start = getCharIndex();
908 -            int _line = getLine();
909 -            int _charPosition = getCharPositionInLine();
910 -            int _channel = Token.DEFAULT_CHANNEL;
911 -            // Bst.g:60:9: ( 'ENTRY' )
912 -            // Bst.g:60:9: 'ENTRY'
913 +            int _channel = DEFAULT_TOKEN_CHANNEL;
914 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:68:7: ( 'ENTRY' )
915 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:68:9: 'ENTRY'
916              {
917              match("ENTRY"); 
918  
919  
920 -            }
921 -
922 -
923  
924 -                    if ( token==null && ruleNestingLevel==1 ) {
925 -                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
926 -                    }
927 +            }
928  
929 -                        }
930 +            state.type = _type;
931 +            state.channel = _channel;
932 +        }
933          finally {
934 -            ruleNestingLevel--;
935 +               // do for sure before leaving
936          }
937      }
938 -    // $ANTLR end ENTRY
939 +    // $ANTLR end "ENTRY"
940  
941 -    // $ANTLR start READ
942 -    public void mREAD() throws RecognitionException {
943 +    // $ANTLR start "READ"
944 +    public final void mREAD() throws RecognitionException {
945          try {
946 -            ruleNestingLevel++;
947              int _type = READ;
948 -            int _start = getCharIndex();
949 -            int _line = getLine();
950 -            int _charPosition = getCharPositionInLine();
951 -            int _channel = Token.DEFAULT_CHANNEL;
952 -            // Bst.g:61:8: ( 'READ' )
953 -            // Bst.g:61:8: 'READ'
954 +            int _channel = DEFAULT_TOKEN_CHANNEL;
955 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:69:6: ( 'READ' )
956 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:69:8: 'READ'
957              {
958              match("READ"); 
959  
960  
961 -            }
962 -
963 -
964  
965 -                    if ( token==null && ruleNestingLevel==1 ) {
966 -                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
967 -                    }
968 +            }
969  
970 -                        }
971 +            state.type = _type;
972 +            state.channel = _channel;
973 +        }
974          finally {
975 -            ruleNestingLevel--;
976 +               // do for sure before leaving
977          }
978      }
979 -    // $ANTLR end READ
980 +    // $ANTLR end "READ"
981  
982 -    // $ANTLR start MACRO
983 -    public void mMACRO() throws RecognitionException {
984 +    // $ANTLR start "MACRO"
985 +    public final void mMACRO() throws RecognitionException {
986          try {
987 -            ruleNestingLevel++;
988              int _type = MACRO;
989 -            int _start = getCharIndex();
990 -            int _line = getLine();
991 -            int _charPosition = getCharPositionInLine();
992 -            int _channel = Token.DEFAULT_CHANNEL;
993 -            // Bst.g:62:9: ( 'MACRO' )
994 -            // Bst.g:62:9: 'MACRO'
995 +            int _channel = DEFAULT_TOKEN_CHANNEL;
996 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:70:7: ( 'MACRO' )
997 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:70:9: 'MACRO'
998              {
999              match("MACRO"); 
1000  
1001  
1002 -            }
1003 -
1004 -
1005  
1006 -                    if ( token==null && ruleNestingLevel==1 ) {
1007 -                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
1008 -                    }
1009 +            }
1010  
1011 -                        }
1012 +            state.type = _type;
1013 +            state.channel = _channel;
1014 +        }
1015          finally {
1016 -            ruleNestingLevel--;
1017 +               // do for sure before leaving
1018          }
1019      }
1020 -    // $ANTLR end MACRO
1021 +    // $ANTLR end "MACRO"
1022  
1023 -    // $ANTLR start QUOTED
1024 -    public void mQUOTED() throws RecognitionException {
1025 +    // $ANTLR start "QUOTED"
1026 +    public final void mQUOTED() throws RecognitionException {
1027          try {
1028 -            ruleNestingLevel++;
1029              int _type = QUOTED;
1030 -            int _start = getCharIndex();
1031 -            int _line = getLine();
1032 -            int _charPosition = getCharPositionInLine();
1033 -            int _channel = Token.DEFAULT_CHANNEL;
1034 -            // Bst.g:65:4: ( '\\'' IDENTIFIER )
1035 -            // Bst.g:65:4: '\\'' IDENTIFIER
1036 +            int _channel = DEFAULT_TOKEN_CHANNEL;
1037 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:73:2: ( '\\'' IDENTIFIER )
1038 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:73:4: '\\'' IDENTIFIER
1039              {
1040              match('\''); 
1041 -            mIDENTIFIER(); 
1042 -
1043 -            }
1044  
1045 +            mIDENTIFIER();
1046  
1047  
1048 -                    if ( token==null && ruleNestingLevel==1 ) {
1049 -                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
1050 -                    }
1051 +            }
1052  
1053 -                        }
1054 +            state.type = _type;
1055 +            state.channel = _channel;
1056 +        }
1057          finally {
1058 -            ruleNestingLevel--;
1059 +               // do for sure before leaving
1060          }
1061      }
1062 -    // $ANTLR end QUOTED
1063 +    // $ANTLR end "QUOTED"
1064  
1065 -    // $ANTLR start IDENTIFIER
1066 -    public void mIDENTIFIER() throws RecognitionException {
1067 +    // $ANTLR start "IDENTIFIER"
1068 +    public final void mIDENTIFIER() throws RecognitionException {
1069          try {
1070 -            ruleNestingLevel++;
1071              int _type = IDENTIFIER;
1072 -            int _start = getCharIndex();
1073 -            int _line = getLine();
1074 -            int _charPosition = getCharPositionInLine();
1075 -            int _channel = Token.DEFAULT_CHANNEL;
1076 -            // Bst.g:68:4: ( LETTER ( LETTER | NUMERAL )* )
1077 -            // Bst.g:68:4: LETTER ( LETTER | NUMERAL )*
1078 +            int _channel = DEFAULT_TOKEN_CHANNEL;
1079 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:76:2: ( LETTER ( LETTER | NUMERAL )* )
1080 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:76:4: LETTER ( LETTER | NUMERAL )*
1081              {
1082              mLETTER(); 
1083 -            // Bst.g:68:11: ( LETTER | NUMERAL )*
1084 +
1085 +
1086 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:76:11: ( LETTER | NUMERAL )*
1087              loop1:
1088              do {
1089 -                int alt1=3;
1090 +                int alt1=2;
1091                  int LA1_0 = input.LA(1);
1092 -                if ( (LA1_0=='$'||LA1_0=='.'||(LA1_0>='A' && LA1_0<='Z')||(LA1_0>='a' && LA1_0<='z')) ) {
1093 +
1094 +                if ( (LA1_0=='$'||LA1_0=='.'||(LA1_0 >= '0' && LA1_0 <= '9')||(LA1_0 >= 'A' && LA1_0 <= 'Z')||(LA1_0 >= 'a' && LA1_0 <= 'z')) ) {
1095                      alt1=1;
1096                  }
1097 -                else if ( ((LA1_0>='0' && LA1_0<='9')) ) {
1098 -                    alt1=2;
1099 -                }
1100  
1101  
1102                  switch (alt1) {
1103                 case 1 :
1104 -                   // Bst.g:68:12: LETTER
1105 +                   // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:
1106                     {
1107 -                   mLETTER(); 
1108 -
1109 +                   if ( input.LA(1)=='$'||input.LA(1)=='.'||(input.LA(1) >= '0' && input.LA(1) <= '9')||(input.LA(1) >= 'A' && input.LA(1) <= 'Z')||(input.LA(1) >= 'a' && input.LA(1) <= 'z') ) {
1110 +                       input.consume();
1111 +                   }
1112 +                   else {
1113 +                       MismatchedSetException mse = new MismatchedSetException(null,input);
1114 +                       recover(mse);
1115 +                       throw mse;
1116                     }
1117 -                   break;
1118 -               case 2 :
1119 -                   // Bst.g:68:19: NUMERAL
1120 -                   {
1121 -                   mNUMERAL(); 
1122 +
1123  
1124                     }
1125                     break;
1126 @@ -708,81 +548,73 @@
1127  
1128              }
1129  
1130 -
1131 -
1132 -                    if ( token==null && ruleNestingLevel==1 ) {
1133 -                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
1134 -                    }
1135 -
1136 -                        }
1137 +            state.type = _type;
1138 +            state.channel = _channel;
1139 +        }
1140          finally {
1141 -            ruleNestingLevel--;
1142 +               // do for sure before leaving
1143          }
1144      }
1145 -    // $ANTLR end IDENTIFIER
1146 +    // $ANTLR end "IDENTIFIER"
1147  
1148 -    // $ANTLR start LETTER
1149 -    public void mLETTER() throws RecognitionException {
1150 +    // $ANTLR start "LETTER"
1151 +    public final void mLETTER() throws RecognitionException {
1152          try {
1153 -            ruleNestingLevel++;
1154 -            // Bst.g:71:4: ( ('a'..'z'|'A'..'Z'|'.'|'$'))
1155 -            // Bst.g:71:4: ('a'..'z'|'A'..'Z'|'.'|'$')
1156 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:79:2: ( ( 'a' .. 'z' | 'A' .. 'Z' | '.' | '$' ) )
1157 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:
1158              {
1159 -            if ( input.LA(1)=='$'||input.LA(1)=='.'||(input.LA(1)>='A' && input.LA(1)<='Z')||(input.LA(1)>='a' && input.LA(1)<='z') ) {
1160 +            if ( input.LA(1)=='$'||input.LA(1)=='.'||(input.LA(1) >= 'A' && input.LA(1) <= 'Z')||(input.LA(1) >= 'a' && input.LA(1) <= 'z') ) {
1161                  input.consume();
1162 -
1163              }
1164              else {
1165 -                MismatchedSetException mse =
1166 -                    new MismatchedSetException(null,input);
1167 -                recover(mse);    throw mse;
1168 +                MismatchedSetException mse = new MismatchedSetException(null,input);
1169 +                recover(mse);
1170 +                throw mse;
1171              }
1172  
1173  
1174              }
1175  
1176 +
1177          }
1178          finally {
1179 -            ruleNestingLevel--;
1180 +               // do for sure before leaving
1181          }
1182      }
1183 -    // $ANTLR end LETTER
1184 +    // $ANTLR end "LETTER"
1185  
1186 -    // $ANTLR start STRING
1187 -    public void mSTRING() throws RecognitionException {
1188 +    // $ANTLR start "STRING"
1189 +    public final void mSTRING() throws RecognitionException {
1190          try {
1191 -            ruleNestingLevel++;
1192              int _type = STRING;
1193 -            int _start = getCharIndex();
1194 -            int _line = getLine();
1195 -            int _charPosition = getCharPositionInLine();
1196 -            int _channel = Token.DEFAULT_CHANNEL;
1197 -            // Bst.g:74:4: ( '\"' (~ '\"' )* '\"' )
1198 -            // Bst.g:74:4: '\"' (~ '\"' )* '\"'
1199 +            int _channel = DEFAULT_TOKEN_CHANNEL;
1200 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:82:2: ( '\"' (~ ( '\"' ) )* '\"' )
1201 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:82:4: '\"' (~ ( '\"' ) )* '\"'
1202              {
1203              match('\"'); 
1204 -            // Bst.g:74:8: (~ '\"' )*
1205 +
1206 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:82:8: (~ ( '\"' ) )*
1207              loop2:
1208              do {
1209                  int alt2=2;
1210                  int LA2_0 = input.LA(1);
1211 -                if ( ((LA2_0>='\u0000' && LA2_0<='!')||(LA2_0>='#' && LA2_0<='\uFFFE')) ) {
1212 +
1213 +                if ( ((LA2_0 >= '\u0000' && LA2_0 <= '!')||(LA2_0 >= '#' && LA2_0 <= '\uFFFF')) ) {
1214                      alt2=1;
1215                  }
1216  
1217  
1218                  switch (alt2) {
1219                 case 1 :
1220 -                   // Bst.g:74:9: ~ '\"'
1221 +                   // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:
1222                     {
1223 -                   if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='\uFFFE') ) {
1224 +                   if ( (input.LA(1) >= '\u0000' && input.LA(1) <= '!')||(input.LA(1) >= '#' && input.LA(1) <= '\uFFFF') ) {
1225                         input.consume();
1226 -
1227                     }
1228                     else {
1229 -                       MismatchedSetException mse =
1230 -                           new MismatchedSetException(null,input);
1231 -                       recover(mse);    throw mse;
1232 +                       MismatchedSetException mse = new MismatchedSetException(null,input);
1233 +                       recover(mse);
1234 +                       throw mse;
1235                     }
1236  
1237  
1238 @@ -794,54 +626,48 @@
1239                  }
1240              } while (true);
1241  
1242 +
1243              match('\"'); 
1244  
1245              }
1246  
1247 -
1248 -
1249 -                    if ( token==null && ruleNestingLevel==1 ) {
1250 -                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
1251 -                    }
1252 -
1253 -                        }
1254 +            state.type = _type;
1255 +            state.channel = _channel;
1256 +        }
1257          finally {
1258 -            ruleNestingLevel--;
1259 +               // do for sure before leaving
1260          }
1261      }
1262 -    // $ANTLR end STRING
1263 +    // $ANTLR end "STRING"
1264  
1265 -    // $ANTLR start INTEGER
1266 -    public void mINTEGER() throws RecognitionException {
1267 +    // $ANTLR start "INTEGER"
1268 +    public final void mINTEGER() throws RecognitionException {
1269          try {
1270 -            ruleNestingLevel++;
1271              int _type = INTEGER;
1272 -            int _start = getCharIndex();
1273 -            int _line = getLine();
1274 -            int _charPosition = getCharPositionInLine();
1275 -            int _channel = Token.DEFAULT_CHANNEL;
1276 -            // Bst.g:77:4: ( '#' ( ('+'|'-'))? ( NUMERAL )+ )
1277 -            // Bst.g:77:4: '#' ( ('+'|'-'))? ( NUMERAL )+
1278 +            int _channel = DEFAULT_TOKEN_CHANNEL;
1279 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:85:2: ( '#' ( '+' | '-' )? ( NUMERAL )+ )
1280 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:85:4: '#' ( '+' | '-' )? ( NUMERAL )+
1281              {
1282              match('#'); 
1283 -            // Bst.g:77:8: ( ('+'|'-'))?
1284 +
1285 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:85:8: ( '+' | '-' )?
1286              int alt3=2;
1287              int LA3_0 = input.LA(1);
1288 +
1289              if ( (LA3_0=='+'||LA3_0=='-') ) {
1290                  alt3=1;
1291              }
1292              switch (alt3) {
1293                  case 1 :
1294 -                    // Bst.g:77:9: ('+'|'-')
1295 +                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:
1296                      {
1297                      if ( input.LA(1)=='+'||input.LA(1)=='-' ) {
1298                          input.consume();
1299 -
1300                      }
1301                      else {
1302 -                        MismatchedSetException mse =
1303 -                            new MismatchedSetException(null,input);
1304 -                        recover(mse);    throw mse;
1305 +                        MismatchedSetException mse = new MismatchedSetException(null,input);
1306 +                        recover(mse);
1307 +                        throw mse;
1308                      }
1309  
1310  
1311 @@ -850,22 +676,32 @@
1312  
1313              }
1314  
1315 -            // Bst.g:77:19: ( NUMERAL )+
1316 +
1317 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:85:19: ( NUMERAL )+
1318              int cnt4=0;
1319              loop4:
1320              do {
1321                  int alt4=2;
1322                  int LA4_0 = input.LA(1);
1323 -                if ( ((LA4_0>='0' && LA4_0<='9')) ) {
1324 +
1325 +                if ( ((LA4_0 >= '0' && LA4_0 <= '9')) ) {
1326                      alt4=1;
1327                  }
1328  
1329  
1330                  switch (alt4) {
1331                 case 1 :
1332 -                   // Bst.g:77:19: NUMERAL
1333 +                   // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:
1334                     {
1335 -                   mNUMERAL(); 
1336 +                   if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) {
1337 +                       input.consume();
1338 +                   }
1339 +                   else {
1340 +                       MismatchedSetException mse = new MismatchedSetException(null,input);
1341 +                       recover(mse);
1342 +                       throw mse;
1343 +                   }
1344 +
1345  
1346                     }
1347                     break;
1348 @@ -882,78 +718,72 @@
1349  
1350              }
1351  
1352 -
1353 -
1354 -                    if ( token==null && ruleNestingLevel==1 ) {
1355 -                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
1356 -                    }
1357 -
1358 -                        }
1359 +            state.type = _type;
1360 +            state.channel = _channel;
1361 +        }
1362          finally {
1363 -            ruleNestingLevel--;
1364 +               // do for sure before leaving
1365          }
1366      }
1367 -    // $ANTLR end INTEGER
1368 +    // $ANTLR end "INTEGER"
1369  
1370 -    // $ANTLR start NUMERAL
1371 -    public void mNUMERAL() throws RecognitionException {
1372 +    // $ANTLR start "NUMERAL"
1373 +    public final void mNUMERAL() throws RecognitionException {
1374          try {
1375 -            ruleNestingLevel++;
1376 -            // Bst.g:80:4: ( ( '0' .. '9' ) )
1377 -            // Bst.g:80:4: ( '0' .. '9' )
1378 -            {
1379 -            // Bst.g:80:4: ( '0' .. '9' )
1380 -            // Bst.g:80:5: '0' .. '9'
1381 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:88:2: ( ( '0' .. '9' ) )
1382 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:
1383              {
1384 -            matchRange('0','9'); 
1385 -
1386 +            if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) {
1387 +                input.consume();
1388 +            }
1389 +            else {
1390 +                MismatchedSetException mse = new MismatchedSetException(null,input);
1391 +                recover(mse);
1392 +                throw mse;
1393              }
1394  
1395  
1396              }
1397  
1398 +
1399          }
1400          finally {
1401 -            ruleNestingLevel--;
1402 +               // do for sure before leaving
1403          }
1404      }
1405 -    // $ANTLR end NUMERAL
1406 +    // $ANTLR end "NUMERAL"
1407  
1408 -    // $ANTLR start WS
1409 -    public void mWS() throws RecognitionException {
1410 +    // $ANTLR start "WS"
1411 +    public final void mWS() throws RecognitionException {
1412          try {
1413 -            ruleNestingLevel++;
1414              int _type = WS;
1415 -            int _start = getCharIndex();
1416 -            int _line = getLine();
1417 -            int _charPosition = getCharPositionInLine();
1418 -            int _channel = Token.DEFAULT_CHANNEL;
1419 -            // Bst.g:82:9: ( ( (' '|'\\t'|'\\r'|'\\n'))+ )
1420 -            // Bst.g:82:9: ( (' '|'\\t'|'\\r'|'\\n'))+
1421 +            int _channel = DEFAULT_TOKEN_CHANNEL;
1422 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:91:2: ( ( ' ' | '\\t' | '\\n' )+ )
1423 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:91:4: ( ' ' | '\\t' | '\\n' )+
1424              {
1425 -            // Bst.g:82:9: ( (' '|'\\t'|'\\r'|'\\n'))+
1426 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:91:4: ( ' ' | '\\t' | '\\n' )+
1427              int cnt5=0;
1428              loop5:
1429              do {
1430                  int alt5=2;
1431                  int LA5_0 = input.LA(1);
1432 -                if ( ((LA5_0>='\t' && LA5_0<='\n')||LA5_0=='\r'||LA5_0==' ') ) {
1433 +
1434 +                if ( ((LA5_0 >= '\t' && LA5_0 <= '\n')||LA5_0==' ') ) {
1435                      alt5=1;
1436                  }
1437  
1438  
1439                  switch (alt5) {
1440                 case 1 :
1441 -                   // Bst.g:82:13: (' '|'\\t'|'\\r'|'\\n')
1442 +                   // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:
1443                     {
1444 -                   if ( (input.LA(1)>='\t' && input.LA(1)<='\n')||input.LA(1)=='\r'||input.LA(1)==' ' ) {
1445 +                   if ( (input.LA(1) >= '\t' && input.LA(1) <= '\n')||input.LA(1)==' ' ) {
1446                         input.consume();
1447 -
1448                     }
1449                     else {
1450 -                       MismatchedSetException mse =
1451 -                           new MismatchedSetException(null,input);
1452 -                       recover(mse);    throw mse;
1453 +                       MismatchedSetException mse = new MismatchedSetException(null,input);
1454 +                       recover(mse);
1455 +                       throw mse;
1456                     }
1457  
1458  
1459 @@ -969,58 +799,52 @@
1460                  cnt5++;
1461              } while (true);
1462  
1463 -             _channel=HIDDEN; 
1464 -
1465 -            }
1466 -
1467  
1468 +            _channel=99;
1469  
1470 -                    if ( token==null && ruleNestingLevel==1 ) {
1471 -                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
1472 -                    }
1473 +            }
1474  
1475 -                        }
1476 +            state.type = _type;
1477 +            state.channel = _channel;
1478 +        }
1479          finally {
1480 -            ruleNestingLevel--;
1481 +               // do for sure before leaving
1482          }
1483      }
1484 -    // $ANTLR end WS
1485 +    // $ANTLR end "WS"
1486  
1487 -    // $ANTLR start LINE_COMMENT
1488 -    public void mLINE_COMMENT() throws RecognitionException {
1489 +    // $ANTLR start "LINE_COMMENT"
1490 +    public final void mLINE_COMMENT() throws RecognitionException {
1491          try {
1492 -            ruleNestingLevel++;
1493              int _type = LINE_COMMENT;
1494 -            int _start = getCharIndex();
1495 -            int _line = getLine();
1496 -            int _charPosition = getCharPositionInLine();
1497 -            int _channel = Token.DEFAULT_CHANNEL;
1498 -            // Bst.g:90:7: ( '%' (~ ('\\n'|'\\r'))* ( '\\r' )? '\\n' )
1499 -            // Bst.g:90:7: '%' (~ ('\\n'|'\\r'))* ( '\\r' )? '\\n'
1500 +            int _channel = DEFAULT_TOKEN_CHANNEL;
1501 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:94:5: ( '%' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n' )
1502 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:94:7: '%' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n'
1503              {
1504              match('%'); 
1505 -            // Bst.g:90:11: (~ ('\\n'|'\\r'))*
1506 +
1507 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:94:11: (~ ( '\\n' | '\\r' ) )*
1508              loop6:
1509              do {
1510                  int alt6=2;
1511                  int LA6_0 = input.LA(1);
1512 -                if ( ((LA6_0>='\u0000' && LA6_0<='\t')||(LA6_0>='\u000B' && LA6_0<='\f')||(LA6_0>='\u000E' && LA6_0<='\uFFFE')) ) {
1513 +
1514 +                if ( ((LA6_0 >= '\u0000' && LA6_0 <= '\t')||(LA6_0 >= '\u000B' && LA6_0 <= '\f')||(LA6_0 >= '\u000E' && LA6_0 <= '\uFFFF')) ) {
1515                      alt6=1;
1516                  }
1517  
1518  
1519                  switch (alt6) {
1520                 case 1 :
1521 -                   // Bst.g:90:11: ~ ('\\n'|'\\r')
1522 +                   // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:
1523                     {
1524 -                   if ( (input.LA(1)>='\u0000' && input.LA(1)<='\t')||(input.LA(1)>='\u000B' && input.LA(1)<='\f')||(input.LA(1)>='\u000E' && input.LA(1)<='\uFFFE') ) {
1525 +                   if ( (input.LA(1) >= '\u0000' && input.LA(1) <= '\t')||(input.LA(1) >= '\u000B' && input.LA(1) <= '\f')||(input.LA(1) >= '\u000E' && input.LA(1) <= '\uFFFF') ) {
1526                         input.consume();
1527 -
1528                     }
1529                     else {
1530 -                       MismatchedSetException mse =
1531 -                           new MismatchedSetException(null,input);
1532 -                       recover(mse);    throw mse;
1533 +                       MismatchedSetException mse = new MismatchedSetException(null,input);
1534 +                       recover(mse);
1535 +                       throw mse;
1536                     }
1537  
1538  
1539 @@ -1032,15 +856,17 @@
1540                  }
1541              } while (true);
1542  
1543 -            // Bst.g:90:25: ( '\\r' )?
1544 +
1545 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:94:25: ( '\\r' )?
1546              int alt7=2;
1547              int LA7_0 = input.LA(1);
1548 +
1549              if ( (LA7_0=='\r') ) {
1550                  alt7=1;
1551              }
1552              switch (alt7) {
1553                  case 1 :
1554 -                    // Bst.g:90:25: '\\r'
1555 +                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:94:25: '\\r'
1556                      {
1557                      match('\r'); 
1558  
1559 @@ -1049,623 +875,225 @@
1560  
1561              }
1562  
1563 -            match('\n'); 
1564 -             _channel=HIDDEN; 
1565 -
1566 -            }
1567  
1568 +            match('\n');
1569  
1570 +            _channel=99;
1571  
1572 -                    if ( token==null && ruleNestingLevel==1 ) {
1573 -                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
1574 -                    }
1575 +            }
1576  
1577 -                        }
1578 +            state.type = _type;
1579 +            state.channel = _channel;
1580 +        }
1581          finally {
1582 -            ruleNestingLevel--;
1583 +               // do for sure before leaving
1584          }
1585      }
1586 -    // $ANTLR end LINE_COMMENT
1587 +    // $ANTLR end "LINE_COMMENT"
1588  
1589      public void mTokens() throws RecognitionException {
1590 -        // Bst.g:1:10: ( T25 | T26 | T27 | T28 | T29 | T30 | T31 | T32 | T33 | STRINGS | INTEGERS | FUNCTION | EXECUTE | SORT | ITERATE | REVERSE | ENTRY | READ | MACRO | QUOTED | IDENTIFIER | STRING | INTEGER | WS | LINE_COMMENT )
1591 +        // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:8: ( T__25 | T__26 | T__27 | T__28 | T__29 | T__30 | T__31 | T__32 | T__33 | STRINGS | INTEGERS | FUNCTION | EXECUTE | SORT | ITERATE | REVERSE | ENTRY | READ | MACRO | QUOTED | IDENTIFIER | STRING | INTEGER | WS | LINE_COMMENT )
1592          int alt8=25;
1593 -        switch ( input.LA(1) ) {
1594 -        case '{':
1595 -            alt8=1;
1596 -            break;
1597 -        case '}':
1598 -            alt8=2;
1599 -            break;
1600 -        case '<':
1601 -            alt8=3;
1602 -            break;
1603 -        case '>':
1604 -            alt8=4;
1605 -            break;
1606 -        case '=':
1607 -            alt8=5;
1608 -            break;
1609 -        case '+':
1610 -            alt8=6;
1611 -            break;
1612 -        case '-':
1613 -            alt8=7;
1614 -            break;
1615 -        case ':':
1616 -            alt8=8;
1617 -            break;
1618 -        case '*':
1619 -            alt8=9;
1620 -            break;
1621 -        case 'S':
1622 -            switch ( input.LA(2) ) {
1623 -            case 'T':
1624 -                int LA8_22 = input.LA(3);
1625 -                if ( (LA8_22=='R') ) {
1626 -                    int LA8_31 = input.LA(4);
1627 -                    if ( (LA8_31=='I') ) {
1628 -                        int LA8_41 = input.LA(5);
1629 -                        if ( (LA8_41=='N') ) {
1630 -                            int LA8_51 = input.LA(6);
1631 -                            if ( (LA8_51=='G') ) {
1632 -                                int LA8_61 = input.LA(7);
1633 -                                if ( (LA8_61=='S') ) {
1634 -                                    int LA8_69 = input.LA(8);
1635 -                                    if ( (LA8_69=='$'||LA8_69=='.'||(LA8_69>='0' && LA8_69<='9')||(LA8_69>='A' && LA8_69<='Z')||(LA8_69>='a' && LA8_69<='z')) ) {
1636 -                                        alt8=21;
1637 -                                    }
1638 -                                    else {
1639 -                                        alt8=10;}
1640 -                                }
1641 -                                else {
1642 -                                    alt8=21;}
1643 -                            }
1644 -                            else {
1645 -                                alt8=21;}
1646 -                        }
1647 -                        else {
1648 -                            alt8=21;}
1649 -                    }
1650 -                    else {
1651 -                        alt8=21;}
1652 -                }
1653 -                else {
1654 -                    alt8=21;}
1655 -                break;
1656 -            case 'O':
1657 -                int LA8_23 = input.LA(3);
1658 -                if ( (LA8_23=='R') ) {
1659 -                    int LA8_32 = input.LA(4);
1660 -                    if ( (LA8_32=='T') ) {
1661 -                        int LA8_42 = input.LA(5);
1662 -                        if ( (LA8_42=='$'||LA8_42=='.'||(LA8_42>='0' && LA8_42<='9')||(LA8_42>='A' && LA8_42<='Z')||(LA8_42>='a' && LA8_42<='z')) ) {
1663 -                            alt8=21;
1664 -                        }
1665 -                        else {
1666 -                            alt8=14;}
1667 -                    }
1668 -                    else {
1669 -                        alt8=21;}
1670 -                }
1671 -                else {
1672 -                    alt8=21;}
1673 -                break;
1674 -            default:
1675 -                alt8=21;}
1676 -
1677 -            break;
1678 -        case 'I':
1679 -            switch ( input.LA(2) ) {
1680 -            case 'T':
1681 -                int LA8_24 = input.LA(3);
1682 -                if ( (LA8_24=='E') ) {
1683 -                    int LA8_33 = input.LA(4);
1684 -                    if ( (LA8_33=='R') ) {
1685 -                        int LA8_43 = input.LA(5);
1686 -                        if ( (LA8_43=='A') ) {
1687 -                            int LA8_53 = input.LA(6);
1688 -                            if ( (LA8_53=='T') ) {
1689 -                                int LA8_62 = input.LA(7);
1690 -                                if ( (LA8_62=='E') ) {
1691 -                                    int LA8_70 = input.LA(8);
1692 -                                    if ( (LA8_70=='$'||LA8_70=='.'||(LA8_70>='0' && LA8_70<='9')||(LA8_70>='A' && LA8_70<='Z')||(LA8_70>='a' && LA8_70<='z')) ) {
1693 -                                        alt8=21;
1694 -                                    }
1695 -                                    else {
1696 -                                        alt8=15;}
1697 -                                }
1698 -                                else {
1699 -                                    alt8=21;}
1700 -                            }
1701 -                            else {
1702 -                                alt8=21;}
1703 -                        }
1704 -                        else {
1705 -                            alt8=21;}
1706 -                    }
1707 -                    else {
1708 -                        alt8=21;}
1709 -                }
1710 -                else {
1711 -                    alt8=21;}
1712 -                break;
1713 -            case 'N':
1714 -                int LA8_25 = input.LA(3);
1715 -                if ( (LA8_25=='T') ) {
1716 -                    int LA8_34 = input.LA(4);
1717 -                    if ( (LA8_34=='E') ) {
1718 -                        int LA8_44 = input.LA(5);
1719 -                        if ( (LA8_44=='G') ) {
1720 -                            int LA8_54 = input.LA(6);
1721 -                            if ( (LA8_54=='E') ) {
1722 -                                int LA8_63 = input.LA(7);
1723 -                                if ( (LA8_63=='R') ) {
1724 -                                    int LA8_71 = input.LA(8);
1725 -                                    if ( (LA8_71=='S') ) {
1726 -                                        int LA8_77 = input.LA(9);
1727 -                                        if ( (LA8_77=='$'||LA8_77=='.'||(LA8_77>='0' && LA8_77<='9')||(LA8_77>='A' && LA8_77<='Z')||(LA8_77>='a' && LA8_77<='z')) ) {
1728 -                                            alt8=21;
1729 -                                        }
1730 -                                        else {
1731 -                                            alt8=11;}
1732 -                                    }
1733 -                                    else {
1734 -                                        alt8=21;}
1735 -                                }
1736 -                                else {
1737 -                                    alt8=21;}
1738 -                            }
1739 -                            else {
1740 -                                alt8=21;}
1741 -                        }
1742 -                        else {
1743 -                            alt8=21;}
1744 -                    }
1745 -                    else {
1746 -                        alt8=21;}
1747 -                }
1748 -                else {
1749 -                    alt8=21;}
1750 -                break;
1751 -            default:
1752 -                alt8=21;}
1753 -
1754 -            break;
1755 -        case 'F':
1756 -            int LA8_12 = input.LA(2);
1757 -            if ( (LA8_12=='U') ) {
1758 -                int LA8_26 = input.LA(3);
1759 -                if ( (LA8_26=='N') ) {
1760 -                    int LA8_35 = input.LA(4);
1761 -                    if ( (LA8_35=='C') ) {
1762 -                        int LA8_45 = input.LA(5);
1763 -                        if ( (LA8_45=='T') ) {
1764 -                            int LA8_55 = input.LA(6);
1765 -                            if ( (LA8_55=='I') ) {
1766 -                                int LA8_64 = input.LA(7);
1767 -                                if ( (LA8_64=='O') ) {
1768 -                                    int LA8_72 = input.LA(8);
1769 -                                    if ( (LA8_72=='N') ) {
1770 -                                        int LA8_78 = input.LA(9);
1771 -                                        if ( (LA8_78=='$'||LA8_78=='.'||(LA8_78>='0' && LA8_78<='9')||(LA8_78>='A' && LA8_78<='Z')||(LA8_78>='a' && LA8_78<='z')) ) {
1772 -                                            alt8=21;
1773 -                                        }
1774 -                                        else {
1775 -                                            alt8=12;}
1776 -                                    }
1777 -                                    else {
1778 -                                        alt8=21;}
1779 -                                }
1780 -                                else {
1781 -                                    alt8=21;}
1782 -                            }
1783 -                            else {
1784 -                                alt8=21;}
1785 -                        }
1786 -                        else {
1787 -                            alt8=21;}
1788 -                    }
1789 -                    else {
1790 -                        alt8=21;}
1791 -                }
1792 -                else {
1793 -                    alt8=21;}
1794 -            }
1795 -            else {
1796 -                alt8=21;}
1797 -            break;
1798 -        case 'E':
1799 -            switch ( input.LA(2) ) {
1800 -            case 'N':
1801 -                int LA8_27 = input.LA(3);
1802 -                if ( (LA8_27=='T') ) {
1803 -                    int LA8_36 = input.LA(4);
1804 -                    if ( (LA8_36=='R') ) {
1805 -                        int LA8_46 = input.LA(5);
1806 -                        if ( (LA8_46=='Y') ) {
1807 -                            int LA8_56 = input.LA(6);
1808 -                            if ( (LA8_56=='$'||LA8_56=='.'||(LA8_56>='0' && LA8_56<='9')||(LA8_56>='A' && LA8_56<='Z')||(LA8_56>='a' && LA8_56<='z')) ) {
1809 -                                alt8=21;
1810 -                            }
1811 -                            else {
1812 -                                alt8=17;}
1813 -                        }
1814 -                        else {
1815 -                            alt8=21;}
1816 -                    }
1817 -                    else {
1818 -                        alt8=21;}
1819 -                }
1820 -                else {
1821 -                    alt8=21;}
1822 -                break;
1823 -            case 'X':
1824 -                int LA8_28 = input.LA(3);
1825 -                if ( (LA8_28=='E') ) {
1826 -                    int LA8_37 = input.LA(4);
1827 -                    if ( (LA8_37=='C') ) {
1828 -                        int LA8_47 = input.LA(5);
1829 -                        if ( (LA8_47=='U') ) {
1830 -                            int LA8_57 = input.LA(6);
1831 -                            if ( (LA8_57=='T') ) {
1832 -                                int LA8_66 = input.LA(7);
1833 -                                if ( (LA8_66=='E') ) {
1834 -                                    int LA8_73 = input.LA(8);
1835 -                                    if ( (LA8_73=='$'||LA8_73=='.'||(LA8_73>='0' && LA8_73<='9')||(LA8_73>='A' && LA8_73<='Z')||(LA8_73>='a' && LA8_73<='z')) ) {
1836 -                                        alt8=21;
1837 -                                    }
1838 -                                    else {
1839 -                                        alt8=13;}
1840 -                                }
1841 -                                else {
1842 -                                    alt8=21;}
1843 -                            }
1844 -                            else {
1845 -                                alt8=21;}
1846 -                        }
1847 -                        else {
1848 -                            alt8=21;}
1849 -                    }
1850 -                    else {
1851 -                        alt8=21;}
1852 -                }
1853 -                else {
1854 -                    alt8=21;}
1855 -                break;
1856 -            default:
1857 -                alt8=21;}
1858 -
1859 -            break;
1860 -        case 'R':
1861 -            int LA8_14 = input.LA(2);
1862 -            if ( (LA8_14=='E') ) {
1863 -                switch ( input.LA(3) ) {
1864 -                case 'A':
1865 -                    int LA8_38 = input.LA(4);
1866 -                    if ( (LA8_38=='D') ) {
1867 -                        int LA8_48 = input.LA(5);
1868 -                        if ( (LA8_48=='$'||LA8_48=='.'||(LA8_48>='0' && LA8_48<='9')||(LA8_48>='A' && LA8_48<='Z')||(LA8_48>='a' && LA8_48<='z')) ) {
1869 -                            alt8=21;
1870 -                        }
1871 -                        else {
1872 -                            alt8=18;}
1873 -                    }
1874 -                    else {
1875 -                        alt8=21;}
1876 -                    break;
1877 -                case 'V':
1878 -                    int LA8_39 = input.LA(4);
1879 -                    if ( (LA8_39=='E') ) {
1880 -                        int LA8_49 = input.LA(5);
1881 -                        if ( (LA8_49=='R') ) {
1882 -                            int LA8_59 = input.LA(6);
1883 -                            if ( (LA8_59=='S') ) {
1884 -                                int LA8_67 = input.LA(7);
1885 -                                if ( (LA8_67=='E') ) {
1886 -                                    int LA8_74 = input.LA(8);
1887 -                                    if ( (LA8_74=='$'||LA8_74=='.'||(LA8_74>='0' && LA8_74<='9')||(LA8_74>='A' && LA8_74<='Z')||(LA8_74>='a' && LA8_74<='z')) ) {
1888 -                                        alt8=21;
1889 -                                    }
1890 -                                    else {
1891 -                                        alt8=16;}
1892 -                                }
1893 -                                else {
1894 -                                    alt8=21;}
1895 -                            }
1896 -                            else {
1897 -                                alt8=21;}
1898 -                        }
1899 -                        else {
1900 -                            alt8=21;}
1901 -                    }
1902 -                    else {
1903 -                        alt8=21;}
1904 -                    break;
1905 -                default:
1906 -                    alt8=21;}
1907 -
1908 -            }
1909 -            else {
1910 -                alt8=21;}
1911 -            break;
1912 -        case 'M':
1913 -            int LA8_15 = input.LA(2);
1914 -            if ( (LA8_15=='A') ) {
1915 -                int LA8_30 = input.LA(3);
1916 -                if ( (LA8_30=='C') ) {
1917 -                    int LA8_40 = input.LA(4);
1918 -                    if ( (LA8_40=='R') ) {
1919 -                        int LA8_50 = input.LA(5);
1920 -                        if ( (LA8_50=='O') ) {
1921 -                            int LA8_60 = input.LA(6);
1922 -                            if ( (LA8_60=='$'||LA8_60=='.'||(LA8_60>='0' && LA8_60<='9')||(LA8_60>='A' && LA8_60<='Z')||(LA8_60>='a' && LA8_60<='z')) ) {
1923 -                                alt8=21;
1924 -                            }
1925 -                            else {
1926 -                                alt8=19;}
1927 -                        }
1928 -                        else {
1929 -                            alt8=21;}
1930 -                    }
1931 -                    else {
1932 -                        alt8=21;}
1933 -                }
1934 -                else {
1935 -                    alt8=21;}
1936 -            }
1937 -            else {
1938 -                alt8=21;}
1939 -            break;
1940 -        case '\'':
1941 -            alt8=20;
1942 -            break;
1943 -        case '$':
1944 -        case '.':
1945 -        case 'A':
1946 -        case 'B':
1947 -        case 'C':
1948 -        case 'D':
1949 -        case 'G':
1950 -        case 'H':
1951 -        case 'J':
1952 -        case 'K':
1953 -        case 'L':
1954 -        case 'N':
1955 -        case 'O':
1956 -        case 'P':
1957 -        case 'Q':
1958 -        case 'T':
1959 -        case 'U':
1960 -        case 'V':
1961 -        case 'W':
1962 -        case 'X':
1963 -        case 'Y':
1964 -        case 'Z':
1965 -        case 'a':
1966 -        case 'b':
1967 -        case 'c':
1968 -        case 'd':
1969 -        case 'e':
1970 -        case 'f':
1971 -        case 'g':
1972 -        case 'h':
1973 -        case 'i':
1974 -        case 'j':
1975 -        case 'k':
1976 -        case 'l':
1977 -        case 'm':
1978 -        case 'n':
1979 -        case 'o':
1980 -        case 'p':
1981 -        case 'q':
1982 -        case 'r':
1983 -        case 's':
1984 -        case 't':
1985 -        case 'u':
1986 -        case 'v':
1987 -        case 'w':
1988 -        case 'x':
1989 -        case 'y':
1990 -        case 'z':
1991 -            alt8=21;
1992 -            break;
1993 -        case '\"':
1994 -            alt8=22;
1995 -            break;
1996 -        case '#':
1997 -            alt8=23;
1998 -            break;
1999 -        case '\t':
2000 -        case '\n':
2001 -        case '\r':
2002 -        case ' ':
2003 -            alt8=24;
2004 -            break;
2005 -        case '%':
2006 -            alt8=25;
2007 -            break;
2008 -        default:
2009 -            NoViableAltException nvae =
2010 -                new NoViableAltException("1:1: Tokens : ( T25 | T26 | T27 | T28 | T29 | T30 | T31 | T32 | T33 | STRINGS | INTEGERS | FUNCTION | EXECUTE | SORT | ITERATE | REVERSE | ENTRY | READ | MACRO | QUOTED | IDENTIFIER | STRING | INTEGER | WS | LINE_COMMENT );", 8, 0, input);
2011 -
2012 -            throw nvae;
2013 -        }
2014 -
2015 +        alt8 = dfa8.predict(input);
2016          switch (alt8) {
2017              case 1 :
2018 -                // Bst.g:1:10: T25
2019 +                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:10: T__25
2020                  {
2021 -                mT25(); 
2022 +                mT__25();
2023 +
2024  
2025                  }
2026                  break;
2027              case 2 :
2028 -                // Bst.g:1:14: T26
2029 +                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:16: T__26
2030                  {
2031 -                mT26(); 
2032 +                mT__26();
2033 +
2034  
2035                  }
2036                  break;
2037              case 3 :
2038 -                // Bst.g:1:18: T27
2039 +                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:22: T__27
2040                  {
2041 -                mT27(); 
2042 +                mT__27();
2043 +
2044  
2045                  }
2046                  break;
2047              case 4 :
2048 -                // Bst.g:1:22: T28
2049 +                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:28: T__28
2050                  {
2051 -                mT28(); 
2052 +                mT__28();
2053 +
2054  
2055                  }
2056                  break;
2057              case 5 :
2058 -                // Bst.g:1:26: T29
2059 +                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:34: T__29
2060                  {
2061 -                mT29(); 
2062 +                mT__29();
2063 +
2064  
2065                  }
2066                  break;
2067              case 6 :
2068 -                // Bst.g:1:30: T30
2069 +                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:40: T__30
2070                  {
2071 -                mT30(); 
2072 +                mT__30();
2073 +
2074  
2075                  }
2076                  break;
2077              case 7 :
2078 -                // Bst.g:1:34: T31
2079 +                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:46: T__31
2080                  {
2081 -                mT31(); 
2082 +                mT__31();
2083 +
2084  
2085                  }
2086                  break;
2087              case 8 :
2088 -                // Bst.g:1:38: T32
2089 +                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:52: T__32
2090                  {
2091 -                mT32(); 
2092 +                mT__32();
2093 +
2094  
2095                  }
2096                  break;
2097              case 9 :
2098 -                // Bst.g:1:42: T33
2099 +                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:58: T__33
2100                  {
2101 -                mT33(); 
2102 +                mT__33();
2103 +
2104  
2105                  }
2106                  break;
2107              case 10 :
2108 -                // Bst.g:1:46: STRINGS
2109 +                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:64: STRINGS
2110                  {
2111                  mSTRINGS(); 
2112  
2113 +
2114                  }
2115                  break;
2116              case 11 :
2117 -                // Bst.g:1:54: INTEGERS
2118 +                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:72: INTEGERS
2119                  {
2120                  mINTEGERS(); 
2121  
2122 +
2123                  }
2124                  break;
2125              case 12 :
2126 -                // Bst.g:1:63: FUNCTION
2127 +                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:81: FUNCTION
2128                  {
2129                  mFUNCTION(); 
2130  
2131 +
2132                  }
2133                  break;
2134              case 13 :
2135 -                // Bst.g:1:72: EXECUTE
2136 +                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:90: EXECUTE
2137                  {
2138                  mEXECUTE(); 
2139  
2140 +
2141                  }
2142                  break;
2143              case 14 :
2144 -                // Bst.g:1:80: SORT
2145 +                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:98: SORT
2146                  {
2147                  mSORT(); 
2148  
2149 +
2150                  }
2151                  break;
2152              case 15 :
2153 -                // Bst.g:1:85: ITERATE
2154 +                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:103: ITERATE
2155                  {
2156                  mITERATE(); 
2157  
2158 +
2159                  }
2160                  break;
2161              case 16 :
2162 -                // Bst.g:1:93: REVERSE
2163 +                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:111: REVERSE
2164                  {
2165                  mREVERSE(); 
2166  
2167 +
2168                  }
2169                  break;
2170              case 17 :
2171 -                // Bst.g:1:101: ENTRY
2172 +                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:119: ENTRY
2173                  {
2174                  mENTRY(); 
2175  
2176 +
2177                  }
2178                  break;
2179              case 18 :
2180 -                // Bst.g:1:107: READ
2181 +                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:125: READ
2182                  {
2183                  mREAD(); 
2184  
2185 +
2186                  }
2187                  break;
2188              case 19 :
2189 -                // Bst.g:1:112: MACRO
2190 +                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:130: MACRO
2191                  {
2192                  mMACRO(); 
2193  
2194 +
2195                  }
2196                  break;
2197              case 20 :
2198 -                // Bst.g:1:118: QUOTED
2199 +                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:136: QUOTED
2200                  {
2201                  mQUOTED(); 
2202  
2203 +
2204                  }
2205                  break;
2206              case 21 :
2207 -                // Bst.g:1:125: IDENTIFIER
2208 +                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:143: IDENTIFIER
2209                  {
2210                  mIDENTIFIER(); 
2211  
2212 +
2213                  }
2214                  break;
2215              case 22 :
2216 -                // Bst.g:1:136: STRING
2217 +                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:154: STRING
2218                  {
2219                  mSTRING(); 
2220  
2221 +
2222                  }
2223                  break;
2224              case 23 :
2225 -                // Bst.g:1:143: INTEGER
2226 +                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:161: INTEGER
2227                  {
2228                  mINTEGER(); 
2229  
2230 +
2231                  }
2232                  break;
2233              case 24 :
2234 -                // Bst.g:1:151: WS
2235 +                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:169: WS
2236                  {
2237                  mWS(); 
2238  
2239 +
2240                  }
2241                  break;
2242              case 25 :
2243 -                // Bst.g:1:154: LINE_COMMENT
2244 +                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:172: LINE_COMMENT
2245                  {
2246                  mLINE_COMMENT(); 
2247  
2248 +
2249                  }
2250                  break;
2251  
2252 @@ -1674,6 +1102,167 @@
2253      }
2254  
2255  
2256 +    protected DFA8 dfa8 = new DFA8(this);
2257 +    static final String DFA8_eotS =
2258 +        "\12\uffff\6\21\6\uffff\24\21\1\64\6\21\1\73\2\21\1\uffff\4\21\1"+
2259 +        "\102\1\21\1\uffff\1\104\5\21\1\uffff\1\21\1\uffff\1\113\1\21\1\115"+
2260 +        "\1\21\1\117\1\120\1\uffff\1\121\1\uffff\1\122\4\uffff";
2261 +    static final String DFA8_eofS =
2262 +        "\123\uffff";
2263 +    static final String DFA8_minS =
2264 +        "\1\11\11\uffff\1\117\1\116\1\125\1\116\1\105\1\101\6\uffff\2\122"+
2265 +        "\1\124\1\105\1\116\1\105\1\124\1\101\1\103\1\111\1\124\1\105\1\122"+
2266 +        "\2\103\1\122\1\105\1\104\1\122\1\116\1\44\1\107\1\101\1\124\1\125"+
2267 +        "\1\131\1\122\1\44\1\117\1\107\1\uffff\1\105\1\124\1\111\1\124\1"+
2268 +        "\44\1\123\1\uffff\1\44\1\123\1\122\1\105\1\117\1\105\1\uffff\1\105"+
2269 +        "\1\uffff\1\44\1\123\1\44\1\116\2\44\1\uffff\1\44\1\uffff\1\44\4"+
2270 +        "\uffff";
2271 +    static final String DFA8_maxS =
2272 +        "\1\175\11\uffff\2\124\1\125\1\130\1\105\1\101\6\uffff\2\122\1\124"+
2273 +        "\1\105\1\116\1\105\1\124\1\126\1\103\1\111\1\124\1\105\1\122\2\103"+
2274 +        "\1\122\1\105\1\104\1\122\1\116\1\172\1\107\1\101\1\124\1\125\1\131"+
2275 +        "\1\122\1\172\1\117\1\107\1\uffff\1\105\1\124\1\111\1\124\1\172\1"+
2276 +        "\123\1\uffff\1\172\1\123\1\122\1\105\1\117\1\105\1\uffff\1\105\1"+
2277 +        "\uffff\1\172\1\123\1\172\1\116\2\172\1\uffff\1\172\1\uffff\1\172"+
2278 +        "\4\uffff";
2279 +    static final String DFA8_acceptS =
2280 +        "\1\uffff\1\1\1\2\1\3\1\4\1\5\1\6\1\7\1\10\1\11\6\uffff\1\24\1\25"+
2281 +        "\1\26\1\27\1\30\1\31\36\uffff\1\16\6\uffff\1\22\6\uffff\1\21\1\uffff"+
2282 +        "\1\23\6\uffff\1\12\1\uffff\1\17\1\uffff\1\15\1\20\1\13\1\14";
2283 +    static final String DFA8_specialS =
2284 +        "\123\uffff}>";
2285 +    static final String[] DFA8_transitionS = {
2286 +            "\2\24\25\uffff\1\24\1\uffff\1\22\1\23\1\21\1\25\1\uffff\1\20"+
2287 +            "\2\uffff\1\1\1\2\1\uffff\1\3\1\21\13\uffff\1\4\1\uffff\1\5\1"+
2288 +            "\6\1\7\2\uffff\4\21\1\15\1\14\2\21\1\13\3\21\1\17\4\21\1\16"+
2289 +            "\1\12\7\21\6\uffff\32\21\1\10\1\uffff\1\11",
2290 +            "",
2291 +            "",
2292 +            "",
2293 +            "",
2294 +            "",
2295 +            "",
2296 +            "",
2297 +            "",
2298 +            "",
2299 +            "\1\27\4\uffff\1\26",
2300 +            "\1\30\5\uffff\1\31",
2301 +            "\1\32",
2302 +            "\1\34\11\uffff\1\33",
2303 +            "\1\35",
2304 +            "\1\36",
2305 +            "",
2306 +            "",
2307 +            "",
2308 +            "",
2309 +            "",
2310 +            "",
2311 +            "\1\37",
2312 +            "\1\40",
2313 +            "\1\41",
2314 +            "\1\42",
2315 +            "\1\43",
2316 +            "\1\44",
2317 +            "\1\45",
2318 +            "\1\47\24\uffff\1\46",
2319 +            "\1\50",
2320 +            "\1\51",
2321 +            "\1\52",
2322 +            "\1\53",
2323 +            "\1\54",
2324 +            "\1\55",
2325 +            "\1\56",
2326 +            "\1\57",
2327 +            "\1\60",
2328 +            "\1\61",
2329 +            "\1\62",
2330 +            "\1\63",
2331 +            "\1\21\11\uffff\1\21\1\uffff\12\21\7\uffff\32\21\6\uffff\32"+
2332 +            "\21",
2333 +            "\1\65",
2334 +            "\1\66",
2335 +            "\1\67",
2336 +            "\1\70",
2337 +            "\1\71",
2338 +            "\1\72",
2339 +            "\1\21\11\uffff\1\21\1\uffff\12\21\7\uffff\32\21\6\uffff\32"+
2340 +            "\21",
2341 +            "\1\74",
2342 +            "\1\75",
2343 +            "",
2344 +            "\1\76",
2345 +            "\1\77",
2346 +            "\1\100",
2347 +            "\1\101",
2348 +            "\1\21\11\uffff\1\21\1\uffff\12\21\7\uffff\32\21\6\uffff\32"+
2349 +            "\21",
2350 +            "\1\103",
2351 +            "",
2352 +            "\1\21\11\uffff\1\21\1\uffff\12\21\7\uffff\32\21\6\uffff\32"+
2353 +            "\21",
2354 +            "\1\105",
2355 +            "\1\106",
2356 +            "\1\107",
2357 +            "\1\110",
2358 +            "\1\111",
2359 +            "",
2360 +            "\1\112",
2361 +            "",
2362 +            "\1\21\11\uffff\1\21\1\uffff\12\21\7\uffff\32\21\6\uffff\32"+
2363 +            "\21",
2364 +            "\1\114",
2365 +            "\1\21\11\uffff\1\21\1\uffff\12\21\7\uffff\32\21\6\uffff\32"+
2366 +            "\21",
2367 +            "\1\116",
2368 +            "\1\21\11\uffff\1\21\1\uffff\12\21\7\uffff\32\21\6\uffff\32"+
2369 +            "\21",
2370 +            "\1\21\11\uffff\1\21\1\uffff\12\21\7\uffff\32\21\6\uffff\32"+
2371 +            "\21",
2372 +            "",
2373 +            "\1\21\11\uffff\1\21\1\uffff\12\21\7\uffff\32\21\6\uffff\32"+
2374 +            "\21",
2375 +            "",
2376 +            "\1\21\11\uffff\1\21\1\uffff\12\21\7\uffff\32\21\6\uffff\32"+
2377 +            "\21",
2378 +            "",
2379 +            "",
2380 +            "",
2381 +            ""
2382 +    };
2383 +
2384 +    static final short[] DFA8_eot = DFA.unpackEncodedString(DFA8_eotS);
2385 +    static final short[] DFA8_eof = DFA.unpackEncodedString(DFA8_eofS);
2386 +    static final char[] DFA8_min = DFA.unpackEncodedStringToUnsignedChars(DFA8_minS);
2387 +    static final char[] DFA8_max = DFA.unpackEncodedStringToUnsignedChars(DFA8_maxS);
2388 +    static final short[] DFA8_accept = DFA.unpackEncodedString(DFA8_acceptS);
2389 +    static final short[] DFA8_special = DFA.unpackEncodedString(DFA8_specialS);
2390 +    static final short[][] DFA8_transition;
2391 +
2392 +    static {
2393 +        int numStates = DFA8_transitionS.length;
2394 +        DFA8_transition = new short[numStates][];
2395 +        for (int i=0; i<numStates; i++) {
2396 +            DFA8_transition[i] = DFA.unpackEncodedString(DFA8_transitionS[i]);
2397 +        }
2398 +    }
2399 +
2400 +    class DFA8 extends DFA {
2401 +
2402 +        public DFA8(BaseRecognizer recognizer) {
2403 +            this.recognizer = recognizer;
2404 +            this.decisionNumber = 8;
2405 +            this.eot = DFA8_eot;
2406 +            this.eof = DFA8_eof;
2407 +            this.min = DFA8_min;
2408 +            this.max = DFA8_max;
2409 +            this.accept = DFA8_accept;
2410 +            this.special = DFA8_special;
2411 +            this.transition = DFA8_transition;
2412 +        }
2413 +        public String getDescription() {
2414 +            return "1:1: Tokens : ( T__25 | T__26 | T__27 | T__28 | T__29 | T__30 | T__31 | T__32 | T__33 | STRINGS | INTEGERS | FUNCTION | EXECUTE | SORT | ITERATE | REVERSE | ENTRY | READ | MACRO | QUOTED | IDENTIFIER | STRING | INTEGER | WS | LINE_COMMENT );";
2415 +        }
2416 +    }
2417   
2418  
2419 -}
2420 +}
2421 \ No newline at end of file
2422 --- a/src/java/net/sf/jabref/bst/BstParser.java
2423 +++ b/src/java/net/sf/jabref/bst/BstParser.java
2424 @@ -1,122 +1,125 @@
2425 -/*  Copyright (C) 2003-2011 JabRef contributors.
2426 -    This program is free software; you can redistribute it and/or modify
2427 -    it under the terms of the GNU General Public License as published by
2428 -    the Free Software Foundation; either version 2 of the License, or
2429 -    (at your option) any later version.
2430 -
2431 -    This program is distributed in the hope that it will be useful,
2432 -    but WITHOUT ANY WARRANTY; without even the implied warranty of
2433 -    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
2434 -    GNU General Public License for more details.
2435 -
2436 -    You should have received a copy of the GNU General Public License along
2437 -    with this program; if not, write to the Free Software Foundation, Inc.,
2438 -    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
2439 -*/
2440 +// $ANTLR 3.4 C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g 2012-10-28 23:48:28
2441 +// Generated by ANTLR
2442  package net.sf.jabref.bst;
2443  
2444 -// $ANTLR 3.0b5 Bst.g 2006-11-23 23:20:24
2445 -
2446 -import java.util.ArrayList;
2447 +import org.antlr.runtime.*;
2448 +import java.util.Stack;
2449  import java.util.List;
2450 +import java.util.ArrayList;
2451  
2452 -import org.antlr.runtime.BitSet;
2453 -import org.antlr.runtime.EarlyExitException;
2454 -import org.antlr.runtime.NoViableAltException;
2455 -import org.antlr.runtime.Parser;
2456 -import org.antlr.runtime.ParserRuleReturnScope;
2457 -import org.antlr.runtime.RecognitionException;
2458 -import org.antlr.runtime.Token;
2459 -import org.antlr.runtime.TokenStream;
2460 -import org.antlr.runtime.tree.CommonTreeAdaptor;
2461 -import org.antlr.runtime.tree.TreeAdaptor;
2462 +import org.antlr.runtime.tree.*;
2463  
2464 -@SuppressWarnings({"unused", "unchecked"})
2465 +
2466 +@SuppressWarnings({"all", "warnings", "unchecked"})
2467  public class BstParser extends Parser {
2468      public static final String[] tokenNames = new String[] {
2469 -        "<invalid>", "<EOR>", "<DOWN>", "<UP>", "IDLIST", "STACK", "ENTRY", "COMMANDS", "STRINGS", "INTEGERS", "FUNCTION", "MACRO", "STRING", "READ", "EXECUTE", "ITERATE", "REVERSE", "SORT", "IDENTIFIER", "INTEGER", "QUOTED", "LETTER", "NUMERAL", "WS", "LINE_COMMENT", "'{'", "'}'", "'<'", "'>'", "'='", "'+'", "'-'", "':='", "'*'"
2470 +        "<invalid>", "<EOR>", "<DOWN>", "<UP>", "COMMANDS", "ENTRY", "EXECUTE", "FUNCTION", "IDENTIFIER", "IDLIST", "INTEGER", "INTEGERS", "ITERATE", "LETTER", "LINE_COMMENT", "MACRO", "NUMERAL", "QUOTED", "READ", "REVERSE", "SORT", "STACK", "STRING", "STRINGS", "WS", "'*'", "'+'", "'-'", "':='", "'<'", "'='", "'>'", "'{'", "'}'"
2471      };
2472 -    public static final int LETTER=21;
2473 -    public static final int ENTRY=6;
2474 -    public static final int INTEGERS=9;
2475 -    public static final int WS=23;
2476 -    public static final int COMMANDS=7;
2477 -    public static final int STRING=12;
2478 -    public static final int EXECUTE=14;
2479 -    public static final int LINE_COMMENT=24;
2480 -    public static final int SORT=17;
2481 -    public static final int STACK=5;
2482 -    public static final int REVERSE=16;
2483 -    public static final int QUOTED=20;
2484 -    public static final int INTEGER=19;
2485 -    public static final int ITERATE=15;
2486 -    public static final int FUNCTION=10;
2487 +
2488      public static final int EOF=-1;
2489 -    public static final int STRINGS=8;
2490 -    public static final int IDENTIFIER=18;
2491 -    public static final int MACRO=11;
2492 -    public static final int IDLIST=4;
2493 -    public static final int NUMERAL=22;
2494 -    public static final int READ=13;
2495 +    public static final int T__25=25;
2496 +    public static final int T__26=26;
2497 +    public static final int T__27=27;
2498 +    public static final int T__28=28;
2499 +    public static final int T__29=29;
2500 +    public static final int T__30=30;
2501 +    public static final int T__31=31;
2502 +    public static final int T__32=32;
2503 +    public static final int T__33=33;
2504 +    public static final int COMMANDS=4;
2505 +    public static final int ENTRY=5;
2506 +    public static final int EXECUTE=6;
2507 +    public static final int FUNCTION=7;
2508 +    public static final int IDENTIFIER=8;
2509 +    public static final int IDLIST=9;
2510 +    public static final int INTEGER=10;
2511 +    public static final int INTEGERS=11;
2512 +    public static final int ITERATE=12;
2513 +    public static final int LETTER=13;
2514 +    public static final int LINE_COMMENT=14;
2515 +    public static final int MACRO=15;
2516 +    public static final int NUMERAL=16;
2517 +    public static final int QUOTED=17;
2518 +    public static final int READ=18;
2519 +    public static final int REVERSE=19;
2520 +    public static final int SORT=20;
2521 +    public static final int STACK=21;
2522 +    public static final int STRING=22;
2523 +    public static final int STRINGS=23;
2524 +    public static final int WS=24;
2525 +
2526 +    // delegates
2527 +    public Parser[] getDelegates() {
2528 +        return new Parser[] {};
2529 +    }
2530 +
2531 +    // delegators
2532  
2533 -        public BstParser(TokenStream input) {
2534 -            super(input);
2535 -        }
2536 -        
2537 -    protected TreeAdaptor adaptor = new CommonTreeAdaptor();
2538  
2539 -    public void setTreeAdaptor(TreeAdaptor adaptor) {
2540 -        this.adaptor = adaptor;
2541 +    public BstParser(TokenStream input) {
2542 +        this(input, new RecognizerSharedState());
2543      }
2544 -    public TreeAdaptor getTreeAdaptor() {
2545 -        return adaptor;
2546 +    public BstParser(TokenStream input, RecognizerSharedState state) {
2547 +        super(input, state);
2548      }
2549  
2550 -    public String[] getTokenNames() { return tokenNames; }
2551 -    public String getGrammarFileName() { return "Bst.g"; }
2552 +protected TreeAdaptor adaptor = new CommonTreeAdaptor();
2553 +
2554 +public void setTreeAdaptor(TreeAdaptor adaptor) {
2555 +    this.adaptor = adaptor;
2556 +}
2557 +public TreeAdaptor getTreeAdaptor() {
2558 +    return adaptor;
2559 +}
2560 +    public String[] getTokenNames() { return BstParser.tokenNames; }
2561 +    public String getGrammarFileName() { return "C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g"; }
2562  
2563  
2564      public static class program_return extends ParserRuleReturnScope {
2565          Object tree;
2566          public Object getTree() { return tree; }
2567 -    }
2568 +    };
2569 +
2570  
2571 -    // $ANTLR start program
2572 -    // Bst.g:14:1: program : ( commands )+ -> ^( COMMANDS ( commands )+ ) ;
2573 -    public program_return program() throws RecognitionException {   
2574 -        program_return retval = new program_return();
2575 +    // $ANTLR start "program"
2576 +    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:22:1: program : ( commands )+ -> ^( COMMANDS ( commands )+ ) ;
2577 +    public final BstParser.program_return program() throws RecognitionException {
2578 +        BstParser.program_return retval = new BstParser.program_return();
2579          retval.start = input.LT(1);
2580  
2581 +
2582          Object root_0 = null;
2583  
2584 -        commands_return commands1 = null;
2585 +        BstParser.commands_return commands1 =null;
2586  
2587 -        List list_commands=new ArrayList();
2588  
2589 +        RewriteRuleSubtreeStream stream_commands=new RewriteRuleSubtreeStream(adaptor,"rule commands");
2590          try {
2591 -            // Bst.g:14:11: ( ( commands )+ -> ^( COMMANDS ( commands )+ ) )
2592 -            // Bst.g:14:11: ( commands )+
2593 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:22:9: ( ( commands )+ -> ^( COMMANDS ( commands )+ ) )
2594 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:22:11: ( commands )+
2595              {
2596 -            // Bst.g:14:11: ( commands )+
2597 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:22:11: ( commands )+
2598              int cnt1=0;
2599              loop1:
2600              do {
2601                  int alt1=2;
2602                  int LA1_0 = input.LA(1);
2603 -                if ( (LA1_0==ENTRY||(LA1_0>=STRINGS && LA1_0<=MACRO)||(LA1_0>=READ && LA1_0<=SORT)) ) {
2604 +
2605 +                if ( ((LA1_0 >= ENTRY && LA1_0 <= FUNCTION)||(LA1_0 >= INTEGERS && LA1_0 <= ITERATE)||LA1_0==MACRO||(LA1_0 >= READ && LA1_0 <= SORT)||LA1_0==STRINGS) ) {
2606                      alt1=1;
2607                  }
2608  
2609  
2610                  switch (alt1) {
2611                 case 1 :
2612 -                   // Bst.g:14:11: commands
2613 +                   // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:22:11: commands
2614                     {
2615 -                   pushFollow(FOLLOW_commands_in_program45);
2616 +                   pushFollow(FOLLOW_commands_in_program62);
2617                     commands1=commands();
2618 -                   _fsp--;
2619  
2620 -                   list_commands.add(commands1.tree);
2621 +                   state._fsp--;
2622 +
2623 +                   stream_commands.add(commands1.getTree());
2624  
2625                     }
2626                     break;
2627 @@ -132,29 +135,33 @@
2628  
2629  
2630              // AST REWRITE
2631 -            
2632 -                       int i_0 = 0;
2633 +            // elements: commands
2634 +            // token labels:
2635 +            // rule labels: retval
2636 +            // token list labels:
2637 +            // rule list labels:
2638 +            // wildcard labels:
2639              retval.tree = root_0;
2640 -            root_0 = adaptor.nil();
2641 -            // 14:21: -> ^( COMMANDS ( commands )+ )
2642 -            {
2643 -                // Bst.g:14:24: ^( COMMANDS ( commands )+ )
2644 -                {
2645 -                Object root_1 = adaptor.nil();
2646 -                root_1 = adaptor.becomeRoot(adaptor.create(COMMANDS, "COMMANDS"), root_1);
2647 +            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
2648  
2649 -                // Bst.g:14:35: ( commands )+
2650 +            root_0 = (Object)adaptor.nil();
2651 +            // 22:21: -> ^( COMMANDS ( commands )+ )
2652 +            {
2653 +                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:22:24: ^( COMMANDS ( commands )+ )
2654                  {
2655 -                int n_1 = list_commands == null ? 0 : list_commands.size();
2656 -                 
2657 -
2658 -
2659 -                if ( n_1==0 ) throw new RuntimeException("Must have more than one element for (...)+ loops");
2660 -                for (int i_1=0; i_1<n_1; i_1++) {
2661 -                    adaptor.addChild(root_1, list_commands.get(i_1));
2662 +                Object root_1 = (Object)adaptor.nil();
2663 +                root_1 = (Object)adaptor.becomeRoot(
2664 +                (Object)adaptor.create(COMMANDS, "COMMANDS")
2665 +                , root_1);
2666  
2667 +                if ( !(stream_commands.hasNext()) ) {
2668 +                    throw new RewriteEarlyExitException();
2669                  }
2670 +                while ( stream_commands.hasNext() ) {
2671 +                    adaptor.addChild(root_1, stream_commands.nextTree());
2672 +
2673                  }
2674 +                stream_commands.reset();
2675  
2676                  adaptor.addChild(root_0, root_1);
2677                  }
2678 @@ -162,36 +169,45 @@
2679              }
2680  
2681  
2682 +            retval.tree = root_0;
2683  
2684              }
2685  
2686 +            retval.stop = input.LT(-1);
2687 +
2688 +
2689 +            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
2690 +            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
2691 +
2692          }
2693          catch (RecognitionException re) {
2694              reportError(re);
2695              recover(input,re);
2696 -        }
2697 -        finally {
2698 -            retval.stop = input.LT(-1);
2699 +       retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
2700  
2701 -                retval.tree = adaptor.rulePostProcessing(root_0);
2702 -                adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
2703 +        }
2704  
2705 -       }
2706 +        finally {
2707 +               // do for sure before leaving
2708 +        }
2709          return retval;
2710      }
2711 -    // $ANTLR end program
2712 +    // $ANTLR end "program"
2713 +
2714  
2715      public static class commands_return extends ParserRuleReturnScope {
2716          Object tree;
2717          public Object getTree() { return tree; }
2718 -    }
2719 +    };
2720 +
2721  
2722 -    // $ANTLR start commands
2723 -    // Bst.g:16:1: commands : ( STRINGS^^ idList | INTEGERS^^ idList | FUNCTION^^ id stack | MACRO^^ id '{'! STRING '}'! | READ^^ | EXECUTE^^ '{'! function '}'! | ITERATE^^ '{'! function '}'! | REVERSE^^ '{'! function '}'! | ENTRY^^ idList0 idList0 idList0 | SORT^^ );
2724 -    public commands_return commands() throws RecognitionException {   
2725 -        commands_return retval = new commands_return();
2726 +    // $ANTLR start "commands"
2727 +    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:24:1: commands : ( STRINGS ^ idList | INTEGERS ^ idList | FUNCTION ^ id stack | MACRO ^ id '{' ! STRING '}' !| READ ^| EXECUTE ^ '{' ! function '}' !| ITERATE ^ '{' ! function '}' !| REVERSE ^ '{' ! function '}' !| ENTRY ^ idList0 idList0 idList0 | SORT ^);
2728 +    public final BstParser.commands_return commands() throws RecognitionException {
2729 +        BstParser.commands_return retval = new BstParser.commands_return();
2730          retval.start = input.LT(1);
2731  
2732 +
2733          Object root_0 = null;
2734  
2735          Token STRINGS2=null;
2736 @@ -213,27 +229,27 @@
2737          Token char_literal26=null;
2738          Token ENTRY27=null;
2739          Token SORT31=null;
2740 -        idList_return idList3 = null;
2741 +        BstParser.idList_return idList3 =null;
2742  
2743 -        idList_return idList5 = null;
2744 +        BstParser.idList_return idList5 =null;
2745  
2746 -        id_return id7 = null;
2747 +        BstParser.id_return id7 =null;
2748  
2749 -        stack_return stack8 = null;
2750 +        BstParser.stack_return stack8 =null;
2751  
2752 -        id_return id10 = null;
2753 +        BstParser.id_return id10 =null;
2754  
2755 -        function_return function17 = null;
2756 +        BstParser.function_return function17 =null;
2757  
2758 -        function_return function21 = null;
2759 +        BstParser.function_return function21 =null;
2760  
2761 -        function_return function25 = null;
2762 +        BstParser.function_return function25 =null;
2763  
2764 -        idList0_return idList028 = null;
2765 +        BstParser.idList0_return idList028 =null;
2766  
2767 -        idList0_return idList029 = null;
2768 +        BstParser.idList0_return idList029 =null;
2769  
2770 -        idList0_return idList030 = null;
2771 +        BstParser.idList0_return idList030 =null;
2772  
2773  
2774          Object STRINGS2_tree=null;
2775 @@ -257,282 +273,355 @@
2776          Object SORT31_tree=null;
2777  
2778          try {
2779 -            // Bst.g:17:4: ( STRINGS^^ idList | INTEGERS^^ idList | FUNCTION^^ id stack | MACRO^^ id '{'! STRING '}'! | READ^^ | EXECUTE^^ '{'! function '}'! | ITERATE^^ '{'! function '}'! | REVERSE^^ '{'! function '}'! | ENTRY^^ idList0 idList0 idList0 | SORT^^ )
2780 +            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:25:2: ( STRINGS ^ idList | INTEGERS ^ idList | FUNCTION ^ id stack | MACRO ^ id '{' ! STRING '}' !| READ ^| EXECUTE ^ '{' ! function '}' !| ITERATE ^ '{' ! function '}' !| REVERSE ^ '{' ! function '}' !| ENTRY ^ idList0 idList0 idList0 | SORT ^)
2781              int alt2=10;
2782              switch ( input.LA(1) ) {
2783              case STRINGS:
2784 +                {
2785                  alt2=1;
2786 +                }
2787                  break;
2788              case INTEGERS:
2789 +                {
2790                  alt2=2;
2791 +                }
2792                  break;
2793              case FUNCTION:
2794 +                {
2795                  alt2=3;
2796 +                }
2797                  break;
2798              case MACRO:
2799 +                {
2800                  alt2=4;
2801 +                }
2802                  break;
2803              case READ:
2804 +                {
2805                  alt2=5;
2806 +                }
2807                  break;
2808              case EXECUTE:
2809 +                {
2810                  alt2=6;
2811 +                }
2812                  break;
2813              case ITERATE:
2814 +                {
2815                  alt2=7;
2816 +                }
2817                  break;
2818              case REVERSE:
2819 +                {
2820                  alt2=8;
2821 +                }
2822                  break;
2823              case ENTRY:
2824 +                {
2825                  alt2=9;
2826 +                }
2827                  break;
2828              case SORT:
2829 +                {
2830                  alt2=10;
2831 +                }
2832                  break;
2833              default:
2834                  NoViableAltException nvae =
2835 -                    new NoViableAltException("16:1: commands : ( STRINGS^^ idList | INTEGERS^^ idList | FUNCTION^^ id stack | MACRO^^ id '{'! STRING '}'! | READ^^ | EXECUTE^^ '{'! function '}'! | ITERATE^^ '{'! function '}'! | REVERSE^^ '{'! function '}'! | ENTRY^^ idList0 idList0 idList0 | SORT^^ );", 2, 0, input);
2836 +                    new NoViableAltException("", 2, 0, input);
2837  
2838                  throw nvae;
2839 +
2840              }
2841  
2842              switch (alt2) {
2843                  case 1 :
2844 -                    // Bst.g:17:4: STRINGS^^ idList
2845 +                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:25:4: STRINGS ^ idList
2846                      {
2847 -                    root_0 = adaptor.nil();
2848 +                    root_0 = (Object)adaptor.nil();
2849 +
2850 +
2851 +                    STRINGS2=(Token)match(input,STRINGS,FOLLOW_STRINGS_in_commands82);
2852 +                    STRINGS2_tree =
2853 +                    (Object)adaptor.create(STRINGS2)
2854 +                    ;
2855 +                    root_0 = (Object)adaptor.becomeRoot(STRINGS2_tree, root_0);
2856  
2857 -                    STRINGS2=input.LT(1);
2858 -                    match(input,STRINGS,FOLLOW_STRINGS_in_commands65); 
2859 -                    STRINGS2_tree = adaptor.create(STRINGS2);
2860 -                    root_0 = adaptor.becomeRoot(STRINGS2_tree, root_0);
2861  
2862 -                    pushFollow(FOLLOW_idList_in_commands68);
2863 +                    pushFollow(FOLLOW_idList_in_commands85);
2864                      idList3=idList();
2865 -                    _fsp--;
2866  
2867 -                    adaptor.addChild(root_0, idList3.tree);
2868 +                    state._fsp--;
2869 +
2870 +                    adaptor.addChild(root_0, idList3.getTree());
2871  
2872                      }
2873                      break;
2874                  case 2 :
2875 -                    // Bst.g:18:4: INTEGERS^^ idList
2876 +                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:26:4: INTEGERS ^ idList
2877                      {
2878 -                    root_0 = adaptor.nil();
2879 +                    root_0 = (Object)adaptor.nil();
2880 +
2881 +
2882 +                    INTEGERS4=(Token)match(input,INTEGERS,FOLLOW_INTEGERS_in_commands90);
2883 +                    INTEGERS4_tree =
2884 +                    (Object)adaptor.create(INTEGERS4)
2885 +                    ;
2886 +                    root_0 = (Object)adaptor.becomeRoot(INTEGERS4_tree, root_0);
2887  
2888 -                    INTEGERS4=input.LT(1);
2889 -                    match(input,INTEGERS,FOLLOW_INTEGERS_in_commands73); 
2890 -                    INTEGERS4_tree = adaptor.create(INTEGERS4);
2891 -                    root_0 = adaptor.becomeRoot(INTEGERS4_tree, root_0);
2892  
2893 -                    pushFollow(FOLLOW_idList_in_commands76);
2894 +                    pushFollow(FOLLOW_idList_in_commands93);
2895                      idList5=idList();
2896 -                    _fsp--;
2897  
2898 -                    adaptor.addChild(root_0, idList5.tree);
2899 +                    state._fsp--;
2900 +
2901 +                    adaptor.addChild(root_0, idList5.getTree());
2902  
2903                      }
2904                      break;
2905                  case 3 :
2906 -                    // Bst.g:19:4: FUNCTION^^ id stack
2907 +                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:27:4: FUNCTION ^ id stack
2908                      {
2909 -                    root_0 = adaptor.nil();
2910 +                    root_0 = (Object)adaptor.nil();
2911 +
2912  
2913 -                    FUNCTION6=input.LT(1);
2914 -                    match(input,FUNCTION,FOLLOW_FUNCTION_in_commands81); 
2915 -                    FUNCTION6_tree = adaptor.create(FUNCTION6);
2916 -                    root_0 = adaptor.becomeRoot(FUNCTION6_tree, root_0);
2917 +                    FUNCTION6=(Token)match(input,FUNCTION,FOLLOW_FUNCTION_in_commands98);
2918 +                    FUNCTION6_tree =
2919 +                    (Object)adaptor.create(FUNCTION6)
2920 +                    ;
2921 +                    root_0 = (Object)adaptor.becomeRoot(FUNCTION6_tree, root_0);
2922  
2923 -                    pushFollow(FOLLOW_id_in_commands84);
2924 +
2925 +                    pushFollow(FOLLOW_id_in_commands101);
2926                      id7=id();
2927 -                    _fsp--;
2928  
2929 -                    adaptor.addChild(root_0, id7.tree);
2930 -                    pushFollow(FOLLOW_stack_in_commands86);
2931 +                    state._fsp--;
2932 +
2933 +                    adaptor.addChild(root_0, id7.getTree());
2934 +
2935 +                    pushFollow(FOLLOW_stack_in_commands103);
2936                      stack8=stack();
2937 -                    _fsp--;
2938  
2939 -                    adaptor.addChild(root_0, stack8.tree);
2940 +                    state._fsp--;
2941 +
2942 +                    adaptor.addChild(root_0, stack8.getTree());
2943  
2944                      }
2945                      break;
2946                  case 4 :
2947 -                    // Bst.g:20:4: MACRO^^ id '{'! STRING '}'!
2948 +                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:28:4: MACRO ^ id '{' ! STRING '}' !
2949                      {
2950 -                    root_0 = adaptor.nil();
2951 +                    root_0 = (Object)adaptor.nil();
2952 +
2953  
2954 -                    MACRO9=input.LT(1);
2955 -                    match(input,MACRO,FOLLOW_MACRO_in_commands91); 
2956 -                    MACRO9_tree = adaptor.create(MACRO9);
2957 -                    root_0 = adaptor.becomeRoot(MACRO9_tree, root_0);
2958 +                    MACRO9=(Token)match(input,MACRO,FOLLOW_MACRO_in_commands108);
2959 +                    MACRO9_tree =
2960 +                    (Object)adaptor.create(MACRO9)
2961 +                    ;
2962 +                    root_0 = (Object)adaptor.becomeRoot(MACRO9_tree, root_0);
2963  
2964 -                    pushFollow(FOLLOW_id_in_commands94);
2965 +
2966 +                    pushFollow(FOLLOW_id_in_commands111);
2967                      id10=id();
2968 -                    _fsp--;
2969  
2970 -                    adaptor.addChild(root_0, id10.tree);
2971 -                    char_literal11=input.LT(1);
2972 -                    match(input,25,FOLLOW_25_in_commands96); 
2973 -                    STRING12=input.LT(1);
2974 -                    match(input,STRING,FOLLOW_STRING_in_commands99); 
2975 -                    STRING12_tree = adaptor.create(STRING12);
2976 +                    state._fsp--;
2977 +
2978 +                    adaptor.addChild(root_0, id10.getTree());
2979 +
2980 +                    char_literal11=(Token)match(input,32,FOLLOW_32_in_commands113);
2981 +
2982 +                    STRING12=(Token)match(input,STRING,FOLLOW_STRING_in_commands116);
2983 +                    STRING12_tree =
2984 +                    (Object)adaptor.create(STRING12)
2985 +                    ;
2986                      adaptor.addChild(root_0, STRING12_tree);
2987  
2988 -                    char_literal13=input.LT(1);
2989 -                    match(input,26,FOLLOW_26_in_commands101); 
2990 +
2991 +                    char_literal13=(Token)match(input,33,FOLLOW_33_in_commands118);
2992  
2993                      }
2994                      break;
2995                  case 5 :
2996 -                    // Bst.g:21:4: READ^^
2997 +                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:29:4: READ ^
2998                      {
2999 -                    root_0 = adaptor.nil();
3000 +                    root_0 = (Object)adaptor.nil();
3001  
3002 -                    READ14=input.LT(1);
3003 -                    match(input,READ,FOLLOW_READ_in_commands107); 
3004 -                    READ14_tree = adaptor.create(READ14);
3005 -                    root_0 = adaptor.becomeRoot(READ14_tree, root_0);
3006 +
3007 +                    READ14=(Token)match(input,READ,FOLLOW_READ_in_commands124);
3008 +                    READ14_tree =
3009 +                    (Object)adaptor.create(READ14)
3010 +                    ;
3011 +                    root_0 = (Object)adaptor.becomeRoot(READ14_tree, root_0);
3012  
3013  
3014                      }
3015                      break;
3016                  case 6 :
3017 -                    // Bst.g:22:4: EXECUTE^^ '{'! function '}'!
3018 +                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:30:4: EXECUTE ^ '{' ! function '}' !
3019                      {
3020 -                    root_0 = adaptor.nil();
3021 +                    root_0 = (Object)adaptor.nil();
3022 +
3023 +
3024 +                    EXECUTE15=(Token)match(input,EXECUTE,FOLLOW_EXECUTE_in_commands130);
3025 +                    EXECUTE15_tree =
3026 +                    (Object)adaptor.create(EXECUTE15)
3027 +                    ;
3028 +                    root_0 = (Object)adaptor.becomeRoot(EXECUTE15_tree, root_0);
3029 +
3030 +
3031 +                    char_literal16=(Token)match(input,32,FOLLOW_32_in_commands133);
3032  
3033 -                    EXECUTE15=input.LT(1);
3034 -                    match(input,EXECUTE,FOLLOW_EXECUTE_in_commands113); 
3035 -                    EXECUTE15_tree = adaptor.create(EXECUTE15);
3036 -                    root_0 = adaptor.becomeRoot(EXECUTE15_tree, root_0);
3037 -
3038 -                    char_literal16=input.LT(1);
3039 -                    match(input,25,FOLLOW_25_in_commands116); 
3040 -                    pushFollow(FOLLOW_function_in_commands119);
3041 +                    pushFollow(FOLLOW_function_in_commands136);
3042                      function17=function();
3043 -                    _fsp--;
3044  
3045 -                    adaptor.addChild(root_0, function17.tree);
3046 -                    char_literal18=input.LT(1);
3047 -                    match(input,26,FOLLOW_26_in_commands121); 
3048 +                    state._fsp--;
3049 +
3050 +                    adaptor.addChild(root_0, function17.getTree());
3051 +
3052 +                    char_literal18=(Token)match(input,33,FOLLOW_33_in_commands138);
3053  
3054                      }
3055                      break;
3056                  case 7 :
3057 -                    // Bst.g:23:4: ITERATE^^ '{'! function '}'!
3058 +                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:31:4: ITERATE ^ '{' ! function '}' !
3059                      {
3060 -                    root_0 = adaptor.nil();
3061 +                    root_0 = (Object)adaptor.nil();
3062 +
3063 +
3064 +                    ITERATE19=(Token)match(input,ITERATE,FOLLOW_ITERATE_in_commands144);
3065 +                    ITERATE19_tree =
3066 +                    (Object)adaptor.create(ITERATE19)
3067 +                    ;
3068 +                    root_0 = (Object)adaptor.becomeRoot(ITERATE19_tree, root_0);
3069 +
3070 +
3071 +                    char_literal20=(Token)match(input,32,FOLLOW_32_in_commands147);
3072  
3073 -                    ITERATE19=input.LT(1);
3074 -                    match(input,ITERATE,FOLLOW_ITERATE_in_commands127); 
3075 -                    ITERATE19_tree = adaptor.create(ITERATE19);
3076 -                    root_0 = adaptor.becomeRoot(ITERATE19_tree, root_0);
3077 -
3078 -                    char_literal20=input.LT(1);
3079 -                    match(input,25,FOLLOW_25_in_commands130); 
3080 -                    pushFollow(FOLLOW_function_in_commands133);
3081 +                    pushFollow(FOLLOW_function_in_commands150);
3082                      function21=function();
3083 -                    _fsp--;
3084  
3085 -                    adaptor.addChild(root_0, function21.tree);
3086 -                    char_literal22=input.LT(1);
3087 -                    match(input,26,FOLLOW_26_in_commands135); 
3088 +                    state._fsp--;
3089 +
3090 +                    adaptor.addChild(root_0, function21.getTree());
3091 +
3092 +                    char_literal22=(Token)match(input,33,FOLLOW_33_in_commands152);
3093  
3094                      }
3095                      break;
3096                  case 8 :
3097 -                    // Bst.g:24:4: REVERSE^^ '{'! function '}'!
3098 +                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:32:4: REVERSE ^ '{' ! function '}' !
3099                      {
3100 -                    root_0 = adaptor.nil();
3101 +                    root_0 = (Object)adaptor.nil();
3102 +
3103 +
3104 +                    REVERSE23=(Token)match(input,REVERSE,FOLLOW_REVERSE_in_commands158);
3105 +                    REVERSE23_tree =
3106 +                    (Object)adaptor.create(REVERSE23)
3107 +                    ;
3108 +                    root_0 = (Object)adaptor.becomeRoot(REVERSE23_tree, root_0);
3109 +
3110  
3111 -                    REVERSE23=input.LT(1);
3112 -                    match(input,REVERSE,FOLLOW_REVERSE_in_commands141); 
3113 -                    REVERSE23_tree = adaptor.create(REVERSE23);
3114 -                    root_0 = adaptor.becomeRoot(REVERSE23_tree, root_0);
3115 -
3116 -                    char_literal24=input.LT(1);
3117 -                    match(input,25,FOLLOW_25_in_commands144); 
3118 -                    pushFollow(FOLLOW_function_in_commands147);
3119 +                    char_literal24=(Token)match(input,32,FOLLOW_32_in_commands161);
3120 +
3121 +                    pushFollow(FOLLOW_function_in_commands164);
3122                      function25=function();
3123 -                    _fsp--;
3124  
3125 -                    adaptor.addChild(root_0, function25.tree);
3126 -                    char_literal26=input.LT(1);
3127 -                    match(input,26,FOLLOW_26_in_commands149); 
3128 +                    state._fsp--;
3129 +
3130 +                    adaptor.addChild(root_0, function25.getTree());
3131 +
3132 +                    char_literal26=(Token)match(input,33,FOLLOW_33_in_commands166);
3133  
3134                      }
3135                      break;
3136                  case 9 :
3137 -                    // Bst.g:25:4: ENTRY^^ idList0 idList0 idList0
3138 +                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:33:4: ENTRY ^ idList0 idList0 idList0
3139                      {
3140 -                    root_0 = adaptor.nil();
3141 +                    root_0 = (Object)adaptor.nil();
3142 +
3143 +
3144 +                    ENTRY27=(Token)match(input,ENTRY,FOLLOW_ENTRY_in_commands172);
3145 +                    ENTRY27_tree =
3146 +                    (Object)adaptor.create(ENTRY27)
3147 +                    ;
3148 +                    root_0 = (Object)adaptor.becomeRoot(ENTRY27_tree, root_0);
3149  
3150 -                    ENTRY27=input.LT(1);
3151 -                    match(input,ENTRY,FOLLOW_ENTRY_in_commands155); 
3152 -                    ENTRY27_tree = adaptor.create(ENTRY27);
3153 -                    root_0 = adaptor.becomeRoot(ENTRY27_tree, root_0);
3154  
3155 -                    pushFollow(FOLLOW_idList0_in_commands158);
3156 +                    pushFollow(FOLLOW_idList0_in_commands175);
3157                      idList028=idList0();
3158 -                    _fsp--;
3159  
3160 -                    adaptor.addChild(root_0, idList028.tree);
3161 -                    pushFollow(FOLLOW_idList0_in_commands160);
3162 +                    state._fsp--;
3163 +
3164 +                    adaptor.addChild(root_0, idList028.getTree());
3165 +
3166 +                    pushFollow(FOLLOW_idList0_in_commands177);
3167                      idList029=idList0();
3168 -                    _fsp--;
3169  
3170 -                    adaptor.addChild(root_0, idList029.tree);
3171 -                    pushFollow(FOLLOW_idList0_in_commands162);
3172 +                    state._fsp--;
3173 +
3174 +                    adaptor.addChild(root_0, idList029.getTree());
3175 +
3176 +                    pushFollow(FOLLOW_idList0_in_commands179);
3177                      idList030=idList0();
3178 -                    _fsp--;
3179  
3180 -                    adaptor.addChild(root_0, idList030.tree);
3181 +                    state._fsp--;
3182 +
3183 +                    adaptor.addChild(root_0, idList030.getTree());
3184  
3185                      }
3186                      break;
3187                  case 10 :
3188 -                    // Bst.g:26:4: SORT^^
3189 +                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:34:4: SORT ^
3190                      {
3191 -                    root_0 = adaptor.nil();
3192 +                    root_0 = (Object)adaptor.nil();
3193  
3194 -                    SORT31=input.LT(1);
3195 -                    match(input,SORT,FOLLOW_SORT_in_commands167); 
3196 -                    SORT31_tree = adaptor.create(SORT31);
3197 -                    root_0 = adaptor.becomeRoot(SORT31_tree, root_0);
3198 +
3199 +                    SORT31=(Token)match(input,SORT,FOLLOW_SORT_in_commands184);
3200 +                    SORT31_tree =
3201 +                    (Object)adaptor.create(SORT31)
3202 +                    ;
3203 +                    root_0 = (Object)adaptor.becomeRoot(SORT31_tree, root_0);
3204  
3205  
3206                      }
3207                      break;
3208  
3209              }
3210 +            retval.stop = input.LT(-1);
3211 +
3212 +
3213 +            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
3214 +            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
3215 +
3216          }
3217          catch (RecognitionException re) {
3218              reportError(re);
3219              recover(input,re);
3220 -        }
3221 -        finally {
3222 -            retval.stop = input.LT(-1);
3223 +       retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
3224  
3225 -                retval.tree = adaptor.rulePostProcessing(root_0);
3226 -                adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);