refresh (and rename) patches again
authorgregor herrmann <gregoa@debian.org>
Mon, 19 Nov 2012 16:06:14 +0000 (17:06 +0100)
committergregor herrmann <gregoa@debian.org>
Mon, 19 Nov 2012 16:06:14 +0000 (17:06 +0100)
Git-Dch: Ignore

debian/patches/0001-Updates-BstLexer-and-BstParser-based-on-an-ANTLR-run.patch [deleted file]
debian/patches/02_libs.patch [deleted file]
debian/patches/debian_libs.patch [new file with mode: 0644]
debian/patches/mrDlib.patch [deleted file]
debian/patches/mrDlib_jayatana.patch [new file with mode: 0644]
debian/patches/series

diff --git a/debian/patches/0001-Updates-BstLexer-and-BstParser-based-on-an-ANTLR-run.patch b/debian/patches/0001-Updates-BstLexer-and-BstParser-based-on-an-ANTLR-run.patch
deleted file mode 100644 (file)
index 188b7dd..0000000
+++ /dev/null
@@ -1,4545 +0,0 @@
-From a3358c3585f41dd795d8c3ba14bbd8412d7c8c57 Mon Sep 17 00:00:00 2001
-From: Oliver Kopp <olly98@users.sourceforge.net>
-Date: Sun, 28 Oct 2012 23:51:22 +0100
-Subject: [PATCH] Updates BstLexer and BstParser based on an ANTLR run on
- Bst.g  * renames bst.g to Bst.g  * enables ANTLRv3 in the
- gradle build. Issue "gradlew generateGrammarSource" to use
- it.  * Adds Bst.tokens to .gitignore. It is a temporary
- file.
-
----
- jabref/build.gradle                              |   25 +
- jabref/src/java/net/sf/jabref/bst/.gitignore     |    1 +
- jabref/src/java/net/sf/jabref/bst/Bst.g          |   96 ++
- jabref/src/java/net/sf/jabref/bst/BstLexer.java  | 1713 ++++++++--------------
- jabref/src/java/net/sf/jabref/bst/BstParser.java | 1396 ++++++++++--------
- jabref/src/java/net/sf/jabref/bst/bst.g          |   94 --
- 6 files changed, 1583 insertions(+), 1742 deletions(-)
- create mode 100644 jabref/src/java/net/sf/jabref/bst/.gitignore
- create mode 100644 jabref/src/java/net/sf/jabref/bst/Bst.g
- delete mode 100644 jabref/src/java/net/sf/jabref/bst/bst.g
-
---- /dev/null
-+++ b/src/java/net/sf/jabref/bst/Bst.g
-@@ -0,0 +1,96 @@
-+grammar Bst;
-+
-+options {
-+    output=AST;
-+}
-+
-+tokens {
-+      IDLIST;
-+      STACK;
-+      ENTRY;
-+      COMMANDS;
-+}
-+
-+// applies only to the parser:
-+@header {// Generated by ANTLR
-+package net.sf.jabref.bst;}
-+
-+// applies only to the lexer:
-+@lexer::header {// Generated by ANTLR
-+package net.sf.jabref.bst;}
-+
-+program : commands+ -> ^(COMMANDS commands+);
-+
-+commands
-+      : STRINGS^ idList
-+      | INTEGERS^ idList
-+      | FUNCTION^ id stack
-+      | MACRO^ id '{'! STRING '}'!
-+      | READ^
-+      | EXECUTE^ '{'! function '}'!
-+      | ITERATE^ '{'! function '}'!
-+      | REVERSE^ '{'! function '}'!
-+      | ENTRY^ idList0 idList0 idList0
-+      | SORT^;
-+
-+identifier
-+      : IDENTIFIER;
-+
-+id
-+      : '{'! identifier '}'!;
-+
-+idList
-+      : '{' identifier+ '}' -> ^(IDLIST identifier+);
-+
-+idList0
-+      : '{' identifier* '}' -> ^(IDLIST identifier*);
-+
-+function
-+      : '<' | '>' | '=' | '+' | '-' | ':=' | '*' | identifier;
-+
-+stack
-+      : '{' stackitem+ '}' -> ^(STACK stackitem+);
-+
-+stackitem
-+      : function
-+      | STRING
-+      | INTEGER
-+      | QUOTED
-+      | stack;
-+
-+STRINGS : 'STRINGS';
-+INTEGERS : 'INTEGERS';
-+FUNCTION : 'FUNCTION';
-+EXECUTE : 'EXECUTE';
-+SORT : 'SORT';
-+ITERATE : 'ITERATE';
-+REVERSE : 'REVERSE';
-+ENTRY : 'ENTRY';
-+READ : 'READ';
-+MACRO : 'MACRO';
-+
-+QUOTED
-+      : '\'' IDENTIFIER;
-+
-+IDENTIFIER
-+      : LETTER (LETTER|NUMERAL)* ;
-+
-+fragment LETTER
-+      : ('a'..'z'|'A'..'Z'|'.'|'$');
-+
-+STRING
-+      : '"' (~('"'))* '"';
-+
-+INTEGER
-+      : '#' ('+'|'-')? NUMERAL+ ;
-+
-+fragment NUMERAL
-+      : ('0'..'9');
-+
-+WS
-+      : (' '|'\t'|'\n')+ {_channel=99;} ;
-+
-+LINE_COMMENT
-+    : '%' ~('\n'|'\r')* '\r'? '\n' {_channel=99;}
-+    ;
-+
---- a/src/java/net/sf/jabref/bst/BstLexer.java
-+++ b/src/java/net/sf/jabref/bst/BstLexer.java
-@@ -1,701 +1,541 @@
--/*  Copyright (C) 2003-2011 JabRef contributors.
--    This program is free software; you can redistribute it and/or modify
--    it under the terms of the GNU General Public License as published by
--    the Free Software Foundation; either version 2 of the License, or
--    (at your option) any later version.
--
--    This program is distributed in the hope that it will be useful,
--    but WITHOUT ANY WARRANTY; without even the implied warranty of
--    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--    GNU General Public License for more details.
--
--    You should have received a copy of the GNU General Public License along
--    with this program; if not, write to the Free Software Foundation, Inc.,
--    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
--*/
-+// $ANTLR 3.4 C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g 2012-10-28 23:48:28
-+// Generated by ANTLR
- package net.sf.jabref.bst;
--// $ANTLR 3.0b5 Bst.g 2006-11-23 23:20:24
--
--import org.antlr.runtime.CharStream;
--import org.antlr.runtime.EarlyExitException;
--import org.antlr.runtime.Lexer;
--import org.antlr.runtime.MismatchedSetException;
--import org.antlr.runtime.NoViableAltException;
--import org.antlr.runtime.RecognitionException;
--import org.antlr.runtime.Token;
-+import org.antlr.runtime.*;
-+import java.util.Stack;
-+import java.util.List;
-+import java.util.ArrayList;
-+@SuppressWarnings({"all", "warnings", "unchecked"})
- public class BstLexer extends Lexer {
--    public static final int LETTER=21;
--    public static final int T29=29;
--    public static final int T33=33;
--    public static final int INTEGERS=9;
--    public static final int ENTRY=6;
--    public static final int WS=23;
--    public static final int COMMANDS=7;
--    public static final int STRING=12;
--    public static final int T28=28;
--    public static final int EXECUTE=14;
--    public static final int LINE_COMMENT=24;
--    public static final int SORT=17;
--    public static final int STACK=5;
--    public static final int REVERSE=16;
--    public static final int QUOTED=20;
--    public static final int T25=25;
--    public static final int INTEGER=19;
--    public static final int ITERATE=15;
--    public static final int FUNCTION=10;
--    public static final int T26=26;
-     public static final int EOF=-1;
--    public static final int T32=32;
--    public static final int Tokens=34;
--    public static final int STRINGS=8;
--    public static final int T31=31;
--    public static final int T27=27;
--    public static final int IDENTIFIER=18;
--    public static final int MACRO=11;
--    public static final int T30=30;
--    public static final int IDLIST=4;
--    public static final int NUMERAL=22;
--    public static final int READ=13;
--    public BstLexer() {
--        
--    } 
-+    public static final int T__25=25;
-+    public static final int T__26=26;
-+    public static final int T__27=27;
-+    public static final int T__28=28;
-+    public static final int T__29=29;
-+    public static final int T__30=30;
-+    public static final int T__31=31;
-+    public static final int T__32=32;
-+    public static final int T__33=33;
-+    public static final int COMMANDS=4;
-+    public static final int ENTRY=5;
-+    public static final int EXECUTE=6;
-+    public static final int FUNCTION=7;
-+    public static final int IDENTIFIER=8;
-+    public static final int IDLIST=9;
-+    public static final int INTEGER=10;
-+    public static final int INTEGERS=11;
-+    public static final int ITERATE=12;
-+    public static final int LETTER=13;
-+    public static final int LINE_COMMENT=14;
-+    public static final int MACRO=15;
-+    public static final int NUMERAL=16;
-+    public static final int QUOTED=17;
-+    public static final int READ=18;
-+    public static final int REVERSE=19;
-+    public static final int SORT=20;
-+    public static final int STACK=21;
-+    public static final int STRING=22;
-+    public static final int STRINGS=23;
-+    public static final int WS=24;
-+
-+    // delegates
-+    // delegators
-+    public Lexer[] getDelegates() {
-+        return new Lexer[] {};
-+    }
-+
-+    public BstLexer() {}
-     public BstLexer(CharStream input) {
--        super(input);
-+        this(input, new RecognizerSharedState());
-     }
--    public String getGrammarFileName() { return "Bst.g"; }
-+    public BstLexer(CharStream input, RecognizerSharedState state) {
-+        super(input,state);
-+    }
-+    public String getGrammarFileName() { return "C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g"; }
--    // $ANTLR start T25
--    public void mT25() throws RecognitionException {
-+    // $ANTLR start "T__25"
-+    public final void mT__25() throws RecognitionException {
-         try {
--            ruleNestingLevel++;
--            int _type = T25;
--            int _start = getCharIndex();
--            int _line = getLine();
--            int _charPosition = getCharPositionInLine();
--            int _channel = Token.DEFAULT_CHANNEL;
--            // Bst.g:3:7: ( '{' )
--            // Bst.g:3:7: '{'
-+            int _type = T__25;
-+            int _channel = DEFAULT_TOKEN_CHANNEL;
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:5:7: ( '*' )
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:5:9: '*'
-             {
--            match('{'); 
-+            match('*');
-             }
--
--
--                    if ( token==null && ruleNestingLevel==1 ) {
--                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
--                    }
--
--                        }
-+            state.type = _type;
-+            state.channel = _channel;
-+        }
-         finally {
--            ruleNestingLevel--;
-+              // do for sure before leaving
-         }
-     }
--    // $ANTLR end T25
-+    // $ANTLR end "T__25"
--    // $ANTLR start T26
--    public void mT26() throws RecognitionException {
-+    // $ANTLR start "T__26"
-+    public final void mT__26() throws RecognitionException {
-         try {
--            ruleNestingLevel++;
--            int _type = T26;
--            int _start = getCharIndex();
--            int _line = getLine();
--            int _charPosition = getCharPositionInLine();
--            int _channel = Token.DEFAULT_CHANNEL;
--            // Bst.g:4:7: ( '}' )
--            // Bst.g:4:7: '}'
-+            int _type = T__26;
-+            int _channel = DEFAULT_TOKEN_CHANNEL;
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:6:7: ( '+' )
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:6:9: '+'
-             {
--            match('}'); 
-+            match('+');
-             }
--
--
--                    if ( token==null && ruleNestingLevel==1 ) {
--                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
--                    }
--
--                        }
-+            state.type = _type;
-+            state.channel = _channel;
-+        }
-         finally {
--            ruleNestingLevel--;
-+              // do for sure before leaving
-         }
-     }
--    // $ANTLR end T26
-+    // $ANTLR end "T__26"
--    // $ANTLR start T27
--    public void mT27() throws RecognitionException {
-+    // $ANTLR start "T__27"
-+    public final void mT__27() throws RecognitionException {
-         try {
--            ruleNestingLevel++;
--            int _type = T27;
--            int _start = getCharIndex();
--            int _line = getLine();
--            int _charPosition = getCharPositionInLine();
--            int _channel = Token.DEFAULT_CHANNEL;
--            // Bst.g:5:7: ( '<' )
--            // Bst.g:5:7: '<'
-+            int _type = T__27;
-+            int _channel = DEFAULT_TOKEN_CHANNEL;
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:7:7: ( '-' )
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:7:9: '-'
-             {
--            match('<'); 
-+            match('-');
-             }
--
--
--                    if ( token==null && ruleNestingLevel==1 ) {
--                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
--                    }
--
--                        }
-+            state.type = _type;
-+            state.channel = _channel;
-+        }
-         finally {
--            ruleNestingLevel--;
-+              // do for sure before leaving
-         }
-     }
--    // $ANTLR end T27
-+    // $ANTLR end "T__27"
--    // $ANTLR start T28
--    public void mT28() throws RecognitionException {
-+    // $ANTLR start "T__28"
-+    public final void mT__28() throws RecognitionException {
-         try {
--            ruleNestingLevel++;
--            int _type = T28;
--            int _start = getCharIndex();
--            int _line = getLine();
--            int _charPosition = getCharPositionInLine();
--            int _channel = Token.DEFAULT_CHANNEL;
--            // Bst.g:6:7: ( '>' )
--            // Bst.g:6:7: '>'
-+            int _type = T__28;
-+            int _channel = DEFAULT_TOKEN_CHANNEL;
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:8:7: ( ':=' )
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:8:9: ':='
-             {
--            match('>'); 
--
--            }
-+            match(":=");
--                    if ( token==null && ruleNestingLevel==1 ) {
--                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
--                    }
-+            }
--                        }
-+            state.type = _type;
-+            state.channel = _channel;
-+        }
-         finally {
--            ruleNestingLevel--;
-+              // do for sure before leaving
-         }
-     }
--    // $ANTLR end T28
-+    // $ANTLR end "T__28"
--    // $ANTLR start T29
--    public void mT29() throws RecognitionException {
-+    // $ANTLR start "T__29"
-+    public final void mT__29() throws RecognitionException {
-         try {
--            ruleNestingLevel++;
--            int _type = T29;
--            int _start = getCharIndex();
--            int _line = getLine();
--            int _charPosition = getCharPositionInLine();
--            int _channel = Token.DEFAULT_CHANNEL;
--            // Bst.g:7:7: ( '=' )
--            // Bst.g:7:7: '='
-+            int _type = T__29;
-+            int _channel = DEFAULT_TOKEN_CHANNEL;
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:9:7: ( '<' )
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:9:9: '<'
-             {
--            match('='); 
-+            match('<');
-             }
--
--
--                    if ( token==null && ruleNestingLevel==1 ) {
--                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
--                    }
--
--                        }
-+            state.type = _type;
-+            state.channel = _channel;
-+        }
-         finally {
--            ruleNestingLevel--;
-+              // do for sure before leaving
-         }
-     }
--    // $ANTLR end T29
-+    // $ANTLR end "T__29"
--    // $ANTLR start T30
--    public void mT30() throws RecognitionException {
-+    // $ANTLR start "T__30"
-+    public final void mT__30() throws RecognitionException {
-         try {
--            ruleNestingLevel++;
--            int _type = T30;
--            int _start = getCharIndex();
--            int _line = getLine();
--            int _charPosition = getCharPositionInLine();
--            int _channel = Token.DEFAULT_CHANNEL;
--            // Bst.g:8:7: ( '+' )
--            // Bst.g:8:7: '+'
-+            int _type = T__30;
-+            int _channel = DEFAULT_TOKEN_CHANNEL;
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:10:7: ( '=' )
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:10:9: '='
-             {
--            match('+'); 
-+            match('=');
-             }
--
--
--                    if ( token==null && ruleNestingLevel==1 ) {
--                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
--                    }
--
--                        }
-+            state.type = _type;
-+            state.channel = _channel;
-+        }
-         finally {
--            ruleNestingLevel--;
-+              // do for sure before leaving
-         }
-     }
--    // $ANTLR end T30
-+    // $ANTLR end "T__30"
--    // $ANTLR start T31
--    public void mT31() throws RecognitionException {
-+    // $ANTLR start "T__31"
-+    public final void mT__31() throws RecognitionException {
-         try {
--            ruleNestingLevel++;
--            int _type = T31;
--            int _start = getCharIndex();
--            int _line = getLine();
--            int _charPosition = getCharPositionInLine();
--            int _channel = Token.DEFAULT_CHANNEL;
--            // Bst.g:9:7: ( '-' )
--            // Bst.g:9:7: '-'
-+            int _type = T__31;
-+            int _channel = DEFAULT_TOKEN_CHANNEL;
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:11:7: ( '>' )
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:11:9: '>'
-             {
--            match('-'); 
-+            match('>');
-             }
--
--
--                    if ( token==null && ruleNestingLevel==1 ) {
--                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
--                    }
--
--                        }
-+            state.type = _type;
-+            state.channel = _channel;
-+        }
-         finally {
--            ruleNestingLevel--;
-+              // do for sure before leaving
-         }
-     }
--    // $ANTLR end T31
-+    // $ANTLR end "T__31"
--    // $ANTLR start T32
--    public void mT32() throws RecognitionException {
-+    // $ANTLR start "T__32"
-+    public final void mT__32() throws RecognitionException {
-         try {
--            ruleNestingLevel++;
--            int _type = T32;
--            int _start = getCharIndex();
--            int _line = getLine();
--            int _charPosition = getCharPositionInLine();
--            int _channel = Token.DEFAULT_CHANNEL;
--            // Bst.g:10:7: ( ':=' )
--            // Bst.g:10:7: ':='
-+            int _type = T__32;
-+            int _channel = DEFAULT_TOKEN_CHANNEL;
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:12:7: ( '{' )
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:12:9: '{'
-             {
--            match(":="); 
--
-+            match('{');
-             }
--
--
--                    if ( token==null && ruleNestingLevel==1 ) {
--                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
--                    }
--
--                        }
-+            state.type = _type;
-+            state.channel = _channel;
-+        }
-         finally {
--            ruleNestingLevel--;
-+              // do for sure before leaving
-         }
-     }
--    // $ANTLR end T32
-+    // $ANTLR end "T__32"
--    // $ANTLR start T33
--    public void mT33() throws RecognitionException {
-+    // $ANTLR start "T__33"
-+    public final void mT__33() throws RecognitionException {
-         try {
--            ruleNestingLevel++;
--            int _type = T33;
--            int _start = getCharIndex();
--            int _line = getLine();
--            int _charPosition = getCharPositionInLine();
--            int _channel = Token.DEFAULT_CHANNEL;
--            // Bst.g:11:7: ( '*' )
--            // Bst.g:11:7: '*'
-+            int _type = T__33;
-+            int _channel = DEFAULT_TOKEN_CHANNEL;
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:13:7: ( '}' )
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:13:9: '}'
-             {
--            match('*'); 
-+            match('}');
-             }
--
--
--                    if ( token==null && ruleNestingLevel==1 ) {
--                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
--                    }
--
--                        }
-+            state.type = _type;
-+            state.channel = _channel;
-+        }
-         finally {
--            ruleNestingLevel--;
-+              // do for sure before leaving
-         }
-     }
--    // $ANTLR end T33
-+    // $ANTLR end "T__33"
--    // $ANTLR start STRINGS
--    public void mSTRINGS() throws RecognitionException {
-+    // $ANTLR start "STRINGS"
-+    public final void mSTRINGS() throws RecognitionException {
-         try {
--            ruleNestingLevel++;
-             int _type = STRINGS;
--            int _start = getCharIndex();
--            int _line = getLine();
--            int _charPosition = getCharPositionInLine();
--            int _channel = Token.DEFAULT_CHANNEL;
--            // Bst.g:53:11: ( 'STRINGS' )
--            // Bst.g:53:11: 'STRINGS'
-+            int _channel = DEFAULT_TOKEN_CHANNEL;
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:61:9: ( 'STRINGS' )
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:61:11: 'STRINGS'
-             {
-             match("STRINGS"); 
--            }
--
--
--                    if ( token==null && ruleNestingLevel==1 ) {
--                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
--                    }
-+            }
--                        }
-+            state.type = _type;
-+            state.channel = _channel;
-+        }
-         finally {
--            ruleNestingLevel--;
-+              // do for sure before leaving
-         }
-     }
--    // $ANTLR end STRINGS
-+    // $ANTLR end "STRINGS"
--    // $ANTLR start INTEGERS
--    public void mINTEGERS() throws RecognitionException {
-+    // $ANTLR start "INTEGERS"
-+    public final void mINTEGERS() throws RecognitionException {
-         try {
--            ruleNestingLevel++;
-             int _type = INTEGERS;
--            int _start = getCharIndex();
--            int _line = getLine();
--            int _charPosition = getCharPositionInLine();
--            int _channel = Token.DEFAULT_CHANNEL;
--            // Bst.g:54:12: ( 'INTEGERS' )
--            // Bst.g:54:12: 'INTEGERS'
-+            int _channel = DEFAULT_TOKEN_CHANNEL;
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:62:10: ( 'INTEGERS' )
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:62:12: 'INTEGERS'
-             {
-             match("INTEGERS"); 
--            }
--
--
--                    if ( token==null && ruleNestingLevel==1 ) {
--                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
--                    }
-+            }
--                        }
-+            state.type = _type;
-+            state.channel = _channel;
-+        }
-         finally {
--            ruleNestingLevel--;
-+              // do for sure before leaving
-         }
-     }
--    // $ANTLR end INTEGERS
-+    // $ANTLR end "INTEGERS"
--    // $ANTLR start FUNCTION
--    public void mFUNCTION() throws RecognitionException {
-+    // $ANTLR start "FUNCTION"
-+    public final void mFUNCTION() throws RecognitionException {
-         try {
--            ruleNestingLevel++;
-             int _type = FUNCTION;
--            int _start = getCharIndex();
--            int _line = getLine();
--            int _charPosition = getCharPositionInLine();
--            int _channel = Token.DEFAULT_CHANNEL;
--            // Bst.g:55:12: ( 'FUNCTION' )
--            // Bst.g:55:12: 'FUNCTION'
-+            int _channel = DEFAULT_TOKEN_CHANNEL;
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:63:10: ( 'FUNCTION' )
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:63:12: 'FUNCTION'
-             {
-             match("FUNCTION"); 
--            }
--
--
--                    if ( token==null && ruleNestingLevel==1 ) {
--                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
--                    }
-+            }
--                        }
-+            state.type = _type;
-+            state.channel = _channel;
-+        }
-         finally {
--            ruleNestingLevel--;
-+              // do for sure before leaving
-         }
-     }
--    // $ANTLR end FUNCTION
-+    // $ANTLR end "FUNCTION"
--    // $ANTLR start EXECUTE
--    public void mEXECUTE() throws RecognitionException {
-+    // $ANTLR start "EXECUTE"
-+    public final void mEXECUTE() throws RecognitionException {
-         try {
--            ruleNestingLevel++;
-             int _type = EXECUTE;
--            int _start = getCharIndex();
--            int _line = getLine();
--            int _charPosition = getCharPositionInLine();
--            int _channel = Token.DEFAULT_CHANNEL;
--            // Bst.g:56:11: ( 'EXECUTE' )
--            // Bst.g:56:11: 'EXECUTE'
-+            int _channel = DEFAULT_TOKEN_CHANNEL;
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:64:9: ( 'EXECUTE' )
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:64:11: 'EXECUTE'
-             {
-             match("EXECUTE"); 
--            }
--
--
--                    if ( token==null && ruleNestingLevel==1 ) {
--                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
--                    }
-+            }
--                        }
-+            state.type = _type;
-+            state.channel = _channel;
-+        }
-         finally {
--            ruleNestingLevel--;
-+              // do for sure before leaving
-         }
-     }
--    // $ANTLR end EXECUTE
-+    // $ANTLR end "EXECUTE"
--    // $ANTLR start SORT
--    public void mSORT() throws RecognitionException {
-+    // $ANTLR start "SORT"
-+    public final void mSORT() throws RecognitionException {
-         try {
--            ruleNestingLevel++;
-             int _type = SORT;
--            int _start = getCharIndex();
--            int _line = getLine();
--            int _charPosition = getCharPositionInLine();
--            int _channel = Token.DEFAULT_CHANNEL;
--            // Bst.g:57:8: ( 'SORT' )
--            // Bst.g:57:8: 'SORT'
-+            int _channel = DEFAULT_TOKEN_CHANNEL;
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:65:6: ( 'SORT' )
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:65:8: 'SORT'
-             {
-             match("SORT"); 
--            }
--
--
--                    if ( token==null && ruleNestingLevel==1 ) {
--                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
--                    }
-+            }
--                        }
-+            state.type = _type;
-+            state.channel = _channel;
-+        }
-         finally {
--            ruleNestingLevel--;
-+              // do for sure before leaving
-         }
-     }
--    // $ANTLR end SORT
-+    // $ANTLR end "SORT"
--    // $ANTLR start ITERATE
--    public void mITERATE() throws RecognitionException {
-+    // $ANTLR start "ITERATE"
-+    public final void mITERATE() throws RecognitionException {
-         try {
--            ruleNestingLevel++;
-             int _type = ITERATE;
--            int _start = getCharIndex();
--            int _line = getLine();
--            int _charPosition = getCharPositionInLine();
--            int _channel = Token.DEFAULT_CHANNEL;
--            // Bst.g:58:11: ( 'ITERATE' )
--            // Bst.g:58:11: 'ITERATE'
-+            int _channel = DEFAULT_TOKEN_CHANNEL;
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:66:9: ( 'ITERATE' )
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:66:11: 'ITERATE'
-             {
-             match("ITERATE"); 
--            }
--
--
--                    if ( token==null && ruleNestingLevel==1 ) {
--                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
--                    }
-+            }
--                        }
-+            state.type = _type;
-+            state.channel = _channel;
-+        }
-         finally {
--            ruleNestingLevel--;
-+              // do for sure before leaving
-         }
-     }
--    // $ANTLR end ITERATE
-+    // $ANTLR end "ITERATE"
--    // $ANTLR start REVERSE
--    public void mREVERSE() throws RecognitionException {
-+    // $ANTLR start "REVERSE"
-+    public final void mREVERSE() throws RecognitionException {
-         try {
--            ruleNestingLevel++;
-             int _type = REVERSE;
--            int _start = getCharIndex();
--            int _line = getLine();
--            int _charPosition = getCharPositionInLine();
--            int _channel = Token.DEFAULT_CHANNEL;
--            // Bst.g:59:11: ( 'REVERSE' )
--            // Bst.g:59:11: 'REVERSE'
-+            int _channel = DEFAULT_TOKEN_CHANNEL;
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:67:9: ( 'REVERSE' )
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:67:11: 'REVERSE'
-             {
-             match("REVERSE"); 
--            }
--
--
--                    if ( token==null && ruleNestingLevel==1 ) {
--                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
--                    }
-+            }
--                        }
-+            state.type = _type;
-+            state.channel = _channel;
-+        }
-         finally {
--            ruleNestingLevel--;
-+              // do for sure before leaving
-         }
-     }
--    // $ANTLR end REVERSE
-+    // $ANTLR end "REVERSE"
--    // $ANTLR start ENTRY
--    public void mENTRY() throws RecognitionException {
-+    // $ANTLR start "ENTRY"
-+    public final void mENTRY() throws RecognitionException {
-         try {
--            ruleNestingLevel++;
-             int _type = ENTRY;
--            int _start = getCharIndex();
--            int _line = getLine();
--            int _charPosition = getCharPositionInLine();
--            int _channel = Token.DEFAULT_CHANNEL;
--            // Bst.g:60:9: ( 'ENTRY' )
--            // Bst.g:60:9: 'ENTRY'
-+            int _channel = DEFAULT_TOKEN_CHANNEL;
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:68:7: ( 'ENTRY' )
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:68:9: 'ENTRY'
-             {
-             match("ENTRY"); 
--            }
--
--
--                    if ( token==null && ruleNestingLevel==1 ) {
--                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
--                    }
-+            }
--                        }
-+            state.type = _type;
-+            state.channel = _channel;
-+        }
-         finally {
--            ruleNestingLevel--;
-+              // do for sure before leaving
-         }
-     }
--    // $ANTLR end ENTRY
-+    // $ANTLR end "ENTRY"
--    // $ANTLR start READ
--    public void mREAD() throws RecognitionException {
-+    // $ANTLR start "READ"
-+    public final void mREAD() throws RecognitionException {
-         try {
--            ruleNestingLevel++;
-             int _type = READ;
--            int _start = getCharIndex();
--            int _line = getLine();
--            int _charPosition = getCharPositionInLine();
--            int _channel = Token.DEFAULT_CHANNEL;
--            // Bst.g:61:8: ( 'READ' )
--            // Bst.g:61:8: 'READ'
-+            int _channel = DEFAULT_TOKEN_CHANNEL;
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:69:6: ( 'READ' )
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:69:8: 'READ'
-             {
-             match("READ"); 
--            }
--
--
--                    if ( token==null && ruleNestingLevel==1 ) {
--                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
--                    }
-+            }
--                        }
-+            state.type = _type;
-+            state.channel = _channel;
-+        }
-         finally {
--            ruleNestingLevel--;
-+              // do for sure before leaving
-         }
-     }
--    // $ANTLR end READ
-+    // $ANTLR end "READ"
--    // $ANTLR start MACRO
--    public void mMACRO() throws RecognitionException {
-+    // $ANTLR start "MACRO"
-+    public final void mMACRO() throws RecognitionException {
-         try {
--            ruleNestingLevel++;
-             int _type = MACRO;
--            int _start = getCharIndex();
--            int _line = getLine();
--            int _charPosition = getCharPositionInLine();
--            int _channel = Token.DEFAULT_CHANNEL;
--            // Bst.g:62:9: ( 'MACRO' )
--            // Bst.g:62:9: 'MACRO'
-+            int _channel = DEFAULT_TOKEN_CHANNEL;
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:70:7: ( 'MACRO' )
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:70:9: 'MACRO'
-             {
-             match("MACRO"); 
--            }
--
--
--                    if ( token==null && ruleNestingLevel==1 ) {
--                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
--                    }
-+            }
--                        }
-+            state.type = _type;
-+            state.channel = _channel;
-+        }
-         finally {
--            ruleNestingLevel--;
-+              // do for sure before leaving
-         }
-     }
--    // $ANTLR end MACRO
-+    // $ANTLR end "MACRO"
--    // $ANTLR start QUOTED
--    public void mQUOTED() throws RecognitionException {
-+    // $ANTLR start "QUOTED"
-+    public final void mQUOTED() throws RecognitionException {
-         try {
--            ruleNestingLevel++;
-             int _type = QUOTED;
--            int _start = getCharIndex();
--            int _line = getLine();
--            int _charPosition = getCharPositionInLine();
--            int _channel = Token.DEFAULT_CHANNEL;
--            // Bst.g:65:4: ( '\\'' IDENTIFIER )
--            // Bst.g:65:4: '\\'' IDENTIFIER
-+            int _channel = DEFAULT_TOKEN_CHANNEL;
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:73:2: ( '\\'' IDENTIFIER )
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:73:4: '\\'' IDENTIFIER
-             {
-             match('\''); 
--            mIDENTIFIER(); 
--
--            }
-+            mIDENTIFIER();
--                    if ( token==null && ruleNestingLevel==1 ) {
--                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
--                    }
-+            }
--                        }
-+            state.type = _type;
-+            state.channel = _channel;
-+        }
-         finally {
--            ruleNestingLevel--;
-+              // do for sure before leaving
-         }
-     }
--    // $ANTLR end QUOTED
-+    // $ANTLR end "QUOTED"
--    // $ANTLR start IDENTIFIER
--    public void mIDENTIFIER() throws RecognitionException {
-+    // $ANTLR start "IDENTIFIER"
-+    public final void mIDENTIFIER() throws RecognitionException {
-         try {
--            ruleNestingLevel++;
-             int _type = IDENTIFIER;
--            int _start = getCharIndex();
--            int _line = getLine();
--            int _charPosition = getCharPositionInLine();
--            int _channel = Token.DEFAULT_CHANNEL;
--            // Bst.g:68:4: ( LETTER ( LETTER | NUMERAL )* )
--            // Bst.g:68:4: LETTER ( LETTER | NUMERAL )*
-+            int _channel = DEFAULT_TOKEN_CHANNEL;
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:76:2: ( LETTER ( LETTER | NUMERAL )* )
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:76:4: LETTER ( LETTER | NUMERAL )*
-             {
-             mLETTER(); 
--            // Bst.g:68:11: ( LETTER | NUMERAL )*
-+
-+
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:76:11: ( LETTER | NUMERAL )*
-             loop1:
-             do {
--                int alt1=3;
-+                int alt1=2;
-                 int LA1_0 = input.LA(1);
--                if ( (LA1_0=='$'||LA1_0=='.'||(LA1_0>='A' && LA1_0<='Z')||(LA1_0>='a' && LA1_0<='z')) ) {
-+
-+                if ( (LA1_0=='$'||LA1_0=='.'||(LA1_0 >= '0' && LA1_0 <= '9')||(LA1_0 >= 'A' && LA1_0 <= 'Z')||(LA1_0 >= 'a' && LA1_0 <= 'z')) ) {
-                     alt1=1;
-                 }
--                else if ( ((LA1_0>='0' && LA1_0<='9')) ) {
--                    alt1=2;
--                }
-                 switch (alt1) {
-               case 1 :
--                  // Bst.g:68:12: LETTER
-+                  // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:
-                   {
--                  mLETTER(); 
--
-+                  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') ) {
-+                      input.consume();
-+                  }
-+                  else {
-+                      MismatchedSetException mse = new MismatchedSetException(null,input);
-+                      recover(mse);
-+                      throw mse;
-                   }
--                  break;
--              case 2 :
--                  // Bst.g:68:19: NUMERAL
--                  {
--                  mNUMERAL(); 
-+
-                   }
-                   break;
-@@ -708,81 +548,73 @@
-             }
--
--
--                    if ( token==null && ruleNestingLevel==1 ) {
--                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
--                    }
--
--                        }
-+            state.type = _type;
-+            state.channel = _channel;
-+        }
-         finally {
--            ruleNestingLevel--;
-+              // do for sure before leaving
-         }
-     }
--    // $ANTLR end IDENTIFIER
-+    // $ANTLR end "IDENTIFIER"
--    // $ANTLR start LETTER
--    public void mLETTER() throws RecognitionException {
-+    // $ANTLR start "LETTER"
-+    public final void mLETTER() throws RecognitionException {
-         try {
--            ruleNestingLevel++;
--            // Bst.g:71:4: ( ('a'..'z'|'A'..'Z'|'.'|'$'))
--            // Bst.g:71:4: ('a'..'z'|'A'..'Z'|'.'|'$')
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:79:2: ( ( 'a' .. 'z' | 'A' .. 'Z' | '.' | '$' ) )
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:
-             {
--            if ( input.LA(1)=='$'||input.LA(1)=='.'||(input.LA(1)>='A' && input.LA(1)<='Z')||(input.LA(1)>='a' && input.LA(1)<='z') ) {
-+            if ( input.LA(1)=='$'||input.LA(1)=='.'||(input.LA(1) >= 'A' && input.LA(1) <= 'Z')||(input.LA(1) >= 'a' && input.LA(1) <= 'z') ) {
-                 input.consume();
--
-             }
-             else {
--                MismatchedSetException mse =
--                    new MismatchedSetException(null,input);
--                recover(mse);    throw mse;
-+                MismatchedSetException mse = new MismatchedSetException(null,input);
-+                recover(mse);
-+                throw mse;
-             }
-             }
-+
-         }
-         finally {
--            ruleNestingLevel--;
-+              // do for sure before leaving
-         }
-     }
--    // $ANTLR end LETTER
-+    // $ANTLR end "LETTER"
--    // $ANTLR start STRING
--    public void mSTRING() throws RecognitionException {
-+    // $ANTLR start "STRING"
-+    public final void mSTRING() throws RecognitionException {
-         try {
--            ruleNestingLevel++;
-             int _type = STRING;
--            int _start = getCharIndex();
--            int _line = getLine();
--            int _charPosition = getCharPositionInLine();
--            int _channel = Token.DEFAULT_CHANNEL;
--            // Bst.g:74:4: ( '\"' (~ '\"' )* '\"' )
--            // Bst.g:74:4: '\"' (~ '\"' )* '\"'
-+            int _channel = DEFAULT_TOKEN_CHANNEL;
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:82:2: ( '\"' (~ ( '\"' ) )* '\"' )
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:82:4: '\"' (~ ( '\"' ) )* '\"'
-             {
-             match('\"'); 
--            // Bst.g:74:8: (~ '\"' )*
-+
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:82:8: (~ ( '\"' ) )*
-             loop2:
-             do {
-                 int alt2=2;
-                 int LA2_0 = input.LA(1);
--                if ( ((LA2_0>='\u0000' && LA2_0<='!')||(LA2_0>='#' && LA2_0<='\uFFFE')) ) {
-+
-+                if ( ((LA2_0 >= '\u0000' && LA2_0 <= '!')||(LA2_0 >= '#' && LA2_0 <= '\uFFFF')) ) {
-                     alt2=1;
-                 }
-                 switch (alt2) {
-               case 1 :
--                  // Bst.g:74:9: ~ '\"'
-+                  // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:
-                   {
--                  if ( (input.LA(1)>='\u0000' && input.LA(1)<='!')||(input.LA(1)>='#' && input.LA(1)<='\uFFFE') ) {
-+                  if ( (input.LA(1) >= '\u0000' && input.LA(1) <= '!')||(input.LA(1) >= '#' && input.LA(1) <= '\uFFFF') ) {
-                       input.consume();
--
-                   }
-                   else {
--                      MismatchedSetException mse =
--                          new MismatchedSetException(null,input);
--                      recover(mse);    throw mse;
-+                      MismatchedSetException mse = new MismatchedSetException(null,input);
-+                      recover(mse);
-+                      throw mse;
-                   }
-@@ -794,54 +626,48 @@
-                 }
-             } while (true);
-+
-             match('\"'); 
-             }
--
--
--                    if ( token==null && ruleNestingLevel==1 ) {
--                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
--                    }
--
--                        }
-+            state.type = _type;
-+            state.channel = _channel;
-+        }
-         finally {
--            ruleNestingLevel--;
-+              // do for sure before leaving
-         }
-     }
--    // $ANTLR end STRING
-+    // $ANTLR end "STRING"
--    // $ANTLR start INTEGER
--    public void mINTEGER() throws RecognitionException {
-+    // $ANTLR start "INTEGER"
-+    public final void mINTEGER() throws RecognitionException {
-         try {
--            ruleNestingLevel++;
-             int _type = INTEGER;
--            int _start = getCharIndex();
--            int _line = getLine();
--            int _charPosition = getCharPositionInLine();
--            int _channel = Token.DEFAULT_CHANNEL;
--            // Bst.g:77:4: ( '#' ( ('+'|'-'))? ( NUMERAL )+ )
--            // Bst.g:77:4: '#' ( ('+'|'-'))? ( NUMERAL )+
-+            int _channel = DEFAULT_TOKEN_CHANNEL;
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:85:2: ( '#' ( '+' | '-' )? ( NUMERAL )+ )
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:85:4: '#' ( '+' | '-' )? ( NUMERAL )+
-             {
-             match('#'); 
--            // Bst.g:77:8: ( ('+'|'-'))?
-+
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:85:8: ( '+' | '-' )?
-             int alt3=2;
-             int LA3_0 = input.LA(1);
-+
-             if ( (LA3_0=='+'||LA3_0=='-') ) {
-                 alt3=1;
-             }
-             switch (alt3) {
-                 case 1 :
--                    // Bst.g:77:9: ('+'|'-')
-+                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:
-                     {
-                     if ( input.LA(1)=='+'||input.LA(1)=='-' ) {
-                         input.consume();
--
-                     }
-                     else {
--                        MismatchedSetException mse =
--                            new MismatchedSetException(null,input);
--                        recover(mse);    throw mse;
-+                        MismatchedSetException mse = new MismatchedSetException(null,input);
-+                        recover(mse);
-+                        throw mse;
-                     }
-@@ -850,22 +676,32 @@
-             }
--            // Bst.g:77:19: ( NUMERAL )+
-+
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:85:19: ( NUMERAL )+
-             int cnt4=0;
-             loop4:
-             do {
-                 int alt4=2;
-                 int LA4_0 = input.LA(1);
--                if ( ((LA4_0>='0' && LA4_0<='9')) ) {
-+
-+                if ( ((LA4_0 >= '0' && LA4_0 <= '9')) ) {
-                     alt4=1;
-                 }
-                 switch (alt4) {
-               case 1 :
--                  // Bst.g:77:19: NUMERAL
-+                  // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:
-                   {
--                  mNUMERAL(); 
-+                  if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) {
-+                      input.consume();
-+                  }
-+                  else {
-+                      MismatchedSetException mse = new MismatchedSetException(null,input);
-+                      recover(mse);
-+                      throw mse;
-+                  }
-+
-                   }
-                   break;
-@@ -882,78 +718,72 @@
-             }
--
--
--                    if ( token==null && ruleNestingLevel==1 ) {
--                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
--                    }
--
--                        }
-+            state.type = _type;
-+            state.channel = _channel;
-+        }
-         finally {
--            ruleNestingLevel--;
-+              // do for sure before leaving
-         }
-     }
--    // $ANTLR end INTEGER
-+    // $ANTLR end "INTEGER"
--    // $ANTLR start NUMERAL
--    public void mNUMERAL() throws RecognitionException {
-+    // $ANTLR start "NUMERAL"
-+    public final void mNUMERAL() throws RecognitionException {
-         try {
--            ruleNestingLevel++;
--            // Bst.g:80:4: ( ( '0' .. '9' ) )
--            // Bst.g:80:4: ( '0' .. '9' )
--            {
--            // Bst.g:80:4: ( '0' .. '9' )
--            // Bst.g:80:5: '0' .. '9'
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:88:2: ( ( '0' .. '9' ) )
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:
-             {
--            matchRange('0','9'); 
--
-+            if ( (input.LA(1) >= '0' && input.LA(1) <= '9') ) {
-+                input.consume();
-+            }
-+            else {
-+                MismatchedSetException mse = new MismatchedSetException(null,input);
-+                recover(mse);
-+                throw mse;
-             }
-             }
-+
-         }
-         finally {
--            ruleNestingLevel--;
-+              // do for sure before leaving
-         }
-     }
--    // $ANTLR end NUMERAL
-+    // $ANTLR end "NUMERAL"
--    // $ANTLR start WS
--    public void mWS() throws RecognitionException {
-+    // $ANTLR start "WS"
-+    public final void mWS() throws RecognitionException {
-         try {
--            ruleNestingLevel++;
-             int _type = WS;
--            int _start = getCharIndex();
--            int _line = getLine();
--            int _charPosition = getCharPositionInLine();
--            int _channel = Token.DEFAULT_CHANNEL;
--            // Bst.g:82:9: ( ( (' '|'\\t'|'\\r'|'\\n'))+ )
--            // Bst.g:82:9: ( (' '|'\\t'|'\\r'|'\\n'))+
-+            int _channel = DEFAULT_TOKEN_CHANNEL;
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:91:2: ( ( ' ' | '\\t' | '\\n' )+ )
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:91:4: ( ' ' | '\\t' | '\\n' )+
-             {
--            // Bst.g:82:9: ( (' '|'\\t'|'\\r'|'\\n'))+
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:91:4: ( ' ' | '\\t' | '\\n' )+
-             int cnt5=0;
-             loop5:
-             do {
-                 int alt5=2;
-                 int LA5_0 = input.LA(1);
--                if ( ((LA5_0>='\t' && LA5_0<='\n')||LA5_0=='\r'||LA5_0==' ') ) {
-+
-+                if ( ((LA5_0 >= '\t' && LA5_0 <= '\n')||LA5_0==' ') ) {
-                     alt5=1;
-                 }
-                 switch (alt5) {
-               case 1 :
--                  // Bst.g:82:13: (' '|'\\t'|'\\r'|'\\n')
-+                  // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:
-                   {
--                  if ( (input.LA(1)>='\t' && input.LA(1)<='\n')||input.LA(1)=='\r'||input.LA(1)==' ' ) {
-+                  if ( (input.LA(1) >= '\t' && input.LA(1) <= '\n')||input.LA(1)==' ' ) {
-                       input.consume();
--
-                   }
-                   else {
--                      MismatchedSetException mse =
--                          new MismatchedSetException(null,input);
--                      recover(mse);    throw mse;
-+                      MismatchedSetException mse = new MismatchedSetException(null,input);
-+                      recover(mse);
-+                      throw mse;
-                   }
-@@ -969,58 +799,52 @@
-                 cnt5++;
-             } while (true);
--             _channel=HIDDEN; 
--
--            }
--
-+            _channel=99;
--                    if ( token==null && ruleNestingLevel==1 ) {
--                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
--                    }
-+            }
--                        }
-+            state.type = _type;
-+            state.channel = _channel;
-+        }
-         finally {
--            ruleNestingLevel--;
-+              // do for sure before leaving
-         }
-     }
--    // $ANTLR end WS
-+    // $ANTLR end "WS"
--    // $ANTLR start LINE_COMMENT
--    public void mLINE_COMMENT() throws RecognitionException {
-+    // $ANTLR start "LINE_COMMENT"
-+    public final void mLINE_COMMENT() throws RecognitionException {
-         try {
--            ruleNestingLevel++;
-             int _type = LINE_COMMENT;
--            int _start = getCharIndex();
--            int _line = getLine();
--            int _charPosition = getCharPositionInLine();
--            int _channel = Token.DEFAULT_CHANNEL;
--            // Bst.g:90:7: ( '%' (~ ('\\n'|'\\r'))* ( '\\r' )? '\\n' )
--            // Bst.g:90:7: '%' (~ ('\\n'|'\\r'))* ( '\\r' )? '\\n'
-+            int _channel = DEFAULT_TOKEN_CHANNEL;
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:94:5: ( '%' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n' )
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:94:7: '%' (~ ( '\\n' | '\\r' ) )* ( '\\r' )? '\\n'
-             {
-             match('%'); 
--            // Bst.g:90:11: (~ ('\\n'|'\\r'))*
-+
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:94:11: (~ ( '\\n' | '\\r' ) )*
-             loop6:
-             do {
-                 int alt6=2;
-                 int LA6_0 = input.LA(1);
--                if ( ((LA6_0>='\u0000' && LA6_0<='\t')||(LA6_0>='\u000B' && LA6_0<='\f')||(LA6_0>='\u000E' && LA6_0<='\uFFFE')) ) {
-+
-+                if ( ((LA6_0 >= '\u0000' && LA6_0 <= '\t')||(LA6_0 >= '\u000B' && LA6_0 <= '\f')||(LA6_0 >= '\u000E' && LA6_0 <= '\uFFFF')) ) {
-                     alt6=1;
-                 }
-                 switch (alt6) {
-               case 1 :
--                  // Bst.g:90:11: ~ ('\\n'|'\\r')
-+                  // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:
-                   {
--                  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') ) {
-+                  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') ) {
-                       input.consume();
--
-                   }
-                   else {
--                      MismatchedSetException mse =
--                          new MismatchedSetException(null,input);
--                      recover(mse);    throw mse;
-+                      MismatchedSetException mse = new MismatchedSetException(null,input);
-+                      recover(mse);
-+                      throw mse;
-                   }
-@@ -1032,15 +856,17 @@
-                 }
-             } while (true);
--            // Bst.g:90:25: ( '\\r' )?
-+
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:94:25: ( '\\r' )?
-             int alt7=2;
-             int LA7_0 = input.LA(1);
-+
-             if ( (LA7_0=='\r') ) {
-                 alt7=1;
-             }
-             switch (alt7) {
-                 case 1 :
--                    // Bst.g:90:25: '\\r'
-+                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:94:25: '\\r'
-                     {
-                     match('\r'); 
-@@ -1049,623 +875,225 @@
-             }
--            match('\n'); 
--             _channel=HIDDEN; 
--
--            }
-+            match('\n');
-+            _channel=99;
--                    if ( token==null && ruleNestingLevel==1 ) {
--                        emit(_type,_line,_charPosition,_channel,_start,getCharIndex()-1);
--                    }
-+            }
--                        }
-+            state.type = _type;
-+            state.channel = _channel;
-+        }
-         finally {
--            ruleNestingLevel--;
-+              // do for sure before leaving
-         }
-     }
--    // $ANTLR end LINE_COMMENT
-+    // $ANTLR end "LINE_COMMENT"
-     public void mTokens() throws RecognitionException {
--        // 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 )
-+        // 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 )
-         int alt8=25;
--        switch ( input.LA(1) ) {
--        case '{':
--            alt8=1;
--            break;
--        case '}':
--            alt8=2;
--            break;
--        case '<':
--            alt8=3;
--            break;
--        case '>':
--            alt8=4;
--            break;
--        case '=':
--            alt8=5;
--            break;
--        case '+':
--            alt8=6;
--            break;
--        case '-':
--            alt8=7;
--            break;
--        case ':':
--            alt8=8;
--            break;
--        case '*':
--            alt8=9;
--            break;
--        case 'S':
--            switch ( input.LA(2) ) {
--            case 'T':
--                int LA8_22 = input.LA(3);
--                if ( (LA8_22=='R') ) {
--                    int LA8_31 = input.LA(4);
--                    if ( (LA8_31=='I') ) {
--                        int LA8_41 = input.LA(5);
--                        if ( (LA8_41=='N') ) {
--                            int LA8_51 = input.LA(6);
--                            if ( (LA8_51=='G') ) {
--                                int LA8_61 = input.LA(7);
--                                if ( (LA8_61=='S') ) {
--                                    int LA8_69 = input.LA(8);
--                                    if ( (LA8_69=='$'||LA8_69=='.'||(LA8_69>='0' && LA8_69<='9')||(LA8_69>='A' && LA8_69<='Z')||(LA8_69>='a' && LA8_69<='z')) ) {
--                                        alt8=21;
--                                    }
--                                    else {
--                                        alt8=10;}
--                                }
--                                else {
--                                    alt8=21;}
--                            }
--                            else {
--                                alt8=21;}
--                        }
--                        else {
--                            alt8=21;}
--                    }
--                    else {
--                        alt8=21;}
--                }
--                else {
--                    alt8=21;}
--                break;
--            case 'O':
--                int LA8_23 = input.LA(3);
--                if ( (LA8_23=='R') ) {
--                    int LA8_32 = input.LA(4);
--                    if ( (LA8_32=='T') ) {
--                        int LA8_42 = input.LA(5);
--                        if ( (LA8_42=='$'||LA8_42=='.'||(LA8_42>='0' && LA8_42<='9')||(LA8_42>='A' && LA8_42<='Z')||(LA8_42>='a' && LA8_42<='z')) ) {
--                            alt8=21;
--                        }
--                        else {
--                            alt8=14;}
--                    }
--                    else {
--                        alt8=21;}
--                }
--                else {
--                    alt8=21;}
--                break;
--            default:
--                alt8=21;}
--
--            break;
--        case 'I':
--            switch ( input.LA(2) ) {
--            case 'T':
--                int LA8_24 = input.LA(3);
--                if ( (LA8_24=='E') ) {
--                    int LA8_33 = input.LA(4);
--                    if ( (LA8_33=='R') ) {
--                        int LA8_43 = input.LA(5);
--                        if ( (LA8_43=='A') ) {
--                            int LA8_53 = input.LA(6);
--                            if ( (LA8_53=='T') ) {
--                                int LA8_62 = input.LA(7);
--                                if ( (LA8_62=='E') ) {
--                                    int LA8_70 = input.LA(8);
--                                    if ( (LA8_70=='$'||LA8_70=='.'||(LA8_70>='0' && LA8_70<='9')||(LA8_70>='A' && LA8_70<='Z')||(LA8_70>='a' && LA8_70<='z')) ) {
--                                        alt8=21;
--                                    }
--                                    else {
--                                        alt8=15;}
--                                }
--                                else {
--                                    alt8=21;}
--                            }
--                            else {
--                                alt8=21;}
--                        }
--                        else {
--                            alt8=21;}
--                    }
--                    else {
--                        alt8=21;}
--                }
--                else {
--                    alt8=21;}
--                break;
--            case 'N':
--                int LA8_25 = input.LA(3);
--                if ( (LA8_25=='T') ) {
--                    int LA8_34 = input.LA(4);
--                    if ( (LA8_34=='E') ) {
--                        int LA8_44 = input.LA(5);
--                        if ( (LA8_44=='G') ) {
--                            int LA8_54 = input.LA(6);
--                            if ( (LA8_54=='E') ) {
--                                int LA8_63 = input.LA(7);
--                                if ( (LA8_63=='R') ) {
--                                    int LA8_71 = input.LA(8);
--                                    if ( (LA8_71=='S') ) {
--                                        int LA8_77 = input.LA(9);
--                                        if ( (LA8_77=='$'||LA8_77=='.'||(LA8_77>='0' && LA8_77<='9')||(LA8_77>='A' && LA8_77<='Z')||(LA8_77>='a' && LA8_77<='z')) ) {
--                                            alt8=21;
--                                        }
--                                        else {
--                                            alt8=11;}
--                                    }
--                                    else {
--                                        alt8=21;}
--                                }
--                                else {
--                                    alt8=21;}
--                            }
--                            else {
--                                alt8=21;}
--                        }
--                        else {
--                            alt8=21;}
--                    }
--                    else {
--                        alt8=21;}
--                }
--                else {
--                    alt8=21;}
--                break;
--            default:
--                alt8=21;}
--
--            break;
--        case 'F':
--            int LA8_12 = input.LA(2);
--            if ( (LA8_12=='U') ) {
--                int LA8_26 = input.LA(3);
--                if ( (LA8_26=='N') ) {
--                    int LA8_35 = input.LA(4);
--                    if ( (LA8_35=='C') ) {
--                        int LA8_45 = input.LA(5);
--                        if ( (LA8_45=='T') ) {
--                            int LA8_55 = input.LA(6);
--                            if ( (LA8_55=='I') ) {
--                                int LA8_64 = input.LA(7);
--                                if ( (LA8_64=='O') ) {
--                                    int LA8_72 = input.LA(8);
--                                    if ( (LA8_72=='N') ) {
--                                        int LA8_78 = input.LA(9);
--                                        if ( (LA8_78=='$'||LA8_78=='.'||(LA8_78>='0' && LA8_78<='9')||(LA8_78>='A' && LA8_78<='Z')||(LA8_78>='a' && LA8_78<='z')) ) {
--                                            alt8=21;
--                                        }
--                                        else {
--                                            alt8=12;}
--                                    }
--                                    else {
--                                        alt8=21;}
--                                }
--                                else {
--                                    alt8=21;}
--                            }
--                            else {
--                                alt8=21;}
--                        }
--                        else {
--                            alt8=21;}
--                    }
--                    else {
--                        alt8=21;}
--                }
--                else {
--                    alt8=21;}
--            }
--            else {
--                alt8=21;}
--            break;
--        case 'E':
--            switch ( input.LA(2) ) {
--            case 'N':
--                int LA8_27 = input.LA(3);
--                if ( (LA8_27=='T') ) {
--                    int LA8_36 = input.LA(4);
--                    if ( (LA8_36=='R') ) {
--                        int LA8_46 = input.LA(5);
--                        if ( (LA8_46=='Y') ) {
--                            int LA8_56 = input.LA(6);
--                            if ( (LA8_56=='$'||LA8_56=='.'||(LA8_56>='0' && LA8_56<='9')||(LA8_56>='A' && LA8_56<='Z')||(LA8_56>='a' && LA8_56<='z')) ) {
--                                alt8=21;
--                            }
--                            else {
--                                alt8=17;}
--                        }
--                        else {
--                            alt8=21;}
--                    }
--                    else {
--                        alt8=21;}
--                }
--                else {
--                    alt8=21;}
--                break;
--            case 'X':
--                int LA8_28 = input.LA(3);
--                if ( (LA8_28=='E') ) {
--                    int LA8_37 = input.LA(4);
--                    if ( (LA8_37=='C') ) {
--                        int LA8_47 = input.LA(5);
--                        if ( (LA8_47=='U') ) {
--                            int LA8_57 = input.LA(6);
--                            if ( (LA8_57=='T') ) {
--                                int LA8_66 = input.LA(7);
--                                if ( (LA8_66=='E') ) {
--                                    int LA8_73 = input.LA(8);
--                                    if ( (LA8_73=='$'||LA8_73=='.'||(LA8_73>='0' && LA8_73<='9')||(LA8_73>='A' && LA8_73<='Z')||(LA8_73>='a' && LA8_73<='z')) ) {
--                                        alt8=21;
--                                    }
--                                    else {
--                                        alt8=13;}
--                                }
--                                else {
--                                    alt8=21;}
--                            }
--                            else {
--                                alt8=21;}
--                        }
--                        else {
--                            alt8=21;}
--                    }
--                    else {
--                        alt8=21;}
--                }
--                else {
--                    alt8=21;}
--                break;
--            default:
--                alt8=21;}
--
--            break;
--        case 'R':
--            int LA8_14 = input.LA(2);
--            if ( (LA8_14=='E') ) {
--                switch ( input.LA(3) ) {
--                case 'A':
--                    int LA8_38 = input.LA(4);
--                    if ( (LA8_38=='D') ) {
--                        int LA8_48 = input.LA(5);
--                        if ( (LA8_48=='$'||LA8_48=='.'||(LA8_48>='0' && LA8_48<='9')||(LA8_48>='A' && LA8_48<='Z')||(LA8_48>='a' && LA8_48<='z')) ) {
--                            alt8=21;
--                        }
--                        else {
--                            alt8=18;}
--                    }
--                    else {
--                        alt8=21;}
--                    break;
--                case 'V':
--                    int LA8_39 = input.LA(4);
--                    if ( (LA8_39=='E') ) {
--                        int LA8_49 = input.LA(5);
--                        if ( (LA8_49=='R') ) {
--                            int LA8_59 = input.LA(6);
--                            if ( (LA8_59=='S') ) {
--                                int LA8_67 = input.LA(7);
--                                if ( (LA8_67=='E') ) {
--                                    int LA8_74 = input.LA(8);
--                                    if ( (LA8_74=='$'||LA8_74=='.'||(LA8_74>='0' && LA8_74<='9')||(LA8_74>='A' && LA8_74<='Z')||(LA8_74>='a' && LA8_74<='z')) ) {
--                                        alt8=21;
--                                    }
--                                    else {
--                                        alt8=16;}
--                                }
--                                else {
--                                    alt8=21;}
--                            }
--                            else {
--                                alt8=21;}
--                        }
--                        else {
--                            alt8=21;}
--                    }
--                    else {
--                        alt8=21;}
--                    break;
--                default:
--                    alt8=21;}
--
--            }
--            else {
--                alt8=21;}
--            break;
--        case 'M':
--            int LA8_15 = input.LA(2);
--            if ( (LA8_15=='A') ) {
--                int LA8_30 = input.LA(3);
--                if ( (LA8_30=='C') ) {
--                    int LA8_40 = input.LA(4);
--                    if ( (LA8_40=='R') ) {
--                        int LA8_50 = input.LA(5);
--                        if ( (LA8_50=='O') ) {
--                            int LA8_60 = input.LA(6);
--                            if ( (LA8_60=='$'||LA8_60=='.'||(LA8_60>='0' && LA8_60<='9')||(LA8_60>='A' && LA8_60<='Z')||(LA8_60>='a' && LA8_60<='z')) ) {
--                                alt8=21;
--                            }
--                            else {
--                                alt8=19;}
--                        }
--                        else {
--                            alt8=21;}
--                    }
--                    else {
--                        alt8=21;}
--                }
--                else {
--                    alt8=21;}
--            }
--            else {
--                alt8=21;}
--            break;
--        case '\'':
--            alt8=20;
--            break;
--        case '$':
--        case '.':
--        case 'A':
--        case 'B':
--        case 'C':
--        case 'D':
--        case 'G':
--        case 'H':
--        case 'J':
--        case 'K':
--        case 'L':
--        case 'N':
--        case 'O':
--        case 'P':
--        case 'Q':
--        case 'T':
--        case 'U':
--        case 'V':
--        case 'W':
--        case 'X':
--        case 'Y':
--        case 'Z':
--        case 'a':
--        case 'b':
--        case 'c':
--        case 'd':
--        case 'e':
--        case 'f':
--        case 'g':
--        case 'h':
--        case 'i':
--        case 'j':
--        case 'k':
--        case 'l':
--        case 'm':
--        case 'n':
--        case 'o':
--        case 'p':
--        case 'q':
--        case 'r':
--        case 's':
--        case 't':
--        case 'u':
--        case 'v':
--        case 'w':
--        case 'x':
--        case 'y':
--        case 'z':
--            alt8=21;
--            break;
--        case '\"':
--            alt8=22;
--            break;
--        case '#':
--            alt8=23;
--            break;
--        case '\t':
--        case '\n':
--        case '\r':
--        case ' ':
--            alt8=24;
--            break;
--        case '%':
--            alt8=25;
--            break;
--        default:
--            NoViableAltException nvae =
--                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);
--
--            throw nvae;
--        }
--
-+        alt8 = dfa8.predict(input);
-         switch (alt8) {
-             case 1 :
--                // Bst.g:1:10: T25
-+                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:10: T__25
-                 {
--                mT25(); 
-+                mT__25();
-+
-                 }
-                 break;
-             case 2 :
--                // Bst.g:1:14: T26
-+                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:16: T__26
-                 {
--                mT26(); 
-+                mT__26();
-+
-                 }
-                 break;
-             case 3 :
--                // Bst.g:1:18: T27
-+                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:22: T__27
-                 {
--                mT27(); 
-+                mT__27();
-+
-                 }
-                 break;
-             case 4 :
--                // Bst.g:1:22: T28
-+                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:28: T__28
-                 {
--                mT28(); 
-+                mT__28();
-+
-                 }
-                 break;
-             case 5 :
--                // Bst.g:1:26: T29
-+                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:34: T__29
-                 {
--                mT29(); 
-+                mT__29();
-+
-                 }
-                 break;
-             case 6 :
--                // Bst.g:1:30: T30
-+                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:40: T__30
-                 {
--                mT30(); 
-+                mT__30();
-+
-                 }
-                 break;
-             case 7 :
--                // Bst.g:1:34: T31
-+                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:46: T__31
-                 {
--                mT31(); 
-+                mT__31();
-+
-                 }
-                 break;
-             case 8 :
--                // Bst.g:1:38: T32
-+                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:52: T__32
-                 {
--                mT32(); 
-+                mT__32();
-+
-                 }
-                 break;
-             case 9 :
--                // Bst.g:1:42: T33
-+                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:58: T__33
-                 {
--                mT33(); 
-+                mT__33();
-+
-                 }
-                 break;
-             case 10 :
--                // Bst.g:1:46: STRINGS
-+                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:64: STRINGS
-                 {
-                 mSTRINGS(); 
-+
-                 }
-                 break;
-             case 11 :
--                // Bst.g:1:54: INTEGERS
-+                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:72: INTEGERS
-                 {
-                 mINTEGERS(); 
-+
-                 }
-                 break;
-             case 12 :
--                // Bst.g:1:63: FUNCTION
-+                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:81: FUNCTION
-                 {
-                 mFUNCTION(); 
-+
-                 }
-                 break;
-             case 13 :
--                // Bst.g:1:72: EXECUTE
-+                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:90: EXECUTE
-                 {
-                 mEXECUTE(); 
-+
-                 }
-                 break;
-             case 14 :
--                // Bst.g:1:80: SORT
-+                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:98: SORT
-                 {
-                 mSORT(); 
-+
-                 }
-                 break;
-             case 15 :
--                // Bst.g:1:85: ITERATE
-+                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:103: ITERATE
-                 {
-                 mITERATE(); 
-+
-                 }
-                 break;
-             case 16 :
--                // Bst.g:1:93: REVERSE
-+                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:111: REVERSE
-                 {
-                 mREVERSE(); 
-+
-                 }
-                 break;
-             case 17 :
--                // Bst.g:1:101: ENTRY
-+                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:119: ENTRY
-                 {
-                 mENTRY(); 
-+
-                 }
-                 break;
-             case 18 :
--                // Bst.g:1:107: READ
-+                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:125: READ
-                 {
-                 mREAD(); 
-+
-                 }
-                 break;
-             case 19 :
--                // Bst.g:1:112: MACRO
-+                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:130: MACRO
-                 {
-                 mMACRO(); 
-+
-                 }
-                 break;
-             case 20 :
--                // Bst.g:1:118: QUOTED
-+                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:136: QUOTED
-                 {
-                 mQUOTED(); 
-+
-                 }
-                 break;
-             case 21 :
--                // Bst.g:1:125: IDENTIFIER
-+                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:143: IDENTIFIER
-                 {
-                 mIDENTIFIER(); 
-+
-                 }
-                 break;
-             case 22 :
--                // Bst.g:1:136: STRING
-+                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:154: STRING
-                 {
-                 mSTRING(); 
-+
-                 }
-                 break;
-             case 23 :
--                // Bst.g:1:143: INTEGER
-+                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:161: INTEGER
-                 {
-                 mINTEGER(); 
-+
-                 }
-                 break;
-             case 24 :
--                // Bst.g:1:151: WS
-+                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:169: WS
-                 {
-                 mWS(); 
-+
-                 }
-                 break;
-             case 25 :
--                // Bst.g:1:154: LINE_COMMENT
-+                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:1:172: LINE_COMMENT
-                 {
-                 mLINE_COMMENT(); 
-+
-                 }
-                 break;
-@@ -1674,6 +1102,167 @@
-     }
-+    protected DFA8 dfa8 = new DFA8(this);
-+    static final String DFA8_eotS =
-+        "\12\uffff\6\21\6\uffff\24\21\1\64\6\21\1\73\2\21\1\uffff\4\21\1"+
-+        "\102\1\21\1\uffff\1\104\5\21\1\uffff\1\21\1\uffff\1\113\1\21\1\115"+
-+        "\1\21\1\117\1\120\1\uffff\1\121\1\uffff\1\122\4\uffff";
-+    static final String DFA8_eofS =
-+        "\123\uffff";
-+    static final String DFA8_minS =
-+        "\1\11\11\uffff\1\117\1\116\1\125\1\116\1\105\1\101\6\uffff\2\122"+
-+        "\1\124\1\105\1\116\1\105\1\124\1\101\1\103\1\111\1\124\1\105\1\122"+
-+        "\2\103\1\122\1\105\1\104\1\122\1\116\1\44\1\107\1\101\1\124\1\125"+
-+        "\1\131\1\122\1\44\1\117\1\107\1\uffff\1\105\1\124\1\111\1\124\1"+
-+        "\44\1\123\1\uffff\1\44\1\123\1\122\1\105\1\117\1\105\1\uffff\1\105"+
-+        "\1\uffff\1\44\1\123\1\44\1\116\2\44\1\uffff\1\44\1\uffff\1\44\4"+
-+        "\uffff";
-+    static final String DFA8_maxS =
-+        "\1\175\11\uffff\2\124\1\125\1\130\1\105\1\101\6\uffff\2\122\1\124"+
-+        "\1\105\1\116\1\105\1\124\1\126\1\103\1\111\1\124\1\105\1\122\2\103"+
-+        "\1\122\1\105\1\104\1\122\1\116\1\172\1\107\1\101\1\124\1\125\1\131"+
-+        "\1\122\1\172\1\117\1\107\1\uffff\1\105\1\124\1\111\1\124\1\172\1"+
-+        "\123\1\uffff\1\172\1\123\1\122\1\105\1\117\1\105\1\uffff\1\105\1"+
-+        "\uffff\1\172\1\123\1\172\1\116\2\172\1\uffff\1\172\1\uffff\1\172"+
-+        "\4\uffff";
-+    static final String DFA8_acceptS =
-+        "\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"+
-+        "\1\26\1\27\1\30\1\31\36\uffff\1\16\6\uffff\1\22\6\uffff\1\21\1\uffff"+
-+        "\1\23\6\uffff\1\12\1\uffff\1\17\1\uffff\1\15\1\20\1\13\1\14";
-+    static final String DFA8_specialS =
-+        "\123\uffff}>";
-+    static final String[] DFA8_transitionS = {
-+            "\2\24\25\uffff\1\24\1\uffff\1\22\1\23\1\21\1\25\1\uffff\1\20"+
-+            "\2\uffff\1\1\1\2\1\uffff\1\3\1\21\13\uffff\1\4\1\uffff\1\5\1"+
-+            "\6\1\7\2\uffff\4\21\1\15\1\14\2\21\1\13\3\21\1\17\4\21\1\16"+
-+            "\1\12\7\21\6\uffff\32\21\1\10\1\uffff\1\11",
-+            "",
-+            "",
-+            "",
-+            "",
-+            "",
-+            "",
-+            "",
-+            "",
-+            "",
-+            "\1\27\4\uffff\1\26",
-+            "\1\30\5\uffff\1\31",
-+            "\1\32",
-+            "\1\34\11\uffff\1\33",
-+            "\1\35",
-+            "\1\36",
-+            "",
-+            "",
-+            "",
-+            "",
-+            "",
-+            "",
-+            "\1\37",
-+            "\1\40",
-+            "\1\41",
-+            "\1\42",
-+            "\1\43",
-+            "\1\44",
-+            "\1\45",
-+            "\1\47\24\uffff\1\46",
-+            "\1\50",
-+            "\1\51",
-+            "\1\52",
-+            "\1\53",
-+            "\1\54",
-+            "\1\55",
-+            "\1\56",
-+            "\1\57",
-+            "\1\60",
-+            "\1\61",
-+            "\1\62",
-+            "\1\63",
-+            "\1\21\11\uffff\1\21\1\uffff\12\21\7\uffff\32\21\6\uffff\32"+
-+            "\21",
-+            "\1\65",
-+            "\1\66",
-+            "\1\67",
-+            "\1\70",
-+            "\1\71",
-+            "\1\72",
-+            "\1\21\11\uffff\1\21\1\uffff\12\21\7\uffff\32\21\6\uffff\32"+
-+            "\21",
-+            "\1\74",
-+            "\1\75",
-+            "",
-+            "\1\76",
-+            "\1\77",
-+            "\1\100",
-+            "\1\101",
-+            "\1\21\11\uffff\1\21\1\uffff\12\21\7\uffff\32\21\6\uffff\32"+
-+            "\21",
-+            "\1\103",
-+            "",
-+            "\1\21\11\uffff\1\21\1\uffff\12\21\7\uffff\32\21\6\uffff\32"+
-+            "\21",
-+            "\1\105",
-+            "\1\106",
-+            "\1\107",
-+            "\1\110",
-+            "\1\111",
-+            "",
-+            "\1\112",
-+            "",
-+            "\1\21\11\uffff\1\21\1\uffff\12\21\7\uffff\32\21\6\uffff\32"+
-+            "\21",
-+            "\1\114",
-+            "\1\21\11\uffff\1\21\1\uffff\12\21\7\uffff\32\21\6\uffff\32"+
-+            "\21",
-+            "\1\116",
-+            "\1\21\11\uffff\1\21\1\uffff\12\21\7\uffff\32\21\6\uffff\32"+
-+            "\21",
-+            "\1\21\11\uffff\1\21\1\uffff\12\21\7\uffff\32\21\6\uffff\32"+
-+            "\21",
-+            "",
-+            "\1\21\11\uffff\1\21\1\uffff\12\21\7\uffff\32\21\6\uffff\32"+
-+            "\21",
-+            "",
-+            "\1\21\11\uffff\1\21\1\uffff\12\21\7\uffff\32\21\6\uffff\32"+
-+            "\21",
-+            "",
-+            "",
-+            "",
-+            ""
-+    };
-+
-+    static final short[] DFA8_eot = DFA.unpackEncodedString(DFA8_eotS);
-+    static final short[] DFA8_eof = DFA.unpackEncodedString(DFA8_eofS);
-+    static final char[] DFA8_min = DFA.unpackEncodedStringToUnsignedChars(DFA8_minS);
-+    static final char[] DFA8_max = DFA.unpackEncodedStringToUnsignedChars(DFA8_maxS);
-+    static final short[] DFA8_accept = DFA.unpackEncodedString(DFA8_acceptS);
-+    static final short[] DFA8_special = DFA.unpackEncodedString(DFA8_specialS);
-+    static final short[][] DFA8_transition;
-+
-+    static {
-+        int numStates = DFA8_transitionS.length;
-+        DFA8_transition = new short[numStates][];
-+        for (int i=0; i<numStates; i++) {
-+            DFA8_transition[i] = DFA.unpackEncodedString(DFA8_transitionS[i]);
-+        }
-+    }
-+
-+    class DFA8 extends DFA {
-+
-+        public DFA8(BaseRecognizer recognizer) {
-+            this.recognizer = recognizer;
-+            this.decisionNumber = 8;
-+            this.eot = DFA8_eot;
-+            this.eof = DFA8_eof;
-+            this.min = DFA8_min;
-+            this.max = DFA8_max;
-+            this.accept = DFA8_accept;
-+            this.special = DFA8_special;
-+            this.transition = DFA8_transition;
-+        }
-+        public String getDescription() {
-+            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 );";
-+        }
-+    }
-  
--}
-+}
-\ No newline at end of file
---- a/src/java/net/sf/jabref/bst/BstParser.java
-+++ b/src/java/net/sf/jabref/bst/BstParser.java
-@@ -1,122 +1,125 @@
--/*  Copyright (C) 2003-2011 JabRef contributors.
--    This program is free software; you can redistribute it and/or modify
--    it under the terms of the GNU General Public License as published by
--    the Free Software Foundation; either version 2 of the License, or
--    (at your option) any later version.
--
--    This program is distributed in the hope that it will be useful,
--    but WITHOUT ANY WARRANTY; without even the implied warranty of
--    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
--    GNU General Public License for more details.
--
--    You should have received a copy of the GNU General Public License along
--    with this program; if not, write to the Free Software Foundation, Inc.,
--    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
--*/
-+// $ANTLR 3.4 C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g 2012-10-28 23:48:28
-+// Generated by ANTLR
- package net.sf.jabref.bst;
--// $ANTLR 3.0b5 Bst.g 2006-11-23 23:20:24
--
--import java.util.ArrayList;
-+import org.antlr.runtime.*;
-+import java.util.Stack;
- import java.util.List;
-+import java.util.ArrayList;
--import org.antlr.runtime.BitSet;
--import org.antlr.runtime.EarlyExitException;
--import org.antlr.runtime.NoViableAltException;
--import org.antlr.runtime.Parser;
--import org.antlr.runtime.ParserRuleReturnScope;
--import org.antlr.runtime.RecognitionException;
--import org.antlr.runtime.Token;
--import org.antlr.runtime.TokenStream;
--import org.antlr.runtime.tree.CommonTreeAdaptor;
--import org.antlr.runtime.tree.TreeAdaptor;
-+import org.antlr.runtime.tree.*;
--@SuppressWarnings({"unused", "unchecked"})
-+
-+@SuppressWarnings({"all", "warnings", "unchecked"})
- public class BstParser extends Parser {
-     public static final String[] tokenNames = new String[] {
--        "<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", "'{'", "'}'", "'<'", "'>'", "'='", "'+'", "'-'", "':='", "'*'"
-+        "<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", "'*'", "'+'", "'-'", "':='", "'<'", "'='", "'>'", "'{'", "'}'"
-     };
--    public static final int LETTER=21;
--    public static final int ENTRY=6;
--    public static final int INTEGERS=9;
--    public static final int WS=23;
--    public static final int COMMANDS=7;
--    public static final int STRING=12;
--    public static final int EXECUTE=14;
--    public static final int LINE_COMMENT=24;
--    public static final int SORT=17;
--    public static final int STACK=5;
--    public static final int REVERSE=16;
--    public static final int QUOTED=20;
--    public static final int INTEGER=19;
--    public static final int ITERATE=15;
--    public static final int FUNCTION=10;
-+
-     public static final int EOF=-1;
--    public static final int STRINGS=8;
--    public static final int IDENTIFIER=18;
--    public static final int MACRO=11;
--    public static final int IDLIST=4;
--    public static final int NUMERAL=22;
--    public static final int READ=13;
-+    public static final int T__25=25;
-+    public static final int T__26=26;
-+    public static final int T__27=27;
-+    public static final int T__28=28;
-+    public static final int T__29=29;
-+    public static final int T__30=30;
-+    public static final int T__31=31;
-+    public static final int T__32=32;
-+    public static final int T__33=33;
-+    public static final int COMMANDS=4;
-+    public static final int ENTRY=5;
-+    public static final int EXECUTE=6;
-+    public static final int FUNCTION=7;
-+    public static final int IDENTIFIER=8;
-+    public static final int IDLIST=9;
-+    public static final int INTEGER=10;
-+    public static final int INTEGERS=11;
-+    public static final int ITERATE=12;
-+    public static final int LETTER=13;
-+    public static final int LINE_COMMENT=14;
-+    public static final int MACRO=15;
-+    public static final int NUMERAL=16;
-+    public static final int QUOTED=17;
-+    public static final int READ=18;
-+    public static final int REVERSE=19;
-+    public static final int SORT=20;
-+    public static final int STACK=21;
-+    public static final int STRING=22;
-+    public static final int STRINGS=23;
-+    public static final int WS=24;
-+
-+    // delegates
-+    public Parser[] getDelegates() {
-+        return new Parser[] {};
-+    }
-+
-+    // delegators
--        public BstParser(TokenStream input) {
--            super(input);
--        }
--        
--    protected TreeAdaptor adaptor = new CommonTreeAdaptor();
--    public void setTreeAdaptor(TreeAdaptor adaptor) {
--        this.adaptor = adaptor;
-+    public BstParser(TokenStream input) {
-+        this(input, new RecognizerSharedState());
-     }
--    public TreeAdaptor getTreeAdaptor() {
--        return adaptor;
-+    public BstParser(TokenStream input, RecognizerSharedState state) {
-+        super(input, state);
-     }
--    public String[] getTokenNames() { return tokenNames; }
--    public String getGrammarFileName() { return "Bst.g"; }
-+protected TreeAdaptor adaptor = new CommonTreeAdaptor();
-+
-+public void setTreeAdaptor(TreeAdaptor adaptor) {
-+    this.adaptor = adaptor;
-+}
-+public TreeAdaptor getTreeAdaptor() {
-+    return adaptor;
-+}
-+    public String[] getTokenNames() { return BstParser.tokenNames; }
-+    public String getGrammarFileName() { return "C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g"; }
-     public static class program_return extends ParserRuleReturnScope {
-         Object tree;
-         public Object getTree() { return tree; }
--    }
-+    };
-+
--    // $ANTLR start program
--    // Bst.g:14:1: program : ( commands )+ -> ^( COMMANDS ( commands )+ ) ;
--    public program_return program() throws RecognitionException {   
--        program_return retval = new program_return();
-+    // $ANTLR start "program"
-+    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:22:1: program : ( commands )+ -> ^( COMMANDS ( commands )+ ) ;
-+    public final BstParser.program_return program() throws RecognitionException {
-+        BstParser.program_return retval = new BstParser.program_return();
-         retval.start = input.LT(1);
-+
-         Object root_0 = null;
--        commands_return commands1 = null;
-+        BstParser.commands_return commands1 =null;
--        List list_commands=new ArrayList();
-+        RewriteRuleSubtreeStream stream_commands=new RewriteRuleSubtreeStream(adaptor,"rule commands");
-         try {
--            // Bst.g:14:11: ( ( commands )+ -> ^( COMMANDS ( commands )+ ) )
--            // Bst.g:14:11: ( commands )+
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:22:9: ( ( commands )+ -> ^( COMMANDS ( commands )+ ) )
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:22:11: ( commands )+
-             {
--            // Bst.g:14:11: ( commands )+
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:22:11: ( commands )+
-             int cnt1=0;
-             loop1:
-             do {
-                 int alt1=2;
-                 int LA1_0 = input.LA(1);
--                if ( (LA1_0==ENTRY||(LA1_0>=STRINGS && LA1_0<=MACRO)||(LA1_0>=READ && LA1_0<=SORT)) ) {
-+
-+                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) ) {
-                     alt1=1;
-                 }
-                 switch (alt1) {
-               case 1 :
--                  // Bst.g:14:11: commands
-+                  // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:22:11: commands
-                   {
--                  pushFollow(FOLLOW_commands_in_program45);
-+                  pushFollow(FOLLOW_commands_in_program62);
-                   commands1=commands();
--                  _fsp--;
--                  list_commands.add(commands1.tree);
-+                  state._fsp--;
-+
-+                  stream_commands.add(commands1.getTree());
-                   }
-                   break;
-@@ -132,29 +135,33 @@
-             // AST REWRITE
--            
--                      int i_0 = 0;
-+            // elements: commands
-+            // token labels:
-+            // rule labels: retval
-+            // token list labels:
-+            // rule list labels:
-+            // wildcard labels:
-             retval.tree = root_0;
--            root_0 = adaptor.nil();
--            // 14:21: -> ^( COMMANDS ( commands )+ )
--            {
--                // Bst.g:14:24: ^( COMMANDS ( commands )+ )
--                {
--                Object root_1 = adaptor.nil();
--                root_1 = adaptor.becomeRoot(adaptor.create(COMMANDS, "COMMANDS"), root_1);
-+            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
--                // Bst.g:14:35: ( commands )+
-+            root_0 = (Object)adaptor.nil();
-+            // 22:21: -> ^( COMMANDS ( commands )+ )
-+            {
-+                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:22:24: ^( COMMANDS ( commands )+ )
-                 {
--                int n_1 = list_commands == null ? 0 : list_commands.size();
--                 
--
--
--                if ( n_1==0 ) throw new RuntimeException("Must have more than one element for (...)+ loops");
--                for (int i_1=0; i_1<n_1; i_1++) {
--                    adaptor.addChild(root_1, list_commands.get(i_1));
-+                Object root_1 = (Object)adaptor.nil();
-+                root_1 = (Object)adaptor.becomeRoot(
-+                (Object)adaptor.create(COMMANDS, "COMMANDS")
-+                , root_1);
-+                if ( !(stream_commands.hasNext()) ) {
-+                    throw new RewriteEarlyExitException();
-                 }
-+                while ( stream_commands.hasNext() ) {
-+                    adaptor.addChild(root_1, stream_commands.nextTree());
-+
-                 }
-+                stream_commands.reset();
-                 adaptor.addChild(root_0, root_1);
-                 }
-@@ -162,36 +169,45 @@
-             }
-+            retval.tree = root_0;
-             }
-+            retval.stop = input.LT(-1);
-+
-+
-+            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
-+            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-+
-         }
-         catch (RecognitionException re) {
-             reportError(re);
-             recover(input,re);
--        }
--        finally {
--            retval.stop = input.LT(-1);
-+      retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
--                retval.tree = adaptor.rulePostProcessing(root_0);
--                adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-+        }
--       }
-+        finally {
-+              // do for sure before leaving
-+        }
-         return retval;
-     }
--    // $ANTLR end program
-+    // $ANTLR end "program"
-+
-     public static class commands_return extends ParserRuleReturnScope {
-         Object tree;
-         public Object getTree() { return tree; }
--    }
-+    };
-+
--    // $ANTLR start commands
--    // 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^^ );
--    public commands_return commands() throws RecognitionException {   
--        commands_return retval = new commands_return();
-+    // $ANTLR start "commands"
-+    // 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 ^);
-+    public final BstParser.commands_return commands() throws RecognitionException {
-+        BstParser.commands_return retval = new BstParser.commands_return();
-         retval.start = input.LT(1);
-+
-         Object root_0 = null;
-         Token STRINGS2=null;
-@@ -213,27 +229,27 @@
-         Token char_literal26=null;
-         Token ENTRY27=null;
-         Token SORT31=null;
--        idList_return idList3 = null;
-+        BstParser.idList_return idList3 =null;
--        idList_return idList5 = null;
-+        BstParser.idList_return idList5 =null;
--        id_return id7 = null;
-+        BstParser.id_return id7 =null;
--        stack_return stack8 = null;
-+        BstParser.stack_return stack8 =null;
--        id_return id10 = null;
-+        BstParser.id_return id10 =null;
--        function_return function17 = null;
-+        BstParser.function_return function17 =null;
--        function_return function21 = null;
-+        BstParser.function_return function21 =null;
--        function_return function25 = null;
-+        BstParser.function_return function25 =null;
--        idList0_return idList028 = null;
-+        BstParser.idList0_return idList028 =null;
--        idList0_return idList029 = null;
-+        BstParser.idList0_return idList029 =null;
--        idList0_return idList030 = null;
-+        BstParser.idList0_return idList030 =null;
-         Object STRINGS2_tree=null;
-@@ -257,282 +273,355 @@
-         Object SORT31_tree=null;
-         try {
--            // 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^^ )
-+            // 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 ^)
-             int alt2=10;
-             switch ( input.LA(1) ) {
-             case STRINGS:
-+                {
-                 alt2=1;
-+                }
-                 break;
-             case INTEGERS:
-+                {
-                 alt2=2;
-+                }
-                 break;
-             case FUNCTION:
-+                {
-                 alt2=3;
-+                }
-                 break;
-             case MACRO:
-+                {
-                 alt2=4;
-+                }
-                 break;
-             case READ:
-+                {
-                 alt2=5;
-+                }
-                 break;
-             case EXECUTE:
-+                {
-                 alt2=6;
-+                }
-                 break;
-             case ITERATE:
-+                {
-                 alt2=7;
-+                }
-                 break;
-             case REVERSE:
-+                {
-                 alt2=8;
-+                }
-                 break;
-             case ENTRY:
-+                {
-                 alt2=9;
-+                }
-                 break;
-             case SORT:
-+                {
-                 alt2=10;
-+                }
-                 break;
-             default:
-                 NoViableAltException nvae =
--                    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);
-+                    new NoViableAltException("", 2, 0, input);
-                 throw nvae;
-+
-             }
-             switch (alt2) {
-                 case 1 :
--                    // Bst.g:17:4: STRINGS^^ idList
-+                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:25:4: STRINGS ^ idList
-                     {
--                    root_0 = adaptor.nil();
-+                    root_0 = (Object)adaptor.nil();
-+
-+
-+                    STRINGS2=(Token)match(input,STRINGS,FOLLOW_STRINGS_in_commands82);
-+                    STRINGS2_tree =
-+                    (Object)adaptor.create(STRINGS2)
-+                    ;
-+                    root_0 = (Object)adaptor.becomeRoot(STRINGS2_tree, root_0);
--                    STRINGS2=input.LT(1);
--                    match(input,STRINGS,FOLLOW_STRINGS_in_commands65); 
--                    STRINGS2_tree = adaptor.create(STRINGS2);
--                    root_0 = adaptor.becomeRoot(STRINGS2_tree, root_0);
--                    pushFollow(FOLLOW_idList_in_commands68);
-+                    pushFollow(FOLLOW_idList_in_commands85);
-                     idList3=idList();
--                    _fsp--;
--                    adaptor.addChild(root_0, idList3.tree);
-+                    state._fsp--;
-+
-+                    adaptor.addChild(root_0, idList3.getTree());
-                     }
-                     break;
-                 case 2 :
--                    // Bst.g:18:4: INTEGERS^^ idList
-+                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:26:4: INTEGERS ^ idList
-                     {
--                    root_0 = adaptor.nil();
-+                    root_0 = (Object)adaptor.nil();
-+
-+
-+                    INTEGERS4=(Token)match(input,INTEGERS,FOLLOW_INTEGERS_in_commands90);
-+                    INTEGERS4_tree =
-+                    (Object)adaptor.create(INTEGERS4)
-+                    ;
-+                    root_0 = (Object)adaptor.becomeRoot(INTEGERS4_tree, root_0);
--                    INTEGERS4=input.LT(1);
--                    match(input,INTEGERS,FOLLOW_INTEGERS_in_commands73); 
--                    INTEGERS4_tree = adaptor.create(INTEGERS4);
--                    root_0 = adaptor.becomeRoot(INTEGERS4_tree, root_0);
--                    pushFollow(FOLLOW_idList_in_commands76);
-+                    pushFollow(FOLLOW_idList_in_commands93);
-                     idList5=idList();
--                    _fsp--;
--                    adaptor.addChild(root_0, idList5.tree);
-+                    state._fsp--;
-+
-+                    adaptor.addChild(root_0, idList5.getTree());
-                     }
-                     break;
-                 case 3 :
--                    // Bst.g:19:4: FUNCTION^^ id stack
-+                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:27:4: FUNCTION ^ id stack
-                     {
--                    root_0 = adaptor.nil();
-+                    root_0 = (Object)adaptor.nil();
-+
--                    FUNCTION6=input.LT(1);
--                    match(input,FUNCTION,FOLLOW_FUNCTION_in_commands81); 
--                    FUNCTION6_tree = adaptor.create(FUNCTION6);
--                    root_0 = adaptor.becomeRoot(FUNCTION6_tree, root_0);
-+                    FUNCTION6=(Token)match(input,FUNCTION,FOLLOW_FUNCTION_in_commands98);
-+                    FUNCTION6_tree =
-+                    (Object)adaptor.create(FUNCTION6)
-+                    ;
-+                    root_0 = (Object)adaptor.becomeRoot(FUNCTION6_tree, root_0);
--                    pushFollow(FOLLOW_id_in_commands84);
-+
-+                    pushFollow(FOLLOW_id_in_commands101);
-                     id7=id();
--                    _fsp--;
--                    adaptor.addChild(root_0, id7.tree);
--                    pushFollow(FOLLOW_stack_in_commands86);
-+                    state._fsp--;
-+
-+                    adaptor.addChild(root_0, id7.getTree());
-+
-+                    pushFollow(FOLLOW_stack_in_commands103);
-                     stack8=stack();
--                    _fsp--;
--                    adaptor.addChild(root_0, stack8.tree);
-+                    state._fsp--;
-+
-+                    adaptor.addChild(root_0, stack8.getTree());
-                     }
-                     break;
-                 case 4 :
--                    // Bst.g:20:4: MACRO^^ id '{'! STRING '}'!
-+                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:28:4: MACRO ^ id '{' ! STRING '}' !
-                     {
--                    root_0 = adaptor.nil();
-+                    root_0 = (Object)adaptor.nil();
-+
--                    MACRO9=input.LT(1);
--                    match(input,MACRO,FOLLOW_MACRO_in_commands91); 
--                    MACRO9_tree = adaptor.create(MACRO9);
--                    root_0 = adaptor.becomeRoot(MACRO9_tree, root_0);
-+                    MACRO9=(Token)match(input,MACRO,FOLLOW_MACRO_in_commands108);
-+                    MACRO9_tree =
-+                    (Object)adaptor.create(MACRO9)
-+                    ;
-+                    root_0 = (Object)adaptor.becomeRoot(MACRO9_tree, root_0);
--                    pushFollow(FOLLOW_id_in_commands94);
-+
-+                    pushFollow(FOLLOW_id_in_commands111);
-                     id10=id();
--                    _fsp--;
--                    adaptor.addChild(root_0, id10.tree);
--                    char_literal11=input.LT(1);
--                    match(input,25,FOLLOW_25_in_commands96); 
--                    STRING12=input.LT(1);
--                    match(input,STRING,FOLLOW_STRING_in_commands99); 
--                    STRING12_tree = adaptor.create(STRING12);
-+                    state._fsp--;
-+
-+                    adaptor.addChild(root_0, id10.getTree());
-+
-+                    char_literal11=(Token)match(input,32,FOLLOW_32_in_commands113);
-+
-+                    STRING12=(Token)match(input,STRING,FOLLOW_STRING_in_commands116);
-+                    STRING12_tree =
-+                    (Object)adaptor.create(STRING12)
-+                    ;
-                     adaptor.addChild(root_0, STRING12_tree);
--                    char_literal13=input.LT(1);
--                    match(input,26,FOLLOW_26_in_commands101); 
-+
-+                    char_literal13=(Token)match(input,33,FOLLOW_33_in_commands118);
-                     }
-                     break;
-                 case 5 :
--                    // Bst.g:21:4: READ^^
-+                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:29:4: READ ^
-                     {
--                    root_0 = adaptor.nil();
-+                    root_0 = (Object)adaptor.nil();
--                    READ14=input.LT(1);
--                    match(input,READ,FOLLOW_READ_in_commands107); 
--                    READ14_tree = adaptor.create(READ14);
--                    root_0 = adaptor.becomeRoot(READ14_tree, root_0);
-+
-+                    READ14=(Token)match(input,READ,FOLLOW_READ_in_commands124);
-+                    READ14_tree =
-+                    (Object)adaptor.create(READ14)
-+                    ;
-+                    root_0 = (Object)adaptor.becomeRoot(READ14_tree, root_0);
-                     }
-                     break;
-                 case 6 :
--                    // Bst.g:22:4: EXECUTE^^ '{'! function '}'!
-+                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:30:4: EXECUTE ^ '{' ! function '}' !
-                     {
--                    root_0 = adaptor.nil();
-+                    root_0 = (Object)adaptor.nil();
-+
-+
-+                    EXECUTE15=(Token)match(input,EXECUTE,FOLLOW_EXECUTE_in_commands130);
-+                    EXECUTE15_tree =
-+                    (Object)adaptor.create(EXECUTE15)
-+                    ;
-+                    root_0 = (Object)adaptor.becomeRoot(EXECUTE15_tree, root_0);
-+
-+
-+                    char_literal16=(Token)match(input,32,FOLLOW_32_in_commands133);
--                    EXECUTE15=input.LT(1);
--                    match(input,EXECUTE,FOLLOW_EXECUTE_in_commands113); 
--                    EXECUTE15_tree = adaptor.create(EXECUTE15);
--                    root_0 = adaptor.becomeRoot(EXECUTE15_tree, root_0);
--
--                    char_literal16=input.LT(1);
--                    match(input,25,FOLLOW_25_in_commands116); 
--                    pushFollow(FOLLOW_function_in_commands119);
-+                    pushFollow(FOLLOW_function_in_commands136);
-                     function17=function();
--                    _fsp--;
--                    adaptor.addChild(root_0, function17.tree);
--                    char_literal18=input.LT(1);
--                    match(input,26,FOLLOW_26_in_commands121); 
-+                    state._fsp--;
-+
-+                    adaptor.addChild(root_0, function17.getTree());
-+
-+                    char_literal18=(Token)match(input,33,FOLLOW_33_in_commands138);
-                     }
-                     break;
-                 case 7 :
--                    // Bst.g:23:4: ITERATE^^ '{'! function '}'!
-+                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:31:4: ITERATE ^ '{' ! function '}' !
-                     {
--                    root_0 = adaptor.nil();
-+                    root_0 = (Object)adaptor.nil();
-+
-+
-+                    ITERATE19=(Token)match(input,ITERATE,FOLLOW_ITERATE_in_commands144);
-+                    ITERATE19_tree =
-+                    (Object)adaptor.create(ITERATE19)
-+                    ;
-+                    root_0 = (Object)adaptor.becomeRoot(ITERATE19_tree, root_0);
-+
-+
-+                    char_literal20=(Token)match(input,32,FOLLOW_32_in_commands147);
--                    ITERATE19=input.LT(1);
--                    match(input,ITERATE,FOLLOW_ITERATE_in_commands127); 
--                    ITERATE19_tree = adaptor.create(ITERATE19);
--                    root_0 = adaptor.becomeRoot(ITERATE19_tree, root_0);
--
--                    char_literal20=input.LT(1);
--                    match(input,25,FOLLOW_25_in_commands130); 
--                    pushFollow(FOLLOW_function_in_commands133);
-+                    pushFollow(FOLLOW_function_in_commands150);
-                     function21=function();
--                    _fsp--;
--                    adaptor.addChild(root_0, function21.tree);
--                    char_literal22=input.LT(1);
--                    match(input,26,FOLLOW_26_in_commands135); 
-+                    state._fsp--;
-+
-+                    adaptor.addChild(root_0, function21.getTree());
-+
-+                    char_literal22=(Token)match(input,33,FOLLOW_33_in_commands152);
-                     }
-                     break;
-                 case 8 :
--                    // Bst.g:24:4: REVERSE^^ '{'! function '}'!
-+                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:32:4: REVERSE ^ '{' ! function '}' !
-                     {
--                    root_0 = adaptor.nil();
-+                    root_0 = (Object)adaptor.nil();
-+
-+
-+                    REVERSE23=(Token)match(input,REVERSE,FOLLOW_REVERSE_in_commands158);
-+                    REVERSE23_tree =
-+                    (Object)adaptor.create(REVERSE23)
-+                    ;
-+                    root_0 = (Object)adaptor.becomeRoot(REVERSE23_tree, root_0);
-+
--                    REVERSE23=input.LT(1);
--                    match(input,REVERSE,FOLLOW_REVERSE_in_commands141); 
--                    REVERSE23_tree = adaptor.create(REVERSE23);
--                    root_0 = adaptor.becomeRoot(REVERSE23_tree, root_0);
--
--                    char_literal24=input.LT(1);
--                    match(input,25,FOLLOW_25_in_commands144); 
--                    pushFollow(FOLLOW_function_in_commands147);
-+                    char_literal24=(Token)match(input,32,FOLLOW_32_in_commands161);
-+
-+                    pushFollow(FOLLOW_function_in_commands164);
-                     function25=function();
--                    _fsp--;
--                    adaptor.addChild(root_0, function25.tree);
--                    char_literal26=input.LT(1);
--                    match(input,26,FOLLOW_26_in_commands149); 
-+                    state._fsp--;
-+
-+                    adaptor.addChild(root_0, function25.getTree());
-+
-+                    char_literal26=(Token)match(input,33,FOLLOW_33_in_commands166);
-                     }
-                     break;
-                 case 9 :
--                    // Bst.g:25:4: ENTRY^^ idList0 idList0 idList0
-+                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:33:4: ENTRY ^ idList0 idList0 idList0
-                     {
--                    root_0 = adaptor.nil();
-+                    root_0 = (Object)adaptor.nil();
-+
-+
-+                    ENTRY27=(Token)match(input,ENTRY,FOLLOW_ENTRY_in_commands172);
-+                    ENTRY27_tree =
-+                    (Object)adaptor.create(ENTRY27)
-+                    ;
-+                    root_0 = (Object)adaptor.becomeRoot(ENTRY27_tree, root_0);
--                    ENTRY27=input.LT(1);
--                    match(input,ENTRY,FOLLOW_ENTRY_in_commands155); 
--                    ENTRY27_tree = adaptor.create(ENTRY27);
--                    root_0 = adaptor.becomeRoot(ENTRY27_tree, root_0);
--                    pushFollow(FOLLOW_idList0_in_commands158);
-+                    pushFollow(FOLLOW_idList0_in_commands175);
-                     idList028=idList0();
--                    _fsp--;
--                    adaptor.addChild(root_0, idList028.tree);
--                    pushFollow(FOLLOW_idList0_in_commands160);
-+                    state._fsp--;
-+
-+                    adaptor.addChild(root_0, idList028.getTree());
-+
-+                    pushFollow(FOLLOW_idList0_in_commands177);
-                     idList029=idList0();
--                    _fsp--;
--                    adaptor.addChild(root_0, idList029.tree);
--                    pushFollow(FOLLOW_idList0_in_commands162);
-+                    state._fsp--;
-+
-+                    adaptor.addChild(root_0, idList029.getTree());
-+
-+                    pushFollow(FOLLOW_idList0_in_commands179);
-                     idList030=idList0();
--                    _fsp--;
--                    adaptor.addChild(root_0, idList030.tree);
-+                    state._fsp--;
-+
-+                    adaptor.addChild(root_0, idList030.getTree());
-                     }
-                     break;
-                 case 10 :
--                    // Bst.g:26:4: SORT^^
-+                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:34:4: SORT ^
-                     {
--                    root_0 = adaptor.nil();
-+                    root_0 = (Object)adaptor.nil();
--                    SORT31=input.LT(1);
--                    match(input,SORT,FOLLOW_SORT_in_commands167); 
--                    SORT31_tree = adaptor.create(SORT31);
--                    root_0 = adaptor.becomeRoot(SORT31_tree, root_0);
-+
-+                    SORT31=(Token)match(input,SORT,FOLLOW_SORT_in_commands184);
-+                    SORT31_tree =
-+                    (Object)adaptor.create(SORT31)
-+                    ;
-+                    root_0 = (Object)adaptor.becomeRoot(SORT31_tree, root_0);
-                     }
-                     break;
-             }
-+            retval.stop = input.LT(-1);
-+
-+
-+            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
-+            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-+
-         }
-         catch (RecognitionException re) {
-             reportError(re);
-             recover(input,re);
--        }
--        finally {
--            retval.stop = input.LT(-1);
-+      retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
--                retval.tree = adaptor.rulePostProcessing(root_0);
--                adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-+        }
--       }
-+        finally {
-+              // do for sure before leaving
-+        }
-         return retval;
-     }
--    // $ANTLR end commands
-+    // $ANTLR end "commands"
-+
-     public static class identifier_return extends ParserRuleReturnScope {
-         Object tree;
-         public Object getTree() { return tree; }
--    }
-+    };
-+
--    // $ANTLR start identifier
--    // Bst.g:28:1: identifier : IDENTIFIER ;
--    public identifier_return identifier() throws RecognitionException {   
--        identifier_return retval = new identifier_return();
-+    // $ANTLR start "identifier"
-+    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:36:1: identifier : IDENTIFIER ;
-+    public final BstParser.identifier_return identifier() throws RecognitionException {
-+        BstParser.identifier_return retval = new BstParser.identifier_return();
-         retval.start = input.LT(1);
-+
-         Object root_0 = null;
-         Token IDENTIFIER32=null;
-@@ -540,128 +629,148 @@
-         Object IDENTIFIER32_tree=null;
-         try {
--            // Bst.g:29:4: ( IDENTIFIER )
--            // Bst.g:29:4: IDENTIFIER
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:37:2: ( IDENTIFIER )
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:37:4: IDENTIFIER
-             {
--            root_0 = adaptor.nil();
-+            root_0 = (Object)adaptor.nil();
-+
--            IDENTIFIER32=input.LT(1);
--            match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_identifier178); 
--            IDENTIFIER32_tree = adaptor.create(IDENTIFIER32);
-+            IDENTIFIER32=(Token)match(input,IDENTIFIER,FOLLOW_IDENTIFIER_in_identifier195);
-+            IDENTIFIER32_tree =
-+            (Object)adaptor.create(IDENTIFIER32)
-+            ;
-             adaptor.addChild(root_0, IDENTIFIER32_tree);
-             }
-+            retval.stop = input.LT(-1);
-+
-+
-+            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
-+            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-+
-         }
-         catch (RecognitionException re) {
-             reportError(re);
-             recover(input,re);
--        }
--        finally {
--            retval.stop = input.LT(-1);
-+      retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
--                retval.tree = adaptor.rulePostProcessing(root_0);
--                adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-+        }
--       }
-+        finally {
-+              // do for sure before leaving
-+        }
-         return retval;
-     }
--    // $ANTLR end identifier
-+    // $ANTLR end "identifier"
-+
-     public static class id_return extends ParserRuleReturnScope {
-         Object tree;
-         public Object getTree() { return tree; }
--    }
-+    };
--    // $ANTLR start id
--    // Bst.g:31:1: id : '{'! identifier '}'! ;
--    public id_return id() throws RecognitionException {   
--        id_return retval = new id_return();
-+
-+    // $ANTLR start "id"
-+    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:39:1: id : '{' ! identifier '}' !;
-+    public final BstParser.id_return id() throws RecognitionException {
-+        BstParser.id_return retval = new BstParser.id_return();
-         retval.start = input.LT(1);
-+
-         Object root_0 = null;
-         Token char_literal33=null;
-         Token char_literal35=null;
--        identifier_return identifier34 = null;
-+        BstParser.identifier_return identifier34 =null;
-         Object char_literal33_tree=null;
-         Object char_literal35_tree=null;
-         try {
--            // Bst.g:32:4: ( '{'! identifier '}'! )
--            // Bst.g:32:4: '{'! identifier '}'!
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:40:2: ( '{' ! identifier '}' !)
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:40:4: '{' ! identifier '}' !
-             {
--            root_0 = adaptor.nil();
-+            root_0 = (Object)adaptor.nil();
-+
--            char_literal33=input.LT(1);
--            match(input,25,FOLLOW_25_in_id188); 
--            pushFollow(FOLLOW_identifier_in_id191);
-+            char_literal33=(Token)match(input,32,FOLLOW_32_in_id205);
-+
-+            pushFollow(FOLLOW_identifier_in_id208);
-             identifier34=identifier();
--            _fsp--;
--            adaptor.addChild(root_0, identifier34.tree);
--            char_literal35=input.LT(1);
--            match(input,26,FOLLOW_26_in_id193); 
-+            state._fsp--;
-+
-+            adaptor.addChild(root_0, identifier34.getTree());
-+
-+            char_literal35=(Token)match(input,33,FOLLOW_33_in_id210);
-             }
-+            retval.stop = input.LT(-1);
-+
-+
-+            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
-+            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-+
-         }
-         catch (RecognitionException re) {
-             reportError(re);
-             recover(input,re);
--        }
--        finally {
--            retval.stop = input.LT(-1);
-+      retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
--                retval.tree = adaptor.rulePostProcessing(root_0);
--                adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-+        }
--       }
-+        finally {
-+              // do for sure before leaving
-+        }
-         return retval;
-     }
--    // $ANTLR end id
-+    // $ANTLR end "id"
-+
-     public static class idList_return extends ParserRuleReturnScope {
-         Object tree;
-         public Object getTree() { return tree; }
--    }
-+    };
-+
--    // $ANTLR start idList
--    // Bst.g:34:1: idList : '{' ( identifier )+ '}' -> ^( IDLIST ( identifier )+ ) ;
--    
--      public idList_return idList() throws RecognitionException {   
--        idList_return retval = new idList_return();
-+    // $ANTLR start "idList"
-+    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:42:1: idList : '{' ( identifier )+ '}' -> ^( IDLIST ( identifier )+ ) ;
-+    public final BstParser.idList_return idList() throws RecognitionException {
-+        BstParser.idList_return retval = new BstParser.idList_return();
-         retval.start = input.LT(1);
-+
-         Object root_0 = null;
-         Token char_literal36=null;
-         Token char_literal38=null;
--        identifier_return identifier37 = null;
-+        BstParser.identifier_return identifier37 =null;
-+
--        List list_identifier=new ArrayList();
--        List list_26=new ArrayList();
--        List list_25=new ArrayList();
-         Object char_literal36_tree=null;
-         Object char_literal38_tree=null;
--
-+        RewriteRuleTokenStream stream_32=new RewriteRuleTokenStream(adaptor,"token 32");
-+        RewriteRuleTokenStream stream_33=new RewriteRuleTokenStream(adaptor,"token 33");
-+        RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");
-         try {
--            // Bst.g:35:4: ( '{' ( identifier )+ '}' -> ^( IDLIST ( identifier )+ ) )
--            // Bst.g:35:4: '{' ( identifier )+ '}'
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:43:2: ( '{' ( identifier )+ '}' -> ^( IDLIST ( identifier )+ ) )
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:43:4: '{' ( identifier )+ '}'
-             {
--            char_literal36=input.LT(1);
--            match(input,25,FOLLOW_25_in_idList205); 
--            list_25.add(char_literal36);
-+            char_literal36=(Token)match(input,32,FOLLOW_32_in_idList222);
-+            stream_32.add(char_literal36);
--            // Bst.g:35:8: ( identifier )+
-+
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:43:8: ( identifier )+
-             int cnt3=0;
-             loop3:
-             do {
-                 int alt3=2;
-                 int LA3_0 = input.LA(1);
-+
-                 if ( (LA3_0==IDENTIFIER) ) {
-                     alt3=1;
-                 }
-@@ -669,13 +778,14 @@
-                 switch (alt3) {
-               case 1 :
--                  // Bst.g:35:8: identifier
-+                  // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:43:8: identifier
-                   {
--                  pushFollow(FOLLOW_identifier_in_idList207);
-+                  pushFollow(FOLLOW_identifier_in_idList224);
-                   identifier37=identifier();
--                  _fsp--;
--                  list_identifier.add(identifier37.tree);
-+                  state._fsp--;
-+
-+                  stream_identifier.add(identifier37.getTree());
-                   }
-                   break;
-@@ -689,34 +799,39 @@
-                 cnt3++;
-             } while (true);
--            char_literal38=input.LT(1);
--            match(input,26,FOLLOW_26_in_idList210); 
--            list_26.add(char_literal38);
-+
-+            char_literal38=(Token)match(input,33,FOLLOW_33_in_idList227);
-+            stream_33.add(char_literal38);
-             // AST REWRITE
--            int i_0 = 0;
-+            // elements: identifier
-+            // token labels:
-+            // rule labels: retval
-+            // token list labels:
-+            // rule list labels:
-+            // wildcard labels:
-             retval.tree = root_0;
--            root_0 = adaptor.nil();
--            // 35:24: -> ^( IDLIST ( identifier )+ )
--            {
--                // Bst.g:35:27: ^( IDLIST ( identifier )+ )
--                {
--                Object root_1 = adaptor.nil();
--                root_1 = adaptor.becomeRoot(adaptor.create(IDLIST, "IDLIST"), root_1);
-+            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
--                // Bst.g:35:36: ( identifier )+
-+            root_0 = (Object)adaptor.nil();
-+            // 43:24: -> ^( IDLIST ( identifier )+ )
-+            {
-+                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:43:27: ^( IDLIST ( identifier )+ )
-                 {
--                int n_1 = list_identifier == null ? 0 : list_identifier.size();
--                 
--
--
--                if ( n_1==0 ) throw new RuntimeException("Must have more than one element for (...)+ loops");
--                for (int i_1=0; i_1<n_1; i_1++) {
--                    adaptor.addChild(root_1, list_identifier.get(i_1));
-+                Object root_1 = (Object)adaptor.nil();
-+                root_1 = (Object)adaptor.becomeRoot(
-+                (Object)adaptor.create(IDLIST, "IDLIST")
-+                , root_1);
-+                if ( !(stream_identifier.hasNext()) ) {
-+                    throw new RewriteEarlyExitException();
-                 }
-+                while ( stream_identifier.hasNext() ) {
-+                    adaptor.addChild(root_1, stream_identifier.nextTree());
-+
-                 }
-+                stream_identifier.reset();
-                 adaptor.addChild(root_0, root_1);
-                 }
-@@ -724,61 +839,71 @@
-             }
-+            retval.tree = root_0;
-             }
-+            retval.stop = input.LT(-1);
-+
-+
-+            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
-+            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-+
-         }
-         catch (RecognitionException re) {
-             reportError(re);
-             recover(input,re);
--        }
--        finally {
--            retval.stop = input.LT(-1);
-+      retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
--                retval.tree = adaptor.rulePostProcessing(root_0);
--                adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-+        }
--       }
-+        finally {
-+              // do for sure before leaving
-+        }
-         return retval;
-     }
--    // $ANTLR end idList
-+    // $ANTLR end "idList"
-+
-     public static class idList0_return extends ParserRuleReturnScope {
-         Object tree;
-         public Object getTree() { return tree; }
--    }
-+    };
-+
--    // $ANTLR start idList0
--    // Bst.g:37:1: idList0 : '{' ( identifier )* '}' -> ^( IDLIST ( identifier )* ) ;
--    public idList0_return idList0() throws RecognitionException {   
--        idList0_return retval = new idList0_return();
-+    // $ANTLR start "idList0"
-+    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:45:1: idList0 : '{' ( identifier )* '}' -> ^( IDLIST ( identifier )* ) ;
-+    public final BstParser.idList0_return idList0() throws RecognitionException {
-+        BstParser.idList0_return retval = new BstParser.idList0_return();
-         retval.start = input.LT(1);
-+
-         Object root_0 = null;
-         Token char_literal39=null;
-         Token char_literal41=null;
--        identifier_return identifier40 = null;
-+        BstParser.identifier_return identifier40 =null;
-+
--        List list_identifier=new ArrayList();
--        List list_26=new ArrayList();
--        List list_25=new ArrayList();
-         Object char_literal39_tree=null;
-         Object char_literal41_tree=null;
--
-+        RewriteRuleTokenStream stream_32=new RewriteRuleTokenStream(adaptor,"token 32");
-+        RewriteRuleTokenStream stream_33=new RewriteRuleTokenStream(adaptor,"token 33");
-+        RewriteRuleSubtreeStream stream_identifier=new RewriteRuleSubtreeStream(adaptor,"rule identifier");
-         try {
--            // Bst.g:38:4: ( '{' ( identifier )* '}' -> ^( IDLIST ( identifier )* ) )
--            // Bst.g:38:4: '{' ( identifier )* '}'
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:46:2: ( '{' ( identifier )* '}' -> ^( IDLIST ( identifier )* ) )
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:46:4: '{' ( identifier )* '}'
-             {
--            char_literal39=input.LT(1);
--            match(input,25,FOLLOW_25_in_idList0230); 
--            list_25.add(char_literal39);
-+            char_literal39=(Token)match(input,32,FOLLOW_32_in_idList0247);
-+            stream_32.add(char_literal39);
--            // Bst.g:38:8: ( identifier )*
-+
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:46:8: ( identifier )*
-             loop4:
-             do {
-                 int alt4=2;
-                 int LA4_0 = input.LA(1);
-+
-                 if ( (LA4_0==IDENTIFIER) ) {
-                     alt4=1;
-                 }
-@@ -786,13 +911,14 @@
-                 switch (alt4) {
-               case 1 :
--                  // Bst.g:38:8: identifier
-+                  // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:46:8: identifier
-                   {
--                  pushFollow(FOLLOW_identifier_in_idList0232);
-+                  pushFollow(FOLLOW_identifier_in_idList0249);
-                   identifier40=identifier();
--                  _fsp--;
--                  list_identifier.add(identifier40.tree);
-+                  state._fsp--;
-+
-+                  stream_identifier.add(identifier40.getTree());
-                   }
-                   break;
-@@ -802,33 +928,37 @@
-                 }
-             } while (true);
--            char_literal41=input.LT(1);
--            match(input,26,FOLLOW_26_in_idList0235); 
--            list_26.add(char_literal41);
-+
-+            char_literal41=(Token)match(input,33,FOLLOW_33_in_idList0252);
-+            stream_33.add(char_literal41);
-             // AST REWRITE
--            int i_0 = 0;
-+            // elements: identifier
-+            // token labels:
-+            // rule labels: retval
-+            // token list labels:
-+            // rule list labels:
-+            // wildcard labels:
-             retval.tree = root_0;
--            root_0 = adaptor.nil();
--            // 38:24: -> ^( IDLIST ( identifier )* )
--            {
--                // Bst.g:38:27: ^( IDLIST ( identifier )* )
--                {
--                Object root_1 = adaptor.nil();
--                root_1 = adaptor.becomeRoot(adaptor.create(IDLIST, "IDLIST"), root_1);
-+            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
--                // Bst.g:38:36: ( identifier )*
-+            root_0 = (Object)adaptor.nil();
-+            // 46:24: -> ^( IDLIST ( identifier )* )
-+            {
-+                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:46:27: ^( IDLIST ( identifier )* )
-                 {
--                int n_1 = list_identifier == null ? 0 : list_identifier.size();
--                 
--
-+                Object root_1 = (Object)adaptor.nil();
-+                root_1 = (Object)adaptor.becomeRoot(
-+                (Object)adaptor.create(IDLIST, "IDLIST")
-+                , root_1);
-+
-+                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:46:36: ( identifier )*
-+                while ( stream_identifier.hasNext() ) {
-+                    adaptor.addChild(root_1, stream_identifier.nextTree());
--                for (int i_1=0; i_1<n_1; i_1++) {
--                    adaptor.addChild(root_1, list_identifier.get(i_1));
--
--                }
-                 }
-+                stream_identifier.reset();
-                 adaptor.addChild(root_0, root_1);
-                 }
-@@ -836,36 +966,45 @@
-             }
-+            retval.tree = root_0;
-             }
-+            retval.stop = input.LT(-1);
-+
-+
-+            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
-+            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-+
-         }
-         catch (RecognitionException re) {
-             reportError(re);
-             recover(input,re);
--        }
--        finally {
--            retval.stop = input.LT(-1);
-+      retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
--                retval.tree = adaptor.rulePostProcessing(root_0);
--                adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-+        }
--       }
-+        finally {
-+              // do for sure before leaving
-+        }
-         return retval;
-     }
--    // $ANTLR end idList0
-+    // $ANTLR end "idList0"
-+
-     public static class function_return extends ParserRuleReturnScope {
-         Object tree;
-         public Object getTree() { return tree; }
--    }
-+    };
-+
--    // $ANTLR start function
--    // Bst.g:40:1: function : ( '<' | '>' | '=' | '+' | '-' | ':=' | '*' | identifier );
--    public function_return function() throws RecognitionException {   
--        function_return retval = new function_return();
-+    // $ANTLR start "function"
-+    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:48:1: function : ( '<' | '>' | '=' | '+' | '-' | ':=' | '*' | identifier );
-+    public final BstParser.function_return function() throws RecognitionException {
-+        BstParser.function_return retval = new BstParser.function_return();
-         retval.start = input.LT(1);
-+
-         Object root_0 = null;
-         Token char_literal42=null;
-@@ -875,7 +1014,7 @@
-         Token char_literal46=null;
-         Token string_literal47=null;
-         Token char_literal48=null;
--        identifier_return identifier49 = null;
-+        BstParser.identifier_return identifier49 =null;
-         Object char_literal42_tree=null;
-@@ -887,214 +1026,257 @@
-         Object char_literal48_tree=null;
-         try {
--            // Bst.g:41:4: ( '<' | '>' | '=' | '+' | '-' | ':=' | '*' | identifier )
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:49:2: ( '<' | '>' | '=' | '+' | '-' | ':=' | '*' | identifier )
-             int alt5=8;
-             switch ( input.LA(1) ) {
--            case 27:
-+            case 29:
-+                {
-                 alt5=1;
-+                }
-                 break;
--            case 28:
-+            case 31:
-+                {
-                 alt5=2;
-+                }
-                 break;
--            case 29:
-+            case 30:
-+                {
-                 alt5=3;
-+                }
-                 break;
--            case 30:
-+            case 26:
-+                {
-                 alt5=4;
-+                }
-                 break;
--            case 31:
-+            case 27:
-+                {
-                 alt5=5;
-+                }
-                 break;
--            case 32:
-+            case 28:
-+                {
-                 alt5=6;
-+                }
-                 break;
--            case 33:
-+            case 25:
-+                {
-                 alt5=7;
-+                }
-                 break;
-             case IDENTIFIER:
-+                {
-                 alt5=8;
-+                }
-                 break;
-             default:
-                 NoViableAltException nvae =
--                    new NoViableAltException("40:1: function : ( '<' | '>' | '=' | '+' | '-' | ':=' | '*' | identifier );", 5, 0, input);
-+                    new NoViableAltException("", 5, 0, input);
-                 throw nvae;
-+
-             }
-             switch (alt5) {
-                 case 1 :
--                    // Bst.g:41:4: '<'
-+                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:49:4: '<'
-                     {
--                    root_0 = adaptor.nil();
-+                    root_0 = (Object)adaptor.nil();
--                    char_literal42=input.LT(1);
--                    match(input,27,FOLLOW_27_in_function254); 
--                    char_literal42_tree = adaptor.create(char_literal42);
-+
-+                    char_literal42=(Token)match(input,29,FOLLOW_29_in_function271);
-+                    char_literal42_tree =
-+                    (Object)adaptor.create(char_literal42)
-+                    ;
-                     adaptor.addChild(root_0, char_literal42_tree);
-                     }
-                     break;
-                 case 2 :
--                    // Bst.g:41:10: '>'
-+                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:49:10: '>'
-                     {
--                    root_0 = adaptor.nil();
-+                    root_0 = (Object)adaptor.nil();
-+
--                    char_literal43=input.LT(1);
--                    match(input,28,FOLLOW_28_in_function258); 
--                    char_literal43_tree = adaptor.create(char_literal43);
-+                    char_literal43=(Token)match(input,31,FOLLOW_31_in_function275);
-+                    char_literal43_tree =
-+                    (Object)adaptor.create(char_literal43)
-+                    ;
-                     adaptor.addChild(root_0, char_literal43_tree);
-                     }
-                     break;
-                 case 3 :
--                    // Bst.g:41:16: '='
-+                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:49:16: '='
-                     {
--                    root_0 = adaptor.nil();
-+                    root_0 = (Object)adaptor.nil();
-+
--                    char_literal44=input.LT(1);
--                    match(input,29,FOLLOW_29_in_function262); 
--                    char_literal44_tree = adaptor.create(char_literal44);
-+                    char_literal44=(Token)match(input,30,FOLLOW_30_in_function279);
-+                    char_literal44_tree =
-+                    (Object)adaptor.create(char_literal44)
-+                    ;
-                     adaptor.addChild(root_0, char_literal44_tree);
-                     }
-                     break;
-                 case 4 :
--                    // Bst.g:41:22: '+'
-+                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:49:22: '+'
-                     {
--                    root_0 = adaptor.nil();
-+                    root_0 = (Object)adaptor.nil();
--                    char_literal45=input.LT(1);
--                    match(input,30,FOLLOW_30_in_function266); 
--                    char_literal45_tree = adaptor.create(char_literal45);
-+
-+                    char_literal45=(Token)match(input,26,FOLLOW_26_in_function283);
-+                    char_literal45_tree =
-+                    (Object)adaptor.create(char_literal45)
-+                    ;
-                     adaptor.addChild(root_0, char_literal45_tree);
-                     }
-                     break;
-                 case 5 :
--                    // Bst.g:41:28: '-'
-+                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:49:28: '-'
-                     {
--                    root_0 = adaptor.nil();
-+                    root_0 = (Object)adaptor.nil();
-+
--                    char_literal46=input.LT(1);
--                    match(input,31,FOLLOW_31_in_function270); 
--                    char_literal46_tree = adaptor.create(char_literal46);
-+                    char_literal46=(Token)match(input,27,FOLLOW_27_in_function287);
-+                    char_literal46_tree =
-+                    (Object)adaptor.create(char_literal46)
-+                    ;
-                     adaptor.addChild(root_0, char_literal46_tree);
-                     }
-                     break;
-                 case 6 :
--                    // Bst.g:41:34: ':='
-+                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:49:34: ':='
-                     {
--                    root_0 = adaptor.nil();
-+                    root_0 = (Object)adaptor.nil();
--                    string_literal47=input.LT(1);
--                    match(input,32,FOLLOW_32_in_function274); 
--                    string_literal47_tree = adaptor.create(string_literal47);
-+
-+                    string_literal47=(Token)match(input,28,FOLLOW_28_in_function291);
-+                    string_literal47_tree =
-+                    (Object)adaptor.create(string_literal47)
-+                    ;
-                     adaptor.addChild(root_0, string_literal47_tree);
-                     }
-                     break;
-                 case 7 :
--                    // Bst.g:41:41: '*'
-+                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:49:41: '*'
-                     {
--                    root_0 = adaptor.nil();
-+                    root_0 = (Object)adaptor.nil();
-+
--                    char_literal48=input.LT(1);
--                    match(input,33,FOLLOW_33_in_function278); 
--                    char_literal48_tree = adaptor.create(char_literal48);
-+                    char_literal48=(Token)match(input,25,FOLLOW_25_in_function295);
-+                    char_literal48_tree =
-+                    (Object)adaptor.create(char_literal48)
-+                    ;
-                     adaptor.addChild(root_0, char_literal48_tree);
-                     }
-                     break;
-                 case 8 :
--                    // Bst.g:41:47: identifier
-+                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:49:47: identifier
-                     {
--                    root_0 = adaptor.nil();
-+                    root_0 = (Object)adaptor.nil();
-+
--                    pushFollow(FOLLOW_identifier_in_function282);
-+                    pushFollow(FOLLOW_identifier_in_function299);
-                     identifier49=identifier();
--                    _fsp--;
--                    adaptor.addChild(root_0, identifier49.tree);
-+                    state._fsp--;
-+
-+                    adaptor.addChild(root_0, identifier49.getTree());
-                     }
-                     break;
-             }
-+            retval.stop = input.LT(-1);
-+
-+
-+            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
-+            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-+
-         }
-         catch (RecognitionException re) {
-             reportError(re);
-             recover(input,re);
--        }
--        finally {
--            retval.stop = input.LT(-1);
-+      retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
--                retval.tree = adaptor.rulePostProcessing(root_0);
--                adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-+        }
--       }
-+        finally {
-+              // do for sure before leaving
-+        }
-         return retval;
-     }
--    // $ANTLR end function
-+    // $ANTLR end "function"
-+
-     public static class stack_return extends ParserRuleReturnScope {
-         Object tree;
-         public Object getTree() { return tree; }
--    }
-+    };
-+
--    // $ANTLR start stack
--    // Bst.g:43:1: stack : '{' ( stackitem )+ '}' -> ^( STACK ( stackitem )+ ) ;
--    public stack_return stack() throws RecognitionException {   
--        stack_return retval = new stack_return();
-+    // $ANTLR start "stack"
-+    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:51:1: stack : '{' ( stackitem )+ '}' -> ^( STACK ( stackitem )+ ) ;
-+    public final BstParser.stack_return stack() throws RecognitionException {
-+        BstParser.stack_return retval = new BstParser.stack_return();
-         retval.start = input.LT(1);
-+
-         Object root_0 = null;
-         Token char_literal50=null;
-         Token char_literal52=null;
--        stackitem_return stackitem51 = null;
-+        BstParser.stackitem_return stackitem51 =null;
-+
--        List list_stackitem=new ArrayList();
--        List list_26=new ArrayList();
--        List list_25=new ArrayList();
-         Object char_literal50_tree=null;
-         Object char_literal52_tree=null;
--
-+        RewriteRuleTokenStream stream_32=new RewriteRuleTokenStream(adaptor,"token 32");
-+        RewriteRuleTokenStream stream_33=new RewriteRuleTokenStream(adaptor,"token 33");
-+        RewriteRuleSubtreeStream stream_stackitem=new RewriteRuleSubtreeStream(adaptor,"rule stackitem");
-         try {
--            // Bst.g:44:4: ( '{' ( stackitem )+ '}' -> ^( STACK ( stackitem )+ ) )
--            // Bst.g:44:4: '{' ( stackitem )+ '}'
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:52:2: ( '{' ( stackitem )+ '}' -> ^( STACK ( stackitem )+ ) )
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:52:4: '{' ( stackitem )+ '}'
-             {
--            char_literal50=input.LT(1);
--            match(input,25,FOLLOW_25_in_stack293); 
--            list_25.add(char_literal50);
-+            char_literal50=(Token)match(input,32,FOLLOW_32_in_stack310);
-+            stream_32.add(char_literal50);
--            // Bst.g:44:8: ( stackitem )+
-+
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:52:8: ( stackitem )+
-             int cnt6=0;
-             loop6:
-             do {
-                 int alt6=2;
-                 int LA6_0 = input.LA(1);
--                if ( (LA6_0==STRING||(LA6_0>=IDENTIFIER && LA6_0<=QUOTED)||LA6_0==25||(LA6_0>=27 && LA6_0<=33)) ) {
-+
-+                if ( (LA6_0==IDENTIFIER||LA6_0==INTEGER||LA6_0==QUOTED||LA6_0==STRING||(LA6_0 >= 25 && LA6_0 <= 32)) ) {
-                     alt6=1;
-                 }
-                 switch (alt6) {
-               case 1 :
--                  // Bst.g:44:8: stackitem
-+                  // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:52:8: stackitem
-                   {
--                  pushFollow(FOLLOW_stackitem_in_stack295);
-+                  pushFollow(FOLLOW_stackitem_in_stack312);
-                   stackitem51=stackitem();
--                  _fsp--;
--                  list_stackitem.add(stackitem51.tree);
-+                  state._fsp--;
-+
-+                  stream_stackitem.add(stackitem51.getTree());
-                   }
-                   break;
-@@ -1108,34 +1290,39 @@
-                 cnt6++;
-             } while (true);
--            char_literal52=input.LT(1);
--            match(input,26,FOLLOW_26_in_stack298); 
--            list_26.add(char_literal52);
-+
-+            char_literal52=(Token)match(input,33,FOLLOW_33_in_stack315);
-+            stream_33.add(char_literal52);
-             // AST REWRITE
--            int i_0 = 0;
-+            // elements: stackitem
-+            // token labels:
-+            // rule labels: retval
-+            // token list labels:
-+            // rule list labels:
-+            // wildcard labels:
-             retval.tree = root_0;
--            root_0 = adaptor.nil();
--            // 44:23: -> ^( STACK ( stackitem )+ )
--            {
--                // Bst.g:44:26: ^( STACK ( stackitem )+ )
--                {
--                Object root_1 = adaptor.nil();
--                root_1 = adaptor.becomeRoot(adaptor.create(STACK, "STACK"), root_1);
-+            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);
--                // Bst.g:44:34: ( stackitem )+
-+            root_0 = (Object)adaptor.nil();
-+            // 52:23: -> ^( STACK ( stackitem )+ )
-+            {
-+                // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:52:26: ^( STACK ( stackitem )+ )
-                 {
--                int n_1 = list_stackitem == null ? 0 : list_stackitem.size();
--                 
--
--
--                if ( n_1==0 ) throw new RuntimeException("Must have more than one element for (...)+ loops");
--                for (int i_1=0; i_1<n_1; i_1++) {
--                    adaptor.addChild(root_1, list_stackitem.get(i_1));
-+                Object root_1 = (Object)adaptor.nil();
-+                root_1 = (Object)adaptor.becomeRoot(
-+                (Object)adaptor.create(STACK, "STACK")
-+                , root_1);
-+                if ( !(stream_stackitem.hasNext()) ) {
-+                    throw new RewriteEarlyExitException();
-                 }
-+                while ( stream_stackitem.hasNext() ) {
-+                    adaptor.addChild(root_1, stream_stackitem.nextTree());
-+
-                 }
-+                stream_stackitem.reset();
-                 adaptor.addChild(root_0, root_1);
-                 }
-@@ -1143,44 +1330,53 @@
-             }
-+            retval.tree = root_0;
-             }
-+            retval.stop = input.LT(-1);
-+
-+
-+            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
-+            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-+
-         }
-         catch (RecognitionException re) {
-             reportError(re);
-             recover(input,re);
--        }
--        finally {
--            retval.stop = input.LT(-1);
-+      retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
--                retval.tree = adaptor.rulePostProcessing(root_0);
--                adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-+        }
--       }
-+        finally {
-+              // do for sure before leaving
-+        }
-         return retval;
-     }
--    // $ANTLR end stack
-+    // $ANTLR end "stack"
-+
-     public static class stackitem_return extends ParserRuleReturnScope {
-         Object tree;
-         public Object getTree() { return tree; }
--    }
-+    };
-+
--    // $ANTLR start stackitem
--    // Bst.g:46:1: stackitem : ( function | STRING | INTEGER | QUOTED | stack );
--    public stackitem_return stackitem() throws RecognitionException {   
--        stackitem_return retval = new stackitem_return();
-+    // $ANTLR start "stackitem"
-+    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:54:1: stackitem : ( function | STRING | INTEGER | QUOTED | stack );
-+    public final BstParser.stackitem_return stackitem() throws RecognitionException {
-+        BstParser.stackitem_return retval = new BstParser.stackitem_return();
-         retval.start = input.LT(1);
-+
-         Object root_0 = null;
-         Token STRING54=null;
-         Token INTEGER55=null;
-         Token QUOTED56=null;
--        function_return function53 = null;
-+        BstParser.function_return function53 =null;
--        stack_return stack57 = null;
-+        BstParser.stack_return stack57 =null;
-         Object STRING54_tree=null;
-@@ -1188,181 +1384,209 @@
-         Object QUOTED56_tree=null;
-         try {
--            // Bst.g:47:4: ( function | STRING | INTEGER | QUOTED | stack )
-+            // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:55:2: ( function | STRING | INTEGER | QUOTED | stack )
-             int alt7=5;
-             switch ( input.LA(1) ) {
-             case IDENTIFIER:
-+            case 25:
-+            case 26:
-             case 27:
-             case 28:
-             case 29:
-             case 30:
-             case 31:
--            case 32:
--            case 33:
-+                {
-                 alt7=1;
-+                }
-                 break;
-             case STRING:
-+                {
-                 alt7=2;
-+                }
-                 break;
-             case INTEGER:
-+                {
-                 alt7=3;
-+                }
-                 break;
-             case QUOTED:
-+                {
-                 alt7=4;
-+                }
-                 break;
--            case 25:
-+            case 32:
-+                {
-                 alt7=5;
-+                }
-                 break;
-             default:
-                 NoViableAltException nvae =
--                    new NoViableAltException("46:1: stackitem : ( function | STRING | INTEGER | QUOTED | stack );", 7, 0, input);
-+                    new NoViableAltException("", 7, 0, input);
-                 throw nvae;
-+
-             }
-             switch (alt7) {
-                 case 1 :
--                    // Bst.g:47:4: function
-+                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:55:4: function
-                     {
--                    root_0 = adaptor.nil();
-+                    root_0 = (Object)adaptor.nil();
-+
--                    pushFollow(FOLLOW_function_in_stackitem317);
-+                    pushFollow(FOLLOW_function_in_stackitem334);
-                     function53=function();
--                    _fsp--;
--                    adaptor.addChild(root_0, function53.tree);
-+                    state._fsp--;
-+
-+                    adaptor.addChild(root_0, function53.getTree());
-                     }
-                     break;
-                 case 2 :
--                    // Bst.g:48:4: STRING
-+                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:56:4: STRING
-                     {
--                    root_0 = adaptor.nil();
-+                    root_0 = (Object)adaptor.nil();
--                    STRING54=input.LT(1);
--                    match(input,STRING,FOLLOW_STRING_in_stackitem322); 
--                    STRING54_tree = adaptor.create(STRING54);
-+
-+                    STRING54=(Token)match(input,STRING,FOLLOW_STRING_in_stackitem339);
-+                    STRING54_tree =
-+                    (Object)adaptor.create(STRING54)
-+                    ;
-                     adaptor.addChild(root_0, STRING54_tree);
-                     }
-                     break;
-                 case 3 :
--                    // Bst.g:49:4: INTEGER
-+                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:57:4: INTEGER
-                     {
--                    root_0 = adaptor.nil();
-+                    root_0 = (Object)adaptor.nil();
-+
--                    INTEGER55=input.LT(1);
--                    match(input,INTEGER,FOLLOW_INTEGER_in_stackitem328); 
--                    INTEGER55_tree = adaptor.create(INTEGER55);
-+                    INTEGER55=(Token)match(input,INTEGER,FOLLOW_INTEGER_in_stackitem345);
-+                    INTEGER55_tree =
-+                    (Object)adaptor.create(INTEGER55)
-+                    ;
-                     adaptor.addChild(root_0, INTEGER55_tree);
-                     }
-                     break;
-                 case 4 :
--                    // Bst.g:50:4: QUOTED
-+                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:58:4: QUOTED
-                     {
--                    root_0 = adaptor.nil();
-+                    root_0 = (Object)adaptor.nil();
--                    QUOTED56=input.LT(1);
--                    match(input,QUOTED,FOLLOW_QUOTED_in_stackitem334); 
--                    QUOTED56_tree = adaptor.create(QUOTED56);
-+
-+                    QUOTED56=(Token)match(input,QUOTED,FOLLOW_QUOTED_in_stackitem351);
-+                    QUOTED56_tree =
-+                    (Object)adaptor.create(QUOTED56)
-+                    ;
-                     adaptor.addChild(root_0, QUOTED56_tree);
-                     }
-                     break;
-                 case 5 :
--                    // Bst.g:51:4: stack
-+                    // C:\\git-repos\\jabref\\jabref\\src\\java\\net\\sf\\jabref\\bst\\Bst.g:59:4: stack
-                     {
--                    root_0 = adaptor.nil();
-+                    root_0 = (Object)adaptor.nil();
-+
--                    pushFollow(FOLLOW_stack_in_stackitem339);
-+                    pushFollow(FOLLOW_stack_in_stackitem356);
-                     stack57=stack();
--                    _fsp--;
--                    adaptor.addChild(root_0, stack57.tree);
-+                    state._fsp--;
-+
-+                    adaptor.addChild(root_0, stack57.getTree());
-                     }
-                     break;
-             }
-+            retval.stop = input.LT(-1);
-+
-+
-+            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
-+            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-+
-         }
-         catch (RecognitionException re) {
-             reportError(re);
-             recover(input,re);
--        }
--        finally {
--            retval.stop = input.LT(-1);
-+      retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);
--                retval.tree = adaptor.rulePostProcessing(root_0);
--                adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);
-+        }
--       }
-+        finally {
-+              // do for sure before leaving
-+        }
-         return retval;
-     }
--    // $ANTLR end stackitem
-+    // $ANTLR end "stackitem"
-+
-+    // Delegated rules
-  
--    public static final BitSet FOLLOW_commands_in_program45 = new BitSet(new long[]{0x000000000003EF42L});
--    public static final BitSet FOLLOW_STRINGS_in_commands65 = new BitSet(new long[]{0x0000000002000000L});
--    public static final BitSet FOLLOW_idList_in_commands68 = new BitSet(new long[]{0x0000000000000002L});
--    public static final BitSet FOLLOW_INTEGERS_in_commands73 = new BitSet(new long[]{0x0000000002000000L});
--    public static final BitSet FOLLOW_idList_in_commands76 = new BitSet(new long[]{0x0000000000000002L});
--    public static final BitSet FOLLOW_FUNCTION_in_commands81 = new BitSet(new long[]{0x0000000002000000L});
--    public static final BitSet FOLLOW_id_in_commands84 = new BitSet(new long[]{0x0000000002000000L});
--    public static final BitSet FOLLOW_stack_in_commands86 = new BitSet(new long[]{0x0000000000000002L});
--    public static final BitSet FOLLOW_MACRO_in_commands91 = new BitSet(new long[]{0x0000000002000000L});
--    public static final BitSet FOLLOW_id_in_commands94 = new BitSet(new long[]{0x0000000002000000L});
--    public static final BitSet FOLLOW_25_in_commands96 = new BitSet(new long[]{0x0000000000001000L});
--    public static final BitSet FOLLOW_STRING_in_commands99 = new BitSet(new long[]{0x0000000004000000L});
--    public static final BitSet FOLLOW_26_in_commands101 = new BitSet(new long[]{0x0000000000000002L});
--    public static final BitSet FOLLOW_READ_in_commands107 = new BitSet(new long[]{0x0000000000000002L});
--    public static final BitSet FOLLOW_EXECUTE_in_commands113 = new BitSet(new long[]{0x0000000002000000L});
--    public static final BitSet FOLLOW_25_in_commands116 = new BitSet(new long[]{0x00000003F8040000L});
--    public static final BitSet FOLLOW_function_in_commands119 = new BitSet(new long[]{0x0000000004000000L});
--    public static final BitSet FOLLOW_26_in_commands121 = new BitSet(new long[]{0x0000000000000002L});
--    public static final BitSet FOLLOW_ITERATE_in_commands127 = new BitSet(new long[]{0x0000000002000000L});
--    public static final BitSet FOLLOW_25_in_commands130 = new BitSet(new long[]{0x00000003F8040000L});
--    public static final BitSet FOLLOW_function_in_commands133 = new BitSet(new long[]{0x0000000004000000L});
--    public static final BitSet FOLLOW_26_in_commands135 = new BitSet(new long[]{0x0000000000000002L});
--    public static final BitSet FOLLOW_REVERSE_in_commands141 = new BitSet(new long[]{0x0000000002000000L});
--    public static final BitSet FOLLOW_25_in_commands144 = new BitSet(new long[]{0x00000003F8040000L});
--    public static final BitSet FOLLOW_function_in_commands147 = new BitSet(new long[]{0x0000000004000000L});
--    public static final BitSet FOLLOW_26_in_commands149 = new BitSet(new long[]{0x0000000000000002L});
--    public static final BitSet FOLLOW_ENTRY_in_commands155 = new BitSet(new long[]{0x0000000002000000L});
--    public static final BitSet FOLLOW_idList0_in_commands158 = new BitSet(new long[]{0x0000000002000000L});
--    public static final BitSet FOLLOW_idList0_in_commands160 = new BitSet(new long[]{0x0000000002000000L});
--    public static final BitSet FOLLOW_idList0_in_commands162 = new BitSet(new long[]{0x0000000000000002L});
--    public static final BitSet FOLLOW_SORT_in_commands167 = new BitSet(new long[]{0x0000000000000002L});
--    public static final BitSet FOLLOW_IDENTIFIER_in_identifier178 = new BitSet(new long[]{0x0000000000000002L});
--    public static final BitSet FOLLOW_25_in_id188 = new BitSet(new long[]{0x0000000000040000L});
--    public static final BitSet FOLLOW_identifier_in_id191 = new BitSet(new long[]{0x0000000004000000L});
--    public static final BitSet FOLLOW_26_in_id193 = new BitSet(new long[]{0x0000000000000002L});
--    public static final BitSet FOLLOW_25_in_idList205 = new BitSet(new long[]{0x0000000000040000L});
--    public static final BitSet FOLLOW_identifier_in_idList207 = new BitSet(new long[]{0x0000000004040000L});
--    public static final BitSet FOLLOW_26_in_idList210 = new BitSet(new long[]{0x0000000000000002L});
--    public static final BitSet FOLLOW_25_in_idList0230 = new BitSet(new long[]{0x0000000004040000L});
--    public static final BitSet FOLLOW_identifier_in_idList0232 = new BitSet(new long[]{0x0000000004040000L});
--    public static final BitSet FOLLOW_26_in_idList0235 = new BitSet(new long[]{0x0000000000000002L});
--    public static final BitSet FOLLOW_27_in_function254 = new BitSet(new long[]{0x0000000000000002L});
--    public static final BitSet FOLLOW_28_in_function258 = new BitSet(new long[]{0x0000000000000002L});
--    public static final BitSet FOLLOW_29_in_function262 = new BitSet(new long[]{0x0000000000000002L});
--    public static final BitSet FOLLOW_30_in_function266 = new BitSet(new long[]{0x0000000000000002L});
--    public static final BitSet FOLLOW_31_in_function270 = new BitSet(new long[]{0x0000000000000002L});
--    public static final BitSet FOLLOW_32_in_function274 = new BitSet(new long[]{0x0000000000000002L});
--    public static final BitSet FOLLOW_33_in_function278 = new BitSet(new long[]{0x0000000000000002L});
--    public static final BitSet FOLLOW_identifier_in_function282 = new BitSet(new long[]{0x0000000000000002L});
--    public static final BitSet FOLLOW_25_in_stack293 = new BitSet(new long[]{0x00000003FA1C1000L});
--    public static final BitSet FOLLOW_stackitem_in_stack295 = new BitSet(new long[]{0x00000003FE1C1000L});
--    public static final BitSet FOLLOW_26_in_stack298 = new BitSet(new long[]{0x0000000000000002L});
--    public static final BitSet FOLLOW_function_in_stackitem317 = new BitSet(new long[]{0x0000000000000002L});
--    public static final BitSet FOLLOW_STRING_in_stackitem322 = new BitSet(new long[]{0x0000000000000002L});
--    public static final BitSet FOLLOW_INTEGER_in_stackitem328 = new BitSet(new long[]{0x0000000000000002L});
--    public static final BitSet FOLLOW_QUOTED_in_stackitem334 = new BitSet(new long[]{0x0000000000000002L});
--    public static final BitSet FOLLOW_stack_in_stackitem339 = new BitSet(new long[]{0x0000000000000002L});
-+    public static final BitSet FOLLOW_commands_in_program62 = new BitSet(new long[]{0x00000000009C98E2L});
-+    public static final BitSet FOLLOW_STRINGS_in_commands82 = new BitSet(new long[]{0x0000000100000000L});
-+    public static final BitSet FOLLOW_idList_in_commands85 = new BitSet(new long[]{0x0000000000000002L});
-+    public static final BitSet FOLLOW_INTEGERS_in_commands90 = new BitSet(new long[]{0x0000000100000000L});
-+    public static final BitSet FOLLOW_idList_in_commands93 = new BitSet(new long[]{0x0000000000000002L});
-+    public static final BitSet FOLLOW_FUNCTION_in_commands98 = new BitSet(new long[]{0x0000000100000000L});
-+    public static final BitSet FOLLOW_id_in_commands101 = new BitSet(new long[]{0x0000000100000000L});
-+    public static final BitSet FOLLOW_stack_in_commands103 = new BitSet(new long[]{0x0000000000000002L});
-+    public static final BitSet FOLLOW_MACRO_in_commands108 = new BitSet(new long[]{0x0000000100000000L});
-+    public static final BitSet FOLLOW_id_in_commands111 = new BitSet(new long[]{0x0000000100000000L});
-+    public static final BitSet FOLLOW_32_in_commands113 = new BitSet(new long[]{0x0000000000400000L});
-+    public static final BitSet FOLLOW_STRING_in_commands116 = new BitSet(new long[]{0x0000000200000000L});
-+    public static final BitSet FOLLOW_33_in_commands118 = new BitSet(new long[]{0x0000000000000002L});
-+    public static final BitSet FOLLOW_READ_in_commands124 = new BitSet(new long[]{0x0000000000000002L});
-+    public static final BitSet FOLLOW_EXECUTE_in_commands130 = new BitSet(new long[]{0x0000000100000000L});
-+    public static final BitSet FOLLOW_32_in_commands133 = new BitSet(new long[]{0x00000000FE000100L});
-+    public static final BitSet FOLLOW_function_in_commands136 = new BitSet(new long[]{0x0000000200000000L});
-+    public static final BitSet FOLLOW_33_in_commands138 = new BitSet(new long[]{0x0000000000000002L});
-+    public static final BitSet FOLLOW_ITERATE_in_commands144 = new BitSet(new long[]{0x0000000100000000L});
-+    public static final BitSet FOLLOW_32_in_commands147 = new BitSet(new long[]{0x00000000FE000100L});
-+    public static final BitSet FOLLOW_function_in_commands150 = new BitSet(new long[]{0x0000000200000000L});
-+    public static final BitSet FOLLOW_33_in_commands152 = new BitSet(new long[]{0x0000000000000002L});
-+    public static final BitSet FOLLOW_REVERSE_in_commands158 = new BitSet(new long[]{0x0000000100000000L});
-+    public static final BitSet FOLLOW_32_in_commands161 = new BitSet(new long[]{0x00000000FE000100L});
-+    public static final BitSet FOLLOW_function_in_commands164 = new BitSet(new long[]{0x0000000200000000L});
-+    public static final BitSet FOLLOW_33_in_commands166 = new BitSet(new long[]{0x0000000000000002L});
-+    public static final BitSet FOLLOW_ENTRY_in_commands172 = new BitSet(new long[]{0x0000000100000000L});
-+    public static final BitSet FOLLOW_idList0_in_commands175 = new BitSet(new long[]{0x0000000100000000L});
-+    public static final BitSet FOLLOW_idList0_in_commands177 = new BitSet(new long[]{0x0000000100000000L});
-+    public static final BitSet FOLLOW_idList0_in_commands179 = new BitSet(new long[]{0x0000000000000002L});
-+    public static final BitSet FOLLOW_SORT_in_commands184 = new BitSet(new long[]{0x0000000000000002L});
-+    public static final BitSet FOLLOW_IDENTIFIER_in_identifier195 = new BitSet(new long[]{0x0000000000000002L});
-+    public static final BitSet FOLLOW_32_in_id205 = new BitSet(new long[]{0x0000000000000100L});
-+    public static final BitSet FOLLOW_identifier_in_id208 = new BitSet(new long[]{0x0000000200000000L});
-+    public static final BitSet FOLLOW_33_in_id210 = new BitSet(new long[]{0x0000000000000002L});
-+    public static final BitSet FOLLOW_32_in_idList222 = new BitSet(new long[]{0x0000000000000100L});
-+    public static final BitSet FOLLOW_identifier_in_idList224 = new BitSet(new long[]{0x0000000200000100L});
-+    public static final BitSet FOLLOW_33_in_idList227 = new BitSet(new long[]{0x0000000000000002L});
-+    public static final BitSet FOLLOW_32_in_idList0247 = new BitSet(new long[]{0x0000000200000100L});
-+    public static final BitSet FOLLOW_identifier_in_idList0249 = new BitSet(new long[]{0x0000000200000100L});
-+    public static final BitSet FOLLOW_33_in_idList0252 = new BitSet(new long[]{0x0000000000000002L});
-+    public static final BitSet FOLLOW_29_in_function271 = new BitSet(new long[]{0x0000000000000002L});
-+    public static final BitSet FOLLOW_31_in_function275 = new BitSet(new long[]{0x0000000000000002L});
-+    public static final BitSet FOLLOW_30_in_function279 = new BitSet(new long[]{0x0000000000000002L});
-+    public static final BitSet FOLLOW_26_in_function283 = new BitSet(new long[]{0x0000000000000002L});
-+    public static final BitSet FOLLOW_27_in_function287 = new BitSet(new long[]{0x0000000000000002L});
-+    public static final BitSet FOLLOW_28_in_function291 = new BitSet(new long[]{0x0000000000000002L});
-+    public static final BitSet FOLLOW_25_in_function295 = new BitSet(new long[]{0x0000000000000002L});
-+    public static final BitSet FOLLOW_identifier_in_function299 = new BitSet(new long[]{0x0000000000000002L});
-+    public static final BitSet FOLLOW_32_in_stack310 = new BitSet(new long[]{0x00000001FE420500L});
-+    public static final BitSet FOLLOW_stackitem_in_stack312 = new BitSet(new long[]{0x00000003FE420500L});
-+    public static final BitSet FOLLOW_33_in_stack315 = new BitSet(new long[]{0x0000000000000002L});
-+    public static final BitSet FOLLOW_function_in_stackitem334 = new BitSet(new long[]{0x0000000000000002L});
-+    public static final BitSet FOLLOW_STRING_in_stackitem339 = new BitSet(new long[]{0x0000000000000002L});
-+    public static final BitSet FOLLOW_INTEGER_in_stackitem345 = new BitSet(new long[]{0x0000000000000002L});
-+    public static final BitSet FOLLOW_QUOTED_in_stackitem351 = new BitSet(new long[]{0x0000000000000002L});
-+    public static final BitSet FOLLOW_stack_in_stackitem356 = new BitSet(new long[]{0x0000000000000002L});
--}
-+}
-\ No newline at end of file
diff --git a/debian/patches/02_libs.patch b/debian/patches/02_libs.patch
deleted file mode 100644 (file)
index ceb2001..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-Author: Gerardo Curiel <gerardo@sophie.gerardo.com.ve>
-Author: Philip Rinn <rinni@gmx.net>
-Description: Use debian libraries and disable unnecesary unjarlib target,
---- a/build.xml
-+++ b/build.xml
-@@ -74,7 +74,9 @@
-       <property name="help.dir" value="${src.dir}/help" />
-       <property name="extensions.dir" value="${src.dir}/extensions" />
-       <property name="layout.dir" value="${src.dir}/resource/layout" />
--      <property name="lib.dir" value="lib" />
-+      <property name="lib.dir" value="/usr/share/java" />
-+      <property name="oo.dir" value="/usr/lib/libreoffice/program/classes" />
-+      <property name="ure.dir" value="/usr/lib/ure/share/java" />
-       <property name="tests.dir" value="${src.dir}/tests" />
-       <property name="nsis.executable" value="C:\Program files\NSIS\makensis.exe"/>
-@@ -96,33 +98,36 @@
-       <fileset id="jarsFileset" dir="${lib.dir}">
-               <include name="antlr.jar" />
--              <include name="antlr-3.0b5.jar" />
--        <include name="jgoodies-common-1.3.1.jar" />
--              <include name="jgoodies-looks-2.5.1.jar" />
--              <include name="jgoodies-forms-1.5.1.jar" />
-+              <include name="antlr3.jar" />
-+              <include name="antlr3-runtime.jar" />
-+        <include name="jgoodies-common.jar" />
-+              <include name="jgoodies-looks.jar" />
-+              <include name="forms.jar" />
-               <include name="spin.jar" />
--              <include name="glazedlists-1.8.0_java15.jar" />
-+              <include name="glazedlists.jar" />
-               <include name="microba.jar" />
--              <include name="pdfbox-1.6.0.jar" />
--              <include name="jempbox-1.6.0.jar" />
--              <include name="fontbox-1.6.0.jar" />
-+              <include name="pdfbox.jar" />
-+              <include name="jempbox.jar" />
-+              <include name="fontbox.jar" />
-               <include name="zoom-java.jar" />
--      <include name="mysql-connector-java-5.0.7-bin.jar" />
--              <include name="postgresql-9.1-902.jdbc4.jar" />
-+      <include name="mysql-connector-java.jar" />
-+              <include name="postgresql.jar" />
-         <!--<include name="substance-4.1.jar" />-->
-         <!-- Plugin runtime dependencies -->
--              <include name="plugin/JPFCodeGenerator-rt.jar" />
--              <include name="plugin/jpf.jar" />
--              <include name="plugin/jpf-boot.jar" />
--              <include name="plugin/commons-logging.jar" />
-+              <include name="JPFCodeGenerator-rt.jar" />
-+              <include name="jpf.jar" />
-+              <include name="jpf-boot.jar" />
-+              <include name="commons-logging.jar" />
-       </fileset>
-     <!-- Openoffice connection dependencies. Compile-time only -->
--    <fileset id="ooFileset" dir="${lib.dir}">
--        <include name="oo/unoil.jar" />
--        <include name="oo/ridl.jar" />
--        <include name="oo/juh.jar" />
--        <include name="oo/jurt.jar" />
-+    <fileset id="ureFileset" dir="${ure.dir}">
-+        <include name="ridl.jar" />
-+        <include name="juh.jar" />
-+        <include name="jurt.jar" />
-+    </fileset>
-+    <fileset id="ooFileset" dir="${oo.dir}">
-+        <include name="unoil.jar" />
-     </fileset>
-     <!-- Done by MrDlib -->
-@@ -145,14 +150,15 @@
-         <!-- Done by MrDlib -->
-               <fileset refid="jarsFileset" />
-         <fileset refid="ooFileset" />
-+        <fileset refid="ureFileset" />
-       </path>
-       <!-- Classpath for running the code generator -->
-       <path id="codegenerator">
--              <pathelement location="${lib.dir}/plugin/JPFCodeGenerator.jar" />
--              <pathelement location="${lib.dir}/plugin/jpf.jar" />
--              <pathelement location="${lib.dir}/plugin/jpf-boot.jar" />
--              <pathelement location="${lib.dir}/plugin/velocity-dep-1.5.jar" />
-+              <pathelement location="${lib.dir}/JPFCodeGenerator.jar" />
-+              <pathelement location="${lib.dir}/jpf.jar" />
-+              <pathelement location="${lib.dir}/jpf-boot.jar" />
-+              <pathelement location="${lib.dir}/velocity.jar" />
-       </path>
-       <!-- Classpath for tests -->
-@@ -233,7 +239,7 @@
-       </target>
-       <!-- Jars up project -->
--      <target name="jars" depends="build, unjarlib">
-+      <target name="jars" depends="build">
-               <mkdir dir="${build.lib}" />
-         
-               <mkdir dir="${build.tmp}" />
-@@ -660,6 +666,4 @@
-               </jalopy>
-       </target>
--      <taskdef name="jarbundler" classpath="${lib.dir}/jarbundler-2.2.0.jar" classname="net.sourceforge.jarbundler.JarBundler" />
--
- </project>
diff --git a/debian/patches/debian_libs.patch b/debian/patches/debian_libs.patch
new file mode 100644 (file)
index 0000000..80b9a31
--- /dev/null
@@ -0,0 +1,108 @@
+Author: Gerardo Curiel <gerardo@sophie.gerardo.com.ve>
+Author: Philip Rinn <rinni@gmx.net>
+Description: Use debian libraries and disable unnecesary unjarlib target,
+--- a/build.xml
++++ b/build.xml
+@@ -75,7 +75,9 @@
+       <property name="help.dir" value="${src.dir}/help" />
+       <property name="extensions.dir" value="${src.dir}/extensions" />
+       <property name="layout.dir" value="${src.dir}/resource/layout" />
+-      <property name="lib.dir" value="lib" />
++      <property name="lib.dir" value="/usr/share/java" />
++      <property name="oo.dir" value="/usr/lib/libreoffice/program/classes" />
++      <property name="ure.dir" value="/usr/lib/ure/share/java" />
+       <property name="buildlib.dir" value="buildlib" />
+       <property name="tests.dir" value="${src.dir}/tests" />
+@@ -100,33 +102,35 @@
+       <fileset id="jarsFileset" dir="${lib.dir}">
+               <include name="antlr.jar" />
+-              <include name="antlr-3.4-complete.jar" />
+-        <include name="jgoodies-common-1.4.0.jar" />
+-              <include name="jgoodies-looks-2.5.2.jar" />
+-              <include name="jgoodies-forms-1.6.0.jar" />
+-              <include name="jayatana-1.2.4.jar" />
++              <include name="antlr3.jar" />
++              <include name="antlr3-runtime.jar" />
++        <include name="jgoodies-common.jar" />
++              <include name="jgoodies-looks.jar" />
++              <include name="forms.jar" />
+               <include name="spin.jar" />
+-              <include name="glazedlists-1.8.0_java15.jar" />
++              <include name="glazedlists.jar" />
+               <include name="microba.jar" />
+-              <include name="pdfbox-1.7.1.jar" />
+-              <include name="jempbox-1.7.1.jar" />
+-              <include name="fontbox-1.7.1.jar" />
++              <include name="pdfbox.jar" />
++              <include name="jempbox.jar" />
++              <include name="fontbox.jar" />
+               <include name="zoom-java.jar" />
+-      <include name="mysql-connector-java-5.0.7-bin.jar" />
+-              <include name="postgresql-9.2-1002.jdbc4.jar" />
++      <include name="mysql-connector-java.jar" />
++              <include name="postgresql.jar" />
+         <!-- Plugin runtime dependencies -->
+-              <include name="plugin/JPFCodeGenerator-rt.jar" />
+-              <include name="plugin/jpf.jar" />
+-              <include name="plugin/jpf-boot.jar" />
+-              <include name="plugin/commons-logging.jar" />
++              <include name="JPFCodeGenerator-rt.jar" />
++              <include name="jpf.jar" />
++              <include name="jpf-boot.jar" />
++              <include name="commons-logging.jar" />
+       </fileset>
+     <!-- Openoffice connection dependencies. Compile-time only -->
+-    <fileset id="ooFileset" dir="${lib.dir}">
+-        <include name="oo/unoil.jar" />
+-        <include name="oo/ridl.jar" />
+-        <include name="oo/juh.jar" />
+-        <include name="oo/jurt.jar" />
++    <fileset id="ureFileset" dir="${ure.dir}">
++        <include name="ridl.jar" />
++        <include name="juh.jar" />
++        <include name="jurt.jar" />
++    </fileset>
++    <fileset id="ooFileset" dir="${oo.dir}">
++        <include name="unoil.jar" />
+     </fileset>
+     <!-- Done by MrDlib -->
+@@ -149,14 +153,15 @@
+         <!-- Done by MrDlib -->
+               <fileset refid="jarsFileset" />
+         <fileset refid="ooFileset" />
++        <fileset refid="ureFileset" />
+       </path>
+       <!-- Classpath for running the code generator -->
+       <path id="codegenerator">
+-              <pathelement location="${lib.dir}/plugin/JPFCodeGenerator.jar" />
+-              <pathelement location="${lib.dir}/plugin/jpf.jar" />
+-              <pathelement location="${lib.dir}/plugin/jpf-boot.jar" />
+-              <pathelement location="${lib.dir}/plugin/velocity-dep-1.5.jar" />
++              <pathelement location="${lib.dir}/JPFCodeGenerator.jar" />
++              <pathelement location="${lib.dir}/jpf.jar" />
++              <pathelement location="${lib.dir}/jpf-boot.jar" />
++              <pathelement location="${lib.dir}/velocity.jar" />
+       </path>
+       <!-- Classpath for tests -->
+@@ -237,7 +242,7 @@
+       </target>
+       <!-- Jars up project -->
+-      <target name="jars" depends="build, unjarlib">
++      <target name="jars" depends="build">
+               <mkdir dir="${build.lib}" />
+         
+               <mkdir dir="${build.tmp}" />
+@@ -595,6 +600,4 @@
+               </jalopy>
+       </target>
+-      <taskdef name="jarbundler" classpath="${buildlib.dir}/jarbundler-2.2.0.jar" classname="net.sourceforge.jarbundler.JarBundler" />
+-
+ </project>
diff --git a/debian/patches/mrDlib.patch b/debian/patches/mrDlib.patch
deleted file mode 100644 (file)
index 7b91e3f..0000000
+++ /dev/null
@@ -1,1297 +0,0 @@
-Description: This is the diff between the debian and the beta_2.9 branches
- in upstream git; the debian branch was created for us with the purpose to
- disable the mrDlib functionality which needs libraries not packaged in
- Debian yet.
-Origin: upstream git
-Author: Oliver Kopp <oliver.kopp@gmail.com>
-Reviewed-by: gregor herrmann <gregoa@debian.org>
-Last-Update: 2012-10-29
-
---- a/src/java/net/sf/jabref/ImportSettingsTab.java
-+++ b/src/java/net/sf/jabref/ImportSettingsTab.java
-@@ -44,10 +44,8 @@
-       
-     private JRadioButton radioButtonXmp;
-       private JRadioButton radioButtonPDFcontent;
--    private JRadioButton radioButtonMrDlib;
-     private JRadioButton radioButtonNoMeta;
-       private JRadioButton radioButtononlyAttachPDF;
--      private JRadioButton radioButtonUpdateEmptyFields;
-       private JCheckBox useDefaultPDFImportStyle;
-       
-       private JTextField fileNamePattern;
-@@ -59,17 +57,12 @@
-         radioButtonNoMeta = new JRadioButton(Globals.lang("Create_blank_entry_linking_the_PDF"));
-         radioButtonXmp = new JRadioButton(Globals.lang("Create_entry_based_on_XMP_data"));
-         radioButtonPDFcontent = new JRadioButton(Globals.lang("Create_entry_based_on_content"));
--        radioButtonMrDlib = new JRadioButton(Globals.lang("Create_entry_based_on_data_fetched_from")+" Mr.DLib");
-         radioButtononlyAttachPDF = new JRadioButton(Globals.lang("Only_attach_PDF"));
--        radioButtonUpdateEmptyFields = new JRadioButton(Globals.lang("Update_empty_fields_with_data_fetched_from")
--            +" Mr.DLib");
-         ButtonGroup bg = new ButtonGroup();
-         bg.add(radioButtonNoMeta);
-         bg.add(radioButtonXmp);
-         bg.add(radioButtonPDFcontent);
--        bg.add(radioButtonMrDlib);
-         bg.add(radioButtononlyAttachPDF);
--        bg.add(radioButtonUpdateEmptyFields);
-         useDefaultPDFImportStyle = new JCheckBox(Globals.lang("Always use this PDF import style (and do not ask for each import)"));
-               
-@@ -96,15 +89,9 @@
-               builder.append(radioButtonPDFcontent);
-         builder.nextLine();
-         builder.append(pan);
--              builder.append(radioButtonMrDlib);
--        builder.nextLine();
--        builder.append(pan);
-               builder.append(radioButtononlyAttachPDF);
-         builder.nextLine();
-         builder.append(pan);
--              builder.append(radioButtonUpdateEmptyFields);
--        builder.nextLine();
--        builder.append(pan);
-               builder.append(useDefaultPDFImportStyle);
-         builder.nextLine();
-               
-@@ -136,15 +123,9 @@
-               case ImportDialog.CONTENT:
-                       radioButtonPDFcontent.setSelected(true);
-                       break;
--              case ImportDialog.MRDLIB:
--                      radioButtonMrDlib.setSelected(true);
--                      break;
-               case ImportDialog.ONLYATTACH:
-                       radioButtononlyAttachPDF.setSelected(true);
-                       break;
--              case ImportDialog.UPDATEEMPTYFIELDS:
--                      radioButtonUpdateEmptyFields.setSelected(true);
--                      break;
-               default:
-                       // fallback
-                       radioButtonPDFcontent.setSelected(true);
-@@ -162,12 +143,9 @@
-                       style = ImportDialog.XMP;
-               else if (radioButtonPDFcontent.isSelected())
-                       style = ImportDialog.CONTENT;
--              else if (radioButtonMrDlib.isSelected())
--                      style = ImportDialog.MRDLIB;
-               else if (radioButtononlyAttachPDF.isSelected())
-                       style = ImportDialog.ONLYATTACH;
--              else if (radioButtonUpdateEmptyFields.isSelected())
--                      style = ImportDialog.UPDATEEMPTYFIELDS;
-+              else throw new IllegalStateException();
-               Globals.prefs.putInt(PREF_IMPORT_DEFAULT_PDF_IMPORT_STYLE, style);
-               Globals.prefs.put(PREF_IMPORT_FILENAMEPATTERN, fileNamePattern.getText());
-       }
---- a/src/java/spl/DocumentWrapper.java
-+++ /dev/null
-@@ -1,272 +0,0 @@
--package spl;\r
--\r
--import java.util.List;\r
--\r
--import org.sciplore.beans.Abstract;\r
--import org.sciplore.beans.Author;\r
--import org.sciplore.beans.Authors;\r
--import org.sciplore.beans.Document;\r
--import org.sciplore.formatter.Bean;\r
--import org.sciplore.formatter.SimpleTypeElementBean;\r
--\r
--/**\r
-- * Created by IntelliJ IDEA.\r
-- * User: Christoph Arbeit\r
-- * Date: 10.09.2010\r
-- * Time: 20:02:51\r
-- * To change this template use File | Settings | File Templates.\r
-- */\r
--public class DocumentWrapper {\r
--\r
--    Document xmlDocument;\r
--\r
--    public DocumentWrapper(Document xmlDocument) {\r
--        this.xmlDocument = xmlDocument;\r
--    }\r
--\r
--    public Document getXmlDocument() {\r
--        return xmlDocument;\r
--    }\r
--\r
--    public void setXmlDocument(Document xmlDocument) {\r
--        this.xmlDocument = xmlDocument;\r
--    }\r
--\r
--    public String getTitle(){\r
--        if(this.hasTitle()){\r
--            return xmlDocument.getTitle().getValue();\r
--        }\r
--        else{\r
--            return "";\r
--        }\r
--    }\r
--\r
--    public boolean hasTitle(){\r
--        return (xmlDocument.getTitle() != null && xmlDocument.getTitle().getValue() != null && !xmlDocument.getTitle().getValue().isEmpty());\r
--    }\r
--\r
--    public String getAbstract(){\r
--        if(this.hasAbstract()){\r
--            return ((Abstract)xmlDocument.getAbstract()).getValue();\r
--        }\r
--        else{\r
--            return "";\r
--        }\r
--    }\r
--\r
--    public boolean hasAbstract(){\r
--        return (xmlDocument.getAbstract() != null && ((Abstract)xmlDocument.getAbstract()).getValue() != null && !((Abstract)xmlDocument.getAbstract()).getValue().isEmpty());\r
--    }\r
--\r
--   public String getAuthors(String seperator){\r
--        if(this.hasAuthors()){\r
--              List<Bean> authors = xmlDocument.getAuthors().getCollection();\r
--            authors = this.sortAuthors(authors);\r
--            String value = "";\r
--            int i = 1;\r
--            for(Bean author : authors){\r
--                if(i < authors.size()){\r
--                    value = value + getNameComplete((Author)author);\r
--                    value = value + " " + seperator + " ";\r
--                }\r
--                else{\r
--                    value = value + getNameComplete((Author)author);\r
--                }\r
--                i++;\r
--            }\r
--            return value;\r
--        }\r
--        else{\r
--            return "";\r
--        }\r
--    }\r
--\r
--    public boolean hasAuthors(){\r
--        return (xmlDocument.getAuthors() != null && xmlDocument.getAuthors().getCollection() != null && !xmlDocument.getAuthors().getCollection().isEmpty());\r
--    }\r
--\r
--    /* public String getKeyWords(){\r
--        if(this.hasKeyWords()){\r
--            List<XmlKeyword> keywords = xmlDocument.getKeywords().getKeywords();\r
--            String value = "";\r
--            int i = 1;\r
--            for(XmlKeyword keyword : keywords){\r
--                if(i < keywords.size()){\r
--                    value = value + keyword.getValue();\r
--                    value = value + ", ";\r
--                }\r
--                else{\r
--                    value = value + keyword.getValue();\r
--                }\r
--                i++;\r
--            }\r
--            return value;\r
--        }\r
--        else{\r
--            return "";\r
--        }\r
--    }\r
--\r
--    public boolean hasKeyWords(){\r
--        return (xmlDocument.getKeywords() != null && xmlDocument.getKeywords().getKeywords() != null && !xmlDocument.getKeywords().getKeywords().isEmpty());\r
--    }\r
--*/\r
--\r
--    public String getDoi(){\r
--        if(this.hasDoi()){\r
--            return this.getSimpleTypeValue(xmlDocument.getDoi());\r
--        }\r
--        else{\r
--            return "";\r
--        }\r
--    }\r
--\r
--    public boolean hasDoi(){\r
--        return (xmlDocument.getDoi() != null && this.getSimpleTypeValue(xmlDocument.getDoi()) != null && !this.getSimpleTypeValue(xmlDocument.getDoi()).isEmpty());\r
--    }\r
--/*\r
--    public String getPages(){\r
--        if(this.hasPages()){\r
--            return xmlDocument.getPages().getValue();\r
--        }\r
--        else{\r
--            return "";\r
--        }\r
--    }\r
--\r
--    public boolean hasPages(){\r
--        return (xmlDocument.getPages() != null && xmlDocument.getPages().getValue() != null && !xmlDocument.getPages().getValue().isEmpty());\r
--    }\r
--\r
--    public String getVolume(){\r
--        if(this.hasVolume()){\r
--            return xmlDocument.getVolume().getValue();\r
--        }\r
--        else{\r
--            return "";\r
--        }\r
--    }\r
--\r
--    public boolean hasVolume(){\r
--        return (xmlDocument.getVolume() != null && xmlDocument.getVolume().getValue() != null && !xmlDocument.getVolume().getValue().isEmpty());\r
--    }\r
--\r
--    public String getNumber(){\r
--        if(this.hasNumber()){\r
--            return xmlDocument.getNumber().getValue();\r
--        }\r
--        else{\r
--            return "";\r
--        }\r
--    }\r
--\r
--    public boolean hasNumber(){\r
--        return (xmlDocument.getNumber() != null && xmlDocument.getNumber().getValue() != null && !xmlDocument.getNumber().getValue().isEmpty());\r
--    }\r
--*/\r
--    \r
--    public String getYear(){\r
--        if(this.hasYear()){\r
--            return this.getSimpleTypeValue(xmlDocument.getYear());\r
--        }\r
--        else{\r
--            return "";\r
--        }\r
--    }\r
--\r
--    public boolean hasYear(){\r
--        return (this.getSimpleTypeValue(xmlDocument.getYear()) != null && !this.getSimpleTypeValue(xmlDocument.getYear()).isEmpty() && !this.getSimpleTypeValue(xmlDocument.getYear()).equalsIgnoreCase("null"));\r
--    }\r
--    \r
--/*\r
--     public String getMonth(){\r
--        if(this.hasMonth()){\r
--            return xmlDocument.getPublishdate().getMonth();\r
--        }\r
--        else{\r
--            return "";\r
--        }\r
--    }\r
--\r
--    public boolean hasMonth(){\r
--        return (xmlDocument.getPublishdate() != null && xmlDocument.getPublishdate().getMonth() != null && !xmlDocument.getPublishdate().getMonth().isEmpty());\r
--    }\r
--\r
--    public String getDay(){\r
--        if(this.hasDay()){\r
--            return xmlDocument.getPublishdate().getDay();\r
--        }\r
--        else{\r
--            return "";\r
--        }\r
--    }\r
--\r
--    public boolean hasDay(){\r
--        return (xmlDocument.getPublishdate() != null && xmlDocument.getPublishdate().getDay() != null && !xmlDocument.getPublishdate().getDay().isEmpty());\r
--    }\r
--    \r
--      /*\r
--    public String getVenue() {\r
--        if(this.hasVenue()){\r
--            return xmlDocument.getVenue().getValue();\r
--        }\r
--        else{\r
--            return "";\r
--        }\r
--    }\r
--\r
--    public boolean hasVenue(){\r
--        return (xmlDocument.getVenue() != null && xmlDocument.getVenue().getValue() != null && !xmlDocument.getVenue().getValue().isEmpty());\r
--    }*/\r
--    \r
--    private String getNameComplete(Author author){\r
--      if(author == null) return "";\r
--      String result = "";\r
--      if(getSimpleTypeValue(author.getName_First()) != null)\r
--              result = result + getSimpleTypeValue(author.getName_First()).trim() + " ";\r
--      if(getSimpleTypeValue(author.getName_Middle()) != null)\r
--              result = result + getSimpleTypeValue(author.getName_Middle()).trim() + " ";\r
--      if(getSimpleTypeValue(author.getName_Last_Prefix()) != null)\r
--              result = result + getSimpleTypeValue(author.getName_Last_Prefix()).trim() + " ";\r
--      if(getSimpleTypeValue(author.getName_Last()) != null)\r
--              result = result + getSimpleTypeValue(author.getName_Last()).trim() + " ";\r
--      if(getSimpleTypeValue(author.getName_Last_Suffix()) != null)\r
--              result = result + getSimpleTypeValue(author.getName_Last_Suffix()).trim() + " ";\r
--      return result.trim();\r
--    }\r
--    \r
--    private String getSimpleTypeValue(Bean bean){\r
--      if(bean == null || !(bean instanceof SimpleTypeElementBean)) return null;\r
--      SimpleTypeElementBean simpleTypeElementBean = (SimpleTypeElementBean)bean;\r
--      if(simpleTypeElementBean.getValue() == null || simpleTypeElementBean.getValue().equalsIgnoreCase("null") || simpleTypeElementBean.getValue().length() <= 0) return null;\r
--      return simpleTypeElementBean.getValue();\r
--    }\r
--    \r
--    private List<Bean> sortAuthors(List<Bean> authors){\r
--       boolean unsorted = true;\r
--        Bean temp;\r
--        \r
--        while (unsorted){\r
--               unsorted = false;\r
--               for (int i = 0; i < authors.size() - 1; i++){\r
--                       int rank = 99;\r
--                       int otherRank = 99;\r
--                       if(((Author)authors.get(i)).getRank() != null && !((Author)authors.get(i)).getRank().equalsIgnoreCase("null")){\r
--                               rank = Integer.parseInt(((Author)authors.get(i)).getRank());\r
--                       }                       \r
--                       if(((Author)authors.get(i + 1)).getRank() != null && !((Author)authors.get(i + 1)).getRank().equalsIgnoreCase("null")){\r
--                               otherRank = Integer.parseInt(((Author)authors.get(i + 1)).getRank());\r
--                       }                       \r
--                       \r
--                       if (rank > otherRank) {                      \r
--                 temp       = authors.get(i);\r
--                 authors.set(i, authors.get(i + 1));\r
--                 authors.set(i + 1, temp);                 \r
--                 unsorted = true;\r
--              }          \r
--              }        \r
--       } \r
--      \r
--      return authors;\r
--   }\r
--}\r
---- a/src/java/spl/DocumentsWrapper.java
-+++ /dev/null
-@@ -1,132 +0,0 @@
--package spl;\r
--\r
--import java.util.ArrayList;\r
--import java.util.List;\r
--import java.util.Vector;\r
--\r
--import org.sciplore.beans.Author;\r
--import org.sciplore.beans.Document;\r
--import org.sciplore.beans.Year;\r
--import org.sciplore.formatter.Bean;\r
--import org.sciplore.formatter.SimpleTypeElementBean;\r
--\r
--/**\r
-- * Created by IntelliJ IDEA.\r
-- * User: Christoph Arbeit\r
-- * Date: 09.09.2010\r
-- * Time: 10:56:50\r
-- * To change this template use File | Settings | File Templates.\r
-- */\r
--public class DocumentsWrapper {\r
--\r
--    Document xmlDocuments;\r
--\r
--    public DocumentsWrapper(Document documents) {\r
--        this.xmlDocuments = documents;\r
--    }\r
--\r
--    public Document getXmlDocuments() {\r
--        return xmlDocuments;\r
--    }\r
--\r
--    public void setXmlDocuments(Document xmlDocuments) {\r
--        this.xmlDocuments = xmlDocuments;\r
--    }\r
--\r
--    public List<Vector> getDocuments(){\r
--        List<Vector> documents = new ArrayList<Vector>();\r
--        //List<XmlDocument> xmlDocuments = this.xmlDocuments.getDocuments();\r
--        //for(XmlDocument xmlDocument : xmlDocuments){\r
--              Document xmlDocument = xmlDocuments;\r
--            Vector<String> vector = new Vector<String>();\r
--            if(xmlDocument.getTitle() != null){\r
--                vector.add(xmlDocument.getTitle().getValue());\r
--            }\r
--            else{\r
--                vector.add("");\r
--            }\r
--            if(xmlDocument.getAuthors() != null){\r
--                List<Bean> authors = xmlDocument.getAuthors().getCollection();\r
--                authors = this.sortAuthors(authors);\r
--                String value = "";\r
--                int i = 1;\r
--                for(Bean author : authors){\r
--                    if(i < authors.size()){\r
--                        value = value + getNameComplete(((Author)author));\r
--                        value = value + ", ";\r
--                    }\r
--                    else{\r
--                        value = value + getNameComplete(((Author)author));\r
--                    }\r
--                    i++;\r
--                }\r
--                vector.add(value);\r
--            }\r
--            else{\r
--                vector.add("");\r
--            }\r
--            if(xmlDocument.getYear() != null && ((Year)xmlDocument.getYear()).getValue() != null && !((Year)xmlDocument.getYear()).getValue().equalsIgnoreCase("null")){\r
--                vector.add(((Year)xmlDocument.getYear()).getValue());\r
--            }\r
--            /*if(xmlDocument.getPublishdate() != null && xmlDocument.getPublishdate().getYear() != null && !xmlDocument.getPublishdate().getYear().equalsIgnoreCase("null")){\r
--                vector.add(xmlDocument.getPublishdate().getYear());\r
--            }*/\r
--            else{\r
--                vector.add("");\r
--            }\r
--            documents.add(vector);\r
--        //}\r
--        return documents;\r
--    }\r
--    \r
--    private String getNameComplete(Author author){\r
--      if(author == null) return "";\r
--      String result = "";\r
--      if(getSimpleTypeValue(author.getName_First()) != null)\r
--              result = result + getSimpleTypeValue(author.getName_First()).trim() + " ";\r
--      if(getSimpleTypeValue(author.getName_Middle()) != null)\r
--              result = result + getSimpleTypeValue(author.getName_Middle()).trim() + " ";\r
--      if(getSimpleTypeValue(author.getName_Last_Prefix()) != null)\r
--              result = result + getSimpleTypeValue(author.getName_Last_Prefix()).trim() + " ";\r
--      if(getSimpleTypeValue(author.getName_Last()) != null)\r
--              result = result + getSimpleTypeValue(author.getName_Last()).trim() + " ";\r
--      if(getSimpleTypeValue(author.getName_Last_Suffix()) != null)\r
--              result = result + getSimpleTypeValue(author.getName_Last_Suffix()).trim() + " ";\r
--      return result.trim();\r
--    }\r
--    \r
--    private String getSimpleTypeValue(Bean bean){\r
--      if(bean == null || !(bean instanceof SimpleTypeElementBean)) return null;\r
--      SimpleTypeElementBean simpleTypeElementBean = (SimpleTypeElementBean)bean;\r
--      if(simpleTypeElementBean.getValue() == null || simpleTypeElementBean.getValue().equalsIgnoreCase("null") || simpleTypeElementBean.getValue().length() <= 0) return null;\r
--      return simpleTypeElementBean.getValue();\r
--    }\r
--    \r
--    private List<Bean> sortAuthors(List<Bean> authors){\r
--       boolean unsorted = true;\r
--         Bean temp;\r
--         \r
--         while (unsorted){\r
--               unsorted = false;\r
--               for (int i = 0; i < authors.size() - 1; i++){\r
--                       int rank = 99;\r
--                       int otherRank = 99;\r
--                       if(((Author)authors.get(i)).getRank() != null && !((Author)authors.get(i)).getRank().equalsIgnoreCase("null")){\r
--                               rank = Integer.parseInt(((Author)authors.get(i)).getRank());\r
--                       }                       \r
--                       if(((Author)authors.get(i + 1)).getRank() != null && !((Author)authors.get(i + 1)).getRank().equalsIgnoreCase("null")){\r
--                               otherRank = Integer.parseInt(((Author)authors.get(i + 1)).getRank());\r
--                       }                       \r
--                       \r
--                       if (rank > otherRank) {                      \r
--                  temp       = authors.get(i);\r
--                  authors.set(i, authors.get(i + 1));\r
--                  authors.set(i + 1, temp);                 \r
--                  unsorted = true;\r
--               }          \r
--              }        \r
--        } \r
--      \r
--      return authors;\r
--    }\r
--}\r
---- a/src/java/spl/PdfImporter.java
-+++ b/src/java/spl/PdfImporter.java
-@@ -21,15 +21,9 @@
- import net.sf.jabref.undo.UndoableInsertEntry;\r
- import net.sf.jabref.util.XMPUtil;\r
\r
--import org.sciplore.beans.Document;\r
--\r
- import spl.filter.PdfFileFilter;\r
- import spl.gui.ImportDialog;\r
--import spl.gui.MetaDataListDialog;\r
\r
--import java.util.ArrayList;\r
--import java.util.Arrays;\r
--import java.util.List;\r
- import java.util.Set;\r
\r
\r
-@@ -113,7 +107,6 @@
-               BibtexEntryType type;\r
-                 InputStream in = null;\r
-                 List<BibtexEntry> res = null;\r
--              MetaDataListDialog metaDataListDialog;\r
-                 switch (choice) {\r
-                       case ImportDialog.XMP:\r
-                     //SplDatabaseChangeListener dataListener = new SplDatabaseChangeListener(frame, panel, entryTable, fileName);\r
-@@ -200,84 +193,9 @@
-                         panel.adjustSplitter();\r
-                     }\r
-                     break;\r
--                      case ImportDialog.MRDLIB:\r
--                    metaDataListDialog = new MetaDataListDialog(fileName, true);\r
--                    Tools.centerRelativeToWindow(metaDataListDialog, frame);\r
--                    metaDataListDialog.showDialog();\r
--                    Document document = metaDataListDialog.getXmlDocuments();\r
--                    if(document != null /*&& documents.getDocuments() != null && documents.getDocuments().size() > 0*/ && metaDataListDialog.getResult() == JOptionPane.OK_OPTION){\r
--                        int selected = metaDataListDialog.getTableMetadata().getSelectedRow();\r
--                        if(selected > -1 /*&& selected < documents.getDocuments().size()*/){\r
--                            //Document document = documents/*.getDocuments().get(selected)*/;\r
--                            String id = Util.createNeutralId();\r
--                            entry = new BibtexEntry(id);\r
--                            if(fieldExists(document.getType())){\r
--                                type = BibtexEntryType.getStandardType(document.getType());\r
--                                if(type == null){\r
--                                    type = BibtexEntryType.ARTICLE;\r
--                                }\r
--                                entry.setType(type);\r
--                            }\r
--                            else{\r
--                                entry.setType(BibtexEntryType.ARTICLE);\r
--                            }\r
--                            ArrayList<BibtexEntry> list = new ArrayList<BibtexEntry>();\r
--                            list.add(entry);\r
--                            Util.setAutomaticFields(list, true, true, false);\r
--                            //insertFields(entry.getRequiredFields(), entry, document);\r
--                            insertFields(BibtexFields.getAllFieldNames(), entry, document);\r
--                            //insertFields(entry.getOptionalFields(), entry, document);\r
--                            panel.database().insertEntry(entry);\r
--                            dfh = new DroppedFileHandler(frame, panel);\r
--                            dfh.linkPdfToEntry(fileName, entryTable, entry);\r
--                            LabelPatternUtil.makeLabel(panel.metaData(), panel.database(), entry);\r
--                        }\r
--                        else{\r
--                            createNewBlankEntry(fileName);\r
--                        }\r
--                    }\r
--                    else if(metaDataListDialog.getResult() == JOptionPane.CANCEL_OPTION ){\r
--                        continue;\r
--                    }\r
--                    else if(metaDataListDialog.getResult() == JOptionPane.NO_OPTION ){\r
--                        createNewBlankEntry(fileName);\r
--                    }\r
--                    else if(document == null /*|| document.getDocuments() == null || document.getDocuments().size() <= 0*/ && metaDataListDialog.getResult() == JOptionPane.OK_OPTION){\r
--                        createNewBlankEntry(fileName);\r
--                    }\r
--                    break;\r
-                       case ImportDialog.NOMETA:\r
-                     createNewBlankEntry(fileName);\r
-                     break;\r
--                      case ImportDialog.UPDATEEMPTYFIELDS:\r
--                    metaDataListDialog = new MetaDataListDialog(fileName, false);                   \r
--                    Tools.centerRelativeToWindow(metaDataListDialog, frame);\r
--                    metaDataListDialog.showDialog();\r
--                    document = metaDataListDialog.getXmlDocuments();\r
--                    if(document != null /*&& document.getDocuments() != null && document.getDocuments().size() > 0*/ && metaDataListDialog.getResult() == JOptionPane.OK_OPTION){\r
--                        int selected = metaDataListDialog.getTableMetadata().getSelectedRow();\r
--                        if(selected > -1 /*&& selected < document.getDocuments().size()*/){\r
--                            //XmlDocument document = documents.getDocuments().get(selected);\r
--                            entry = entryTable.getEntryAt(dropRow);\r
--                            if(fieldExists(document.getType())){\r
--                                type = BibtexEntryType.getStandardType(document.getType());\r
--                                if(type != null){\r
--                                    entry.setType(type);\r
--                                }\r
--                            }\r
--                            //insertFields(entry.getRequiredFields(), entry, document);\r
--                            insertFields(BibtexFields.getAllFieldNames(), entry, document);\r
--                            //insertFields(entry.getOptionalFields(), entry, document);\r
--\r
--                            dfh = new DroppedFileHandler(frame, panel);\r
--                            dfh.linkPdfToEntry(fileName, entryTable, dropRow);\r
--                        }\r
--                    }\r
--                    break;\r
--                      case ImportDialog.ONLYATTACH:\r
--                    dfh = new DroppedFileHandler(frame, panel);\r
--                    dfh.linkPdfToEntry(fileName, entryTable, dropRow);\r
--                    break;\r
-                 }\r
-             }\r
\r
-@@ -295,58 +213,6 @@
-         }\r
-     }\r
\r
--    private void insertFields(String[] fields, BibtexEntry entry, Document xmlDocument) {\r
--        DocumentWrapper document = new DocumentWrapper(xmlDocument);\r
--        for(String field : fields){\r
--            if(entry.getField(field) != null){\r
--                continue;\r
--            }\r
--            if(field.equalsIgnoreCase("author")){\r
--                entry.setField(field, document.getAuthors("and"));\r
--            }\r
--            if(field.equalsIgnoreCase("title")){\r
--                entry.setField(field, document.getTitle());\r
--            }\r
--            if(field.equalsIgnoreCase("abstract")){\r
--                entry.setField(field, document.getAbstract());\r
--            }\r
--            /*if(field.equalsIgnoreCase("keywords")){\r
--                entry.setField(field, document.getKeyWords());\r
--            }*/\r
--            if(field.equalsIgnoreCase("doi")){\r
--                entry.setField(field, document.getDoi());\r
--            }\r
--            /*if(field.equalsIgnoreCase("pages")){\r
--                entry.setField(field, document.getPages());\r
--            }\r
--            if(field.equalsIgnoreCase("volume")){\r
--                entry.setField(field, document.getVolume());\r
--            }\r
--            if(field.equalsIgnoreCase("number")){\r
--                entry.setField(field, document.getNumber());\r
--            }*/\r
--            if(field.equalsIgnoreCase("year")){\r
--                entry.setField(field, document.getYear());\r
--            }\r
--            /*if(field.equalsIgnoreCase("month")){\r
--                entry.setField(field, document.getMonth());\r
--            }\r
--            if(field.equalsIgnoreCase("day")){\r
--                entry.setField(field, document.getDay());\r
--            }\r
--            if(field.equalsIgnoreCase("booktitle")){\r
--                entry.setField(field, document.getVenue());\r
--            }\r
--            if(field.equalsIgnoreCase("journal")){\r
--                entry.setField(field, document.getVenue());\r
--            }*/\r
--        }\r
--    }\r
--\r
--    private boolean fieldExists(String string) {\r
--        return string != null && !string.isEmpty();\r
--    }\r
--\r
-     private BibtexEntry createNewEntry() {\r
\r
-         // Find out what type is wanted.\r
---- a/src/java/spl/SplWebClient.java
-+++ /dev/null
-@@ -1,196 +0,0 @@
--package spl;\r
--\r
--import java.io.ByteArrayInputStream;\r
--import java.io.File;\r
--import java.io.FileInputStream;\r
--import java.io.InputStream;\r
--import java.io.UnsupportedEncodingException;\r
--\r
--import javax.ws.rs.core.MediaType;\r
--import javax.xml.bind.JAXB;\r
--\r
--import org.sciplore.beans.Author;\r
--import org.sciplore.beans.Document;\r
--import org.sciplore.deserialize.creator.AuthorBeanCreator;\r
--import org.sciplore.deserialize.creator.AuthorsBeanCreator;\r
--import org.sciplore.deserialize.creator.DefaultStringCreator;\r
--import org.sciplore.deserialize.creator.DocumentBeanCreator;\r
--import org.sciplore.deserialize.creator.DocumentsBeanCreator;\r
--import org.sciplore.deserialize.creator.ObjectCreator;\r
--import org.sciplore.deserialize.creator.TitleBeanCreator;\r
--import org.sciplore.deserialize.creator.YearBeanCreator;\r
--import org.sciplore.deserialize.reader.ObjectCreatorMapper;\r
--import org.sciplore.deserialize.reader.XmlResourceReader;\r
--import org.sciplore.formatter.Bean;\r
--import org.sciplore.formatter.SimpleTypeElementBean;\r
--\r
--import com.sun.jersey.api.client.Client;\r
--import com.sun.jersey.api.client.ClientResponse;\r
--import com.sun.jersey.api.client.WebResource;\r
--import com.sun.jersey.multipart.FormDataMultiPart;\r
--\r
--/**\r
-- * Created by IntelliJ IDEA.\r
-- * User: Christoph Arbeit\r
-- * Date: 09.09.2010\r
-- * Time: 10:35:20\r
-- * To change this template use File | Settings | File Templates.\r
-- */\r
--public class SplWebClient {\r
--\r
--    private static Client CLIENT = Client.create();\r
--    static{\r
--        CLIENT.setConnectTimeout(1000);\r
--        CLIENT.setReadTimeout(70000);\r
--    }\r
--    private static WebResource WEBRESOURCE = CLIENT.resource( "http://api.mr-dlib.org/" );\r
--    private static WebResource INTERNETRESOURCE = CLIENT.resource( "http://www.google.com" );\r
--    //private static WebResource WEBRESOURCE = CLIENT.resource( "http://localhost:8080/rest/" );\r
--\r
--    public static Document metadata;\r
--\r
--    public static WebServiceStatus getMetaData(File file){\r
--        try{\r
--            if(isWebServiceAvailable() == false){\r
--                if(isInternetAvailable()){\r
--                    return  WebServiceStatus.WEBSERVICE_DOWN;\r
--                }\r
--                else{\r
--                    return  WebServiceStatus.NO_INTERNET;\r
--                }\r
--            }\r
--            if(isWebServiceOutDated()){\r
--                return  WebServiceStatus.OUTDATED;\r
--            }\r
--            if(isMetaDataServiceAvailable() == false){\r
--                return  WebServiceStatus.UNAVAILABLE;\r
--            }\r
--            FileInputStream fin = new FileInputStream(file);      \r
--            byte[] data = new byte[(int)file.length()];          \r
--            fin.read(data);           \r
--            \r
--            FormDataMultiPart formDataMultiPart = new FormDataMultiPart();            \r
--            formDataMultiPart.field("file", data,  MediaType.APPLICATION_OCTET_STREAM_TYPE);            \r
--            formDataMultiPart.field("source", "jabref",  MediaType.TEXT_PLAIN_TYPE);\r
--            formDataMultiPart.field("filename", file.getName(), MediaType.TEXT_PLAIN_TYPE);\r
--           \r
--           \r
--            ClientResponse response = WEBRESOURCE.path("documents").type(MediaType.MULTIPART_FORM_DATA_TYPE).post(ClientResponse.class, formDataMultiPart);\r
--            //System.out.println(response.getEntity(String.class));\r
--            if(response.getClientResponseStatus() == ClientResponse.Status.OK && response.hasEntity()){\r
--                String entity = response.getEntity(String.class);\r
--                byte[] bytes = new byte[0];\r
--                try {\r
--                    bytes = entity.getBytes("UTF-8");\r
--                } catch (UnsupportedEncodingException e) {\r
--                    return null;\r
--                }\r
--                InputStream is = new ByteArrayInputStream(bytes);\r
--                if(is != null){\r
--                      ObjectCreatorMapper resourceMapper = new ObjectCreatorMapper();\r
--                      ObjectCreator stringCreator = new DefaultStringCreator();\r
--                      // initialize Mapper    \r
--                        resourceMapper.addCreator("documents", new DocumentsBeanCreator());\r
--                        resourceMapper.addCreator("authors", new AuthorsBeanCreator());\r
--                        resourceMapper.addCreator("document", new DocumentBeanCreator());\r
--                        resourceMapper.addCreator("title", new TitleBeanCreator());\r
--                        resourceMapper.addCreator("year", new YearBeanCreator());\r
--                        resourceMapper.addCreator("author", new AuthorBeanCreator());\r
--                        \r
--                        resourceMapper.addCreator("name_first", stringCreator);\r
--                        resourceMapper.addCreator("name_middle", stringCreator);\r
--                        resourceMapper.addCreator("name_last", stringCreator);\r
--                        resourceMapper.addCreator("name_last_prefix", stringCreator);\r
--                        resourceMapper.addCreator("name_last_suffix", stringCreator);\r
--                        \r
--                        // initialize xml reader\r
--                        XmlResourceReader<?> reader = new XmlResourceReader(resourceMapper);\r
--                        \r
--                        // parse given file -> create object tree\r
--                        Document docs =  (Document)reader.parse(is);\r
--                        for(Bean author : docs.getAuthors().getCollection()){\r
--                                Author temp = (Author)author;\r
--                                System.out.println(((SimpleTypeElementBean)temp.getName_Last()).getValue() + " " + temp.getRank());\r
--                        }\r
--                   // XmlDocuments documents = JAXB.unmarshal(is, XmlDocuments.class);\r
--                    SplWebClient.metadata = docs;\r
--                    return WebServiceStatus.OK;\r
--                }\r
--                else{\r
--                    return WebServiceStatus.NO_METADATA;\r
--                }\r
--            }\r
--            if(response.getClientResponseStatus() == ClientResponse.Status.SERVICE_UNAVAILABLE){\r
--                return  WebServiceStatus.UNAVAILABLE;\r
--            }\r
--        }catch(Exception e){\r
--            System.out.println(Tools.getStackTraceAsString(e));\r
--            //Todo logging\r
--        }\r
--        return WebServiceStatus.NO_METADATA;\r
--    }\r
--\r
--    public static boolean isWebServiceOutDated(){\r
--        try{\r
--            ClientResponse response =  WEBRESOURCE.path("service/versioncheck/" + Tools.WEBSERVICE_APP_ID + "/current").get(ClientResponse.class);\r
--            if(response.getClientResponseStatus() == ClientResponse.Status.OK && response.hasEntity()){\r
--                String entity = response.getEntity(String.class);\r
--                byte[] bytes = entity.getBytes();\r
--                InputStream is = new ByteArrayInputStream(bytes);\r
--                if(is != null){\r
--                    /*XmlApplication app = JAXB.unmarshal(is, XmlApplication.class);\r
--                    if(app != null){\r
--                        if(app.getVersion() != null && !app.getVersion().equalsIgnoreCase(Tools.WEBSERVICE_VERSION_SHORT)){\r
--                            return true;\r
--                        }\r
--                    }*/\r
--                }\r
--            }\r
--        }catch(Exception e){\r
--            //Todo logging\r
--        }\r
--        return false;\r
--    }\r
--\r
--    public static boolean isMetaDataServiceAvailable(){\r
--        try{\r
--            ClientResponse response =  WEBRESOURCE.path("service/metadata/available").get(ClientResponse.class);\r
--            if(response.getClientResponseStatus() == ClientResponse.Status.OK && response.hasEntity()){\r
--                String entity = response.getEntity(String.class);\r
--                if(entity != null && entity.equalsIgnoreCase("false")){\r
--                    return false;\r
--                }\r
--            }\r
--        }catch(Exception e){\r
--            //Todo logging\r
--        }\r
--        return true;\r
--    }\r
--\r
--    public static boolean isWebServiceAvailable(){\r
--        try{\r
--            ClientResponse response =  WEBRESOURCE.path("service/metadata/available").get(ClientResponse.class);\r
--        }catch(Exception e){\r
--            return false;\r
--        }\r
--        return true;\r
--    }\r
--\r
--    public static boolean isInternetAvailable(){\r
--        try{\r
--            ClientResponse response =  INTERNETRESOURCE.get(ClientResponse.class);\r
--        }catch(Exception e){\r
--            return false;\r
--        }\r
--        return true;\r
--    }\r
--\r
--    public enum WebServiceStatus {\r
--        OK,\r
--        NO_METADATA,\r
--        UNAVAILABLE,\r
--        OUTDATED,\r
--        WEBSERVICE_DOWN,\r
--        NO_INTERNET\r
--    }\r
--}\r
---- a/src/java/spl/gui/ImportDialog.java
-+++ b/src/java/spl/gui/ImportDialog.java
-@@ -20,9 +20,7 @@
-       public final static int NOMETA = 0;\r
-       public final static int XMP = 1;\r
-       public final static int CONTENT = 2;\r
--      public final static int MRDLIB = 3;\r
-       public final static int ONLYATTACH = 4;\r
--      public final static int UPDATEEMPTYFIELDS = 5;\r
-       \r
-     private JPanel contentPane;\r
-     private JLabel labelSubHeadline;\r
-@@ -32,14 +30,10 @@
-       private JCheckBox useDefaultPDFImportStyle;\r
-     private JRadioButton radioButtonXmp;\r
-       private JRadioButton radioButtonPDFcontent;\r
--    private JRadioButton radioButtonMrDlib;\r
-     private JRadioButton radioButtonNoMeta;\r
-     private JLabel labelHeadline;\r
-     private JLabel labelFileName;\r
-     private JRadioButton radioButtononlyAttachPDF;\r
--    private JRadioButton radioButtonUpdateEmptyFields;\r
--    private JLabel labelMrDlib1;\r
--    private JLabel labelMrDlib2;\r
-     private int result;\r
-     private int dropRow;\r
-     private String fileName;\r
-@@ -71,15 +65,7 @@
-         radioButtonNoMeta = new JRadioButton(Globals.lang("Create_blank_entry_linking_the_PDF"));\r
-         radioButtonXmp = new JRadioButton(Globals.lang("Create_entry_based_on_XMP_data"));\r
-         radioButtonPDFcontent = new JRadioButton(Globals.lang("Create_entry_based_on_content"));\r
--        radioButtonMrDlib = new JRadioButton(Globals.lang("Create_entry_based_on_data_fetched_from"));\r
-         radioButtononlyAttachPDF = new JRadioButton(Globals.lang("Only_attach_PDF"));\r
--        radioButtonUpdateEmptyFields = new JRadioButton(Globals.lang("Update_empty_fields_with_data_fetched_from"));\r
--        labelMrDlib1 = new JLabel("Mr._dLib");\r
--        labelMrDlib1.setFont(new Font(labelMrDlib1.getFont().getName(), Font.BOLD, 13));\r
--        labelMrDlib1.setForeground(new Color(-16776961));\r
--        labelMrDlib2 = new JLabel("Mr._dLib");\r
--        labelMrDlib2.setFont(new Font(labelMrDlib1.getFont().getName(), Font.BOLD, 13));\r
--        labelMrDlib2.setForeground(new Color(-16776961));\r
-         buttonOK = new JButton(Globals.lang("Ok"));\r
-         buttonCancel = new JButton(Globals.lang("Cancel"));\r
-         checkBoxDoNotShowAgain = new JCheckBox(Globals.lang("Do not show this box again for this import"));\r
-@@ -89,12 +75,8 @@
-         b.append(radioButtonNoMeta, 3);\r
-         b.append(radioButtonXmp, 3);\r
-         b.append(radioButtonPDFcontent, 3);\r
--        b.append(radioButtonMrDlib);\r
--        b.append(labelMrDlib1);\r
-         b.appendSeparator(Globals.lang("Update_Existing_Entry"));\r
-         b.append(radioButtononlyAttachPDF, 3);\r
--        b.append(radioButtonUpdateEmptyFields);\r
--        b.append(labelMrDlib2);\r
-         b.nextLine();\r
-         b.append(checkBoxDoNotShowAgain);\r
-         b.append(useDefaultPDFImportStyle);\r
-@@ -114,8 +96,6 @@
-         //this.setText();\r
-         if (this.dropRow < 0) {\r
-             this.radioButtononlyAttachPDF.setEnabled(false);\r
--            this.radioButtonUpdateEmptyFields.setEnabled(false);\r
--            this.labelMrDlib2.setEnabled(false);\r
-         }\r
-         this.fileName = fileName;\r
-         String name = new File(this.fileName).getName();\r
-@@ -124,8 +104,6 @@
-         } else {\r
-             this.labelFileName.setText(new File(this.fileName).getName().substring(0, 33) + "...");\r
-         }\r
--        this.labelMrDlib1.addMouseListener(new LabelLinkListener(this.labelMrDlib1, "www.mr-dlib.org/docs/pdf_metadata_extraction.php"));\r
--        this.labelMrDlib2.addMouseListener(new LabelLinkListener(this.labelMrDlib2, "www.mr-dlib.org/docs/pdf_metadata_extraction.php"));\r
-         this.setTitle(LocalizationSupport.message("Import_Metadata_From_PDF"));\r
\r
-         setModal(true);\r
-@@ -136,9 +114,7 @@
-         bg.add(radioButtonNoMeta);\r
-         bg.add(radioButtonXmp);\r
-         bg.add(radioButtonPDFcontent);\r
--        bg.add(radioButtonMrDlib);\r
-         bg.add(radioButtononlyAttachPDF);\r
--        bg.add(radioButtonUpdateEmptyFields);\r
\r
-         buttonOK.addActionListener(new ActionListener() {\r
-             public void actionPerformed(ActionEvent e) {\r
-@@ -175,15 +151,9 @@
-               case CONTENT:\r
-                       radioButtonPDFcontent.setSelected(true);\r
-                       break;\r
--              case MRDLIB:\r
--                      radioButtonMrDlib.setSelected(true);\r
--                      break;\r
-               case ONLYATTACH:\r
-                       radioButtononlyAttachPDF.setSelected(true);\r
-                       break;\r
--              case UPDATEEMPTYFIELDS:\r
--                      radioButtonUpdateEmptyFields.setSelected(true);\r
--                      break;\r
-               default:\r
-                       // fallback\r
-                       radioButtonPDFcontent.setSelected(true);\r
-@@ -218,14 +188,10 @@
-               return XMP;\r
-       else if (radioButtonPDFcontent.isSelected())\r
-               return CONTENT;\r
--      else if (radioButtonMrDlib.isSelected())\r
--              return MRDLIB;\r
-       else if (radioButtonNoMeta.isSelected())\r
-               return NOMETA;\r
-       else if (radioButtononlyAttachPDF.isSelected())\r
-               return ONLYATTACH;\r
--      else if (radioButtonUpdateEmptyFields.isSelected())\r
--              return UPDATEEMPTYFIELDS;\r
-       else throw new IllegalStateException();\r
-     }\r
\r
---- a/src/java/spl/gui/MetaDataListDialog.java
-+++ /dev/null
-@@ -1,314 +0,0 @@
--package spl.gui;\r
--\r
--\r
--import java.awt.BorderLayout;\r
--import java.awt.CardLayout;\r
--import java.awt.Color;\r
--import java.awt.Component;\r
--import java.awt.Dimension;\r
--import java.awt.Font;\r
--import java.awt.event.ActionEvent;\r
--import java.awt.event.ActionListener;\r
--import java.awt.event.KeyEvent;\r
--import java.awt.event.WindowAdapter;\r
--import java.awt.event.WindowEvent;\r
--import java.io.File;\r
--import java.io.IOException;\r
--import java.util.List;\r
--import java.util.Vector;\r
--\r
--import javax.swing.BorderFactory;\r
--import javax.swing.ImageIcon;\r
--import javax.swing.JButton;\r
--import javax.swing.JComponent;\r
--import javax.swing.JDialog;\r
--import javax.swing.JLabel;\r
--import javax.swing.JOptionPane;\r
--import javax.swing.JPanel;\r
--import javax.swing.JScrollPane;\r
--import javax.swing.JTable;\r
--import javax.swing.KeyStroke;\r
--import javax.swing.ListSelectionModel;\r
--import javax.swing.SwingWorker;\r
--import javax.swing.table.DefaultTableModel;\r
--\r
--import net.sf.jabref.Globals;\r
--import net.sf.jabref.MetaData;\r
--import net.sf.jabref.Util;\r
--\r
--import org.sciplore.beans.Document;\r
--\r
--import spl.DocumentsWrapper;\r
--import spl.SplWebClient;\r
--import spl.listener.LabelLinkListener;\r
--import spl.localization.LocalizationSupport;\r
--\r
--import com.jgoodies.forms.builder.ButtonBarBuilder2;\r
--\r
--public class MetaDataListDialog extends JDialog {\r
--    private JPanel contentPane;\r
--    private JTable tableMetadata;\r
--    private JButton buttonOK;\r
--    private JButton buttonCancel;\r
--    private JScrollPane scrollPane;\r
--    private JPanel panelWait;\r
--    private JLabel labelFetch;\r
--    private JLabel iconLabel;\r
--    private JButton blankButton;\r
--    private JLabel labelLogo;\r
--    private JButton moreInformationButton;\r
--    private JPanel panelMetadata;\r
--    private DefaultTableModel tableModel;\r
--    private int result;\r
--    private Document xmlDocuments;\r
--    private String fileName;\r
--    private SplWebClient.WebServiceStatus webserviceStatus;\r
--    private Component thisDialog;\r
--    private boolean showBlankButton;\r
--    private CardLayout cardLayou = new CardLayout();\r
--\r
--    public MetaDataListDialog(String fileName, boolean showBlankButton) {\r
--        $$$setupUI$$$();\r
--        this.showBlankButton = showBlankButton;\r
--        this.thisDialog = this;\r
--        this.fileName = fileName;\r
--        this.labelLogo.addMouseListener(new LabelLinkListener(this.labelLogo, "www.mr-dlib.org"));\r
--        this.setTitle(LocalizationSupport.message("Mr._dLib_Metadata_Entries_Associated_With_PDF_File"));\r
--        this.tableMetadata.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r
--        setContentPane(contentPane);\r
--        pack();\r
--        setModal(true);\r
--        getRootPane().setDefaultButton(buttonOK);\r
--\r
--        buttonOK.addActionListener(new ActionListener() {\r
--            public void actionPerformed(ActionEvent e) {\r
--                onOK();\r
--            }\r
--        });\r
--\r
--        buttonCancel.addActionListener(new ActionListener() {\r
--            public void actionPerformed(ActionEvent e) {\r
--                onCancel();\r
--            }\r
--        });\r
--\r
--        blankButton.addActionListener(new ActionListener() {\r
--            public void actionPerformed(ActionEvent e) {\r
--                onBlank();\r
--            }\r
--        });\r
--\r
--        moreInformationButton.addActionListener(new ActionListener() {\r
--            public void actionPerformed(ActionEvent e) {\r
--                onInfo();\r
--            }\r
--        });\r
--\r
--        setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);\r
--        addWindowListener(new WindowAdapter() {\r
--            public void windowClosing(WindowEvent e) {\r
--                onCancel();\r
--            }\r
--        });\r
--\r
--        contentPane.registerKeyboardAction(new ActionListener() {\r
--            public void actionPerformed(ActionEvent e) {\r
--                onCancel();\r
--            }\r
--        }, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);\r
--\r
--        cardLayou.show(panelMetadata, "panelWait");\r
--        //this.scrollPane.setVisible(false);\r
--        //this.blankButton.setVisible(false);\r
--        this.moreInformationButton.setVisible(true);\r
--        this.setSize(616, 366);\r
--    }\r
--\r
--    private void onInfo() {\r
--        try {\r
--            Util.openExternalViewer(new MetaData(), "http://www.mr-dlib.org/docs/jabref_metadata_extraction_alpha.php", "url");\r
--        } catch (IOException exc) {\r
--            exc.printStackTrace();\r
--        }\r
--    }\r
--\r
--    private void onBlank() {\r
--        this.result = JOptionPane.NO_OPTION;\r
--        dispose();\r
--    }\r
--\r
--    private void onOK() {\r
--        this.result = JOptionPane.OK_OPTION;\r
--        dispose();\r
--    }\r
--\r
--    private void onCancel() {\r
--        this.result = JOptionPane.CANCEL_OPTION;\r
--        dispose();\r
--    }\r
--\r
--    public void showDialog() {\r
--        SwingWorker worker = new SwingWorker<Void, Void>() {\r
--            @Override\r
--            public Void doInBackground() {\r
--                System.out.println("Starting Webclient...");\r
--                webserviceStatus = SplWebClient.getMetaData(new File(fileName));\r
--                return null;\r
--            }\r
--\r
--            @Override\r
--            public void done() {\r
--                if (webserviceStatus == SplWebClient.WebServiceStatus.OK) {\r
--                    xmlDocuments = SplWebClient.metadata;\r
--                    if (xmlDocuments != null /*&& xmlDocuments.getDocuments() != null && xmlDocuments.getDocuments().size() > 0*/) {\r
--                        DocumentsWrapper documents = new DocumentsWrapper(xmlDocuments);\r
--                        List<Vector> vectorList = documents.getDocuments();\r
--                        for (Vector vector : vectorList) {\r
--                            tableModel.addRow(vector);\r
--                        }\r
--\r
--                        tableMetadata.getSelectionModel().setSelectionInterval(0, 0);\r
--                        cardLayou.show(panelMetadata, "scrollPane");\r
--                        //panelWait.setVisible(false);\r
--                        //scrollPane.setVisible(true);\r
--                        moreInformationButton.setVisible(true);\r
--                    } else {\r
--                        iconLabel.setVisible(false);\r
--                        labelFetch.setText(LocalizationSupport.message("No_metadata_found."));\r
--                        blankButton.setVisible(showBlankButton);\r
--                    }\r
--                }\r
--                if (webserviceStatus == SplWebClient.WebServiceStatus.NO_METADATA) {\r
--                    iconLabel.setVisible(false);\r
--                    labelFetch.setText(LocalizationSupport.message("No_metadata_found."));\r
--                    blankButton.setVisible(showBlankButton);\r
--                }\r
--                if (webserviceStatus == SplWebClient.WebServiceStatus.UNAVAILABLE) {\r
--                    iconLabel.setVisible(false);\r
--                    labelFetch.setText(LocalizationSupport.message("Mr._dLib_web_service_is_temporarily_unavailable."));\r
--                    blankButton.setVisible(showBlankButton);\r
--                }\r
--                if (webserviceStatus == SplWebClient.WebServiceStatus.OUTDATED) {\r
--                    iconLabel.setVisible(false);\r
--                    labelFetch.setText(LocalizationSupport.message("The_Mr._dLib_web_service_version_you_trying_to_access_is_outdated."));\r
--                    blankButton.setVisible(showBlankButton);\r
--                    JOptionPane.showMessageDialog(thisDialog, LocalizationSupport.message("This_JabRef_version_is_trying_to_access_an_old_version_of_Mr._dLib's_webservice_that_is_not_working_any_more.\\nPlease_visit_http://jabref.sourceforge.net_or_http://www.mr-dlib.org_for_more_information_and_updates.\\n\\n\\n"), LocalizationSupport.message("Web_Service_Version_Outdated"), JOptionPane.INFORMATION_MESSAGE);\r
--                }\r
--                if (webserviceStatus == SplWebClient.WebServiceStatus.WEBSERVICE_DOWN) {\r
--                    iconLabel.setVisible(false);\r
--                    labelFetch.setText(LocalizationSupport.message("Mr._dLib_web_service_is_temporarily_down._Please_try_again_later."));\r
--                    blankButton.setVisible(showBlankButton);\r
--                }\r
--                if (webserviceStatus == SplWebClient.WebServiceStatus.NO_INTERNET) {\r
--                    iconLabel.setVisible(false);\r
--                    labelFetch.setText(LocalizationSupport.message("No_Internet_Connection."));\r
--                    blankButton.setVisible(showBlankButton);\r
--                    JOptionPane.showMessageDialog(thisDialog, LocalizationSupport.message("You_are_not_connected_to_the_Internet._To_access_Mr._dLib_web_service_an_internet_connection_is_needed."), LocalizationSupport.message("No_Internet_Connection."), JOptionPane.INFORMATION_MESSAGE);\r
--                }\r
--            }\r
--        };\r
--        worker.execute();\r
--        this.pack();\r
--        this.setVisible(true);\r
--    }\r
--\r
--    public Document getXmlDocuments() {\r
--        return xmlDocuments;\r
--    }\r
--\r
--    private void createUIComponents() {\r
--        this.tableModel = new MyTableModel();\r
--        this.tableModel.addColumn(LocalizationSupport.message("Title"));\r
--        this.tableModel.addColumn(LocalizationSupport.message("Author(s)"));\r
--        this.tableModel.addColumn(LocalizationSupport.message("Published_Year"));\r
--        this.tableMetadata = new JTable(this.tableModel);\r
--    }\r
--\r
--    public JTable getTableMetadata() {\r
--        return tableMetadata;\r
--    }\r
--\r
--    public int getResult() {\r
--        return result;\r
--    }\r
--\r
--    public JButton getBlankButton() {\r
--        return blankButton;\r
--    }\r
--\r
--    private void $$$setupUI$$$() {\r
--        createUIComponents();\r
--        contentPane = new JPanel();\r
--        contentPane.setLayout(new BorderLayout());\r
--        labelLogo = new JLabel();\r
--        labelLogo.setIcon(new ImageIcon(getClass().getResource("/spl/gui/mrdlib header.png")));\r
--        labelLogo.setText("");\r
--        contentPane.add(labelLogo, BorderLayout.NORTH);\r
--        panelMetadata = new JPanel();\r
--        panelMetadata.setLayout(cardLayou);\r
--\r
--\r
--        panelMetadata.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), null));\r
--        scrollPane = new JScrollPane();\r
--        scrollPane.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLoweredBevelBorder(), null));\r
--        tableMetadata.setAutoCreateRowSorter(false);\r
--        tableMetadata.setEnabled(true);\r
--        tableMetadata.setFillsViewportHeight(true);\r
--        tableMetadata.setShowVerticalLines(true);\r
--        scrollPane.setViewportView(tableMetadata);\r
--        panelMetadata.add(scrollPane, "scrollPane");\r
--        panelWait = new JPanel();\r
--        panelWait.setLayout(new BorderLayout());\r
--        panelWait.setBackground(new Color(-1));\r
--        panelMetadata.add(panelWait, "panelWait");\r
--        panelWait.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLoweredBevelBorder(), null));\r
--        iconLabel = new JLabel();\r
--        iconLabel.setBackground(new Color(-1));\r
--        iconLabel.setHorizontalAlignment(0);\r
--        iconLabel.setHorizontalTextPosition(11);\r
--        iconLabel.setIcon(new ImageIcon(getClass().getResource("/spl/gui/ajax-loader.gif")));\r
--        iconLabel.setText("");\r
--        panelWait.add(iconLabel, BorderLayout.CENTER);\r
--        labelFetch = new JLabel();\r
--        labelFetch.setHorizontalAlignment(JLabel.CENTER);\r
--        labelFetch.setFont(new Font(labelFetch.getFont().getName(), labelFetch.getFont().getStyle(), 13));\r
--        labelFetch.setText(Globals.lang("Fetching Metadata..."));\r
--        panelWait.add(labelFetch, BorderLayout.SOUTH);\r
--\r
--        cardLayou.show(panelMetadata, "panelWait");\r
--        panelMetadata.setPreferredSize(new Dimension(400, 200));\r
--        contentPane.add(panelMetadata, BorderLayout.CENTER);\r
--\r
--        buttonOK = new JButton(Globals.lang("Ok"));\r
--        buttonCancel = new JButton(Globals.lang("Cancel"));\r
--        moreInformationButton = new JButton(Globals.lang("More information"));\r
--        ButtonBarBuilder2 bb = new ButtonBarBuilder2();\r
--        bb.addGlue();\r
--        bb.addButton(moreInformationButton);\r
--        bb.addButton(buttonOK);\r
--        bb.addButton(buttonCancel);\r
--        bb.addGlue();\r
--        blankButton = new JButton();\r
--        blankButton.setText("");\r
--        contentPane.add(bb.getPanel(), BorderLayout.SOUTH);\r
--        iconLabel.setLabelFor(scrollPane);\r
--\r
--\r
--    }\r
--\r
--    /**\r
--     * @noinspection ALL\r
--     */\r
--    public JComponent $$$getRootComponent$$$() {\r
--        return contentPane;\r
--    }\r
--\r
--    public class MyTableModel extends DefaultTableModel {\r
--\r
--        @Override\r
--        public boolean isCellEditable(int row, int column) {\r
--            return false;\r
--        }\r
--    }\r
--\r
--}\r
diff --git a/debian/patches/mrDlib_jayatana.patch b/debian/patches/mrDlib_jayatana.patch
new file mode 100644 (file)
index 0000000..5584895
--- /dev/null
@@ -0,0 +1,1362 @@
+Description: This is the diff between the debian branch and the v_2.9b2 tag
+ in upstream git; the debian branch was created for us with the purpose to
+ disable the mrDlib functionality which needs libraries not packaged in
+ Debian yet.
+Origin: upstream git
+Author: Oliver Kopp <oliver.kopp@gmail.com>
+Reviewed-by: gregor herrmann <gregoa@debian.org>
+Last-Update: 2012-11-19
+
+--- a/.classpath
++++ b/.classpath
+@@ -11,8 +11,6 @@
+       <classpathentry exported="true" kind="lib" path="lib/plugin/JPFCodeGenerator-rt.jar" sourcepath="/JPFCodeGenerator/src"/>
+       <classpathentry exported="true" kind="lib" path="lib/glazedlists-1.8.0_java15.jar"/>
+       <classpathentry kind="lib" path="lib/mysql-connector-java-5.0.7-bin.jar"/>
+-      <classpathentry kind="lib" path="lib/spl/sciplore/xstream-1.4.1.jar"/>
+-      <classpathentry kind="lib" path="lib/spl/sciplore/mrDlib-serialization-api.jar" sourcepath="/Serialization API"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
+               <accessrules>
+                       <accessrule kind="accessible" pattern="**"/>
+@@ -21,14 +19,10 @@
+       <classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
+       <classpathentry exported="true" kind="con" path="org.eclipse.jdt.USER_LIBRARY/resources"/>
+       <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/sciplore"/>
+-      <classpathentry kind="lib" path="lib/spl/jersey/mimepull-1.3.jar"/>
+       <classpathentry kind="lib" path="lib/oo/juh.jar"/>
+       <classpathentry kind="lib" path="lib/oo/jurt.jar"/>
+       <classpathentry kind="lib" path="lib/oo/ridl.jar"/>
+       <classpathentry kind="lib" path="lib/oo/unoil.jar"/>
+-      <classpathentry kind="lib" path="lib/spl/jersey/jersey-client-1.14.jar"/>
+-      <classpathentry kind="lib" path="lib/spl/jersey/jersey-core-1.14.jar"/>
+-      <classpathentry kind="lib" path="lib/spl/jersey/jersey-multipart-1.14.jar"/>
+       <classpathentry kind="lib" path="lib/antlr-3.4-complete.jar"/>
+       <classpathentry kind="lib" path="lib/jgoodies-common-1.4.0.jar"/>
+       <classpathentry kind="lib" path="lib/jgoodies-forms-1.6.0.jar"/>
+@@ -36,7 +30,6 @@
+       <classpathentry kind="lib" path="lib/fontbox-1.7.1.jar"/>
+       <classpathentry kind="lib" path="lib/jempbox-1.7.1.jar"/>
+       <classpathentry kind="lib" path="lib/pdfbox-1.7.1.jar"/>
+-      <classpathentry kind="lib" path="lib/jayatana-1.2.4.jar"/>
+       <classpathentry kind="lib" path="lib/postgresql-9.2-1002.jdbc4.jar"/>
+       <classpathentry kind="output" path="bin"/>
+ </classpath>
+--- a/src/java/net/sf/jabref/ImportSettingsTab.java
++++ b/src/java/net/sf/jabref/ImportSettingsTab.java
+@@ -44,10 +44,8 @@
+       
+     private JRadioButton radioButtonXmp;
+       private JRadioButton radioButtonPDFcontent;
+-    private JRadioButton radioButtonMrDlib;
+     private JRadioButton radioButtonNoMeta;
+       private JRadioButton radioButtononlyAttachPDF;
+-      private JRadioButton radioButtonUpdateEmptyFields;
+       private JCheckBox useDefaultPDFImportStyle;
+       
+       private JTextField fileNamePattern;
+@@ -59,17 +57,12 @@
+         radioButtonNoMeta = new JRadioButton(Globals.lang("Create_blank_entry_linking_the_PDF"));
+         radioButtonXmp = new JRadioButton(Globals.lang("Create_entry_based_on_XMP_data"));
+         radioButtonPDFcontent = new JRadioButton(Globals.lang("Create_entry_based_on_content"));
+-        radioButtonMrDlib = new JRadioButton(Globals.lang("Create_entry_based_on_data_fetched_from")+" Mr.DLib");
+         radioButtononlyAttachPDF = new JRadioButton(Globals.lang("Only_attach_PDF"));
+-        radioButtonUpdateEmptyFields = new JRadioButton(Globals.lang("Update_empty_fields_with_data_fetched_from")
+-            +" Mr.DLib");
+         ButtonGroup bg = new ButtonGroup();
+         bg.add(radioButtonNoMeta);
+         bg.add(radioButtonXmp);
+         bg.add(radioButtonPDFcontent);
+-        bg.add(radioButtonMrDlib);
+         bg.add(radioButtononlyAttachPDF);
+-        bg.add(radioButtonUpdateEmptyFields);
+         useDefaultPDFImportStyle = new JCheckBox(Globals.lang("Always use this PDF import style (and do not ask for each import)"));
+               
+@@ -96,15 +89,9 @@
+               builder.append(radioButtonPDFcontent);
+         builder.nextLine();
+         builder.append(pan);
+-              builder.append(radioButtonMrDlib);
+-        builder.nextLine();
+-        builder.append(pan);
+               builder.append(radioButtononlyAttachPDF);
+         builder.nextLine();
+         builder.append(pan);
+-              builder.append(radioButtonUpdateEmptyFields);
+-        builder.nextLine();
+-        builder.append(pan);
+               builder.append(useDefaultPDFImportStyle);
+         builder.nextLine();
+               
+@@ -136,15 +123,9 @@
+               case ImportDialog.CONTENT:
+                       radioButtonPDFcontent.setSelected(true);
+                       break;
+-              case ImportDialog.MRDLIB:
+-                      radioButtonMrDlib.setSelected(true);
+-                      break;
+               case ImportDialog.ONLYATTACH:
+                       radioButtononlyAttachPDF.setSelected(true);
+                       break;
+-              case ImportDialog.UPDATEEMPTYFIELDS:
+-                      radioButtonUpdateEmptyFields.setSelected(true);
+-                      break;
+               default:
+                       // fallback
+                       radioButtonPDFcontent.setSelected(true);
+@@ -162,12 +143,9 @@
+                       style = ImportDialog.XMP;
+               else if (radioButtonPDFcontent.isSelected())
+                       style = ImportDialog.CONTENT;
+-              else if (radioButtonMrDlib.isSelected())
+-                      style = ImportDialog.MRDLIB;
+               else if (radioButtononlyAttachPDF.isSelected())
+                       style = ImportDialog.ONLYATTACH;
+-              else if (radioButtonUpdateEmptyFields.isSelected())
+-                      style = ImportDialog.UPDATEEMPTYFIELDS;
++              else throw new IllegalStateException();
+               Globals.prefs.putInt(PREF_IMPORT_DEFAULT_PDF_IMPORT_STYLE, style);
+               Globals.prefs.put(PREF_IMPORT_FILENAMEPATTERN, fileNamePattern.getText());
+       }
+--- a/src/java/net/sf/jabref/JabRefFrame.java
++++ b/src/java/net/sf/jabref/JabRefFrame.java
+@@ -1,4 +1,4 @@
+-/*  Copyright (C) 2003-2012 JabRef contributors.
++/*  Copyright (C) 2003-2011 JabRef contributors.
+     This program is free software; you can redistribute it and/or modify
+     it under the terms of the GNU General Public License as published by
+     the Free Software Foundation; either version 2 of the License, or
+@@ -40,8 +40,6 @@
+ import javax.swing.event.ChangeEvent;
+ import javax.swing.event.ChangeListener;
+-import org.java.ayatana.ApplicationMenu;
+-
+ import net.sf.jabref.export.*;
+ import net.sf.jabref.external.ExternalFileTypeEditor;
+ import net.sf.jabref.external.PushToApplicationButton;
+@@ -550,13 +548,6 @@
+                 }
+             }
+         });
+-
+-        // The following sets up integration with Unity's global menu, but currently (Nov 18, 2012)
+-        // this doesn't work with OpenJDK 6 (leads to crash), only with 7.
+-        String javaVersion = System.getProperty("java.version", null);
+-        if (javaVersion.compareTo("1.7") >= 0)
+-            ApplicationMenu.tryInstall(this);
+-
+     }
+     public void setWindowTitle() {
+--- a/src/java/spl/DocumentWrapper.java
++++ /dev/null
+@@ -1,272 +0,0 @@
+-package spl;\r
+-\r
+-import java.util.List;\r
+-\r
+-import org.sciplore.beans.Abstract;\r
+-import org.sciplore.beans.Author;\r
+-import org.sciplore.beans.Authors;\r
+-import org.sciplore.beans.Document;\r
+-import org.sciplore.formatter.Bean;\r
+-import org.sciplore.formatter.SimpleTypeElementBean;\r
+-\r
+-/**\r
+- * Created by IntelliJ IDEA.\r
+- * User: Christoph Arbeit\r
+- * Date: 10.09.2010\r
+- * Time: 20:02:51\r
+- * To change this template use File | Settings | File Templates.\r
+- */\r
+-public class DocumentWrapper {\r
+-\r
+-    Document xmlDocument;\r
+-\r
+-    public DocumentWrapper(Document xmlDocument) {\r
+-        this.xmlDocument = xmlDocument;\r
+-    }\r
+-\r
+-    public Document getXmlDocument() {\r
+-        return xmlDocument;\r
+-    }\r
+-\r
+-    public void setXmlDocument(Document xmlDocument) {\r
+-        this.xmlDocument = xmlDocument;\r
+-    }\r
+-\r
+-    public String getTitle(){\r
+-        if(this.hasTitle()){\r
+-            return xmlDocument.getTitle().getValue();\r
+-        }\r
+-        else{\r
+-            return "";\r
+-        }\r
+-    }\r
+-\r
+-    public boolean hasTitle(){\r
+-        return (xmlDocument.getTitle() != null && xmlDocument.getTitle().getValue() != null && !xmlDocument.getTitle().getValue().isEmpty());\r
+-    }\r
+-\r
+-    public String getAbstract(){\r
+-        if(this.hasAbstract()){\r
+-            return ((Abstract)xmlDocument.getAbstract()).getValue();\r
+-        }\r
+-        else{\r
+-            return "";\r
+-        }\r
+-    }\r
+-\r
+-    public boolean hasAbstract(){\r
+-        return (xmlDocument.getAbstract() != null && ((Abstract)xmlDocument.getAbstract()).getValue() != null && !((Abstract)xmlDocument.getAbstract()).getValue().isEmpty());\r
+-    }\r
+-\r
+-   public String getAuthors(String seperator){\r
+-        if(this.hasAuthors()){\r
+-              List<Bean> authors = xmlDocument.getAuthors().getCollection();\r
+-            authors = this.sortAuthors(authors);\r
+-            String value = "";\r
+-            int i = 1;\r
+-            for(Bean author : authors){\r
+-                if(i < authors.size()){\r
+-                    value = value + getNameComplete((Author)author);\r
+-                    value = value + " " + seperator + " ";\r
+-                }\r
+-                else{\r
+-                    value = value + getNameComplete((Author)author);\r
+-                }\r
+-                i++;\r
+-            }\r
+-            return value;\r
+-        }\r
+-        else{\r
+-            return "";\r
+-        }\r
+-    }\r
+-\r
+-    public boolean hasAuthors(){\r
+-        return (xmlDocument.getAuthors() != null && xmlDocument.getAuthors().getCollection() != null && !xmlDocument.getAuthors().getCollection().isEmpty());\r
+-    }\r
+-\r
+-    /* public String getKeyWords(){\r
+-        if(this.hasKeyWords()){\r
+-            List<XmlKeyword> keywords = xmlDocument.getKeywords().getKeywords();\r
+-            String value = "";\r
+-            int i = 1;\r
+-            for(XmlKeyword keyword : keywords){\r
+-                if(i < keywords.size()){\r
+-                    value = value + keyword.getValue();\r
+-                    value = value + ", ";\r
+-                }\r
+-                else{\r
+-                    value = value + keyword.getValue();\r
+-                }\r
+-                i++;\r
+-            }\r
+-            return value;\r
+-        }\r
+-        else{\r
+-            return "";\r
+-        }\r
+-    }\r
+-\r
+-    public boolean hasKeyWords(){\r
+-        return (xmlDocument.getKeywords() != null && xmlDocument.getKeywords().getKeywords() != null && !xmlDocument.getKeywords().getKeywords().isEmpty());\r
+-    }\r
+-*/\r
+-\r
+-    public String getDoi(){\r
+-        if(this.hasDoi()){\r
+-            return this.getSimpleTypeValue(xmlDocument.getDoi());\r
+-        }\r
+-        else{\r
+-            return "";\r
+-        }\r
+-    }\r
+-\r
+-    public boolean hasDoi(){\r
+-        return (xmlDocument.getDoi() != null && this.getSimpleTypeValue(xmlDocument.getDoi()) != null && !this.getSimpleTypeValue(xmlDocument.getDoi()).isEmpty());\r
+-    }\r
+-/*\r
+-    public String getPages(){\r
+-        if(this.hasPages()){\r
+-            return xmlDocument.getPages().getValue();\r
+-        }\r
+-        else{\r
+-            return "";\r
+-        }\r
+-    }\r
+-\r
+-    public boolean hasPages(){\r
+-        return (xmlDocument.getPages() != null && xmlDocument.getPages().getValue() != null && !xmlDocument.getPages().getValue().isEmpty());\r
+-    }\r
+-\r
+-    public String getVolume(){\r
+-        if(this.hasVolume()){\r
+-            return xmlDocument.getVolume().getValue();\r
+-        }\r
+-        else{\r
+-            return "";\r
+-        }\r
+-    }\r
+-\r
+-    public boolean hasVolume(){\r
+-        return (xmlDocument.getVolume() != null && xmlDocument.getVolume().getValue() != null && !xmlDocument.getVolume().getValue().isEmpty());\r
+-    }\r
+-\r
+-    public String getNumber(){\r
+-        if(this.hasNumber()){\r
+-            return xmlDocument.getNumber().getValue();\r
+-        }\r
+-        else{\r
+-            return "";\r
+-        }\r
+-    }\r
+-\r
+-    public boolean hasNumber(){\r
+-        return (xmlDocument.getNumber() != null && xmlDocument.getNumber().getValue() != null && !xmlDocument.getNumber().getValue().isEmpty());\r
+-    }\r
+-*/\r
+-    \r
+-    public String getYear(){\r
+-        if(this.hasYear()){\r
+-            return this.getSimpleTypeValue(xmlDocument.getYear());\r
+-        }\r
+-        else{\r
+-            return "";\r
+-        }\r
+-    }\r
+-\r
+-    public boolean hasYear(){\r
+-        return (this.getSimpleTypeValue(xmlDocument.getYear()) != null && !this.getSimpleTypeValue(xmlDocument.getYear()).isEmpty() && !this.getSimpleTypeValue(xmlDocument.getYear()).equalsIgnoreCase("null"));\r
+-    }\r
+-    \r
+-/*\r
+-     public String getMonth(){\r
+-        if(this.hasMonth()){\r
+-            return xmlDocument.getPublishdate().getMonth();\r
+-        }\r
+-        else{\r
+-            return "";\r
+-        }\r
+-    }\r
+-\r
+-    public boolean hasMonth(){\r
+-        return (xmlDocument.getPublishdate() != null && xmlDocument.getPublishdate().getMonth() != null && !xmlDocument.getPublishdate().getMonth().isEmpty());\r
+-    }\r
+-\r
+-    public String getDay(){\r
+-        if(this.hasDay()){\r
+-            return xmlDocument.getPublishdate().getDay();\r
+-        }\r
+-        else{\r
+-            return "";\r
+-        }\r
+-    }\r
+-\r
+-    public boolean hasDay(){\r
+-        return (xmlDocument.getPublishdate() != null && xmlDocument.getPublishdate().getDay() != null && !xmlDocument.getPublishdate().getDay().isEmpty());\r
+-    }\r
+-    \r
+-      /*\r
+-    public String getVenue() {\r
+-        if(this.hasVenue()){\r
+-            return xmlDocument.getVenue().getValue();\r
+-        }\r
+-        else{\r
+-            return "";\r
+-        }\r
+-    }\r
+-\r
+-    public boolean hasVenue(){\r
+-        return (xmlDocument.getVenue() != null && xmlDocument.getVenue().getValue() != null && !xmlDocument.getVenue().getValue().isEmpty());\r
+-    }*/\r
+-    \r
+-    private String getNameComplete(Author author){\r
+-      if(author == null) return "";\r
+-      String result = "";\r
+-      if(getSimpleTypeValue(author.getName_First()) != null)\r
+-              result = result + getSimpleTypeValue(author.getName_First()).trim() + " ";\r
+-      if(getSimpleTypeValue(author.getName_Middle()) != null)\r
+-              result = result + getSimpleTypeValue(author.getName_Middle()).trim() + " ";\r
+-      if(getSimpleTypeValue(author.getName_Last_Prefix()) != null)\r
+-              result = result + getSimpleTypeValue(author.getName_Last_Prefix()).trim() + " ";\r
+-      if(getSimpleTypeValue(author.getName_Last()) != null)\r
+-              result = result + getSimpleTypeValue(author.getName_Last()).trim() + " ";\r
+-      if(getSimpleTypeValue(author.getName_Last_Suffix()) != null)\r
+-              result = result + getSimpleTypeValue(author.getName_Last_Suffix()).trim() + " ";\r
+-      return result.trim();\r
+-    }\r
+-    \r
+-    private String getSimpleTypeValue(Bean bean){\r
+-      if(bean == null || !(bean instanceof SimpleTypeElementBean)) return null;\r
+-      SimpleTypeElementBean simpleTypeElementBean = (SimpleTypeElementBean)bean;\r
+-      if(simpleTypeElementBean.getValue() == null || simpleTypeElementBean.getValue().equalsIgnoreCase("null") || simpleTypeElementBean.getValue().length() <= 0) return null;\r
+-      return simpleTypeElementBean.getValue();\r
+-    }\r
+-    \r
+-    private List<Bean> sortAuthors(List<Bean> authors){\r
+-       boolean unsorted = true;\r
+-        Bean temp;\r
+-        \r
+-        while (unsorted){\r
+-               unsorted = false;\r
+-               for (int i = 0; i < authors.size() - 1; i++){\r
+-                       int rank = 99;\r
+-                       int otherRank = 99;\r
+-                       if(((Author)authors.get(i)).getRank() != null && !((Author)authors.get(i)).getRank().equalsIgnoreCase("null")){\r
+-                               rank = Integer.parseInt(((Author)authors.get(i)).getRank());\r
+-                       }                       \r
+-                       if(((Author)authors.get(i + 1)).getRank() != null && !((Author)authors.get(i + 1)).getRank().equalsIgnoreCase("null")){\r
+-                               otherRank = Integer.parseInt(((Author)authors.get(i + 1)).getRank());\r
+-                       }                       \r
+-                       \r
+-                       if (rank > otherRank) {                      \r
+-                 temp       = authors.get(i);\r
+-                 authors.set(i, authors.get(i + 1));\r
+-                 authors.set(i + 1, temp);                 \r
+-                 unsorted = true;\r
+-              }          \r
+-              }        \r
+-       } \r
+-      \r
+-      return authors;\r
+-   }\r
+-}\r
+--- a/src/java/spl/DocumentsWrapper.java
++++ /dev/null
+@@ -1,132 +0,0 @@
+-package spl;\r
+-\r
+-import java.util.ArrayList;\r
+-import java.util.List;\r
+-import java.util.Vector;\r
+-\r
+-import org.sciplore.beans.Author;\r
+-import org.sciplore.beans.Document;\r
+-import org.sciplore.beans.Year;\r
+-import org.sciplore.formatter.Bean;\r
+-import org.sciplore.formatter.SimpleTypeElementBean;\r
+-\r
+-/**\r
+- * Created by IntelliJ IDEA.\r
+- * User: Christoph Arbeit\r
+- * Date: 09.09.2010\r
+- * Time: 10:56:50\r
+- * To change this template use File | Settings | File Templates.\r
+- */\r
+-public class DocumentsWrapper {\r
+-\r
+-    Document xmlDocuments;\r
+-\r
+-    public DocumentsWrapper(Document documents) {\r
+-        this.xmlDocuments = documents;\r
+-    }\r
+-\r
+-    public Document getXmlDocuments() {\r
+-        return xmlDocuments;\r
+-    }\r
+-\r
+-    public void setXmlDocuments(Document xmlDocuments) {\r
+-        this.xmlDocuments = xmlDocuments;\r
+-    }\r
+-\r
+-    public List<Vector> getDocuments(){\r
+-        List<Vector> documents = new ArrayList<Vector>();\r
+-        //List<XmlDocument> xmlDocuments = this.xmlDocuments.getDocuments();\r
+-        //for(XmlDocument xmlDocument : xmlDocuments){\r
+-              Document xmlDocument = xmlDocuments;\r
+-            Vector<String> vector = new Vector<String>();\r
+-            if(xmlDocument.getTitle() != null){\r
+-                vector.add(xmlDocument.getTitle().getValue());\r
+-            }\r
+-            else{\r
+-                vector.add("");\r
+-            }\r
+-            if(xmlDocument.getAuthors() != null){\r
+-                List<Bean> authors = xmlDocument.getAuthors().getCollection();\r
+-                authors = this.sortAuthors(authors);\r
+-                String value = "";\r
+-                int i = 1;\r
+-                for(Bean author : authors){\r
+-                    if(i < authors.size()){\r
+-                        value = value + getNameComplete(((Author)author));\r
+-                        value = value + ", ";\r
+-                    }\r
+-                    else{\r
+-                        value = value + getNameComplete(((Author)author));\r
+-                    }\r
+-                    i++;\r
+-                }\r
+-                vector.add(value);\r
+-            }\r
+-            else{\r
+-                vector.add("");\r
+-            }\r
+-            if(xmlDocument.getYear() != null && ((Year)xmlDocument.getYear()).getValue() != null && !((Year)xmlDocument.getYear()).getValue().equalsIgnoreCase("null")){\r
+-                vector.add(((Year)xmlDocument.getYear()).getValue());\r
+-            }\r
+-            /*if(xmlDocument.getPublishdate() != null && xmlDocument.getPublishdate().getYear() != null && !xmlDocument.getPublishdate().getYear().equalsIgnoreCase("null")){\r
+-                vector.add(xmlDocument.getPublishdate().getYear());\r
+-            }*/\r
+-            else{\r
+-                vector.add("");\r
+-            }\r
+-            documents.add(vector);\r
+-        //}\r
+-        return documents;\r
+-    }\r
+-    \r
+-    private String getNameComplete(Author author){\r
+-      if(author == null) return "";\r
+-      String result = "";\r
+-      if(getSimpleTypeValue(author.getName_First()) != null)\r
+-              result = result + getSimpleTypeValue(author.getName_First()).trim() + " ";\r
+-      if(getSimpleTypeValue(author.getName_Middle()) != null)\r
+-              result = result + getSimpleTypeValue(author.getName_Middle()).trim() + " ";\r
+-      if(getSimpleTypeValue(author.getName_Last_Prefix()) != null)\r
+-              result = result + getSimpleTypeValue(author.getName_Last_Prefix()).trim() + " ";\r
+-      if(getSimpleTypeValue(author.getName_Last()) != null)\r
+-              result = result + getSimpleTypeValue(author.getName_Last()).trim() + " ";\r
+-      if(getSimpleTypeValue(author.getName_Last_Suffix()) != null)\r
+-              result = result + getSimpleTypeValue(author.getName_Last_Suffix()).trim() + " ";\r
+-      return result.trim();\r
+-    }\r
+-    \r
+-    private String getSimpleTypeValue(Bean bean){\r
+-      if(bean == null || !(bean instanceof SimpleTypeElementBean)) return null;\r
+-      SimpleTypeElementBean simpleTypeElementBean = (SimpleTypeElementBean)bean;\r
+-      if(simpleTypeElementBean.getValue() == null || simpleTypeElementBean.getValue().equalsIgnoreCase("null") || simpleTypeElementBean.getValue().length() <= 0) return null;\r
+-      return simpleTypeElementBean.getValue();\r
+-    }\r
+-    \r
+-    private List<Bean> sortAuthors(List<Bean> authors){\r
+-       boolean unsorted = true;\r
+-         Bean temp;\r
+-         \r
+-         while (unsorted){\r
+-               unsorted = false;\r
+-               for (int i = 0; i < authors.size() - 1; i++){\r
+-                       int rank = 99;\r
+-                       int otherRank = 99;\r
+-                       if(((Author)authors.get(i)).getRank() != null && !((Author)authors.get(i)).getRank().equalsIgnoreCase("null")){\r
+-                               rank = Integer.parseInt(((Author)authors.get(i)).getRank());\r
+-                       }                       \r
+-                       if(((Author)authors.get(i + 1)).getRank() != null && !((Author)authors.get(i + 1)).getRank().equalsIgnoreCase("null")){\r
+-                               otherRank = Integer.parseInt(((Author)authors.get(i + 1)).getRank());\r
+-                       }                       \r
+-                       \r
+-                       if (rank > otherRank) {                      \r
+-                  temp       = authors.get(i);\r
+-                  authors.set(i, authors.get(i + 1));\r
+-                  authors.set(i + 1, temp);                 \r
+-                  unsorted = true;\r
+-               }          \r
+-              }        \r
+-        } \r
+-      \r
+-      return authors;\r
+-    }\r
+-}\r
+--- a/src/java/spl/PdfImporter.java
++++ b/src/java/spl/PdfImporter.java
+@@ -21,15 +21,9 @@
+ import net.sf.jabref.undo.UndoableInsertEntry;\r
+ import net.sf.jabref.util.XMPUtil;\r
\r
+-import org.sciplore.beans.Document;\r
+-\r
+ import spl.filter.PdfFileFilter;\r
+ import spl.gui.ImportDialog;\r
+-import spl.gui.MetaDataListDialog;\r
\r
+-import java.util.ArrayList;\r
+-import java.util.Arrays;\r
+-import java.util.List;\r
+ import java.util.Set;\r
\r
\r
+@@ -113,7 +107,6 @@
+               BibtexEntryType type;\r
+                 InputStream in = null;\r
+                 List<BibtexEntry> res = null;\r
+-              MetaDataListDialog metaDataListDialog;\r
+                 switch (choice) {\r
+                       case ImportDialog.XMP:\r
+                     //SplDatabaseChangeListener dataListener = new SplDatabaseChangeListener(frame, panel, entryTable, fileName);\r
+@@ -200,84 +193,9 @@
+                         panel.adjustSplitter();\r
+                     }\r
+                     break;\r
+-                      case ImportDialog.MRDLIB:\r
+-                    metaDataListDialog = new MetaDataListDialog(fileName, true);\r
+-                    Tools.centerRelativeToWindow(metaDataListDialog, frame);\r
+-                    metaDataListDialog.showDialog();\r
+-                    Document document = metaDataListDialog.getXmlDocuments();\r
+-                    if(document != null /*&& documents.getDocuments() != null && documents.getDocuments().size() > 0*/ && metaDataListDialog.getResult() == JOptionPane.OK_OPTION){\r
+-                        int selected = metaDataListDialog.getTableMetadata().getSelectedRow();\r
+-                        if(selected > -1 /*&& selected < documents.getDocuments().size()*/){\r
+-                            //Document document = documents/*.getDocuments().get(selected)*/;\r
+-                            String id = Util.createNeutralId();\r
+-                            entry = new BibtexEntry(id);\r
+-                            if(fieldExists(document.getType())){\r
+-                                type = BibtexEntryType.getStandardType(document.getType());\r
+-                                if(type == null){\r
+-                                    type = BibtexEntryType.ARTICLE;\r
+-                                }\r
+-                                entry.setType(type);\r
+-                            }\r
+-                            else{\r
+-                                entry.setType(BibtexEntryType.ARTICLE);\r
+-                            }\r
+-                            ArrayList<BibtexEntry> list = new ArrayList<BibtexEntry>();\r
+-                            list.add(entry);\r
+-                            Util.setAutomaticFields(list, true, true, false);\r
+-                            //insertFields(entry.getRequiredFields(), entry, document);\r
+-                            insertFields(BibtexFields.getAllFieldNames(), entry, document);\r
+-                            //insertFields(entry.getOptionalFields(), entry, document);\r
+-                            panel.database().insertEntry(entry);\r
+-                            dfh = new DroppedFileHandler(frame, panel);\r
+-                            dfh.linkPdfToEntry(fileName, entryTable, entry);\r
+-                            LabelPatternUtil.makeLabel(panel.metaData(), panel.database(), entry);\r
+-                        }\r
+-                        else{\r
+-                            createNewBlankEntry(fileName);\r
+-                        }\r
+-                    }\r
+-                    else if(metaDataListDialog.getResult() == JOptionPane.CANCEL_OPTION ){\r
+-                        continue;\r
+-                    }\r
+-                    else if(metaDataListDialog.getResult() == JOptionPane.NO_OPTION ){\r
+-                        createNewBlankEntry(fileName);\r
+-                    }\r
+-                    else if(document == null /*|| document.getDocuments() == null || document.getDocuments().size() <= 0*/ && metaDataListDialog.getResult() == JOptionPane.OK_OPTION){\r
+-                        createNewBlankEntry(fileName);\r
+-                    }\r
+-                    break;\r
+                       case ImportDialog.NOMETA:\r
+                     createNewBlankEntry(fileName);\r
+                     break;\r
+-                      case ImportDialog.UPDATEEMPTYFIELDS:\r
+-                    metaDataListDialog = new MetaDataListDialog(fileName, false);                   \r
+-                    Tools.centerRelativeToWindow(metaDataListDialog, frame);\r
+-                    metaDataListDialog.showDialog();\r
+-                    document = metaDataListDialog.getXmlDocuments();\r
+-                    if(document != null /*&& document.getDocuments() != null && document.getDocuments().size() > 0*/ && metaDataListDialog.getResult() == JOptionPane.OK_OPTION){\r
+-                        int selected = metaDataListDialog.getTableMetadata().getSelectedRow();\r
+-                        if(selected > -1 /*&& selected < document.getDocuments().size()*/){\r
+-                            //XmlDocument document = documents.getDocuments().get(selected);\r
+-                            entry = entryTable.getEntryAt(dropRow);\r
+-                            if(fieldExists(document.getType())){\r
+-                                type = BibtexEntryType.getStandardType(document.getType());\r
+-                                if(type != null){\r
+-                                    entry.setType(type);\r
+-                                }\r
+-                            }\r
+-                            //insertFields(entry.getRequiredFields(), entry, document);\r
+-                            insertFields(BibtexFields.getAllFieldNames(), entry, document);\r
+-                            //insertFields(entry.getOptionalFields(), entry, document);\r
+-\r
+-                            dfh = new DroppedFileHandler(frame, panel);\r
+-                            dfh.linkPdfToEntry(fileName, entryTable, dropRow);\r
+-                        }\r
+-                    }\r
+-                    break;\r
+-                      case ImportDialog.ONLYATTACH:\r
+-                    dfh = new DroppedFileHandler(frame, panel);\r
+-                    dfh.linkPdfToEntry(fileName, entryTable, dropRow);\r
+-                    break;\r
+                 }\r
+             }\r
\r
+@@ -295,58 +213,6 @@
+         }\r
+     }\r
\r
+-    private void insertFields(String[] fields, BibtexEntry entry, Document xmlDocument) {\r
+-        DocumentWrapper document = new DocumentWrapper(xmlDocument);\r
+-        for(String field : fields){\r
+-            if(entry.getField(field) != null){\r
+-                continue;\r
+-            }\r
+-            if(field.equalsIgnoreCase("author")){\r
+-                entry.setField(field, document.getAuthors("and"));\r
+-            }\r
+-            if(field.equalsIgnoreCase("title")){\r
+-                entry.setField(field, document.getTitle());\r
+-            }\r
+-            if(field.equalsIgnoreCase("abstract")){\r
+-                entry.setField(field, document.getAbstract());\r
+-            }\r
+-            /*if(field.equalsIgnoreCase("keywords")){\r
+-                entry.setField(field, document.getKeyWords());\r
+-            }*/\r
+-            if(field.equalsIgnoreCase("doi")){\r
+-                entry.setField(field, document.getDoi());\r
+-            }\r
+-            /*if(field.equalsIgnoreCase("pages")){\r
+-                entry.setField(field, document.getPages());\r
+-            }\r
+-            if(field.equalsIgnoreCase("volume")){\r
+-                entry.setField(field, document.getVolume());\r
+-            }\r
+-            if(field.equalsIgnoreCase("number")){\r
+-                entry.setField(field, document.getNumber());\r
+-            }*/\r
+-            if(field.equalsIgnoreCase("year")){\r
+-                entry.setField(field, document.getYear());\r
+-            }\r
+-            /*if(field.equalsIgnoreCase("month")){\r
+-                entry.setField(field, document.getMonth());\r
+-            }\r
+-            if(field.equalsIgnoreCase("day")){\r
+-                entry.setField(field, document.getDay());\r
+-            }\r
+-            if(field.equalsIgnoreCase("booktitle")){\r
+-                entry.setField(field, document.getVenue());\r
+-            }\r
+-            if(field.equalsIgnoreCase("journal")){\r
+-                entry.setField(field, document.getVenue());\r
+-            }*/\r
+-        }\r
+-    }\r
+-\r
+-    private boolean fieldExists(String string) {\r
+-        return string != null && !string.isEmpty();\r
+-    }\r
+-\r
+     private BibtexEntry createNewEntry() {\r
\r
+         // Find out what type is wanted.\r
+--- a/src/java/spl/SplWebClient.java
++++ /dev/null
+@@ -1,196 +0,0 @@
+-package spl;\r
+-\r
+-import java.io.ByteArrayInputStream;\r
+-import java.io.File;\r
+-import java.io.FileInputStream;\r
+-import java.io.InputStream;\r
+-import java.io.UnsupportedEncodingException;\r
+-\r
+-import javax.ws.rs.core.MediaType;\r
+-import javax.xml.bind.JAXB;\r
+-\r
+-import org.sciplore.beans.Author;\r
+-import org.sciplore.beans.Document;\r
+-import org.sciplore.deserialize.creator.AuthorBeanCreator;\r
+-import org.sciplore.deserialize.creator.AuthorsBeanCreator;\r
+-import org.sciplore.deserialize.creator.DefaultStringCreator;\r
+-import org.sciplore.deserialize.creator.DocumentBeanCreator;\r
+-import org.sciplore.deserialize.creator.DocumentsBeanCreator;\r
+-import org.sciplore.deserialize.creator.ObjectCreator;\r
+-import org.sciplore.deserialize.creator.TitleBeanCreator;\r
+-import org.sciplore.deserialize.creator.YearBeanCreator;\r
+-import org.sciplore.deserialize.reader.ObjectCreatorMapper;\r
+-import org.sciplore.deserialize.reader.XmlResourceReader;\r
+-import org.sciplore.formatter.Bean;\r
+-import org.sciplore.formatter.SimpleTypeElementBean;\r
+-\r
+-import com.sun.jersey.api.client.Client;\r
+-import com.sun.jersey.api.client.ClientResponse;\r
+-import com.sun.jersey.api.client.WebResource;\r
+-import com.sun.jersey.multipart.FormDataMultiPart;\r
+-\r
+-/**\r
+- * Created by IntelliJ IDEA.\r
+- * User: Christoph Arbeit\r
+- * Date: 09.09.2010\r
+- * Time: 10:35:20\r
+- * To change this template use File | Settings | File Templates.\r
+- */\r
+-public class SplWebClient {\r
+-\r
+-    private static Client CLIENT = Client.create();\r
+-    static{\r
+-        CLIENT.setConnectTimeout(1000);\r
+-        CLIENT.setReadTimeout(70000);\r
+-    }\r
+-    private static WebResource WEBRESOURCE = CLIENT.resource( "http://api.mr-dlib.org/" );\r
+-    private static WebResource INTERNETRESOURCE = CLIENT.resource( "http://www.google.com" );\r
+-    //private static WebResource WEBRESOURCE = CLIENT.resource( "http://localhost:8080/rest/" );\r
+-\r
+-    public static Document metadata;\r
+-\r
+-    public static WebServiceStatus getMetaData(File file){\r
+-        try{\r
+-            if(isWebServiceAvailable() == false){\r
+-                if(isInternetAvailable()){\r
+-                    return  WebServiceStatus.WEBSERVICE_DOWN;\r
+-                }\r
+-                else{\r
+-                    return  WebServiceStatus.NO_INTERNET;\r
+-                }\r
+-            }\r
+-            if(isWebServiceOutDated()){\r
+-                return  WebServiceStatus.OUTDATED;\r
+-            }\r
+-            if(isMetaDataServiceAvailable() == false){\r
+-                return  WebServiceStatus.UNAVAILABLE;\r
+-            }\r
+-            FileInputStream fin = new FileInputStream(file);      \r
+-            byte[] data = new byte[(int)file.length()];          \r
+-            fin.read(data);           \r
+-            \r
+-            FormDataMultiPart formDataMultiPart = new FormDataMultiPart();            \r
+-            formDataMultiPart.field("file", data,  MediaType.APPLICATION_OCTET_STREAM_TYPE);            \r
+-            formDataMultiPart.field("source", "jabref",  MediaType.TEXT_PLAIN_TYPE);\r
+-            formDataMultiPart.field("filename", file.getName(), MediaType.TEXT_PLAIN_TYPE);\r
+-           \r
+-           \r
+-            ClientResponse response = WEBRESOURCE.path("documents").type(MediaType.MULTIPART_FORM_DATA_TYPE).post(ClientResponse.class, formDataMultiPart);\r
+-            //System.out.println(response.getEntity(String.class));\r
+-            if(response.getClientResponseStatus() == ClientResponse.Status.OK && response.hasEntity()){\r
+-                String entity = response.getEntity(String.class);\r
+-                byte[] bytes = new byte[0];\r
+-                try {\r
+-                    bytes = entity.getBytes("UTF-8");\r
+-                } catch (UnsupportedEncodingException e) {\r
+-                    return null;\r
+-                }\r
+-                InputStream is = new ByteArrayInputStream(bytes);\r
+-                if(is != null){\r
+-                      ObjectCreatorMapper resourceMapper = new ObjectCreatorMapper();\r
+-                      ObjectCreator stringCreator = new DefaultStringCreator();\r
+-                      // initialize Mapper    \r
+-                        resourceMapper.addCreator("documents", new DocumentsBeanCreator());\r
+-                        resourceMapper.addCreator("authors", new AuthorsBeanCreator());\r
+-                        resourceMapper.addCreator("document", new DocumentBeanCreator());\r
+-                        resourceMapper.addCreator("title", new TitleBeanCreator());\r
+-                        resourceMapper.addCreator("year", new YearBeanCreator());\r
+-                        resourceMapper.addCreator("author", new AuthorBeanCreator());\r
+-                        \r
+-                        resourceMapper.addCreator("name_first", stringCreator);\r
+-                        resourceMapper.addCreator("name_middle", stringCreator);\r
+-                        resourceMapper.addCreator("name_last", stringCreator);\r
+-                        resourceMapper.addCreator("name_last_prefix", stringCreator);\r
+-                        resourceMapper.addCreator("name_last_suffix", stringCreator);\r
+-                        \r
+-                        // initialize xml reader\r
+-                        XmlResourceReader<?> reader = new XmlResourceReader(resourceMapper);\r
+-                        \r
+-                        // parse given file -> create object tree\r
+-                        Document docs =  (Document)reader.parse(is);\r
+-                        for(Bean author : docs.getAuthors().getCollection()){\r
+-                                Author temp = (Author)author;\r
+-                                System.out.println(((SimpleTypeElementBean)temp.getName_Last()).getValue() + " " + temp.getRank());\r
+-                        }\r
+-                   // XmlDocuments documents = JAXB.unmarshal(is, XmlDocuments.class);\r
+-                    SplWebClient.metadata = docs;\r
+-                    return WebServiceStatus.OK;\r
+-                }\r
+-                else{\r
+-                    return WebServiceStatus.NO_METADATA;\r
+-                }\r
+-            }\r
+-            if(response.getClientResponseStatus() == ClientResponse.Status.SERVICE_UNAVAILABLE){\r
+-                return  WebServiceStatus.UNAVAILABLE;\r
+-            }\r
+-        }catch(Exception e){\r
+-            System.out.println(Tools.getStackTraceAsString(e));\r
+-            //Todo logging\r
+-        }\r
+-        return WebServiceStatus.NO_METADATA;\r
+-    }\r
+-\r
+-    public static boolean isWebServiceOutDated(){\r
+-        try{\r
+-            ClientResponse response =  WEBRESOURCE.path("service/versioncheck/" + Tools.WEBSERVICE_APP_ID + "/current").get(ClientResponse.class);\r
+-            if(response.getClientResponseStatus() == ClientResponse.Status.OK && response.hasEntity()){\r
+-                String entity = response.getEntity(String.class);\r
+-                byte[] bytes = entity.getBytes();\r
+-                InputStream is = new ByteArrayInputStream(bytes);\r
+-                if(is != null){\r
+-                    /*XmlApplication app = JAXB.unmarshal(is, XmlApplication.class);\r
+-                    if(app != null){\r
+-                        if(app.getVersion() != null && !app.getVersion().equalsIgnoreCase(Tools.WEBSERVICE_VERSION_SHORT)){\r
+-                            return true;\r
+-                        }\r
+-                    }*/\r
+-                }\r
+-            }\r
+-        }catch(Exception e){\r
+-            //Todo logging\r
+-        }\r
+-        return false;\r
+-    }\r
+-\r
+-    public static boolean isMetaDataServiceAvailable(){\r
+-        try{\r
+-            ClientResponse response =  WEBRESOURCE.path("service/metadata/available").get(ClientResponse.class);\r
+-            if(response.getClientResponseStatus() == ClientResponse.Status.OK && response.hasEntity()){\r
+-                String entity = response.getEntity(String.class);\r
+-                if(entity != null && entity.equalsIgnoreCase("false")){\r
+-                    return false;\r
+-                }\r
+-            }\r
+-        }catch(Exception e){\r
+-            //Todo logging\r
+-        }\r
+-        return true;\r
+-    }\r
+-\r
+-    public static boolean isWebServiceAvailable(){\r
+-        try{\r
+-            ClientResponse response =  WEBRESOURCE.path("service/metadata/available").get(ClientResponse.class);\r
+-        }catch(Exception e){\r
+-            return false;\r
+-        }\r
+-        return true;\r
+-    }\r
+-\r
+-    public static boolean isInternetAvailable(){\r
+-        try{\r
+-            ClientResponse response =  INTERNETRESOURCE.get(ClientResponse.class);\r
+-        }catch(Exception e){\r
+-            return false;\r
+-        }\r
+-        return true;\r
+-    }\r
+-\r
+-    public enum WebServiceStatus {\r
+-        OK,\r
+-        NO_METADATA,\r
+-        UNAVAILABLE,\r
+-        OUTDATED,\r
+-        WEBSERVICE_DOWN,\r
+-        NO_INTERNET\r
+-    }\r
+-}\r
+--- a/src/java/spl/gui/ImportDialog.java
++++ b/src/java/spl/gui/ImportDialog.java
+@@ -20,9 +20,7 @@
+       public final static int NOMETA = 0;\r
+       public final static int XMP = 1;\r
+       public final static int CONTENT = 2;\r
+-      public final static int MRDLIB = 3;\r
+       public final static int ONLYATTACH = 4;\r
+-      public final static int UPDATEEMPTYFIELDS = 5;\r
+       \r
+     private JPanel contentPane;\r
+     private JLabel labelSubHeadline;\r
+@@ -32,14 +30,10 @@
+       private JCheckBox useDefaultPDFImportStyle;\r
+     private JRadioButton radioButtonXmp;\r
+       private JRadioButton radioButtonPDFcontent;\r
+-    private JRadioButton radioButtonMrDlib;\r
+     private JRadioButton radioButtonNoMeta;\r
+     private JLabel labelHeadline;\r
+     private JLabel labelFileName;\r
+     private JRadioButton radioButtononlyAttachPDF;\r
+-    private JRadioButton radioButtonUpdateEmptyFields;\r
+-    private JLabel labelMrDlib1;\r
+-    private JLabel labelMrDlib2;\r
+     private int result;\r
+     private int dropRow;\r
+     private String fileName;\r
+@@ -71,15 +65,7 @@
+         radioButtonNoMeta = new JRadioButton(Globals.lang("Create_blank_entry_linking_the_PDF"));\r
+         radioButtonXmp = new JRadioButton(Globals.lang("Create_entry_based_on_XMP_data"));\r
+         radioButtonPDFcontent = new JRadioButton(Globals.lang("Create_entry_based_on_content"));\r
+-        radioButtonMrDlib = new JRadioButton(Globals.lang("Create_entry_based_on_data_fetched_from"));\r
+         radioButtononlyAttachPDF = new JRadioButton(Globals.lang("Only_attach_PDF"));\r
+-        radioButtonUpdateEmptyFields = new JRadioButton(Globals.lang("Update_empty_fields_with_data_fetched_from"));\r
+-        labelMrDlib1 = new JLabel("Mr._dLib");\r
+-        labelMrDlib1.setFont(new Font(labelMrDlib1.getFont().getName(), Font.BOLD, 13));\r
+-        labelMrDlib1.setForeground(new Color(-16776961));\r
+-        labelMrDlib2 = new JLabel("Mr._dLib");\r
+-        labelMrDlib2.setFont(new Font(labelMrDlib1.getFont().getName(), Font.BOLD, 13));\r
+-        labelMrDlib2.setForeground(new Color(-16776961));\r
+         buttonOK = new JButton(Globals.lang("Ok"));\r
+         buttonCancel = new JButton(Globals.lang("Cancel"));\r
+         checkBoxDoNotShowAgain = new JCheckBox(Globals.lang("Do not show this box again for this import"));\r
+@@ -89,12 +75,8 @@
+         b.append(radioButtonNoMeta, 3);\r
+         b.append(radioButtonXmp, 3);\r
+         b.append(radioButtonPDFcontent, 3);\r
+-        b.append(radioButtonMrDlib);\r
+-        b.append(labelMrDlib1);\r
+         b.appendSeparator(Globals.lang("Update_Existing_Entry"));\r
+         b.append(radioButtononlyAttachPDF, 3);\r
+-        b.append(radioButtonUpdateEmptyFields);\r
+-        b.append(labelMrDlib2);\r
+         b.nextLine();\r
+         b.append(checkBoxDoNotShowAgain);\r
+         b.append(useDefaultPDFImportStyle);\r
+@@ -114,8 +96,6 @@
+         //this.setText();\r
+         if (this.dropRow < 0) {\r
+             this.radioButtononlyAttachPDF.setEnabled(false);\r
+-            this.radioButtonUpdateEmptyFields.setEnabled(false);\r
+-            this.labelMrDlib2.setEnabled(false);\r
+         }\r
+         this.fileName = fileName;\r
+         String name = new File(this.fileName).getName();\r
+@@ -124,8 +104,6 @@
+         } else {\r
+             this.labelFileName.setText(new File(this.fileName).getName().substring(0, 33) + "...");\r
+         }\r
+-        this.labelMrDlib1.addMouseListener(new LabelLinkListener(this.labelMrDlib1, "www.mr-dlib.org/docs/pdf_metadata_extraction.php"));\r
+-        this.labelMrDlib2.addMouseListener(new LabelLinkListener(this.labelMrDlib2, "www.mr-dlib.org/docs/pdf_metadata_extraction.php"));\r
+         this.setTitle(LocalizationSupport.message("Import_Metadata_From_PDF"));\r
\r
+         setModal(true);\r
+@@ -136,9 +114,7 @@
+         bg.add(radioButtonNoMeta);\r
+         bg.add(radioButtonXmp);\r
+         bg.add(radioButtonPDFcontent);\r
+-        bg.add(radioButtonMrDlib);\r
+         bg.add(radioButtononlyAttachPDF);\r
+-        bg.add(radioButtonUpdateEmptyFields);\r
\r
+         buttonOK.addActionListener(new ActionListener() {\r
+             public void actionPerformed(ActionEvent e) {\r
+@@ -175,15 +151,9 @@
+               case CONTENT:\r
+                       radioButtonPDFcontent.setSelected(true);\r
+                       break;\r
+-              case MRDLIB:\r
+-                      radioButtonMrDlib.setSelected(true);\r
+-                      break;\r
+               case ONLYATTACH:\r
+                       radioButtononlyAttachPDF.setSelected(true);\r
+                       break;\r
+-              case UPDATEEMPTYFIELDS:\r
+-                      radioButtonUpdateEmptyFields.setSelected(true);\r
+-                      break;\r
+               default:\r
+                       // fallback\r
+                       radioButtonPDFcontent.setSelected(true);\r
+@@ -218,14 +188,10 @@
+               return XMP;\r
+       else if (radioButtonPDFcontent.isSelected())\r
+               return CONTENT;\r
+-      else if (radioButtonMrDlib.isSelected())\r
+-              return MRDLIB;\r
+       else if (radioButtonNoMeta.isSelected())\r
+               return NOMETA;\r
+       else if (radioButtononlyAttachPDF.isSelected())\r
+               return ONLYATTACH;\r
+-      else if (radioButtonUpdateEmptyFields.isSelected())\r
+-              return UPDATEEMPTYFIELDS;\r
+       else throw new IllegalStateException();\r
+     }\r
\r
+--- a/src/java/spl/gui/MetaDataListDialog.java
++++ /dev/null
+@@ -1,314 +0,0 @@
+-package spl.gui;\r
+-\r
+-\r
+-import java.awt.BorderLayout;\r
+-import java.awt.CardLayout;\r
+-import java.awt.Color;\r
+-import java.awt.Component;\r
+-import java.awt.Dimension;\r
+-import java.awt.Font;\r
+-import java.awt.event.ActionEvent;\r
+-import java.awt.event.ActionListener;\r
+-import java.awt.event.KeyEvent;\r
+-import java.awt.event.WindowAdapter;\r
+-import java.awt.event.WindowEvent;\r
+-import java.io.File;\r
+-import java.io.IOException;\r
+-import java.util.List;\r
+-import java.util.Vector;\r
+-\r
+-import javax.swing.BorderFactory;\r
+-import javax.swing.ImageIcon;\r
+-import javax.swing.JButton;\r
+-import javax.swing.JComponent;\r
+-import javax.swing.JDialog;\r
+-import javax.swing.JLabel;\r
+-import javax.swing.JOptionPane;\r
+-import javax.swing.JPanel;\r
+-import javax.swing.JScrollPane;\r
+-import javax.swing.JTable;\r
+-import javax.swing.KeyStroke;\r
+-import javax.swing.ListSelectionModel;\r
+-import javax.swing.SwingWorker;\r
+-import javax.swing.table.DefaultTableModel;\r
+-\r
+-import net.sf.jabref.Globals;\r
+-import net.sf.jabref.MetaData;\r
+-import net.sf.jabref.Util;\r
+-\r
+-import org.sciplore.beans.Document;\r
+-\r
+-import spl.DocumentsWrapper;\r
+-import spl.SplWebClient;\r
+-import spl.listener.LabelLinkListener;\r
+-import spl.localization.LocalizationSupport;\r
+-\r
+-import com.jgoodies.forms.builder.ButtonBarBuilder;\r
+-\r
+-public class MetaDataListDialog extends JDialog {\r
+-    private JPanel contentPane;\r
+-    private JTable tableMetadata;\r
+-    private JButton buttonOK;\r
+-    private JButton buttonCancel;\r
+-    private JScrollPane scrollPane;\r
+-    private JPanel panelWait;\r
+-    private JLabel labelFetch;\r
+-    private JLabel iconLabel;\r
+-    private JButton blankButton;\r
+-    private JLabel labelLogo;\r
+-    private JButton moreInformationButton;\r
+-    private JPanel panelMetadata;\r
+-    private DefaultTableModel tableModel;\r
+-    private int result;\r
+-    private Document xmlDocuments;\r
+-    private String fileName;\r
+-    private SplWebClient.WebServiceStatus webserviceStatus;\r
+-    private Component thisDialog;\r
+-    private boolean showBlankButton;\r
+-    private CardLayout cardLayou = new CardLayout();\r
+-\r
+-    public MetaDataListDialog(String fileName, boolean showBlankButton) {\r
+-        $$$setupUI$$$();\r
+-        this.showBlankButton = showBlankButton;\r
+-        this.thisDialog = this;\r
+-        this.fileName = fileName;\r
+-        this.labelLogo.addMouseListener(new LabelLinkListener(this.labelLogo, "www.mr-dlib.org"));\r
+-        this.setTitle(LocalizationSupport.message("Mr._dLib_Metadata_Entries_Associated_With_PDF_File"));\r
+-        this.tableMetadata.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);\r
+-        setContentPane(contentPane);\r
+-        pack();\r
+-        setModal(true);\r
+-        getRootPane().setDefaultButton(buttonOK);\r
+-\r
+-        buttonOK.addActionListener(new ActionListener() {\r
+-            public void actionPerformed(ActionEvent e) {\r
+-                onOK();\r
+-            }\r
+-        });\r
+-\r
+-        buttonCancel.addActionListener(new ActionListener() {\r
+-            public void actionPerformed(ActionEvent e) {\r
+-                onCancel();\r
+-            }\r
+-        });\r
+-\r
+-        blankButton.addActionListener(new ActionListener() {\r
+-            public void actionPerformed(ActionEvent e) {\r
+-                onBlank();\r
+-            }\r
+-        });\r
+-\r
+-        moreInformationButton.addActionListener(new ActionListener() {\r
+-            public void actionPerformed(ActionEvent e) {\r
+-                onInfo();\r
+-            }\r
+-        });\r
+-\r
+-        setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);\r
+-        addWindowListener(new WindowAdapter() {\r
+-            public void windowClosing(WindowEvent e) {\r
+-                onCancel();\r
+-            }\r
+-        });\r
+-\r
+-        contentPane.registerKeyboardAction(new ActionListener() {\r
+-            public void actionPerformed(ActionEvent e) {\r
+-                onCancel();\r
+-            }\r
+-        }, KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);\r
+-\r
+-        cardLayou.show(panelMetadata, "panelWait");\r
+-        //this.scrollPane.setVisible(false);\r
+-        //this.blankButton.setVisible(false);\r
+-        this.moreInformationButton.setVisible(true);\r
+-        this.setSize(616, 366);\r
+-    }\r
+-\r
+-    private void onInfo() {\r
+-        try {\r
+-            Util.openExternalViewer(new MetaData(), "http://www.mr-dlib.org/docs/jabref_metadata_extraction_alpha.php", "url");\r
+-        } catch (IOException exc) {\r
+-            exc.printStackTrace();\r
+-        }\r
+-    }\r
+-\r
+-    private void onBlank() {\r
+-        this.result = JOptionPane.NO_OPTION;\r
+-        dispose();\r
+-    }\r
+-\r
+-    private void onOK() {\r
+-        this.result = JOptionPane.OK_OPTION;\r
+-        dispose();\r
+-    }\r
+-\r
+-    private void onCancel() {\r
+-        this.result = JOptionPane.CANCEL_OPTION;\r
+-        dispose();\r
+-    }\r
+-\r
+-    public void showDialog() {\r
+-        SwingWorker worker = new SwingWorker<Void, Void>() {\r
+-            @Override\r
+-            public Void doInBackground() {\r
+-                System.out.println("Starting Webclient...");\r
+-                webserviceStatus = SplWebClient.getMetaData(new File(fileName));\r
+-                return null;\r
+-            }\r
+-\r
+-            @Override\r
+-            public void done() {\r
+-                if (webserviceStatus == SplWebClient.WebServiceStatus.OK) {\r
+-                    xmlDocuments = SplWebClient.metadata;\r
+-                    if (xmlDocuments != null /*&& xmlDocuments.getDocuments() != null && xmlDocuments.getDocuments().size() > 0*/) {\r
+-                        DocumentsWrapper documents = new DocumentsWrapper(xmlDocuments);\r
+-                        List<Vector> vectorList = documents.getDocuments();\r
+-                        for (Vector vector : vectorList) {\r
+-                            tableModel.addRow(vector);\r
+-                        }\r
+-\r
+-                        tableMetadata.getSelectionModel().setSelectionInterval(0, 0);\r
+-                        cardLayou.show(panelMetadata, "scrollPane");\r
+-                        //panelWait.setVisible(false);\r
+-                        //scrollPane.setVisible(true);\r
+-                        moreInformationButton.setVisible(true);\r
+-                    } else {\r
+-                        iconLabel.setVisible(false);\r
+-                        labelFetch.setText(LocalizationSupport.message("No_metadata_found."));\r
+-                        blankButton.setVisible(showBlankButton);\r
+-                    }\r
+-                }\r
+-                if (webserviceStatus == SplWebClient.WebServiceStatus.NO_METADATA) {\r
+-                    iconLabel.setVisible(false);\r
+-                    labelFetch.setText(LocalizationSupport.message("No_metadata_found."));\r
+-                    blankButton.setVisible(showBlankButton);\r
+-                }\r
+-                if (webserviceStatus == SplWebClient.WebServiceStatus.UNAVAILABLE) {\r
+-                    iconLabel.setVisible(false);\r
+-                    labelFetch.setText(LocalizationSupport.message("Mr._dLib_web_service_is_temporarily_unavailable."));\r
+-                    blankButton.setVisible(showBlankButton);\r
+-                }\r
+-                if (webserviceStatus == SplWebClient.WebServiceStatus.OUTDATED) {\r
+-                    iconLabel.setVisible(false);\r
+-                    labelFetch.setText(LocalizationSupport.message("The_Mr._dLib_web_service_version_you_trying_to_access_is_outdated."));\r
+-                    blankButton.setVisible(showBlankButton);\r
+-                    JOptionPane.showMessageDialog(thisDialog, LocalizationSupport.message("This_JabRef_version_is_trying_to_access_an_old_version_of_Mr._dLib's_webservice_that_is_not_working_any_more.\nPlease_visit_http://jabref.sourceforge.net_or_http://www.mr-dlib.org_for_more_information_and_updates."), LocalizationSupport.message("Web_Service_Version_Outdated"), JOptionPane.INFORMATION_MESSAGE);\r
+-                }\r
+-                if (webserviceStatus == SplWebClient.WebServiceStatus.WEBSERVICE_DOWN) {\r
+-                    iconLabel.setVisible(false);\r
+-                    labelFetch.setText(LocalizationSupport.message("Mr._dLib_web_service_is_temporarily_down._Please_try_again_later."));\r
+-                    blankButton.setVisible(showBlankButton);\r
+-                }\r
+-                if (webserviceStatus == SplWebClient.WebServiceStatus.NO_INTERNET) {\r
+-                    iconLabel.setVisible(false);\r
+-                    labelFetch.setText(LocalizationSupport.message("No_Internet_Connection."));\r
+-                    blankButton.setVisible(showBlankButton);\r
+-                    JOptionPane.showMessageDialog(thisDialog, LocalizationSupport.message("You_are_not_connected_to_the_Internet._To_access_Mr._dLib_web_service_an_internet_connection_is_needed."), LocalizationSupport.message("No_Internet_Connection."), JOptionPane.INFORMATION_MESSAGE);\r
+-                }\r
+-            }\r
+-        };\r
+-        worker.execute();\r
+-        this.