BELScript.g:48:1: record : ( define_namespace | define_annotation | set_annotation | set_document | set_statement_group | unset_statement_group | unset | statement ) ;
548402
public final BELScriptParser.record_return record() throws RecognitionException {
        BELScriptParser.record_return retval = new BELScriptParser.record_return();
        retval.start = input.LT(1);

        Object root_0 = null;

        BELScriptParser.define_namespace_return define_namespace5 = null;

        BELScriptParser.define_annotation_return define_annotation6 = null;

        BELScriptParser.set_annotation_return set_annotation7 = null;

        BELScriptParser.set_document_return set_document8 = null;

        BELScriptParser.set_statement_group_return set_statement_group9 = null;

        BELScriptParser.unset_statement_group_return unset_statement_group10 = null;

        BELScriptParser.unset_return unset11 = null;

        BELScriptParser.statement_return statement12 = null;



        try {
            // BELScript.g:48:7: ( ( define_namespace | define_annotation | set_annotation | set_document | set_statement_group | unset_statement_group | unset | statement ) )
            // BELScript.g:49:5: ( define_namespace | define_annotation | set_annotation | set_document | set_statement_group | unset_statement_group | unset | statement )
            {
            root_0 = (Object)adaptor.nil();

            // BELScript.g:49:5: ( define_namespace | define_annotation | set_annotation | set_document | set_statement_group | unset_statement_group | unset | statement )
            int alt2=8;
            alt2 = dfa2.predict(input);
            switch (alt2) {
                case 1 :
                    // BELScript.g:49:6: define_namespace
                    {
                    pushFollow(FOLLOW_define_namespace_in_record91);
                    define_namespace5=define_namespace();

                    state._fsp--;

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

                    }
                    break;
                case 2 :
                    // BELScript.g:49:25: define_annotation
                    {
                    pushFollow(FOLLOW_define_annotation_in_record95);
                    define_annotation6=define_annotation();

                    state._fsp--;

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

                    }
                    break;
                case 3 :
                    // BELScript.g:49:45: set_annotation
                    {
                    pushFollow(FOLLOW_set_annotation_in_record99);
                    set_annotation7=set_annotation();

                    state._fsp--;

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

                    }
                    break;
                case 4 :
                    // BELScript.g:49:62: set_document
                    {
                    pushFollow(FOLLOW_set_document_in_record103);
                    set_document8=set_document();

                    state._fsp--;

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

                    }
                    break;
                case 5 :
                    // BELScript.g:49:77: set_statement_group
                    {
                    pushFollow(FOLLOW_set_statement_group_in_record107);
                    set_statement_group9=set_statement_group();

                    state._fsp--;

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

                    }
                    break;
                case 6 :
                    // BELScript.g:49:99: unset_statement_group
                    {
                    pushFollow(FOLLOW_unset_statement_group_in_record111);
                    unset_statement_group10=unset_statement_group();

                    state._fsp--;

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

                    }
                    break;
                case 7 :
                    // BELScript.g:49:123: unset
                    {
                    pushFollow(FOLLOW_unset_in_record115);
                    unset11=unset();

                    state._fsp--;

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

                    }
                    break;
                case 8 :
                    // BELScript.g:49:131: statement
                    {
                    pushFollow(FOLLOW_statement_in_record119);
                    statement12=statement();

                    state._fsp--;

                    adaptor.addChild(root_0, statement12.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);
    	retval.tree = (Object)adaptor.errorNode(input, retval.start, input.LT(-1), re);

        }
        finally {
        }
        return retval;
    }
1009905
public final BELScriptWalker.set_annotation_return set_annotation() throws RecognitionException {
        BELScriptWalker.set_annotation_return retval = new BELScriptWalker.set_annotation_return();
        retval.start = input.LT(1);

        CommonTree root_0 = null;

        CommonTree _first_0 = null;
        CommonTree _last = null;

        CommonTree an=null;
        CommonTree qv=null;
        CommonTree list=null;
        CommonTree oi=null;
        CommonTree string_literal18=null;
        CommonTree char_literal19=null;

        CommonTree an_tree=null;
        CommonTree qv_tree=null;
        CommonTree list_tree=null;
        CommonTree oi_tree=null;
        CommonTree string_literal18_tree=null;
        CommonTree char_literal19_tree=null;

        try {
            // BELScriptWalker.g:157:15: ( 'SET' an= OBJECT_IDENT '=' (qv= QUOTED_VALUE | list= VALUE_LIST | oi= OBJECT_IDENT ) )
            // BELScriptWalker.g:158:5: 'SET' an= OBJECT_IDENT '=' (qv= QUOTED_VALUE | list= VALUE_LIST | oi= OBJECT_IDENT )
            {
            root_0 = (CommonTree)adaptor.nil();

            _last = (CommonTree)input.LT(1);
            string_literal18=(CommonTree)match(input,24,FOLLOW_24_in_set_annotation219); 
            string_literal18_tree = (CommonTree)adaptor.dupNode(string_literal18);

            adaptor.addChild(root_0, string_literal18_tree);

            _last = (CommonTree)input.LT(1);
            an=(CommonTree)match(input,OBJECT_IDENT,FOLLOW_OBJECT_IDENT_in_set_annotation223); 
            an_tree = (CommonTree)adaptor.dupNode(an);

            adaptor.addChild(root_0, an_tree);

            _last = (CommonTree)input.LT(1);
            char_literal19=(CommonTree)match(input,25,FOLLOW_25_in_set_annotation225); 
            char_literal19_tree = (CommonTree)adaptor.dupNode(char_literal19);

            adaptor.addChild(root_0, char_literal19_tree);

            // BELScriptWalker.g:158:31: (qv= QUOTED_VALUE | list= VALUE_LIST | oi= OBJECT_IDENT )
            int alt5=3;
            switch ( input.LA(1) ) {
            case QUOTED_VALUE:
                {
                alt5=1;
                }
                break;
            case VALUE_LIST:
                {
                alt5=2;
                }
                break;
            case OBJECT_IDENT:
                {
                alt5=3;
                }
                break;
            default:
                NoViableAltException nvae =
                    new NoViableAltException("", 5, 0, input);

                throw nvae;
            }

            switch (alt5) {
                case 1 :
                    // BELScriptWalker.g:158:32: qv= QUOTED_VALUE
                    {
                    _last = (CommonTree)input.LT(1);
                    qv=(CommonTree)match(input,QUOTED_VALUE,FOLLOW_QUOTED_VALUE_in_set_annotation230); 
                    qv_tree = (CommonTree)adaptor.dupNode(qv);

                    adaptor.addChild(root_0, qv_tree);


                    }
                    break;
                case 2 :
                    // BELScriptWalker.g:158:50: list= VALUE_LIST
                    {
                    _last = (CommonTree)input.LT(1);
                    list=(CommonTree)match(input,VALUE_LIST,FOLLOW_VALUE_LIST_in_set_annotation236); 
                    list_tree = (CommonTree)adaptor.dupNode(list);

                    adaptor.addChild(root_0, list_tree);


                    }
                    break;
                case 3 :
                    // BELScriptWalker.g:158:68: oi= OBJECT_IDENT
                    {
                    _last = (CommonTree)input.LT(1);
                    oi=(CommonTree)match(input,OBJECT_IDENT,FOLLOW_OBJECT_IDENT_in_set_annotation242); 
                    oi_tree = (CommonTree)adaptor.dupNode(oi);

                    adaptor.addChild(root_0, oi_tree);


                    }
                    break;

            }


                    final String name = an.getText();

                    BELAnnotationDefinition ad = definedAnnotations.get(name);
                    if (ad != null) {
                        // read annotation value
                        final BELAnnotation annotation;
                        if (qv != null) {
                            annotation = new BELAnnotation(ad, qv.getText());
                        } else if (oi != null) {
                            annotation = new BELAnnotation(ad, oi.getText());
                        } else {
                            if (list == null) {
                                throw new IllegalStateException("Did not understand annotation value, expecting annotation list form.");
                            }

                            String listvalues = list.getText();
                            listvalues = listvalues.substring(1, listvalues.length() - 1);
                            annotation = new BELAnnotation(ad, Arrays.asList(ParserUtil.parseListRecord(listvalues)));
                        }

                        if (activeStatementGroup != null) {
                            // add to local statement group scope
                            sgAnnotationContext.put(name, annotation);
                        } else {
                            // add to main statement group scope
                            annotationContext.put(name, annotation);
                        }
                    } else if (!name.equals("Citation") && !name.equals("Evidence")) {
                        // throw if annotation is not defined and it's not the intrinsics: Citation or EvidenceLine
                        addError(new DefineAnnotationBeforeUsageException(an.getLine(), an.getCharPositionInLine()));
                    }

                    if (name.equals("Citation")) {
                        // redefinition of citation so clear out citation context
                        citationContext = null;

                        if (list == null) {
                            addError(new InvalidCitationException(an.getLine(), an.getCharPositionInLine()));
                        } else {
                            String listvalues = list.getText();
                            String[] tokens = ParserUtil.parseListRecord(listvalues);

                            String type = null;
                            String cname = null;
                            String reference = null;
                            Date publicationDate = null;
                            String[] authors = null;
                            String comment = null;

                            // (required) parse type
                            if (tokens.length > 0 && tokens[0] != null) {
            	                type = tokens[0];
            	                if (!("Book".equals(type) || "Journal".equals(type) || "Online Resource".equals(type) || "Other".equals(type) || "PubMed".equals(type))) {
            	                    addError(new InvalidCitationException(an.getLine(), an.getCharPositionInLine()));
            	                }
                            } else {
                                addError(new InvalidCitationException(an.getLine(), an.getCharPositionInLine()));
                            }

                            // (required) parse name
                            if (tokens.length > 1 && tokens[1] != null) {
            	                if ("".equals(tokens[1].trim())) {
            	                    addError(new InvalidCitationException(an.getLine(), an.getCharPositionInLine()));
            	                } else {
            	                    cname = tokens[1];
            	                }
                            } else {
                                addError(new InvalidCitationException(an.getLine(), an.getCharPositionInLine()));
                            }

                            // (required) parse reference
                            if (tokens.length > 2 && tokens[2] != null) {
                                if ("".equals(tokens[2].trim())) {
                                    addError(new InvalidCitationException(an.getLine(), an.getCharPositionInLine()));
                                } else {
                                    reference = tokens[2];
                                }
                            }

                            // (optional) parse date of publication
                            if (tokens.length > 3 && tokens[3] != null) {
            	                if (!"".equals(tokens[3].trim())) {
            	                    try {
            	                        publicationDate = iso8601DateFormat.parse(tokens[3]);
            	                    } catch (ParseException e) {
            	                        addError(new InvalidCitationException(an.getLine(), an.getCharPositionInLine()));
            	                    }

            	                    if (publicationDate == null) {
            	                        addError(new InvalidCitationException(an.getLine(), an.getCharPositionInLine()));
            	                    }
            	                }
                            }

                            // (optional) parse authors
                            if (tokens.length > 4 && tokens[4] != null) {
                                authors = ParserUtil.parseValueSeparated(tokens[4]);
                            }

                            // (optional) parse comments
                            if (tokens.length > 5 && tokens[5] != null) {
                                comment = tokens[5];
                            }

                            citationContext = new BELCitation(type, cname, publicationDate, reference, authors == null ? null : Arrays.asList(authors), comment);
                        }
                    } else if (name.equals("Evidence")) {
                        // redefinition of evidence so clear out evidence context
                        evidenceContext = null;

                        if (qv == null || "".equals(qv.getText().trim())) {
                            addError(new InvalidEvidenceException(an.getLine(), an.getCharPositionInLine()));
                        } else {
                            evidenceContext = new BELEvidence(qv.getText());
                        }
                    }
                

            }

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

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return retval;
    }
354869
public void resolveReferences() {
        // Resolve annotations to their definitions
        Map<String, AnnotationDefinition> defs = getDefinitionMap();
        final List<Annotation> annos = new ArrayList<Annotation>();

        // Get all the annotation used by the document's statement groups
        for (final StatementGroup sg : statementGroups) {
            annos.addAll(sg.getAllAnnotations());
        }

        // Resolve the references
        for (final Annotation a : annos) {
            AnnotationDefinition ad = a.getDefinition();
            // Skip annotations without definitions
            if (ad == null) {
                continue;
            }

            final String id = ad.getId();
            AnnotationDefinition documentDefinition = defs.get(id);

            // BEL document annotations must reference valid definitions...
            assert documentDefinition != null;
            // ... so sanity check that for now.

            // Resolve the reference to the instance
            a.setDefinition(documentDefinition);
        }

        // Resolve parameters to their namespaces
        Map<String, Namespace> nspcs = getNamespaceMap();
        final List<Parameter> params = new ArrayList<Parameter>();

        // Get all the parameters within the document
        for (final StatementGroup sg : statementGroups) {
            params.addAll(sg.getAllParameters());
        }

        // Get the default namespace if present
        final Namespace defaultNS = nspcs.get(DEFAULT_NAMESPACE_PREFIX);

        // Resolve the references
        for (final Parameter av : params) {
            Namespace ns = av.getNamespace();

            // Skip parameters without namespaces
            if (ns == null) {
                if (defaultNS != null) {
                    av.setNamespace(defaultNS);
                }
                continue;
            }

            final String prefix = ns.getPrefix();
            Namespace documentNamespace = nspcs.get(prefix);

            // BEL document parameters must reference valid namespaces...
            assert documentNamespace != null;
            // ... so sanity check that for now.

            // Resolve the reference to the instance
            av.setNamespace(documentNamespace);
        }
    }
588966
function writeNaptr(buff, val, label_index) {
  assertUndefined(val.order, 'NAPTR record requires "order"');
  assertUndefined(val.preference, 'NAPTR record requires "preference"');
  assertUndefined(val.flags, 'NAPTR record requires "flags"');
  assertUndefined(val.service, 'NAPTR record requires "service"');
  assertUndefined(val.regexp, 'NAPTR record requires "regexp"');
  assertUndefined(val.replacement, 'NAPTR record requires "replacement"');
  buff.writeUInt16BE(val.order & 0xFFFF);
  buff.writeUInt16BE(val.preference & 0xFFFF);
  buff.writeUInt8(val.flags.length);
  buff.write(val.flags, val.flags.length, 'ascii');
  buff.writeUInt8(val.service.length);
  buff.write(val.service, val.service.length, 'ascii');
  buff.writeUInt8(val.regexp.length);
  buff.write(val.regexp, val.regexp.length, 'ascii');
  namePack(val.replacement, buff, label_index);
  return WRITE_RESOURCE_DONE;
}
798938
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;
    }
690464
def _reverse_annotations(old_record, new_record):
    
    # Copy the annotations over
    for k, v in list(old_record.annotations.items()):
        # Trim if appropriate
        if isinstance(v, (tuple, list)) and len(v) == len(old_record):
            assert len(v) == len(old_record)
            v = v[::-1]
        new_record.annotations[k] = v

    # Letter annotations must be lists / tuples / strings of the same
    # length as the sequence
    for k, v in list(old_record.letter_annotations.items()):
        assert len(v) == len(old_record)
        new_record.letter_annotations[k] = v[::-1]
332781
function record(name, components, { ignoreExtraProps } = {}) {
  if (name != null && typeof name === 'object') {
    ({ ignoreExtraProps } = Object(components));
    components = name;
    name = `SomeRecord`;
  }

  const componentKeys = keysOf(components);

  /* istanbul ignore else */
  if (__DEV__) {
    assert(typeof name === 'string', `record()'s name must be a string`);
    assert(
      components != null && typeof components === 'object',
      `record()'s components must be an object`
    );
    for (const key of componentKeys) {
      assert(
        components[key][TYPICAL_TYPE],
        `record()'s component value must be a type`
      );
    }
  }

  const api = this;

  function Record(value, context) {
    if (Context.isRequired(context)) {
      return Context.with(value, Record, context, api);
    } else if (value == null || typeof value !== 'object') {
      return context.valueIsNotOfType(value, Record);
    }

    const result = forEachTypedProperty(
      value,
      componentKeys,
      k => components[k],
      context.validateAndCopy ? create(Record.prototype) : void 0,
      context
    );

    if (ignoreExtraProps === void 0) {
      ignoreExtraProps =
        context.ignoreExtraProps !== void 0 ? context.ignoreExtraProps : false;
    }

    if (!ignoreExtraProps) {
      const extras = keysOf(value).filter(k => !components[k]);
      if (extras.length) {
        if (!context.isErrorWrapper(result)) {
          return context.valueHasExtraProperties(value, extras);
        } else {
          return context.mergeWrappers(
            result,
            context.valueHasExtraProperties(value, extras)
          );
        }
      }
    }

    return result;
  }

  return decorate(Record, name, record, { ...components });
}
19375
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;
    }
503655
def enumerate_records(xml)
      doc = Nokogiri::XML(xml)
      doc.root.add_namespace_definition('nmbib', PRIMO_NS)
      doc.xpath('//sear:DOC').lazy.map do |record|
        identifier = record.xpath('./nmbib:PrimoNMBib/nmbib:record/' \
                                  'nmbib:control/nmbib:recordid')
                     .first.text

        record = record.dup
        record.add_namespace_definition('sear', SEAR_NS)

        @record_class.build(mint_id(identifier), record.to_xml)
      end
    end
1145592
private void checkRecordAnnotation(final Class<?> tableClass, final AnnotationReader annoReader) {

        final int horizontalSize = FieldAccessorUtils.getPropertiesWithAnnotation(
                tableClass, annoReader, XlsHorizontalRecords.class)
                .size();

        final int verticalSize = FieldAccessorUtils.getPropertiesWithAnnotation(
                tableClass, annoReader, XlsVerticalRecords.class)
                .size();

        if(horizontalSize > 0 && verticalSize > 0) {
            throw new AnnotationInvalidException(MessageBuilder.create("anno.XlsIterateTables.horizontalAndVertical")
                    .varWithClass("tableClass", tableClass)
                    .format());
        }

    }
68653
public void init(Record record, boolean bNoDelete, boolean bNoModify)
    {   // For this to work right, the booking number field needs a listener to re-select this file whenever it changes
        m_bNoDelete = bNoDelete;
        m_bNoModify = bNoModify;
        super.init(record);
    }
20918
def get_namespace_record(namespace_id, proxy=None, hostport=None):
    

    assert proxy or hostport, 'Need either proxy handle or hostport string'
    if proxy is None:
        proxy = connect_hostport(hostport)
    
    namespace_schema = {
        'type': 'object',
        'properties': NAMESPACE_SCHEMA_PROPERTIES,
        'required': NAMESPACE_SCHEMA_REQUIRED
    }

    rec_schema = {
        'type': 'object',
        'properties': {
            'record': namespace_schema,
        },
        'required': [
            'record',
        ],
    }

    resp_schema = json_response_schema( rec_schema )
            
    ret = {}
    try:
        ret = proxy.get_namespace_blockchain_record(namespace_id)
        ret = json_validate(resp_schema, ret)
        if json_is_error(ret):
            return ret

        ret = ret['record']

        # this isn't needed
        ret.pop('opcode', None)

    except socket.timeout:
        log.error("Connection timed out")
        resp = {'error': 'Connection to remote host timed out.', 'http_status': 503}
        return resp

    except socket.error as se:
        log.error("Connection error {}".format(se.errno))
        resp = {'error': 'Connection to remote host failed.', 'http_status': 502}
        return resp

    except ValidationError as e:
        if BLOCKSTACK_DEBUG:
            log.exception(e)

        resp = {'error': 'Server response did not match expected schema.  You are likely communicating with an out-of-date Blockstack node.', 'http_status': 502}
        return resp

    except Exception as ee:
        if BLOCKSTACK_DEBUG:
            log.exception(ee)

        log.error("Caught exception while connecting to Blockstack node: {}".format(ee))
        resp = {'error': 'Failed to contact Blockstack node.  Try again with `--debug`.', 'http_status': 500}
        return resp

    return ret
829013
def process_set(line, annotations):
    """"""

    matches = re.match('SET\s+(\w+)\s*=\s*"?(.*?)"?\s*$', line)

    key = None
    if matches:
        key = matches.group(1)
        val = matches.group(2)

    if key == "STATEMENT_GROUP":
        annotations["statement_group"] = val
    elif key == "Citation":
        annotations["citation"] = process_citation(val)
    elif key.lower() == "support" or key.lower() == "evidence":
        annotations["evidence"] = val
    elif re.match("\s*{.*?}", val):
        vals = convert_csv_str_to_list(val)
        annotations[key] = vals
    else:
        annotations[key] = val

    return annotations
550456
public final BELScriptWalker.unset_statement_group_return unset_statement_group() throws RecognitionException {
        BELScriptWalker.unset_statement_group_return retval = new BELScriptWalker.unset_statement_group_return();
        retval.start = input.LT(1);

        CommonTree root_0 = null;

        CommonTree _first_0 = null;
        CommonTree _last = null;

        CommonTree string_literal20=null;
        CommonTree STATEMENT_GROUP_KEYWORD21=null;

        CommonTree string_literal20_tree=null;
        CommonTree STATEMENT_GROUP_KEYWORD21_tree=null;

        try {
            // BELScriptWalker.g:278:22: ( 'UNSET' STATEMENT_GROUP_KEYWORD )
            // BELScriptWalker.g:279:5: 'UNSET' STATEMENT_GROUP_KEYWORD
            {
            root_0 = (CommonTree)adaptor.nil();

            _last = (CommonTree)input.LT(1);
            string_literal20=(CommonTree)match(input,26,FOLLOW_26_in_unset_statement_group261); 
            string_literal20_tree = (CommonTree)adaptor.dupNode(string_literal20);

            adaptor.addChild(root_0, string_literal20_tree);

            _last = (CommonTree)input.LT(1);
            STATEMENT_GROUP_KEYWORD21=(CommonTree)match(input,STATEMENT_GROUP_KEYWORD,FOLLOW_STATEMENT_GROUP_KEYWORD_in_unset_statement_group263); 
            STATEMENT_GROUP_KEYWORD21_tree = (CommonTree)adaptor.dupNode(STATEMENT_GROUP_KEYWORD21);

            adaptor.addChild(root_0, STATEMENT_GROUP_KEYWORD21_tree);


                    activeStatementGroup = null;
                    sgAnnotationContext.clear();
                

            }

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

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {
        }
        return retval;
    }
620463
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;
    }
1127033
public void mTokens() throws RecognitionException {
        // BELScript.g:1:8: ( T__24 | T__25 | T__26 | T__27 | T__28 | T__29 | T__30 | T__31 | T__32 | T__33 | T__34 | T__35 | T__36 | T__37 | T__38 | T__39 | T__40 | T__41 | T__42 | T__43 | T__44 | T__45 | T__46 | T__47 | T__48 | T__49 | T__50 | T__51 | T__52 | T__53 | T__54 | T__55 | T__56 | T__57 | T__58 | T__59 | T__60 | T__61 | T__62 | T__63 | T__64 | T__65 | T__66 | T__67 | T__68 | T__69 | T__70 | T__71 | T__72 | T__73 | T__74 | T__75 | T__76 | T__77 | T__78 | T__79 | T__80 | T__81 | T__82 | T__83 | T__84 | T__85 | T__86 | T__87 | T__88 | T__89 | T__90 | T__91 | T__92 | T__93 | T__94 | T__95 | T__96 | T__97 | T__98 | T__99 | T__100 | T__101 | T__102 | T__103 | T__104 | T__105 | T__106 | T__107 | T__108 | T__109 | T__110 | T__111 | T__112 | T__113 | T__114 | T__115 | T__116 | T__117 | T__118 | T__119 | T__120 | T__121 | T__122 | T__123 | T__124 | T__125 | T__126 | T__127 | T__128 | T__129 | T__130 | DOCUMENT_COMMENT | STATEMENT_COMMENT | DOCUMENT_KEYWORD | STATEMENT_GROUP_KEYWORD | IDENT_LIST | VALUE_LIST | OBJECT_IDENT | QUOTED_VALUE | OPEN_PAREN | CLOSE_PAREN | NS_PREFIX | NEWLINE | WS )
        int alt17=120;
        alt17 = dfa17.predict(input);
        switch (alt17) {
            case 1 :
                // BELScript.g:1:10: T__24
                {
                mT__24(); 

                }
                break;
            case 2 :
                // BELScript.g:1:16: T__25
                {
                mT__25(); 

                }
                break;
            case 3 :
                // BELScript.g:1:22: T__26
                {
                mT__26(); 

                }
                break;
            case 4 :
                // BELScript.g:1:28: T__27
                {
                mT__27(); 

                }
                break;
            case 5 :
                // BELScript.g:1:34: T__28
                {
                mT__28(); 

                }
                break;
            case 6 :
                // BELScript.g:1:40: T__29
                {
                mT__29(); 

                }
                break;
            case 7 :
                // BELScript.g:1:46: T__30
                {
                mT__30(); 

                }
                break;
            case 8 :
                // BELScript.g:1:52: T__31
                {
                mT__31(); 

                }
                break;
            case 9 :
                // BELScript.g:1:58: T__32
                {
                mT__32(); 

                }
                break;
            case 10 :
                // BELScript.g:1:64: T__33
                {
                mT__33(); 

                }
                break;
            case 11 :
                // BELScript.g:1:70: T__34
                {
                mT__34(); 

                }
                break;
            case 12 :
                // BELScript.g:1:76: T__35
                {
                mT__35(); 

                }
                break;
            case 13 :
                // BELScript.g:1:82: T__36
                {
                mT__36(); 

                }
                break;
            case 14 :
                // BELScript.g:1:88: T__37
                {
                mT__37(); 

                }
                break;
            case 15 :
                // BELScript.g:1:94: T__38
                {
                mT__38(); 

                }
                break;
            case 16 :
                // BELScript.g:1:100: T__39
                {
                mT__39(); 

                }
                break;
            case 17 :
                // BELScript.g:1:106: T__40
                {
                mT__40(); 

                }
                break;
            case 18 :
                // BELScript.g:1:112: T__41
                {
                mT__41(); 

                }
                break;
            case 19 :
                // BELScript.g:1:118: T__42
                {
                mT__42(); 

                }
                break;
            case 20 :
                // BELScript.g:1:124: T__43
                {
                mT__43(); 

                }
                break;
            case 21 :
                // BELScript.g:1:130: T__44
                {
                mT__44(); 

                }
                break;
            case 22 :
                // BELScript.g:1:136: T__45
                {
                mT__45(); 

                }
                break;
            case 23 :
                // BELScript.g:1:142: T__46
                {
                mT__46(); 

                }
                break;
            case 24 :
                // BELScript.g:1:148: T__47
                {
                mT__47(); 

                }
                break;
            case 25 :
                // BELScript.g:1:154: T__48
                {
                mT__48(); 

                }
                break;
            case 26 :
                // BELScript.g:1:160: T__49
                {
                mT__49(); 

                }
                break;
            case 27 :
                // BELScript.g:1:166: T__50
                {
                mT__50(); 

                }
                break;
            case 28 :
                // BELScript.g:1:172: T__51
                {
                mT__51(); 

                }
                break;
            case 29 :
                // BELScript.g:1:178: T__52
                {
                mT__52(); 

                }
                break;
            case 30 :
                // BELScript.g:1:184: T__53
                {
                mT__53(); 

                }
                break;
            case 31 :
                // BELScript.g:1:190: T__54
                {
                mT__54(); 

                }
                break;
            case 32 :
                // BELScript.g:1:196: T__55
                {
                mT__55(); 

                }
                break;
            case 33 :
                // BELScript.g:1:202: T__56
                {
                mT__56(); 

                }
                break;
            case 34 :
                // BELScript.g:1:208: T__57
                {
                mT__57(); 

                }
                break;
            case 35 :
                // BELScript.g:1:214: T__58
                {
                mT__58(); 

                }
                break;
            case 36 :
                // BELScript.g:1:220: T__59
                {
                mT__59(); 

                }
                break;
            case 37 :
                // BELScript.g:1:226: T__60
                {
                mT__60(); 

                }
                break;
            case 38 :
                // BELScript.g:1:232: T__61
                {
                mT__61(); 

                }
                break;
            case 39 :
                // BELScript.g:1:238: T__62
                {
                mT__62(); 

                }
                break;
            case 40 :
                // BELScript.g:1:244: T__63
                {
                mT__63(); 

                }
                break;
            case 41 :
                // BELScript.g:1:250: T__64
                {
                mT__64(); 

                }
                break;
            case 42 :
                // BELScript.g:1:256: T__65
                {
                mT__65(); 

                }
                break;
            case 43 :
                // BELScript.g:1:262: T__66
                {
                mT__66(); 

                }
                break;
            case 44 :
                // BELScript.g:1:268: T__67
                {
                mT__67(); 

                }
                break;
            case 45 :
                // BELScript.g:1:274: T__68
                {
                mT__68(); 

                }
                break;
            case 46 :
                // BELScript.g:1:280: T__69
                {
                mT__69(); 

                }
                break;
            case 47 :
                // BELScript.g:1:286: T__70
                {
                mT__70(); 

                }
                break;
            case 48 :
                // BELScript.g:1:292: T__71
                {
                mT__71(); 

                }
                break;
            case 49 :
                // BELScript.g:1:298: T__72
                {
                mT__72(); 

                }
                break;
            case 50 :
                // BELScript.g:1:304: T__73
                {
                mT__73(); 

                }
                break;
            case 51 :
                // BELScript.g:1:310: T__74
                {
                mT__74(); 

                }
                break;
            case 52 :
                // BELScript.g:1:316: T__75
                {
                mT__75(); 

                }
                break;
            case 53 :
                // BELScript.g:1:322: T__76
                {
                mT__76(); 

                }
                break;
            case 54 :
                // BELScript.g:1:328: T__77
                {
                mT__77(); 

                }
                break;
            case 55 :
                // BELScript.g:1:334: T__78
                {
                mT__78(); 

                }
                break;
            case 56 :
                // BELScript.g:1:340: T__79
                {
                mT__79(); 

                }
                break;
            case 57 :
                // BELScript.g:1:346: T__80
                {
                mT__80(); 

                }
                break;
            case 58 :
                // BELScript.g:1:352: T__81
                {
                mT__81(); 

                }
                break;
            case 59 :
                // BELScript.g:1:358: T__82
                {
                mT__82(); 

                }
                break;
            case 60 :
                // BELScript.g:1:364: T__83
                {
                mT__83(); 

                }
                break;
            case 61 :
                // BELScript.g:1:370: T__84
                {
                mT__84(); 

                }
                break;
            case 62 :
                // BELScript.g:1:376: T__85
                {
                mT__85(); 

                }
                break;
            case 63 :
                // BELScript.g:1:382: T__86
                {
                mT__86(); 

                }
                break;
            case 64 :
                // BELScript.g:1:388: T__87
                {
                mT__87(); 

                }
                break;
            case 65 :
                // BELScript.g:1:394: T__88
                {
                mT__88(); 

                }
                break;
            case 66 :
                // BELScript.g:1:400: T__89
                {
                mT__89(); 

                }
                break;
            case 67 :
                // BELScript.g:1:406: T__90
                {
                mT__90(); 

                }
                break;
            case 68 :
                // BELScript.g:1:412: T__91
                {
                mT__91(); 

                }
                break;
            case 69 :
                // BELScript.g:1:418: T__92
                {
                mT__92(); 

                }
                break;
            case 70 :
                // BELScript.g:1:424: T__93
                {
                mT__93(); 

                }
                break;
            case 71 :
                // BELScript.g:1:430: T__94
                {
                mT__94(); 

                }
                break;
            case 72 :
                // BELScript.g:1:436: T__95
                {
                mT__95(); 

                }
                break;
            case 73 :
                // BELScript.g:1:442: T__96
                {
                mT__96(); 

                }
                break;
            case 74 :
                // BELScript.g:1:448: T__97
                {
                mT__97(); 

                }
                break;
            case 75 :
                // BELScript.g:1:454: T__98
                {
                mT__98(); 

                }
                break;
            case 76 :
                // BELScript.g:1:460: T__99
                {
                mT__99(); 

                }
                break;
            case 77 :
                // BELScript.g:1:466: T__100
                {
                mT__100(); 

                }
                break;
            case 78 :
                // BELScript.g:1:473: T__101
                {
                mT__101(); 

                }
                break;
            case 79 :
                // BELScript.g:1:480: T__102
                {
                mT__102(); 

                }
                break;
            case 80 :
                // BELScript.g:1:487: T__103
                {
                mT__103(); 

                }
                break;
            case 81 :
                // BELScript.g:1:494: T__104
                {
                mT__104(); 

                }
                break;
            case 82 :
                // BELScript.g:1:501: T__105
                {
                mT__105(); 

                }
                break;
            case 83 :
                // BELScript.g:1:508: T__106
                {
                mT__106(); 

                }
                break;
            case 84 :
                // BELScript.g:1:515: T__107
                {
                mT__107(); 

                }
                break;
            case 85 :
                // BELScript.g:1:522: T__108
                {
                mT__108(); 

                }
                break;
            case 86 :
                // BELScript.g:1:529: T__109
                {
                mT__109(); 

                }
                break;
            case 87 :
                // BELScript.g:1:536: T__110
                {
                mT__110(); 

                }
                break;
            case 88 :
                // BELScript.g:1:543: T__111
                {
                mT__111(); 

                }
                break;
            case 89 :
                // BELScript.g:1:550: T__112
                {
                mT__112(); 

                }
                break;
            case 90 :
                // BELScript.g:1:557: T__113
                {
                mT__113(); 

                }
                break;
            case 91 :
                // BELScript.g:1:564: T__114
                {
                mT__114(); 

                }
                break;
            case 92 :
                // BELScript.g:1:571: T__115
                {
                mT__115(); 

                }
                break;
            case 93 :
                // BELScript.g:1:578: T__116
                {
                mT__116(); 

                }
                break;
            case 94 :
                // BELScript.g:1:585: T__117
                {
                mT__117(); 

                }
                break;
            case 95 :
                // BELScript.g:1:592: T__118
                {
                mT__118(); 

                }
                break;
            case 96 :
                // BELScript.g:1:599: T__119
                {
                mT__119(); 

                }
                break;
            case 97 :
                // BELScript.g:1:606: T__120
                {
                mT__120(); 

                }
                break;
            case 98 :
                // BELScript.g:1:613: T__121
                {
                mT__121(); 

                }
                break;
            case 99 :
                // BELScript.g:1:620: T__122
                {
                mT__122(); 

                }
                break;
            case 100 :
                // BELScript.g:1:627: T__123
                {
                mT__123(); 

                }
                break;
            case 101 :
                // BELScript.g:1:634: T__124
                {
                mT__124(); 

                }
                break;
            case 102 :
                // BELScript.g:1:641: T__125
                {
                mT__125(); 

                }
                break;
            case 103 :
                // BELScript.g:1:648: T__126
                {
                mT__126(); 

                }
                break;
            case 104 :
                // BELScript.g:1:655: T__127
                {
                mT__127(); 

                }
                break;
            case 105 :
                // BELScript.g:1:662: T__128
                {
                mT__128(); 

                }
                break;
            case 106 :
                // BELScript.g:1:669: T__129
                {
                mT__129(); 

                }
                break;
            case 107 :
                // BELScript.g:1:676: T__130
                {
                mT__130(); 

                }
                break;
            case 108 :
                // BELScript.g:1:683: DOCUMENT_COMMENT
                {
                mDOCUMENT_COMMENT(); 

                }
                break;
            case 109 :
                // BELScript.g:1:700: STATEMENT_COMMENT
                {
                mSTATEMENT_COMMENT(); 

                }
                break;
            case 110 :
                // BELScript.g:1:718: DOCUMENT_KEYWORD
                {
                mDOCUMENT_KEYWORD(); 

                }
                break;
            case 111 :
                // BELScript.g:1:735: STATEMENT_GROUP_KEYWORD
                {
                mSTATEMENT_GROUP_KEYWORD(); 

                }
                break;
            case 112 :
                // BELScript.g:1:759: IDENT_LIST
                {
                mIDENT_LIST(); 

                }
                break;
            case 113 :
                // BELScript.g:1:770: VALUE_LIST
                {
                mVALUE_LIST(); 

                }
                break;
            case 114 :
                // BELScript.g:1:781: OBJECT_IDENT
                {
                mOBJECT_IDENT(); 

                }
                break;
            case 115 :
                // BELScript.g:1:794: QUOTED_VALUE
                {
                mQUOTED_VALUE(); 

                }
                break;
            case 116 :
                // BELScript.g:1:807: OPEN_PAREN
                {
                mOPEN_PAREN(); 

                }
                break;
            case 117 :
                // BELScript.g:1:818: CLOSE_PAREN
                {
                mCLOSE_PAREN(); 

                }
                break;
            case 118 :
                // BELScript.g:1:830: NS_PREFIX
                {
                mNS_PREFIX(); 

                }
                break;
            case 119 :
                // BELScript.g:1:840: NEWLINE
                {
                mNEWLINE(); 

                }
                break;
            case 120 :
                // BELScript.g:1:848: WS
                {
                mWS(); 

                }
                break;

        }

    }
1186243
function objectToRecord(object, strict) {
  if (object === null || typeof object !== 'object') {
    throw new TypeError('object must be an Object');
  }

  const keys = Object.keys(object);
  const fields = [];

  for (let i = 0, len = keys.length; i < len; ++i) {
    const label = keys[i];
    const value = object[keys[i]];

    if (strict && !(0, _validator.isValidLabel)(label)) {
      throw new SyntaxError(`unexpected character of label: "${label}"`);
    }

    if (strict && !(0, _validator.isValidValue)(value)) {
      throw new SyntaxError(`unexpected character of value: "${value}"`);
    }

    fields[i] = label + ':' + value;
  }

  return fields.join('\t');
}