public final BELScriptWalker.set_document_return set_document() throws RecognitionException {
        BELScriptWalker.set_document_return retval = new BELScriptWalker.set_document_return();
        retval.start = input.LT(1);

        CommonTree root_0 = null;

        CommonTree _first_0 = null;
        CommonTree _last = null;

        CommonTree dkt=null;
        CommonTree qv=null;
        CommonTree oi=null;
        CommonTree string_literal13=null;
        CommonTree char_literal14=null;
        BELScriptWalker.document_property_return prop = null;


        CommonTree dkt_tree=null;
        CommonTree qv_tree=null;
        CommonTree oi_tree=null;
        CommonTree string_literal13_tree=null;
        CommonTree char_literal14_tree=null;

        try {
            // BELScriptWalker.g:121:13: ( ( 'SET' dkt= DOCUMENT_KEYWORD ) prop= document_property '=' (qv= QUOTED_VALUE | oi= OBJECT_IDENT ) )
            // BELScriptWalker.g:122:5: ( 'SET' dkt= DOCUMENT_KEYWORD ) prop= document_property '=' (qv= QUOTED_VALUE | oi= OBJECT_IDENT )
            {
            root_0 = (CommonTree)adaptor.nil();

            // BELScriptWalker.g:122:5: ( 'SET' dkt= DOCUMENT_KEYWORD )
            // BELScriptWalker.g:122:6: 'SET' dkt= DOCUMENT_KEYWORD
            {
            _last = (CommonTree)input.LT(1);
            string_literal13=(CommonTree)match(input,24,FOLLOW_24_in_set_document144); 
            string_literal13_tree = (CommonTree)adaptor.dupNode(string_literal13);

            adaptor.addChild(root_0, string_literal13_tree);

            _last = (CommonTree)input.LT(1);
            dkt=(CommonTree)match(input,DOCUMENT_KEYWORD,FOLLOW_DOCUMENT_KEYWORD_in_set_document148); 
            dkt_tree = (CommonTree)adaptor.dupNode(dkt);

            adaptor.addChild(root_0, dkt_tree);


            }

            _last = (CommonTree)input.LT(1);
            pushFollow(FOLLOW_document_property_in_set_document153);
            prop=document_property();

            state._fsp--;

            adaptor.addChild(root_0, prop.getTree());
            _last = (CommonTree)input.LT(1);
            char_literal14=(CommonTree)match(input,25,FOLLOW_25_in_set_document155); 
            char_literal14_tree = (CommonTree)adaptor.dupNode(char_literal14);

            adaptor.addChild(root_0, char_literal14_tree);

            // BELScriptWalker.g:122:61: (qv= QUOTED_VALUE | oi= OBJECT_IDENT )
            int alt3=2;
            int LA3_0 = input.LA(1);

            if ( (LA3_0==QUOTED_VALUE) ) {
                alt3=1;
            }
            else if ( (LA3_0==OBJECT_IDENT) ) {
                alt3=2;
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 3, 0, input);

                throw nvae;
            }
            switch (alt3) {
                case 1 :
                    // BELScriptWalker.g:122:62: qv= QUOTED_VALUE
                    {
                    _last = (CommonTree)input.LT(1);
                    qv=(CommonTree)match(input,QUOTED_VALUE,FOLLOW_QUOTED_VALUE_in_set_document160); 
                    qv_tree = (CommonTree)adaptor.dupNode(qv);

                    adaptor.addChild(root_0, qv_tree);


                    }
                    break;
                case 2 :
                    // BELScriptWalker.g:122:80: oi= OBJECT_IDENT
                    {
                    _last = (CommonTree)input.LT(1);
                    oi=(CommonTree)match(input,OBJECT_IDENT,FOLLOW_OBJECT_IDENT_in_set_document166); 
                    oi_tree = (CommonTree)adaptor.dupNode(oi);

                    adaptor.addChild(root_0, oi_tree);


                    }
                    break;

            }


                    if (!annotationContext.isEmpty() || !stmtlist.isEmpty()) {
                        addError(new SetDocumentPropertiesFirstException(dkt.getLine(), dkt.getCharPositionInLine()));
                    }

                    final String keywordValue;
                    if (qv != null) {
                        keywordValue = qv.toString();
                    } else if (oi != null) {
                        keywordValue = oi.toString();
                    } else {
                        throw new IllegalStateException("Did not understand document keyword value, expecting quoted value or object identifier.");
                    }

                    docprop.put(prop.r, keywordValue);
                    lastDocumentPropertyLocation = dkt.getLine();
                

            }

            retval.tree = (CommonTree)adaptor.rulePostProcessing(root_0);

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return retval;
    }
public final BELScriptWalker . set_document_return set_document ( ) throws RecognitionException { BELScriptWalker . set_document_return retval = new BELScriptWalker . set_document_return ( ) ; retval . start = input . LT ( 1 ) ; CommonTree root_0 = null ; CommonTree _first_0 = null ; CommonTree _last = null ; CommonTree dkt = null ; CommonTree qv = null ; CommonTree oi = null ; CommonTree string_literal13 = null ; CommonTree char_literal14 = null ; BELScriptWalker . document_property_return prop = null ; CommonTree dkt_tree = null ; CommonTree qv_tree = null ; CommonTree oi_tree = null ; CommonTree string_literal13_tree = null ; CommonTree char_literal14_tree = null ; try { { root_0 = ( CommonTree ) adaptor . nil ( ) ; { _last = ( CommonTree ) input . LT ( 1 ) ; string_literal13 = ( CommonTree ) match ( input , 24 , FOLLOW_24_in_set_document144 ) ; string_literal13_tree = ( CommonTree ) adaptor . dupNode ( string_literal13 ) ; adaptor . addChild ( root_0 , string_literal13_tree ) ; _last = ( CommonTree ) input . LT ( 1 ) ; dkt = ( CommonTree ) match ( input , DOCUMENT_KEYWORD , FOLLOW_DOCUMENT_KEYWORD_in_set_document148 ) ; dkt_tree = ( CommonTree ) adaptor . dupNode ( dkt ) ; adaptor . addChild ( root_0 , dkt_tree ) ; } _last = ( CommonTree ) input . LT ( 1 ) ; pushFollow ( FOLLOW_document_property_in_set_document153 ) ; prop = document_property ( ) ; state . _fsp -- ; adaptor . addChild ( root_0 , prop . getTree ( ) ) ; _last = ( CommonTree ) input . LT ( 1 ) ; char_literal14 = ( CommonTree ) match ( input , 25 , FOLLOW_25_in_set_document155 ) ; char_literal14_tree = ( CommonTree ) adaptor . dupNode ( char_literal14 ) ; adaptor . addChild ( root_0 , char_literal14_tree ) ; int alt3 = 2 ; int LA3_0 = input . LA ( 1 ) ; if ( ( LA3_0 == QUOTED_VALUE ) ) { alt3 = 1 ; } else if ( ( LA3_0 == OBJECT_IDENT ) ) { alt3 = 2 ; } else { NoViableAltException nvae = new NoViableAltException ( "" , 3 , 0 , input ) ; throw nvae ; } switch ( alt3 ) { case 1 : { _last = ( CommonTree ) input . LT ( 1 ) ; qv = ( CommonTree ) match ( input , QUOTED_VALUE , FOLLOW_QUOTED_VALUE_in_set_document160 ) ; qv_tree = ( CommonTree ) adaptor . dupNode ( qv ) ; adaptor . addChild ( root_0 , qv_tree ) ; } break ; case 2 : { _last = ( CommonTree ) input . LT ( 1 ) ; oi = ( CommonTree ) match ( input , OBJECT_IDENT , FOLLOW_OBJECT_IDENT_in_set_document166 ) ; oi_tree = ( CommonTree ) adaptor . dupNode ( oi ) ; adaptor . addChild ( root_0 , oi_tree ) ; } break ; } if ( ! annotationContext . isEmpty ( ) || ! stmtlist . isEmpty ( ) ) { addError ( new SetDocumentPropertiesFirstException ( dkt . getLine ( ) , dkt . getCharPositionInLine ( ) ) ) ; } final String keywordValue ; if ( qv != null ) { keywordValue = qv . toString ( ) ; } else if ( oi != null ) { keywordValue = oi . toString ( ) ; } else { throw new IllegalStateException ( "Did not understand document keyword value, expecting quoted value or object identifier." ) ; } docprop . put ( prop . r , keywordValue ) ; lastDocumentPropertyLocation = dkt . getLine ( ) ; } retval . tree = ( CommonTree ) adaptor . rulePostProcessing ( root_0 ) ; } catch ( RecognitionException re ) { reportError ( re ) ; recover ( input , re ) ; } finally { } return retval ; }
BELScriptWalker.g:121:1: set_document : ( 'SET' dkt= DOCUMENT_KEYWORD ) prop= document_property '=' (qv= QUOTED_VALUE | oi= OBJECT_IDENT ) ;