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

        CommonTree root_0 = null;

        CommonTree _first_0 = null;
        CommonTree _last = null;

        CommonTree nsp=null;
        CommonTree id=null;
        CommonTree quo=null;

        CommonTree nsp_tree=null;
        CommonTree id_tree=null;
        CommonTree quo_tree=null;

        try {
            // BELScriptWalker.g:464:34: ( (nsp= NS_PREFIX )? (id= OBJECT_IDENT | quo= QUOTED_VALUE ) )
            // BELScriptWalker.g:465:5: (nsp= NS_PREFIX )? (id= OBJECT_IDENT | quo= QUOTED_VALUE )
            {
            root_0 = (CommonTree)adaptor.nil();

            // BELScriptWalker.g:465:8: (nsp= NS_PREFIX )?
            int alt20=2;
            int LA20_0 = input.LA(1);

            if ( (LA20_0==NS_PREFIX) ) {
                alt20=1;
            }
            switch (alt20) {
                case 1 :
                    // BELScriptWalker.g:465:8: nsp= NS_PREFIX
                    {
                    _last = (CommonTree)input.LT(1);
                    nsp=(CommonTree)match(input,NS_PREFIX,FOLLOW_NS_PREFIX_in_param772); 
                    nsp_tree = (CommonTree)adaptor.dupNode(nsp);

                    adaptor.addChild(root_0, nsp_tree);


                    }
                    break;

            }

            // BELScriptWalker.g:465:20: (id= OBJECT_IDENT | quo= QUOTED_VALUE )
            int alt21=2;
            int LA21_0 = input.LA(1);

            if ( (LA21_0==OBJECT_IDENT) ) {
                alt21=1;
            }
            else if ( (LA21_0==QUOTED_VALUE) ) {
                alt21=2;
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 21, 0, input);

                throw nvae;
            }
            switch (alt21) {
                case 1 :
                    // BELScriptWalker.g:465:21: id= OBJECT_IDENT
                    {
                    _last = (CommonTree)input.LT(1);
                    id=(CommonTree)match(input,OBJECT_IDENT,FOLLOW_OBJECT_IDENT_in_param778); 
                    id_tree = (CommonTree)adaptor.dupNode(id);

                    adaptor.addChild(root_0, id_tree);


                    }
                    break;
                case 2 :
                    // BELScriptWalker.g:465:39: quo= QUOTED_VALUE
                    {
                    _last = (CommonTree)input.LT(1);
                    quo=(CommonTree)match(input,QUOTED_VALUE,FOLLOW_QUOTED_VALUE_in_param784); 
                    quo_tree = (CommonTree)adaptor.dupNode(quo);

                    adaptor.addChild(root_0, quo_tree);


                    }
                    break;

            }


                    final StringBuilder pBuilder = new StringBuilder();

                    if (nsp != null) {
                        String prefix = nsp.getText();
                        if (!definedNamespaces.containsKey(prefix.substring(0, prefix.length() - 1))) {
                            addError(new NamespaceUndefinedException(nsp.getLine(), nsp.getCharPositionInLine()));
                        }

                        pBuilder.append(prefix);
                    }

                    if (id != null) {
                        pBuilder.append(id.getText());
                    }

                    if (quo != null) {
                        pBuilder.append(quo.getText());
                    }

                    retval.r = pBuilder.toString();
                

            }

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

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return retval;
    }
public final BELScriptWalker . param_return param ( ) throws RecognitionException { BELScriptWalker . param_return retval = new BELScriptWalker . param_return ( ) ; retval . start = input . LT ( 1 ) ; CommonTree root_0 = null ; CommonTree _first_0 = null ; CommonTree _last = null ; CommonTree nsp = null ; CommonTree id = null ; CommonTree quo = null ; CommonTree nsp_tree = null ; CommonTree id_tree = null ; CommonTree quo_tree = null ; try { { root_0 = ( CommonTree ) adaptor . nil ( ) ; int alt20 = 2 ; int LA20_0 = input . LA ( 1 ) ; if ( ( LA20_0 == NS_PREFIX ) ) { alt20 = 1 ; } switch ( alt20 ) { case 1 : { _last = ( CommonTree ) input . LT ( 1 ) ; nsp = ( CommonTree ) match ( input , NS_PREFIX , FOLLOW_NS_PREFIX_in_param772 ) ; nsp_tree = ( CommonTree ) adaptor . dupNode ( nsp ) ; adaptor . addChild ( root_0 , nsp_tree ) ; } break ; } int alt21 = 2 ; int LA21_0 = input . LA ( 1 ) ; if ( ( LA21_0 == OBJECT_IDENT ) ) { alt21 = 1 ; } else if ( ( LA21_0 == QUOTED_VALUE ) ) { alt21 = 2 ; } else { NoViableAltException nvae = new NoViableAltException ( "" , 21 , 0 , input ) ; throw nvae ; } switch ( alt21 ) { case 1 : { _last = ( CommonTree ) input . LT ( 1 ) ; id = ( CommonTree ) match ( input , OBJECT_IDENT , FOLLOW_OBJECT_IDENT_in_param778 ) ; id_tree = ( CommonTree ) adaptor . dupNode ( id ) ; adaptor . addChild ( root_0 , id_tree ) ; } break ; case 2 : { _last = ( CommonTree ) input . LT ( 1 ) ; quo = ( CommonTree ) match ( input , QUOTED_VALUE , FOLLOW_QUOTED_VALUE_in_param784 ) ; quo_tree = ( CommonTree ) adaptor . dupNode ( quo ) ; adaptor . addChild ( root_0 , quo_tree ) ; } break ; } final StringBuilder pBuilder = new StringBuilder ( ) ; if ( nsp != null ) { String prefix = nsp . getText ( ) ; if ( ! definedNamespaces . containsKey ( prefix . substring ( 0 , prefix . length ( ) - 1 ) ) ) { addError ( new NamespaceUndefinedException ( nsp . getLine ( ) , nsp . getCharPositionInLine ( ) ) ) ; } pBuilder . append ( prefix ) ; } if ( id != null ) { pBuilder . append ( id . getText ( ) ) ; } if ( quo != null ) { pBuilder . append ( quo . getText ( ) ) ; } retval . r = pBuilder . toString ( ) ; } retval . tree = ( CommonTree ) adaptor . rulePostProcessing ( root_0 ) ; } catch ( RecognitionException re ) { reportError ( re ) ; recover ( input , re ) ; } finally { } return retval ; }
BELScriptWalker.g:464:10: fragment param returns [String r] : (nsp= NS_PREFIX )? (id= OBJECT_IDENT | quo= QUOTED_VALUE ) ;