# Copyright 2005-2018 ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
#

ascii[4] identifier  = "BUFR" : read_only,hidden;
alias identifier=identifier;

section_length[3]   totalLength ;

unsigned[1] edition = 3 : dump;
alias editionNumber=edition;

template    section_1 "bufr/section.1.3.def"   ;

flagbit localSectionPresent(section1Flags,7) = 1;
alias section2Present=localSectionPresent;


if(localSectionPresent){
   template section_2 "bufr/section.2.def"     ;
}
else {
	transient section2Length = 0;
}

template section_3 "bufr/section.3.def"     ;
template section_4 "bufr/section.4.def"     ;
template section_5 "bufr/section.5.def"     ;

