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

        CommonTree root_0 = null;

        CommonTree _first_0 = null;
        CommonTree _last = null;

        CommonTree isdefault=null;
        CommonTree name=null;
        CommonTree rloc=null;
        CommonTree string_literal23=null;
        CommonTree string_literal24=null;
        CommonTree string_literal25=null;
        CommonTree string_literal26=null;

        CommonTree isdefault_tree=null;
        CommonTree name_tree=null;
        CommonTree rloc_tree=null;
        CommonTree string_literal23_tree=null;
        CommonTree string_literal24_tree=null;
        CommonTree string_literal25_tree=null;
        CommonTree string_literal26_tree=null;

        try {
            // BELScriptWalker.g:308:17: ( ( 'DEFINE' ( (isdefault= 'DEFAULT' )? 'NAMESPACE' ) ) name= OBJECT_IDENT 'AS' 'URL' rloc= QUOTED_VALUE )
            // BELScriptWalker.g:309:5: ( 'DEFINE' ( (isdefault= 'DEFAULT' )? 'NAMESPACE' ) ) name= OBJECT_IDENT 'AS' 'URL' rloc= QUOTED_VALUE
            {
            root_0 = (CommonTree)adaptor.nil();

            // BELScriptWalker.g:309:5: ( 'DEFINE' ( (isdefault= 'DEFAULT' )? 'NAMESPACE' ) )
            // BELScriptWalker.g:309:6: 'DEFINE' ( (isdefault= 'DEFAULT' )? 'NAMESPACE' )
            {
            _last = (CommonTree)input.LT(1);
            string_literal23=(CommonTree)match(input,27,FOLLOW_27_in_define_namespace312); 
            string_literal23_tree = (CommonTree)adaptor.dupNode(string_literal23);

            adaptor.addChild(root_0, string_literal23_tree);

            // BELScriptWalker.g:309:15: ( (isdefault= 'DEFAULT' )? 'NAMESPACE' )
            // BELScriptWalker.g:309:16: (isdefault= 'DEFAULT' )? 'NAMESPACE'
            {
            // BELScriptWalker.g:309:16: (isdefault= 'DEFAULT' )?
            int alt7=2;
            int LA7_0 = input.LA(1);

            if ( (LA7_0==28) ) {
                alt7=1;
            }
            switch (alt7) {
                case 1 :
                    // BELScriptWalker.g:309:17: isdefault= 'DEFAULT'
                    {
                    _last = (CommonTree)input.LT(1);
                    isdefault=(CommonTree)match(input,28,FOLLOW_28_in_define_namespace318); 
                    isdefault_tree = (CommonTree)adaptor.dupNode(isdefault);

                    adaptor.addChild(root_0, isdefault_tree);


                    }
                    break;

            }

            _last = (CommonTree)input.LT(1);
            string_literal24=(CommonTree)match(input,29,FOLLOW_29_in_define_namespace322); 
            string_literal24_tree = (CommonTree)adaptor.dupNode(string_literal24);

            adaptor.addChild(root_0, string_literal24_tree);


            }


            }

            _last = (CommonTree)input.LT(1);
            name=(CommonTree)match(input,OBJECT_IDENT,FOLLOW_OBJECT_IDENT_in_define_namespace328); 
            name_tree = (CommonTree)adaptor.dupNode(name);

            adaptor.addChild(root_0, name_tree);

            _last = (CommonTree)input.LT(1);
            string_literal25=(CommonTree)match(input,30,FOLLOW_30_in_define_namespace330); 
            string_literal25_tree = (CommonTree)adaptor.dupNode(string_literal25);

            adaptor.addChild(root_0, string_literal25_tree);

            _last = (CommonTree)input.LT(1);
            string_literal26=(CommonTree)match(input,31,FOLLOW_31_in_define_namespace332); 
            string_literal26_tree = (CommonTree)adaptor.dupNode(string_literal26);

            adaptor.addChild(root_0, string_literal26_tree);

            _last = (CommonTree)input.LT(1);
            rloc=(CommonTree)match(input,QUOTED_VALUE,FOLLOW_QUOTED_VALUE_in_define_namespace336); 
            rloc_tree = (CommonTree)adaptor.dupNode(rloc);

            adaptor.addChild(root_0, rloc_tree);


                    final String nametext = name.getText();
                    final String rloctext = rloc.getText();

                    BELNamespaceDefinition belnsd;
                    if (isdefault != null) {
                        belnsd = new BELNamespaceDefinition(nametext, rloctext, true);
                    } else {
                        belnsd = new BELNamespaceDefinition(nametext, rloctext, false);
                    }

                    nslist.add(belnsd);
                    definedNamespaces.put(nametext, belnsd);
                

            }

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

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return retval;
    }
public final BELScriptWalker . define_namespace_return define_namespace ( ) throws RecognitionException { BELScriptWalker . define_namespace_return retval = new BELScriptWalker . define_namespace_return ( ) ; retval . start = input . LT ( 1 ) ; CommonTree root_0 = null ; CommonTree _first_0 = null ; CommonTree _last = null ; CommonTree isdefault = null ; CommonTree name = null ; CommonTree rloc = null ; CommonTree string_literal23 = null ; CommonTree string_literal24 = null ; CommonTree string_literal25 = null ; CommonTree string_literal26 = null ; CommonTree isdefault_tree = null ; CommonTree name_tree = null ; CommonTree rloc_tree = null ; CommonTree string_literal23_tree = null ; CommonTree string_literal24_tree = null ; CommonTree string_literal25_tree = null ; CommonTree string_literal26_tree = null ; try { { root_0 = ( CommonTree ) adaptor . nil ( ) ; { _last = ( CommonTree ) input . LT ( 1 ) ; string_literal23 = ( CommonTree ) match ( input , 27 , FOLLOW_27_in_define_namespace312 ) ; string_literal23_tree = ( CommonTree ) adaptor . dupNode ( string_literal23 ) ; adaptor . addChild ( root_0 , string_literal23_tree ) ; { int alt7 = 2 ; int LA7_0 = input . LA ( 1 ) ; if ( ( LA7_0 == 28 ) ) { alt7 = 1 ; } switch ( alt7 ) { case 1 : { _last = ( CommonTree ) input . LT ( 1 ) ; isdefault = ( CommonTree ) match ( input , 28 , FOLLOW_28_in_define_namespace318 ) ; isdefault_tree = ( CommonTree ) adaptor . dupNode ( isdefault ) ; adaptor . addChild ( root_0 , isdefault_tree ) ; } break ; } _last = ( CommonTree ) input . LT ( 1 ) ; string_literal24 = ( CommonTree ) match ( input , 29 , FOLLOW_29_in_define_namespace322 ) ; string_literal24_tree = ( CommonTree ) adaptor . dupNode ( string_literal24 ) ; adaptor . addChild ( root_0 , string_literal24_tree ) ; } } _last = ( CommonTree ) input . LT ( 1 ) ; name = ( CommonTree ) match ( input , OBJECT_IDENT , FOLLOW_OBJECT_IDENT_in_define_namespace328 ) ; name_tree = ( CommonTree ) adaptor . dupNode ( name ) ; adaptor . addChild ( root_0 , name_tree ) ; _last = ( CommonTree ) input . LT ( 1 ) ; string_literal25 = ( CommonTree ) match ( input , 30 , FOLLOW_30_in_define_namespace330 ) ; string_literal25_tree = ( CommonTree ) adaptor . dupNode ( string_literal25 ) ; adaptor . addChild ( root_0 , string_literal25_tree ) ; _last = ( CommonTree ) input . LT ( 1 ) ; string_literal26 = ( CommonTree ) match ( input , 31 , FOLLOW_31_in_define_namespace332 ) ; string_literal26_tree = ( CommonTree ) adaptor . dupNode ( string_literal26 ) ; adaptor . addChild ( root_0 , string_literal26_tree ) ; _last = ( CommonTree ) input . LT ( 1 ) ; rloc = ( CommonTree ) match ( input , QUOTED_VALUE , FOLLOW_QUOTED_VALUE_in_define_namespace336 ) ; rloc_tree = ( CommonTree ) adaptor . dupNode ( rloc ) ; adaptor . addChild ( root_0 , rloc_tree ) ; final String nametext = name . getText ( ) ; final String rloctext = rloc . getText ( ) ; BELNamespaceDefinition belnsd ; if ( isdefault != null ) { belnsd = new BELNamespaceDefinition ( nametext , rloctext , true ) ; } else { belnsd = new BELNamespaceDefinition ( nametext , rloctext , false ) ; } nslist . add ( belnsd ) ; definedNamespaces . put ( nametext , belnsd ) ; } retval . tree = ( CommonTree ) adaptor . rulePostProcessing ( root_0 ) ; } catch ( RecognitionException re ) { reportError ( re ) ; recover ( input , re ) ; } finally { } return retval ; }
BELScriptWalker.g:308:1: define_namespace : ( 'DEFINE' ( (isdefault= 'DEFAULT' )? 'NAMESPACE' ) ) name= OBJECT_IDENT 'AS' 'URL' rloc= QUOTED_VALUE ;