public final BELScriptParser.define_annotation_return define_annotation() throws RecognitionException {
        BELScriptParser.define_annotation_return retval = new BELScriptParser.define_annotation_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        Token vl=null;
        Token string_literal40=null;
        Token string_literal41=null;
        Token OBJECT_IDENT42=null;
        Token string_literal43=null;
        Token set44=null;
        Token string_literal46=null;
        BELScriptParser.quoted_value_return quoted_value45 = null;


        Object vl_tree=null;
        Object string_literal40_tree=null;
        Object string_literal41_tree=null;
        Object OBJECT_IDENT42_tree=null;
        Object string_literal43_tree=null;
        Object set44_tree=null;
        Object string_literal46_tree=null;

         paraphrases.push("in define annotation."); 
        try {
            // BELScript.g:105:5: ( ( 'DEFINE' 'ANNOTATION' ) OBJECT_IDENT 'AS' ( ( ( 'URL' | 'PATTERN' ) quoted_value ) | ( 'LIST' vl= VALUE_LIST ) ) )
            // BELScript.g:106:5: ( 'DEFINE' 'ANNOTATION' ) OBJECT_IDENT 'AS' ( ( ( 'URL' | 'PATTERN' ) quoted_value ) | ( 'LIST' vl= VALUE_LIST ) )
            {
            root_0 = (Object)adaptor.nil();

            // BELScript.g:106:5: ( 'DEFINE' 'ANNOTATION' )
            // BELScript.g:106:6: 'DEFINE' 'ANNOTATION'
            {
            string_literal40=(Token)match(input,27,FOLLOW_27_in_define_annotation487); 
            string_literal40_tree = (Object)adaptor.create(string_literal40);
            adaptor.addChild(root_0, string_literal40_tree);

            string_literal41=(Token)match(input,32,FOLLOW_32_in_define_annotation489); 
            string_literal41_tree = (Object)adaptor.create(string_literal41);
            adaptor.addChild(root_0, string_literal41_tree);


            }

            OBJECT_IDENT42=(Token)match(input,OBJECT_IDENT,FOLLOW_OBJECT_IDENT_in_define_annotation492); 
            OBJECT_IDENT42_tree = (Object)adaptor.create(OBJECT_IDENT42);
            adaptor.addChild(root_0, OBJECT_IDENT42_tree);

            string_literal43=(Token)match(input,30,FOLLOW_30_in_define_annotation494); 
            string_literal43_tree = (Object)adaptor.create(string_literal43);
            adaptor.addChild(root_0, string_literal43_tree);

            // BELScript.g:106:47: ( ( ( 'URL' | 'PATTERN' ) quoted_value ) | ( 'LIST' vl= VALUE_LIST ) )
            int alt7=2;
            int LA7_0 = input.LA(1);

            if ( (LA7_0==31||LA7_0==33) ) {
                alt7=1;
            }
            else if ( (LA7_0==34) ) {
                alt7=2;
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 7, 0, input);

                throw nvae;
            }
            switch (alt7) {
                case 1 :
                    // BELScript.g:106:48: ( ( 'URL' | 'PATTERN' ) quoted_value )
                    {
                    // BELScript.g:106:48: ( ( 'URL' | 'PATTERN' ) quoted_value )
                    // BELScript.g:106:49: ( 'URL' | 'PATTERN' ) quoted_value
                    {
                    set44=(Token)input.LT(1);
                    if ( input.LA(1)==31||input.LA(1)==33 ) {
                        input.consume();
                        adaptor.addChild(root_0, (Object)adaptor.create(set44));
                        state.errorRecovery=false;
                    }
                    else {
                        MismatchedSetException mse = new MismatchedSetException(null,input);
                        throw mse;
                    }

                    pushFollow(FOLLOW_quoted_value_in_define_annotation506);
                    quoted_value45=quoted_value();

                    state._fsp--;

                    adaptor.addChild(root_0, quoted_value45.getTree());

                    }


                    }
                    break;
                case 2 :
                    // BELScript.g:106:85: ( 'LIST' vl= VALUE_LIST )
                    {
                    // BELScript.g:106:85: ( 'LIST' vl= VALUE_LIST )
                    // BELScript.g:106:86: 'LIST' vl= VALUE_LIST
                    {
                    string_literal46=(Token)match(input,34,FOLLOW_34_in_define_annotation512); 
                    string_literal46_tree = (Object)adaptor.create(string_literal46);
                    adaptor.addChild(root_0, string_literal46_tree);

                    vl=(Token)match(input,VALUE_LIST,FOLLOW_VALUE_LIST_in_define_annotation516); 
                    vl_tree = (Object)adaptor.create(vl);
                    adaptor.addChild(root_0, vl_tree);


                    }


                    }
                    break;

            }


                    // https://github.com/OpenBEL/openbel-framework/issues/14
                    if (vl != null) vl.setText(vl.getText().replace("\\\\", "\\"));
                

            }

            retval.stop = input.LT(-1);

            retval.tree = (Object)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

             paraphrases.pop(); 
        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
public final BELScriptParser . define_annotation_return define_annotation ( ) throws RecognitionException { BELScriptParser . define_annotation_return retval = new BELScriptParser . define_annotation_return ( ) ; retval . start = input . LT ( 1 ) ; Object root_0 = null ; Token vl = null ; Token string_literal40 = null ; Token string_literal41 = null ; Token OBJECT_IDENT42 = null ; Token string_literal43 = null ; Token set44 = null ; Token string_literal46 = null ; BELScriptParser . quoted_value_return quoted_value45 = null ; Object vl_tree = null ; Object string_literal40_tree = null ; Object string_literal41_tree = null ; Object OBJECT_IDENT42_tree = null ; Object string_literal43_tree = null ; Object set44_tree = null ; Object string_literal46_tree = null ; paraphrases . push ( "in define annotation." ) ; try { { root_0 = ( Object ) adaptor . nil ( ) ; { string_literal40 = ( Token ) match ( input , 27 , FOLLOW_27_in_define_annotation487 ) ; string_literal40_tree = ( Object ) adaptor . create ( string_literal40 ) ; adaptor . addChild ( root_0 , string_literal40_tree ) ; string_literal41 = ( Token ) match ( input , 32 , FOLLOW_32_in_define_annotation489 ) ; string_literal41_tree = ( Object ) adaptor . create ( string_literal41 ) ; adaptor . addChild ( root_0 , string_literal41_tree ) ; } OBJECT_IDENT42 = ( Token ) match ( input , OBJECT_IDENT , FOLLOW_OBJECT_IDENT_in_define_annotation492 ) ; OBJECT_IDENT42_tree = ( Object ) adaptor . create ( OBJECT_IDENT42 ) ; adaptor . addChild ( root_0 , OBJECT_IDENT42_tree ) ; string_literal43 = ( Token ) match ( input , 30 , FOLLOW_30_in_define_annotation494 ) ; string_literal43_tree = ( Object ) adaptor . create ( string_literal43 ) ; adaptor . addChild ( root_0 , string_literal43_tree ) ; int alt7 = 2 ; int LA7_0 = input . LA ( 1 ) ; if ( ( LA7_0 == 31 || LA7_0 == 33 ) ) { alt7 = 1 ; } else if ( ( LA7_0 == 34 ) ) { alt7 = 2 ; } else { NoViableAltException nvae = new NoViableAltException ( "" , 7 , 0 , input ) ; throw nvae ; } switch ( alt7 ) { case 1 : { { set44 = ( Token ) input . LT ( 1 ) ; if ( input . LA ( 1 ) == 31 || input . LA ( 1 ) == 33 ) { input . consume ( ) ; adaptor . addChild ( root_0 , ( Object ) adaptor . create ( set44 ) ) ; state . errorRecovery = false ; } else { MismatchedSetException mse = new MismatchedSetException ( null , input ) ; throw mse ; } pushFollow ( FOLLOW_quoted_value_in_define_annotation506 ) ; quoted_value45 = quoted_value ( ) ; state . _fsp -- ; adaptor . addChild ( root_0 , quoted_value45 . getTree ( ) ) ; } } break ; case 2 : { { string_literal46 = ( Token ) match ( input , 34 , FOLLOW_34_in_define_annotation512 ) ; string_literal46_tree = ( Object ) adaptor . create ( string_literal46 ) ; adaptor . addChild ( root_0 , string_literal46_tree ) ; vl = ( Token ) match ( input , VALUE_LIST , FOLLOW_VALUE_LIST_in_define_annotation516 ) ; vl_tree = ( Object ) adaptor . create ( vl ) ; adaptor . addChild ( root_0 , vl_tree ) ; } } break ; } if ( vl != null ) vl . setText ( vl . getText ( ) . replace ( "\\\\" , "\\" ) ) ; } retval . stop = input . LT ( - 1 ) ; retval . tree = ( Object ) adaptor . rulePostProcessing ( root_0 ) ; adaptor . setTokenBoundaries ( retval . tree , retval . start , retval . stop ) ; paraphrases . pop ( ) ; } catch ( RecognitionException re ) { reportError ( re ) ; recover ( input , re ) ; retval . tree = ( Object ) adaptor . errorNode ( input , retval . start , input . LT ( - 1 ) , re ) ; } finally { } return retval ; }
BELScript.g:102:1: define_annotation : ( 'DEFINE' 'ANNOTATION' ) OBJECT_IDENT 'AS' ( ( ( 'URL' | 'PATTERN' ) quoted_value ) | ( 'LIST' vl= VALUE_LIST ) ) ;