Next Previous Contents

3. A grammar for UDCF

Lowercase words (e.g. profile, units_section or mix_list) represent non terminals, whereas uppercase words or words enclosed in double quotes (e.g. <UNITS>, </UNITS>, "Imperial" or <ALARM>BREATH</ALARM>) represent terminals.

profile -> <PROFILE UDCF = "1">
            units_section
            device_section
            additional_section
            repgroups
           </PROFILE>

units_section -> <UNITS>
                  unitsymbol 
                 </UNITS>

unitsymbol -> "Metric" | "Imperial"          

device_section -> <DEVICE>
                   <VENDOR>
                    vendorString  
                   </VENDOR>
                   <MODEL> 
                    modelString
                   </MODEL>
                   <VERSION>
                    versionID
                   </VERSION>
                  </DEVICE>
vendorString -> String     
modelString -> String
versionID -> Integer

additional_section ->  <ADDINFO>
                        personal_desc
                        totalDives_desc
                        IDString_desc
                       </ADDINFO>
                      |
                       Empty

personal_desc ->  <PERSINFO> 
                   String
                  </PERSINFO>
                 |
                  Empty   

totalDives_desc ->  <TOTALDIVES>
                     Integer
                    </TOTALDIVES>
                   |
                    Empty

IDString_desc ->  <SERIALID>  
                   String
                  </SERIALID>
                 |
                  Empty

repgroups ->   repgroups repgroupdesc
             | repgroupdesc

repgroupdesc -> <REPGROUP>
                 divelist
                </REPGROUP>

divelist ->   divelist dive_desc 
            | dive_desc 

dive_desc -> <DIVE>
              place_desc
              date
              time
              surface_interval
              temperature
              density
              alt_info
              gases_section
              prg_data
              samples
             </DIVE>

place_desc ->  <PLACE>
                String
               </PLACE>
              |
               Empty

date -> <DATE> 
         <YEAR> 
          year_desc
         </YEAR> 
         <MONTH> 
          month_desc
         </MONTH> 
         <DAY>
          day_desc 
         </DAY> 
        </DATE>
day_desc -> Integer 
month_desc -> Integer
year_desc -> Integer

time -> <TIME>
         <HOUR> 
          hour_desc 
         </HOUR>
         <MINUTE> 
          minute_desc 
         </MINUTE>
        </TIME>
hour_desc ->   Integer 
minute_desc -> Integer 

temperature ->  <TEMPERATURE> 
                  temp_desc 
                </TEMPERATURE>
               |
                Empty
temp_desc -> Real

density -> <DENSITY>
            density_desc
           </DENSITY>
density_desc -> Real

alt_info -> <ALTITUDE> 
             level 
            </ALTITUDE>
level -> Real

surface_interval -> <SURFACEINTERVAL> 
                     interval_desc 
                    </SURFACEINTERVAL> 
interval_desc -> secs | INFINITY
secs -> Real

gases_section -> <GASES>
                  mix_list
                 </GASES>

mix_list ->   mix_desc mix_list
            | mix_desc

mix_desc -> <MIX>
             <MIXNAME> mixname </MIXNAME>
             tank_info
             <O2> o2_ratio </O2>
             <N2> n2_ratio </N2>
             <HE> he_ratio </HE>
             acv_desc
            </MIX>
mixname -> String 
n2_ratio -> Real 
o2_ratio -> Real   
he_ratio -> Real

acv_desc ->  <ACV>
              acv_value
             </ACV>
            |
             Empty
acv_value -> Real

tank_info ->  <TANK>
               tank_volume_info 
               <PSTART> 
                press_in 
               </PSTART>
               press_end_desc
              </TANK> 
             |
              Emtpy

press_end_desc -> <PEND> 
                   press_out 
                  </PEND>
                 |
                  Empty

press_in -> Real
press_out -> Real

tank_volume_info ->  <TANKVOLUME>
                      volume
                     </TANKVOLUME>
                    |
                     Empty
volume -> Real

prg_data ->  <PRG>
              String
             </PRG>
            |
             Empty

samples ->  delta_mode_marker
            <SAMPLES>
             delta_marker switch_desc sample_list_delta
            </SAMPLES>
          | timedep_mode_marker
            <SAMPLES>
             switch_desc sample_list_timedepth
            </SAMPLES>

delta_mode_marker -> DELTAMODE

timedep_mode_marker -> TIMEDEPTHMODE

sample_list_delta ->   sampledesc_delta sample_list_delta
                     | sampledesc_delta

sample_list_timedepth ->   sampledesc_timedepth sample_list_timedepth
                         | sampledesc_timedepth

sampledesc_delta ->   depth 
                    | switch_desc
                    | temperature
                    | markers

sampledesc_timedepth ->   point
                        | switch_desc
                        | temperature
                        | markers

delta_marker ->
                <DELTA> 
                 delta 
                </DELTA>

delta -> Real

markers ->   <ALARM>SURFACE</ALARM>  
           | <ALARM>ASCENT</ALARM>
           | <ALARM>DECO</ALARM> 
           | <ALARM>BREATH</ALARM> 
           | <ALARM>RBT</ALARM> 
           | <ALARM>ERROR</ALARM> 
           | workdesc 

depth -> <DEPTH> Real </DEPTH> 

point -> <T> 
          Real 
         </T>
         <DEPTH>
          Real 
         </DEPTH> 

switch_desc -> <SWITCH> 
                changedMix 
               </SWITCH> 
changedMix -> String

workdesc -> <WORK> 
             Real
            </WORK>

String -> [a-zA-Z0-9\+\-\.@.,:;'=&\!$\~\(\)\*\ ]+

Real -> ((([0-9]+)|([0-9]*\.[0-9]+)([eE][-+]?[0-9]+)?)|[0-9]+)

Integer -> -?[0-9]+

Empty -> Epsilon


Next Previous Contents